/*cartb2b.js starts here*/
function getCartCookie(Name){
var search = Name + "=";
if (document.cookie.length > 0){ /* if there are any cookies*/
offset = document.cookie.indexOf(search);
if (offset != -1)
{ /* if cookie exists*/
offset += search.length;
/* set index of beginning of value*/
end = document.cookie.indexOf(";", offset);
/* set index of end of cookie value*/
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(offset, end));
}
}
return "";
};
function getparamVal1(cookieStr, key){
if( cookieStr > ""){
var val = "|"+cookieStr+"|";
var pattern = new RegExp(".*?\\|"+key+"=([^|]*).*|.*");
return val.replace(pattern, "$1");
}else{
return "";
}
};
/* function for pagename start here*/
var pagename='';
var countes='';
var display_desc_name='';
function page_name(namevalues,countess,selectedImage){
pagename=namevalues;
countes=countess;
display_desc_name=countess;
if(selectedImage !== undefined){
window.selectedMultiImage = selectedImage;
}
}
var pagecount='';
var name_of_page='';
function page_counter(nameofpage,countervalues,selectedImage){
pagecount=countervalues;
name_of_page=nameofpage;
if(selectedImage !== undefined){
window.selectedMultiImage = selectedImage;
}
}
/* function for pagename ends here*/
function display_multi_img(){
document.getElementById("arrow").style.display="none";
document.getElementById("multi_img_box").style.display="block";
}
var zoomup_desc_placeholder = '';
var zoomup_desc_value = '';
/* new functions added to display popup after 5 minutes starts here*/
function setCartCookie1(name, value,tm){
expires = new Date();
expires.setTime (expires.getTime() + 24 * 60 * 60 * 1000); //after 24 hours
if (value.length > 0){
document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString() + ";";
}
setTimeout(function(){empty_cart1();},24 * 60 * 60 * 1000);
};
var pv_cookie=parseInt(getCartCookie("page_view")) || 0;
pv_cookie=pv_cookie+1;
setCartCookie1("page_view",""+pv_cookie+"");
if(getCartCookie("page_view") == "3"){
setTimeout(function(){
document.zoom_dataform.S_reference_text.value="#2pv-zoomup";
_gaq.push(['b._trackEvent','Body','2pv-autozoomup',''+PC_CLNT_TMPL_PATH+'']);
show_form();},5000);
}
function show_form_onpage(){
var Interval_id;
Interval_id=setInterval(function(){
if((cookie = getCartCookie("CART_SESSION")) > ""){
myCart = eval("(" + cookie + ")");
var itemsArr = myCart[0][0];
if(typeof(itemsArr) != "undefined" && itemsArr.time != 0 )
{
timer = new Date(itemsArr.time);
times = new Date();
if(((times.getHours()*60+times.getMinutes()) - (timer.getHours()*60+timer.getMinutes())) > 1.5){
if(display_form == 0){
document.zoom_dataform.S_reference_text.value="#auto-zoomup";
_gaq.push(['b._trackEvent','Body','autozoomup-pv',''+PC_CLNT_TMPL_PATH+'']);
show_form();
}
cookie = cookie.replace(itemsArr.time,0);
setCartCookie1("CART_SESSION",cookie);
clearInterval(Interval_id);
}
}
}
},1000);
}
function show_form(){
popupopen='zoom_dataform';
show_form_flag=1;
if((document.getElementById("form_blow") != undefined && document.getElementById("form_blow").style.display=='block') || // job
(document.getElementById("ffc_blow_up") != undefined && document.getElementById("ffc_blow_up").style.display=='block') || //img-zoomup
(document.getElementById("ffc_blow_up_getcall") != undefined && document.getElementById("ffc_blow_up_getcall").style.display=='block') //request callback
|| (document.getElementById("ffc_blow_up_sms") != undefined && document.getElementById("ffc_blow_up_sms").style.display=='block') // sms
|| (document.getElementById("light") != undefined && document.getElementById("light").style.display=='block') // profile page
){ show_form_flag=0; }
if((cookie_enquiry = getCartCookie("querysent")) > "" || document.getElementById('searchnotfound').className == ' srnt_p' || show_form_flag==0 ){}
else{
if((cookie = getCartCookie("CART_SESSION")) > "" && cookie != '[[],{}]'){
myCart = eval("(" + cookie + ")");
var itemsArr = myCart[0];
Selected_product['prd_id'] = itemsArr[0].item_id;
Selected_product['prd_code'] = itemsArr[0].item_code;
Selected_product['prd_name'] = itemsArr[0].item_name;
Selected_product['prd_img'] = itemsArr[0].item_img;
Selected_product['prd_dis_id'] = itemsArr[0].item_dis_id;
Selected_product['prd_mcatid'] = itemsArr[0].item_mcatid;
in_cart_exist=1;
pagecount='';
pagename='';
name_of_page='';
countes='';
if(document.zoom_dataform.modref_id){
try{
document.zoom_dataform.modref_type.value = 2;
document.zoom_dataform.modref_id.value = Selected_product['prd_dis_id'];
document.zoom_dataform.modref_name.value = Selected_product['prd_name'];
document.zoom_dataform.mcat_id.value = Selected_product['prd_mcatid'];
}catch(e){ }
}
document.getElementById('bimg_zoom_up_center').innerHTML ='
';
document.getElementById('bimgname_zoom_title').innerHTML = unescape(itemsArr[0].item_name);
document.getElementById("default_icon").style.display="none";
$(".cen2_p").css("background-color", "");
document.getElementById('3pv_desc').style.display="none";
document.getElementById('txt_id_3pv').style.display="none";
icode='';
if(itemsArr[0].item_code !== 'undefined' && itemsArr[0].item_code != '' && itemsArr[0].item_code != itemsArr[0].item_id){ icode = '('+itemsArr[0].item_code+')'; }
zoomup_desc_value = "Send us quotation & details of '"+unescape(itemsArr[0].item_name)+icode+'\'.';
}else if(typeof dataref1 !== 'undefined'){
if(document.zoom_dataform.modref_id){
try{
document.zoom_dataform.modref_type.value = 2;
document.zoom_dataform.modref_id.value = dataref1[0].prd_dis_id;
document.zoom_dataform.modref_name.value = dataref1[0].prd_name;
if(dataref1[0].prd_mcatid == undefined){ dataref1[0].prd_mcatid=''; }
document.zoom_dataform.mcat_id.value = dataref1[0].prd_mcatid;
}catch(e){ }
}
document.getElementById('bimg_zoom_up_center').innerHTML ='
';
document.getElementById('bimgname_zoom_title').innerHTML = unescape(dataref1[0].prd_name);
document.getElementById("default_icon").style.display="none";
$(".cen2_p").css("background-color", "");
document.getElementById('3pv_desc').style.display="none";
document.getElementById('txt_id_3pv').style.display="none";
icode='';
if(dataref1[0].prd_code !== 'undefined' && dataref1[0].prd_code != '' && dataref1[0].prd_code != dataref1[0].prd_id){ icode = '('+dataref1[0].prd_code+')'; }
zoomup_desc_value = "Send us quotation & details of '"+unescape(dataref1[0].prd_name)+icode+'\'.';
}else{
document.getElementById("default_icon").style.display="block";
$(".cen2_p").css("background-color", "#fff");
document.getElementById('imgbox').style.display="none";
document.getElementById('bimgname_zoom_title').style.display="none";
document.getElementById('bg_zoom_title1').style.display="none";
document.getElementById('3pv_desc').style.display="block";
}
document.getElementById('ffc_blow_up').style.display="block";
document.getElementById('fgb_blow').style.display="block";
document.getElementById('closebtn').style.display="block";
document.getElementById("arrow").style.display="none";
document.getElementById("multi_img_box").style.display="none";
document.getElementById('txt_id').style.display="none";
document.getElementById('txt_id1').style.display="block";
document.getElementById('txt_id2').style.display="none";
document.getElementById('txt_id3').style.display="none";
document.getElementById('contact_btn').style.display="none";
document.getElementById('contact_btn1').style.display="block";
document.getElementById('ask_price').style.display="none";
$('#blwup').removeClass('popup_zoom1').addClass('popup_zoom');
document.getElementById('dataform_alert').style.display="block";
$('#infocus_div').removeClass('cen-1_p').addClass('cen1_p');
document.getElementById('infocus_div').style.display="block";
$('#enqsent').removeClass('fnt3_zoom-3').addClass('fnt3_zoom');
zoomup_desc_placeholder = "To get Quotations and Details kindly describe your requirement for your products.";
document.getElementById('tnkMsg').innerHTML='We will get in touch with you shortly.';
document.getElementById('Description1').value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
if(document.zoom_dataform.S_email.value == "Enter your email:"){
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p';
}else{
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid';
}
if((cookie1 = getCartCookie("ImeshVisitor")) > "" ){
if(getparamVal1(cookie1, "em") != "" ){
if(document.getElementById('mobile-number_zoom_dataform').value != "+91"){
$('#mobile-number_zoom_dataform').addClass('off_p');
}
}
}else{
get_ip();
}
}
}
function empty_cart1(){
var myCart;
if((cookie = getCartCookie("CART_SESSION")) > ""){
myCart = eval("(" + cookie + ")");
var itemsArr = myCart[0];
var itemsArr1 = myCart[1];
itemsArr.splice(0,itemsArr.length);
for (x in itemsArr1) {
delete itemsArr1[x];
}
var myCartJSON = !(window.JSON)?myCart.toJSONString():JSON.stringify(myCart);
setCartCookie1("CART_SESSION",myCartJSON);
}
return true;
};
/* cart function */
function cart_display(myId){
}
/*cart function */
/* new functions added to display popup after 5 minutes ends here*/
/* function for search not found starts here*/
var searchcheck='';
function checkfunction(searchpl){
searchcheck=searchpl;
setTimeout(function(){ document.getElementById('searchnotfound').className = ' srnt_p';
document.getElementById('on250').className = "";
document.getElementById('ffc_blow_up').style.display="block";
document.getElementById('ffc_blow_up').className+= ' ps11';
document.getElementById('dataform_alert').className+= ' m33';
document.getElementById('ch_srch').className+= ' fl1';
document.getElementById('searchnotfound1').style.display="block";
document.getElementById('contact_btn').style.display="none";
document.getElementById('searchnotfound2').style.display="block";
document.getElementById('Description1').style.display="block";
document.getElementById('Description1').setAttribute("placeholder","Describe your requirement in detail:");
setTimeout(function(){ $('#searchnotfound .email_wid').attr('style','width: 90.8% !important'); },1000)
document.zoom_dataform.S_reference_text.value="#enquiryform-notfoundSP";
if(im_readCookie("ImeshVisitor") != ""){
if(typeof fill_cookies =="function"){
fill_cookies(); }}
},1000);
}
/* function for search not found ends here*/
var pos_in_cart = 0;
function add_item_cart(iid, pcode, pname,pimg,psimg,referer,disid,mcatid){
var myCart;
var myCart = new Array(2);
myCart[0] = new Array();
myCart[1] = new Object();
var item = new Object();
item.item_id = iid;
item.item_code = pcode;
item.item_name = pname;
item.item_img = pimg;
item.item_simg = psimg;
item.item_dis_id = disid;
item.item_mcatid = mcatid;
myCart[0][myCart[0].length]=item;
pos_in_cart=myCart[0].length-1;
times = new Date();
item.time = times;
if(getCartCookie("querysent") > ""){}else{ show_form_onpage(); }
myCart[1].referer = eval(referer);
var myCartJSON = !(window.JSON)?myCart.toJSONString():JSON.stringify(myCart);
setCartCookie1("CART_SESSION",myCartJSON);
imgset_zoom(pos_in_cart,'prd');
return true;
};
function removeitem1(i,frm){
var myCart;
if((cookie = getCartCookie("CART_SESSION")) > ""){
myCart = eval("(" + cookie + ")");
var itemsArr = myCart[0];
myCart[0].splice(i,1);
if(itemsArr.length ==0){
myCart[1].message1 = "Your Enquiry Basket has been emptied";
}
var myCartJSON = !(window.JSON)?myCart.toJSONString():JSON.stringify(myCart);
setCartCookie1("CART_SESSION",myCartJSON);
}
return true;
};
/*for enquiry page expand collapse in other contact details*/
function ExpandCollapse(id){
if(id=="plus"){
document.getElementById('plus').style.display = "block";
document.getElementById('minus').style.display = "none";
}else{
document.getElementById('minus').style.display = "block";
document.getElementById('plus').style.display = "none";
}
};
/* Blow up Zoom Form Function start */
popupopen = '';
var Selected_product = new Array();
var imgid_zoom=0;
var display_form=0;
function imgset_zoom(id, switchpr){
popupopen = 'zoom_dataform';
var countes_same=countes;
var tnkMsg = '';
if(name_of_page == "catindex" || pagename == "catindex" ){
if(countes == "count4"){
document.zoom_dataform.S_reference_text.value="#get-quotation";
}else{
document.zoom_dataform.S_reference_text.value="#imagezoomup-category";
}
}
else if(name_of_page == "productpage" || pagename == "productpage"){
if(pagecount == "counter2" || countes == "count2")
{document.zoom_dataform.S_reference_text.value="#imagezoomup-product";}
else if(countes == "count5" || pagecount == "counter5")
{document.zoom_dataform.S_reference_text.value="#get-best-quote";}
else
{document.zoom_dataform.S_reference_text.value="#ask-for-price";}}
else if(name_of_page == "searchpage" || pagename == "searchpage"){
if(pagecount == "counter3" || countes == "count3")
{document.zoom_dataform.S_reference_text.value="#imagezoomup-search";}
else if(countes == "count5" || pagecount == "counter5")
{document.zoom_dataform.S_reference_text.value="#get-best-quote";}
else
{document.zoom_dataform.S_reference_text.value="#ask-for-price";}}
else if(pagename == "index" || name_of_page == "index" ){document.zoom_dataform.S_reference_text.value="#imagezoomup-home";}
else if(pagename == "corporatevideopage"){document.zoom_dataform.S_reference_text.value="#gbq_videopage";}
else if(name_of_page == "productpageslider"){document.zoom_dataform.S_reference_text.value="#gbq_slider"; name_of_page = "productpage";}
if(pagecount == "counter2" || pagecount == "counter3" || pagename == "index"){
tnkMsg='We will share the Quotations & Details with you soon.'; //YIAI button
}else if(countes == "count3" || countes == "count2" || name_of_page == "category" || pagename == "category" ){
tnkMsg='We will get in touch with you shortly.'; //Image
}else if(countes == "count5"){
tnkMsg='We will share the Best Quote with you soon.'; //get best quotes
}else{
tnkMsg='We will share the Price with you soon.'; //Ask for price
}
document.getElementById('tnkMsg').innerHTML=tnkMsg;
var in_cart_exist = 0;
document.getElementById('searchnotfound').className = "nwp";
document.getElementById("default_icon").style.display="none";
$(".cen2_p").css("background-color", "");
document.getElementById('3pv_desc').style.display="none";
document.getElementById('bimgname_zoom_title2').style.display="none";
document.getElementById('imgbox').style.display="block";
document.getElementById('prditembox').style.display="none";
document.getElementById('closebtn').style.display="block";
document.getElementById('bimgname_zoom_title').style.display="block";
document.getElementById('bg_zoom_title1').style.display="block";
document.getElementById('txt_id1').style.display="none";
if((pagename == "productpage" && countes == "count5") || (pagename == "searchpage" && countes == "count5") || (name_of_page == "productpage" && pagecount == "counter5")){
document.getElementById('txt_id').style.display="none";
document.getElementById('txt_id2').style.display="none";
document.getElementById('txt_id3').style.display="block";
}else if((pagename == "productpage" && countes != "count2") || (pagename == "searchpage" && countes != "count3") || (name_of_page == "productpage" && pagecount == "counter6")){
document.getElementById('txt_id').style.display="none";
document.getElementById('txt_id2').style.display="block";
document.getElementById('txt_id3').style.display="none";
}else{
document.getElementById('txt_id2').style.display="none";
document.getElementById('txt_id').style.display="block";
document.getElementById('txt_id3').style.display="none";
}
document.getElementById('contact_btn').style.display="block";
document.getElementById('contact_btn1').style.display="none";
document.getElementById('ask_price').style.display="none";
$('#searchnotfound .email_wid').attr('style','width: 79.5% !important');
var pic=document.getElementById('bimg_zoom_up_center');
var cart_index = 0;
var itemBigImage='';
if((cookie = getCartCookie("CART_SESSION")) > ""){
myCart = eval("(" + cookie + ")");
var itemsArr = myCart[0];
var itemBigImage='';
var itemImage='';
var multi_div='';
if(switchpr != "dataref"){
if(document.getElementById("multi_img_box")){
document.getElementById("multi_img_box").innerHTML=''; }
document.getElementById("arrow").style.display="none";
if(itemsArr[id].item_img != ""){
if( pagename == "search" || name_of_page == "search" || pagename == "index" || name_of_page == "catindex"){
pic.innerHTML ='
';
$('#change_class').removeClass('cen-2_p').addClass('cen2_p bx11_p');
}else{
itemBigImage = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].getAttribute('data-bimg') : itemsArr[id].item_simg;
multi_div = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].getAttribute('data-multiimg') : '';
var divContent = '';
if(multi_div != ''){
var arr_multi_div = multi_div.split(",");
for(var x in multi_div.split(",")){
divContent += '
'
}
var arrwup = '';
var arrwdown = '';
var sdcls1 = 'sd17_p';
var sdcls2 = 'sd16_p';
if(arr_multi_div.length > 4){
arrwup = '';
arrwdown = '';
}
if(arr_multi_div.length >= 4){
sdcls1 = 'sd13_p';
sdcls2 = 'sd11_p';
}else if(arr_multi_div.length == 3){
sdcls1 = 'sd15_p';
sdcls2 = 'sd14_p';
}
divContent = '';
document.getElementById("multi_img_box").innerHTML=divContent;
document.getElementById("multi_img_box").style.display="none";
document.getElementById("arrow").style.display="block";
}
$('#blwup').removeClass('popup_zoom1').addClass('popup_zoom');
$('#dataform_alert').removeClass('enq_out_p1').addClass('enq_out_p');
$('#infocus_div').removeClass('cen-1_p').addClass('cen1_p');
$('#change_class').removeClass('cen-2_p').addClass('cen2_p bx11_p');
$('#enqsent').removeClass('fnt3_zoom-3').addClass('fnt3_zoom');
itemImage = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].src : itemsArr[id].item_simg;
pic.innerHTML ='
';$(".enqload_blow").html("");
}
}else{
if(!( pagename == "searchpage" || name_of_page == "searchpage" || name_of_page == "category" )){
$('#blwup').removeClass('popup_zoom1').addClass('popup_zoom');
$('#dataform_alert').removeClass('enq_out_p1').addClass('enq_out_p');
$('#infocus_div').removeClass('cen-1_p').addClass('cen1_p');
$('#change_class').removeClass('cen-2_p').addClass('cen2_p bx11_p');
$('#enqsent').removeClass('fnt3_zoom-3').addClass('fnt3_zoom');
}
pic.innerHTML =''+unescape(itemsArr[id].item_name)+'
';
}
document.getElementById('bimgname_zoom_title').innerHTML = unescape(itemsArr[id].item_name);
if(name_of_page == "category" && pagecount == "counter1"){
zoomup_desc_placeholder = "Please send details of product in category '"+unescape(itemsArr[id].item_name)+'\'.';}
else if((pagename == "productpage" && countes == "count5") || (pagename == "searchpage" && countes == "count5") || (name_of_page == "productpage" && pagecount == "counter5"))
{zoomup_desc_placeholder = "To get Best Quote kindly describe your requirement for '"+unescape(itemsArr[id].item_name)+'\'.';}
else if((pagename == "productpage" && countes != "count2") || (pagename == "searchpage" && countes != "count3") || (name_of_page == "productpage" && pagecount == "counter6")){zoomup_desc_placeholder = "To get Best Price kindly describe your requirement for '"+unescape(itemsArr[id].item_name)+'\'.';}
else{zoomup_desc_placeholder = "To get Quotations and Details kindly describe your requirement for '"+unescape(itemsArr[id].item_name)+'\'.';}
icode='';
if(itemsArr[id].item_code !== 'undefined' && itemsArr[id].item_code != '' && itemsArr[id].item_code != itemsArr[id].item_id){ icode = '('+itemsArr[id].item_code+')'; }
zoomup_desc_value = "Send us quotation & details of '"+unescape(itemsArr[id].item_name)+icode+'\'.';
document.getElementById('Description1').value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
if(pagename == "index"){
document.getElementById('txt_id1').style.display="none";
document.getElementById('txt_id').style.display="block";
document.getElementById('txt_id2').style.display="none";
document.getElementById('txt_id3').style.display="none";
}
Selected_product['prd_id'] = itemsArr[id].item_id;
Selected_product['prd_code'] = itemsArr[id].item_code;
Selected_product['prd_name'] = itemsArr[id].item_name;
Selected_product['prd_img'] = itemsArr[id].item_img;
Selected_product['prd_dis_id'] = itemsArr[id].item_dis_id;
Selected_product['prd_mcatid'] = itemsArr[id].item_mcatid;
in_cart_exist=1;
pagecount='';
pagename='';
name_of_page='';
countes='';
if(document.zoom_dataform.modref_id){
try{
document.zoom_dataform.modref_type.value = 2;
document.zoom_dataform.modref_id.value = Selected_product['prd_dis_id'];
document.zoom_dataform.modref_name.value = Selected_product['prd_name'];
document.zoom_dataform.mcat_id.value = Selected_product['prd_mcatid'];
}catch(e){ }
}
for(temp1 in dataref1){
if(dataref1[temp1].prd_id == itemsArr[id].item_id){
cart_index = dataref1[temp1].img_id;
break;
}
}
}
}
if(switchpr == "dataref"){
if(document.getElementById("multi_img_box")){
document.getElementById("multi_img_box").innerHTML=''; }
document.getElementById("arrow").style.display="none";
for(temp2 in dataref1){
if(dataref1[temp2].img_id == id){
// add_item_cart(dataref1[temp2].img_id, dataref1[temp2].prd_code, dataref1[temp2].prd_name,dataref1[temp2].img_path,dataref1[temp2].img_path1,'window.location.href',dataref1[temp2].prd_dis_id,dataref1[temp2].prd_mcatid);
var myCart;
var referer=window.location.href;
var myCart = new Array(2);
myCart[0] = new Array();
myCart[1] = new Object();
var item = new Object();
item.item_id = dataref1[temp2].img_id;
item.item_code = dataref1[temp2].prd_code;
item.item_name = dataref1[temp2].prd_name;
item.item_img =dataref1[temp2].img_path;
item.item_simg = dataref1[temp2].img_path1;
item.item_dis_id = dataref1[temp2].prd_dis_id;
item.item_mcatid = dataref1[temp2].prd_mcatid;
myCart[0][myCart[0].length]=item;
pos_in_cart=myCart[0].length-1;
times = new Date();
item.time = times;
if(getCartCookie("querysent") > ""){}else{ show_form_onpage(); }
myCart[1].referer = referer;
var myCartJSON = !(window.JSON)?myCart.toJSONString():JSON.stringify(myCart);
setCartCookie1("CART_SESSION",myCartJSON);
icode='';
if(dataref1[temp2].prd_code !== 'undefined' && dataref1[temp2].prd_code != '' && dataref1[temp2].prd_code != dataref1[temp2].prd_id){ icode = '('+dataref1[temp2].prd_code+')'; }
if( pagename == "catindex" || pagename == "search"){
pic.innerHTML ='
';
$('#change_class').removeClass('cen-2_p').addClass('cen2_p bx11_p');
}else{
itemBigImage = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].getAttribute('data-bimg') : dataref1[temp2].img_path;
multi_div = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].getAttribute('data-multiimg') : '';
var divContent = '';
if(multi_div != ''){
var arr_multi_div = multi_div.split(",");
for(var x in multi_div.split(",")){
divContent += ''
}
var arrwup = '';
var arrwdown = '';
var sdcls1 = 'sd17_p';
var sdcls2 = 'sd16_p';
if(arr_multi_div.length > 4){
arrwup = '';
arrwdown = '';
}
if(arr_multi_div.length >= 4){
sdcls1 = 'sd13_p';
sdcls2 = 'sd11_p';
}else if(arr_multi_div.length == 3){
sdcls1 = 'sd15_p';
sdcls2 = 'sd14_p';
}
divContent = '';
document.getElementById("multi_img_box").innerHTML=divContent;
document.getElementById("multi_img_box").style.display="none";
document.getElementById("arrow").style.display="block";
}
$('#blwup').removeClass('popup_zoom1').addClass('popup_zoom');
$('#dataform_alert').removeClass('enq_out_p1').addClass('enq_out_p');
$('#infocus_div').removeClass('cen-1_p').addClass('cen1_p');
$('#change_class').removeClass('cen-2_p').addClass('cen2_p bx11_p');
$('#enqsent').removeClass('fnt3_zoom-3').addClass('fnt3_zoom');
itemImage = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].src : dataref1[temp2].img_path1;
itemBigImage = (window.selectedMultiImage !== undefined && document[window.selectedMultiImage]!==undefined) ? document[window.selectedMultiImage].getAttribute('data-bimg') : dataref1[temp2].img_path;
pic.innerHTML ='
';$(".enqload_blow").html("");
}
document.getElementById('bimgname_zoom_title').innerHTML = unescape(dataref1[temp2].prd_name);
if(pagename == "category" && countes == "count1"){zoomup_desc_placeholder = "Please send details of product in category '"+unescape(dataref1[temp2].prd_name)+'\'.';}
else if((pagename == "productpage" && countes == "count5") || (pagename == "searchpage" && countes == "count5") || (name_of_page == "productpage" && pagecount == "counter5"))
{zoomup_desc_placeholder = "To get Best Quote kindly describe your requirement for '"+unescape(dataref1[temp2].prd_name)+'\'.';}
else if((pagename == "productpage" && countes != "count2") || (pagename == "searchpage" && countes != "count3") || (name_of_page == "productpage" && pagecount == "counter6")){
zoomup_desc_placeholder = "To get Best Price kindly describe your requirement for '"+unescape(dataref1[temp2].prd_name)+'\'.';
}else{
zoomup_desc_placeholder = "To get Quotations and Details kindly describe your requirement for '"+unescape(dataref1[temp2].prd_name)+'\'.';}
zoomup_desc_value = "Send us quotation & details of '"+unescape(dataref1[temp2].prd_name)+icode+'\'.';
document.getElementById('Description1').value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
if((pagename == "productpage" && countes != "count2") || (pagename == "searchpage" && countes != "count3") ){
document.getElementById('ask_price').style.display="block";
document.getElementById('contact_btn').style.display="none";
}else if(pagename == "category" && countes == "count4"){
document.getElementById('txt_id1').style.display="none";
document.getElementById('txt_id').style.display="none";
document.getElementById('txt_id2').style.display="none";
document.getElementById('txt_id3').style.display="none";
zoomup_desc_placeholder = "Please send quotation and pricing of products in category '"+unescape(dataref1[temp2].prd_name)+'\'.';
zoomup_desc_value = "Send us quotation & details of '"+unescape(dataref1[temp2].prd_name)+icode+'\'.';
document.getElementById('Description1').value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
}else{
document.getElementById('ask_price').style.display="none";
document.getElementById('contact_btn').style.display="block";
}
Selected_product['prd_id'] = dataref1[temp2].prd_id;
Selected_product['prd_code'] = dataref1[temp2].prd_code;
Selected_product['prd_name'] = dataref1[temp2].prd_name;
Selected_product['prd_img'] = dataref1[temp2].img_path;
Selected_product['prd_dis_id'] = dataref1[temp2].prd_dis_id;
Selected_product['prd_mcatid'] = dataref1[temp2].prd_mcatid;
pagename='';
countes='';
if(document.zoom_dataform.modref_id){
try{
document.zoom_dataform.modref_type.value = 2;
document.zoom_dataform.modref_id.value = Selected_product['prd_dis_id'];
document.zoom_dataform.modref_name.value = Selected_product['prd_name'];
document.zoom_dataform.mcat_id.value = Selected_product['prd_mcatid'];
}catch(e){ }
}
if((document.zoom_dataform.modref_id.value == '') || (document.zoom_dataform.modref_id.value == 'undefined') ){
document.zoom_dataform.modref_id.value= 7857336865;
document.zoom_dataform.modref_type.value= 1;
document.zoom_dataform.modref_name.value = '';
document.zoom_dataform.mcat_id.value = '';
}
}
}
for(temp2 in dataref1){
if(dataref1[temp2].img_id == id){
for(temp3 in itemsArr){
if(itemsArr[temp3].item_id == dataref1[temp2].prd_id){
in_cart_exist=1;
cart_index = temp3;
break;
}
}
break;
}
}
cart_index = id;
}
imgid_zoom=parseInt(cart_index);
$('#dataform_alert_display').hide();
$('#infocus_div').show();
var full_name='';
if((cookie1 = getCartCookie("ImeshVisitor")) > "" && (!(countes_same == "count2" || countes_same == "count3"))){
if(getparamVal1(cookie1, "mb1") != "" ){
document.zoom_dataform.S_mobile.value = getparamVal1(cookie1, "mb1");
}
if(getparamVal1(cookie1, "em") != "" ){
document.zoom_dataform.S_email.value = getparamVal1(cookie1, "em");
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid';
}else{
document.zoom_dataform.S_email.value ="Enter your email:";
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p';
}
if(getparamVal1(cookie1, "fn") != "" ){
document.twostep_dataform.S_name=getparamVal1(cookie1, "fn");
full_name =getparamVal1(cookie1, "fn");
}
if(getparamVal1(cookie1, "ln") != "" ){
document.twostep_dataform.S_lname=getparamVal1(cookie1, "ln");;
full_name = full_name +' '+ getparamVal1(cookie1, "ln");
}
$('#dataform_alert').hide();
$('#form_load').show();
}else{
$('#dataform_alert').show();
}
document.getElementById('ffc_blow_up').style.display="block";
document.getElementById('fgb_blow').style.display="block";
display_form=1;
$('#ffc_blow_up').removeClass('ps11');
$('.f_w7_p').removeClass('fl1');
$('#dataform_alert').removeClass('m33');
if(im_readCookie("ImeshVisitor") == ""){
$('#S_email').trigger('focus');
$('#S_email').attr("class","bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p");
document.zoom_dataform.S_mobile.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p c11_p';
}else{
fill_cookies();
}
product_style();
if(in_cart_exist){
$('#add_cart_icon').addClass("prd_exst");
}else{
$('#add_cart_icon').removeClass("prd_exst");
}
document.zoom_dataform.Description.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
document.getElementById("d1").style.display="none";
document.getElementById("d1").innerHTML='';
if(primary_biz.match(/Service Provider/ig)){
$('#purpse').hide();
$('#spacing').addClass("h16_sec");
}else{
$('#purpse').show();
$('#spacing').removeClass("h16_sec");
}
if(!(countes_same == "count2" || countes_same == "count3")){
var mobilevalue_with_cookie=check_Mobile();
var emailvalue_with_cookie=check_Email();
if(mobilevalue_with_cookie && emailvalue_with_cookie){
document.zoom_dataform.Description.value = zoomup_desc_value;
document.zoom_dataform.twostep.value="twostep";
if(document.zoom_dataform.S_email.value == "Enter your email:"){
document.zoom_dataform.S_email.value = "";
}
$.post($('.zoom_dataform').attr('action'),$('.zoom_dataform').serialize(),function(result){
if(result.response == 'OK'){
setCartCookie1('querysent','enter',4);
$('#qid').val(result.queryid);
$('#query_destination').val(result.query_destination);
if(result.email != ""){
$('#email_twostep').hide();
$('#S_email_twostep').val(result.email);
}else{$('#email_twostep').show();
$('#S_email_twostep').val("Enter your email:").addClass("c11_p");
}
if(result.S_name != ""){
$('#S_name_twostep').hide();
$('#fullname').val(result.S_name);
}else{
$('#S_name_twostep').show();}
if(result.mob != ""){
$('#mob_twostep').hide();
$('#S_mob_twostep').val(result.mob);
}else{$('#mob_twostep').show();
$('#S_mob_twostep').val("Enter your number:").addClass("c11_p");
}
$('#twostepenquiry').show();
if($('#email_twostep').is(':hidden') && $('#S_name_twostep').is(':hidden')){
$('#spacing').addClass("secstep");
}else if($('#spacing').hasClass("secstep")){
$('#spacing').removeClass("secstep");}
$('#form_load').hide();
}else{
$('#dataform_alert').show();
$('#form_load').hide();
$('#twostepenquiry').hide();
}
},'json');
}
document.getElementById('m1').style.display="none";
$('#S_mobile2').removeClass("ac1_p");
$('#mobile-number_zoom_dataform').removeClass("ac2_p");
document.getElementById('e1_pop').style.display="none";
$('#S_email').removeClass("active_error2");
if(document.getElementById('fullname').value == "Enter your name:") document.getElementById('fullname').style.display="block";
document.getElementById('Descriptiontwostep').value = "Describe your requirement in detail:";
document.twostep_dataform.usage.className='h12_p m2_p clr7_p br7_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p c11_p';
document.twostep_dataform.estimatedquantity.value = 'Estimated Quantity';
document.twostep_dataform.estimatedquantity.className='h10_p m8_p bdr2_p icon15_p c11_p';
document.twostep_dataform.approxvalue.value = 'Approx. order value';
document.twostep_dataform.approxvalue.className='m8_p bdr2_p h10_p icon15_p c11_p';
document.twostep_dataform.fullname.value = 'Enter your name:';
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri c11_p';
}
};
function fg_hideform_zoom(){
display_form=0;
document.getElementById('ffc_blow_up').style.display="none";
document.getElementById('fgb_blow').style.display="none";
document.getElementById('twostepenquiry').style.display="none";
document.getElementById('d1').style.display="none";
document.getElementById('e1').style.display="none";
document.getElementById('m1').style.display="none";
document.getElementById('e1_t').style.display="none";
document.getElementById('m1_t').style.display="none";
document.getElementById('e1_pop').style.display="none";
document.getElementById('f1').style.display="none";
if(im_readCookie("ImeshVisitor") == ""){
document.getElementById('S_email').value="";
document.getElementById('S_mobile2').value="";
$('#S_email').val('Enter your email:');
$('#S_mobile2').val('Enter your number:');
get_ip();
}
else
{if(typeof fill_cookies =="function"){
fill_cookies(); }}
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid';
document.zoom_dataform.S_mobile.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p';
document.zoom_dataform.S_cmobile.className='cnty_isd bg10_p bdr2_p cn1_p validate_pop req_pop mobile_val_pop';
};
var submitQuery = 0;
var enquirysent=1;
var submitQuery = 0;
var enquirysent=1;
/* popup validations start*/
function check_Email_focus(FieldName,event){
if(FieldName.value == 'Enter your email:' ){
FieldName.value = '';
}
FieldName.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid';
if(event!=undefined && event.keyCode==13){
if(document.getElementById('SubmitEnq')){document.getElementById('SubmitEnq').focus();}
}
document.zoom_dataform.S_mobile.value='';
document.twostep_dataform.S_mobile.value='';
document.getElementById("e1_pop").style.display="none";
};
function check_Mobile_focus(FieldName) {
if(FieldName.value == 'Enter your number:' ){
FieldName.value = '';
}
FieldName.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p';
document.zoom_dataform.S_cmobile.className='cnty_isd bg10_p bdr2_p cn1_p validate_pop req_pop mobile_val_pop';
document.getElementById("m1").style.display="none";
};
function check_Description_focus(FieldName) {
if(FieldName.value == zoomup_desc_placeholder ){
FieldName.value = '';
}
FieldName.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop';
document.getElementById("d1").style.display="none";
};
function check_Description(){
if(document.zoom_dataform.Description1.value == ""){
document.zoom_dataform.Description1.value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
if(searchcheck == "searchpl"){
document.getElementById("d1").style.display="block";
document.getElementById("d1").innerHTML='Kindly Describe Your Requirement.';
return false;
}
}else{
document.getElementById("d1").style.display="none";
}
return true;
};
function check_Email(){
if(document.getElementById('emailfield_zoom_dataform').style.display =="none"){
return true;
}
document.zoom_dataform.S_email.value = document.zoom_dataform.S_email.value.replace(/^\s+|\s+$/g,"");
var x=document.zoom_dataform.S_email.value;
if (x==null || x==""){
document.getElementById("e1_pop").style.display="block";
document.getElementById("e1_pop").innerHTML='Please enter your email.';
document.getElementById("S_email").value="Enter your email:";
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p active_error2';
document.getElementById("e1_pop").innerHTML='Please enter your email.'
return false;
}else if (!(/^[A-z0-9][_.A-z0-9-]+@[a-zA-Z0-9]+[\.\-\_]{0,1}[a-zA-Z0-9]+\.[a-zA-Z]{2,6}\.?[a-zA-Z]{0,4}$/.test(document.zoom_dataform.S_email.value))){
document.getElementById("e1_pop").style.display="block";
if(document.zoom_dataform.S_email.value == "Enter your email:"){
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p active_error2';
document.getElementById("e1_pop").innerHTML='Please enter your email.'}
else{
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid active_error2';
document.getElementById("e1_pop").innerHTML='Please enter valid email.';}
return false;
}else{
document.getElementById("e1_pop").style.display="none";
}
return true;
};
function check_Mobile(){
if(document.getElementById('mobilefield_zoom_dataform').style.display =="none"){
return true;
}
if(document.zoom_dataform.S_mobile.value != "Enter your number:"){
document.zoom_dataform.S_mobile.value = document.zoom_dataform.S_mobile.value.replace(/\s+/g,"");
}
document.zoom_dataform.S_mobile.value = document.zoom_dataform.S_mobile.value.replace(/^0+/, "");
var mobile_valid = document.getElementById("txtCountry1").value == "IN" ? (/^((?![1-5])[0-9]{10})$/.test(document.zoom_dataform.S_mobile.value)): (/^[0-9]{1,30}$/.test(document.zoom_dataform.S_mobile.value));
if(document.zoom_dataform.S_mobile.value == "Enter your number:" || document.zoom_dataform.S_mobile.value == ""){
document.getElementById("m1").style.display="block";
document.getElementById("m1").innerHTML='Please enter your mobile number.';
document.zoom_dataform.S_mobile.className = 'bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p c11_p ac1_p';
document.zoom_dataform.S_cmobile.className='cnty_isd bg10_p bdr2_p cn1_p validate_pop req_pop mobile_val_pop ac2_p';
return false;
}else if(!mobile_valid){
document.getElementById("m1").style.display="block";
document.getElementById("m1").innerHTML='Please enter valid mobile number.';
document.zoom_dataform.S_mobile.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p ac1_p';
document.zoom_dataform.S_cmobile.className='cnty_isd bg10_p bdr2_p cn1_p validate_pop req_pop mobile_val_pop ac2_p';
return false;
}else{
document.getElementById("m1").style.display="none";
document.zoom_dataform.S_mobile.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p';
document.zoom_dataform.S_cmobile.className='cnty_isd bg10_p bdr2_p cn1_p validate_pop req_pop mobile_val_pop';
}
return true;
};
function check_Description2(){
if(document.zoom_dataform.Description1.value == ""){
document.zoom_dataform.Description1.value = zoomup_desc_placeholder;
document.zoom_dataform.Description1.className='clr7_p bdr2_p bg10_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p m41_p validate_pop Desc_err_pop c11_p';
}
};
function check_Email2(){
if(document.getElementById('emailfield_zoom_dataform').style.display =="none"){
return true;
}
document.zoom_dataform.S_email.value = document.zoom_dataform.S_email.value.replace(/^\s+|\s+$/g,"");
var x=document.zoom_dataform.S_email.value;
if (x=="Enter your email:" || x==""){
document.getElementById("S_email").value="Enter your email:";
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid c11_p';
return false;
}
};
function check_Mobile2(){
if(document.getElementById('mobilefield_zoom_dataform').style.display =="none"){
return true;
}
x=document.zoom_dataform.S_mobile.value;
if(x == "Enter your number:" || x == ''){
document.zoom_dataform.S_mobile.value="Enter your number:";
document.zoom_dataform.S_mobile.className='bdr2_p bg10_p ft5_p validate_pop req_pop mobile_val_pop cn2_p c11_p';
}
};
function product_style(){
if(document.zoom_dataform.S_email.value != "Enter your email:"){
document.zoom_dataform.S_email.className='bdr2_p bg10_p hi2_p icon9_p icon4_p validate_pop req_pop email_val_pop email_wid';
}
};
function validate_bind_zoom_popup(){
if(typeof jQuery != undefined){
if (document.zoom_dataform.S_mobile.value == "Enter your number:"){
document.zoom_dataform.S_mobile.value="";
}
if (document.zoom_dataform.S_email.value == "Enter your email:"){
document.zoom_dataform.S_email.value="";
}
if (document.zoom_dataform.ss_frm.value == "Product/Service"){
document.zoom_dataform.ss_frm.value="";
}
var descvalue=check_Description();
var mobilevalue=check_Mobile();
var emailvalue=check_Email();
var ss_frmvalue=check_ss_frm();
if(descvalue && emailvalue && mobilevalue && ss_frmvalue){
if(document.zoom_dataform.Description1.value == zoomup_desc_placeholder){
document.zoom_dataform.Description.value = zoomup_desc_value;
}else{
document.zoom_dataform.Description.value = document.zoom_dataform.Description1.value;
}
if(document.getElementById('3pv_desc').style.display == "block"){
document.zoom_dataform.Description.value = "Send us quotation & details of "+document.zoom_dataform.ss_frm.value+" products.";
}
if((document.zoom_dataform.modref_id.value == '') || (document.zoom_dataform.modref_id.value == 'undefined')){
document.zoom_dataform.modref_id.value=7857336865;
document.zoom_dataform.modref_type.value=1;
}
document.zoom_dataform.twostep.value="twostep";
var idprd=Selected_product['prd_id'];
if(submitQuery == 0){
submitQuery = 1;
$(".enqload").html("
");
check_loginmode();
$.post($('.zoom_dataform').attr('action'),$('.zoom_dataform').serialize(),function(result){
$(".enqload").html("");
if(result.error == '204'){
e1_pop=document.getElementById('e1_pop');
e1_pop.innerHTML = 'Kindly choose correct country.';
e1_pop.style.display="block";
}
else if(result.response == 'OK'){
$('.error_notification').html("").hide();
$('#dataform_alert').hide();
if(searchcheck != "searchpl"){
if(result.queryid !=""){
if(typeof im_getCookieValues=="function"){
im_getCookieValues('twostep_dataform',ZoomElementNamesHash_two);
}
$('#twostepenquiry').show();
$('#qid').val(result.queryid);
$('#query_destination').val(result.query_destination);
if(result.email != ""){
$('#email_twostep').hide();
$('#S_email_twostep').val(result.email);
}else{$('#email_twostep').show();}
if(result.S_name != ""){
$('#S_name_twostep').hide();
document.twostep_dataform.S_name.value = result.S_name;
}else{$('#S_name_twostep').show();
}
if(result.mob != ""){
$('#mob_twostep').hide();
$('#S_mob_twostep').val(result.mob);
}else{$('#mob_twostep').show();}
if($('#prditembox').is(':visible') ){
$('#spacing').addClass('scnd_p_old');
}else{
$('#spacing').removeClass('scnd_p_old');
}
if($('#email_twostep').is(':hidden') && $('#S_name_twostep').is(':hidden')){
$('#spacing').addClass("secstep");
}else if($('#spacing').hasClass("secstep")){
$('#spacing').removeClass("secstep");}
}else{
$('#infocus_div').hide();$('#twostepenquiry').hide();$('#closebtn').hide();
$('#dataform_alert_display').show();
setTimeout(function(){ fg_hideform_zoom();},2000);
}
Selected_product['prd_name']="";
}else{
$('#dataform_alert_display_search').show();
}
clearValue();
empty_cart1();
_gaq.push(['b._trackEvent','Body','ProductZoom/thankyou',''+PC_CLNT_TMPL_PATH+'']);
$("Description1").focus();
if(result.gluser_id){
document.zoom_dataform.S_glusr_id.value = result.gluser_id;
}
setCartCookie1('querysent','enter',4);
document.twostep_dataform.fullname.value = document.twostep_dataform.fullname.value.replace(/\s+/g,"");
if(document.twostep_dataform.estimatedquantity.value == ""){
document.twostep_dataform.estimatedquantity.value = 'Estimated Quantity';
document.twostep_dataform.estimatedquantity.className='h10_p m8_p bdr2_p icon15_p c11_p';
}
if(document.twostep_dataform.approxvalue.value == ""){
document.twostep_dataform.approxvalue.value = 'Approx. order value';
document.twostep_dataform.approxvalue.className='m8_p bdr2_p h10_p icon15_p c11_p';
}
if(document.twostep_dataform.fullname.value == ""){
document.twostep_dataform.fullname.value = 'Enter your name:';
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri c11_p';
}
if(document.twostep_dataform.S_email.value == ""){
document.twostep_dataform.S_email.value = 'Enter your email:';
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri c11_p';
}
if(document.twostep_dataform.S_mobile.value == ""){
document.twostep_dataform.S_mobile.value = 'Enter your number:';
document.twostep_dataform.S_mobile.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri c11_p';
}
document.getElementById('Descriptiontwostep').value = "Describe your requirement in detail:";
document.twostep_dataform.usage.className='h12_p m2_p clr7_p br7_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p c11_p';
}else{
msg="* Some error has occured while submitting enquiry.Please try again!!!";
$('.error_notification').html(msg).show();
}
submitQuery = 0;
return false;
},'json');
}
return false;
}else{
if(descvalue == false){
$('#Description1').trigger('focus');
}else if(ss_frmvalue == false){
$('#ss_frm').trigger('focus');
}else if(emailvalue == false){
$('#S_email').trigger('focus');
}else if(mobilevalue == false) {
$('#S_mobile2').trigger('focus');
}
return false;
}
}
return false;
};
function check_loginmode(){
if( im_readCookie("v4iilex") != "" && im_readCookie("ImeshVisitor") != ""){
$('#usr_login_mode').val(1);
}else if(im_readCookie("ImeshVisitor") != ""){
$('#usr_login_mode').val(2);
}else{
$('#usr_login_mode').val(3);
}
};
function check_loginmode_fooetrprd(){
if( im_readCookie("v4iilex") != "" && im_readCookie("ImeshVisitor") != ""){
$('#usr_login_mode_footerprd').val(1);
}else if(im_readCookie("ImeshVisitor") != ""){
$('#usr_login_mode_footerprd').val(2);
}else{
$('#usr_login_mode_footerprd').val(3);
}
};
/* twostep validation start*/
function twostepestimated_focus(FieldName) {
if(FieldName.value == 'Estimated Quantity'){
FieldName.value = '';
}
FieldName.className='h10_p m8_p bdr2_p icon15_p';
};
function twostepestimated(){
if(document.twostep_dataform.estimatedquantity.value == ""){
document.twostep_dataform.estimatedquantity.value = 'Estimated Quantity';
document.twostep_dataform.estimatedquantity.className='h10_p m8_p bdr2_p icon15_p c11_p';
}else{
document.twostep_dataform.estimatedquantity.className='h10_p m8_p bdr2_p icon15_p';
}
};
function twostepApproximate_focus(FieldName) {
if(FieldName.value == 'Approx. order value'){
FieldName.value = '';
}
FieldName.className='m8_p bdr2_p h10_p icon15_p';
};
function twostepApproximate(){
if(document.twostep_dataform.approxvalue.value == ""){
document.twostep_dataform.approxvalue.value = 'Approx. order value';
document.twostep_dataform.approxvalue.className='m8_p bdr2_p h10_p icon15_p c11_p';
}else{
document.twostep_dataform.approxvalue.className='m8_p bdr2_p h10_p icon15_p';
}
};
function twostepusage_focus(FieldName) {
if(FieldName.value == 'Describe your requirement in detail:'){
FieldName.value = '';
}
FieldName.className='h12_p m2_p clr7_p br7_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p';
};
function twostepusage(){
if(document.twostep_dataform.usage.value == ""){
document.twostep_dataform.usage.value = 'Describe your requirement in detail:';
document.twostep_dataform.usage.className='h12_p m2_p clr7_p br7_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p c11_p';
}else{
document.twostep_dataform.usage.className='h12_p m2_p clr7_p br7_p h1_p w30_p fnt_p icon8_p icon_datauri icon2_p';
}
};
function check_Fullname_twostep(){
if(document.getElementById("fullname").style.display =="none"){
return true;
}
document.twostep_dataform.fullname.value = document.twostep_dataform.fullname.value.replace(/^\s+/, "");
if(document.twostep_dataform.fullname.value == "Enter your name:"){
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri c11_p';
document.getElementById("f1").style.display="none";
return true;
}else if((document.twostep_dataform.fullname.value != "") && !(/^\s+$/.test(document.twostep_dataform.fullname.value)) && !(/^[A-z][A-z. ]{0,42}$/.test(document.twostep_dataform.fullname.value))){
document.getElementById("f1").style.display="block";
document.getElementById("f1").innerHTML='Please enter valid name.';
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri';
return false;
}else if(document.getElementById("fullname").value == ""){
document.getElementById("fullname").value="Enter your name:";
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri c11_p';
document.getElementById("f1").style.display="none";
}else{
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri';
document.getElementById("f1").style.display="none";
}
return true;
};
function check_Moblie_twostep(){
if(document.twostep_dataform.S_mobile.value != "Enter your number:"){
document.twostep_dataform.S_mobile.value = document.twostep_dataform.S_mobile.value.replace(/\s+/g,"");
}
document.twostep_dataform.S_mobile.value = document.twostep_dataform.S_mobile.value.replace(/^0+/, "");
var mobile_valid = (/^[0-9]{1,30}$/.test(document.twostep_dataform.S_mobile.value));
if(document.twostep_dataform.S_mobile.value == "" || document.twostep_dataform.S_mobile.value == "Enter your number:"){
document.twostep_dataform.S_mobile.value="Enter your number:";
document.twostep_dataform.S_mobile.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri c11_p';
document.getElementById("m1_t").style.display="none";
}else if(!mobile_valid){
document.getElementById("m1_t").style.display="block";
document.getElementById("m1_t").innerHTML='Please enter valid mobile number.';
document.twostep_dataform.S_mobile.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri';
return false;
}else{
document.getElementById("m1_t").style.display="none";
document.twostep_dataform.S_mobile.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri';
}
return true;
};
function check_Email_twostep(){
if(document.getElementById("S_email_twostep").style.display =="none"){
return true;
}
if(document.twostep_dataform.S_email.value == "Enter your email:"){
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri c11_p';
document.getElementById("e1_t").style.display="none";
}else if((document.twostep_dataform.S_email.value != "") && !(/^[A-z0-9][_.A-z0-9-]+@[a-zA-Z0-9]+[\.\-\_]{0,1}[a-zA-Z0-9]+\.[a-zA-Z]{2,6}\.?[a-zA-Z]{0,4}$/.test(document.twostep_dataform.S_email.value))){
document.getElementById("e1_t").style.display="block";
document.getElementById("e1_t").innerHTML='Please enter valid email.';
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri';
return false;
}else if(document.getElementById("S_email_twostep").value == ""){
document.getElementById("S_email_twostep").value="Enter your email:";
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri c11_p';
document.getElementById("e1_t").style.display="none";
}else{
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri';
document.getElementById("e1_t").style.display="none";
}
return true;
};
function check_Fullname_twostep2(){
if(document.getElementById("fullname").style.display =="none"){
return true;
}
if(document.twostep_dataform.fullname.value == "Enter your name:" || document.getElementById("fullname").value == ""){
document.getElementById("fullname").value="Enter your name:";
document.twostep_dataform.fullname.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri c11_p';
}
};
function check_Moblie_twostep2(){
x=document.twostep_dataform.S_mobile.value;
if(x == "" || x == "Enter your number:"){
document.twostep_dataform.S_mobile.value="Enter your number:";
document.twostep_dataform.S_mobile.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri c11_p';
}
};
function check_Email_twostep2(){
if(document.getElementById("S_email_twostep").style.display =="none"){
return true;
}
x=document.twostep_dataform.S_email.value;
if(x == "Enter your email:" || x == ""){
document.getElementById("S_email_twostep").value="Enter your email:";
document.twostep_dataform.S_email.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri c11_p';
}
};
function check_Fullname_focus_twostep(FieldName) {
if(FieldName.value == 'Enter your name:'){
FieldName.value = '';
}
FieldName.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon5_p icon_datauri';
document.getElementById("f1").style.display="none";
};
function check_mobile_focus_twostep(FieldName) {
if(FieldName.value == 'Enter your number:'){
FieldName.value = '';
FieldName.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon6_p icon_datauri';
}
document.getElementById("m1_t").style.display="none";
};
function check_Email_focus_twostep(FieldName) {
if(FieldName.value == 'Enter your email:'){
FieldName.value = '';
}
FieldName.className='bdr2_p bg10_p m8_p hi2_p icon9_p icon4_p icon_datauri';
document.getElementById("e1_t").style.display="none";
};
function validate_twostep_popup(){
if(typeof jQuery != undefined){
var fullname_twostep=check_Fullname_twostep();
var emailvalue_twostep=check_Email_twostep();
var mobilevalue_twostep=check_Moblie_twostep();
if(fullname_twostep && emailvalue_twostep && mobilevalue_twostep){
if (document.twostep_dataform.S_email.value == "Enter your email:"){
document.twostep_dataform.S_email.value='';
}
if (document.twostep_dataform.fullname.value == "Enter your name:"){
document.twostep_dataform.fullname.value='';
}
if (document.twostep_dataform.S_mobile.value == "Enter your number:"){
document.twostep_dataform.S_mobile.value='';
}
if (document.twostep_dataform.usage.value == "Describe your requirement in detail:"){
document.twostep_dataform.usage.value='';
}
if (document.twostep_dataform.estimatedquantity.value == "Estimated Quantity"){
document.twostep_dataform.estimatedquantity.value='';
}
if (document.twostep_dataform.approxvalue.value == "Approx. order value"){
document.twostep_dataform.approxvalue.value='';
}
if (document.twostep_dataform.usage.value == "Describe your requirement in detail:"){
document.twostep_dataform.usage.value='';
}
$(".enqload").html("
");
$.post($('.twostep_dataform').attr('action'),$('.twostep_dataform').serialize(),function(results){
$(".enqload").html("");
if(results == 'enter'){$('#infocus_div').hide();$('#twostepenquiry').hide();$('#closebtn').hide();$('#dataform_alert_display').show();
setTimeout(function(){ fg_hideform_zoom();},2000);
}
return false;});
return false;
}else{
if(fullname_twostep == false){
$('#fullname').trigger('focus');
}else if(mobilevalue_twostep == false){
$('#S_mob_twostep').trigger('focus');
}else{
$('#S_email_twostep').trigger('focus');
}
return false;
}
}
return false;
};
/*twostep validation end*/
var Selected_product = new Array();
function zoom_up_img(iid,pid, pcode, pname, pimg){
Selected_product['prd_id'] = pid;
Selected_product['prd_code'] = pcode;
Selected_product['prd_name'] = pname;
Selected_product['prd_img'] = pimg;
imgset_zoom(iid,'dataref');
};
function clearValue(){
if(document.zoom_dataform){
document.zoom_dataform.Description.value="";
}
};
/* Blow up Zoom Form Function End */
// For email field mandatory for foreign users in product zoom up
function check_country_flag(){
var prefix=popupopen;
if(document.getElementById('mobile-number_'+prefix) != null){
if(document.getElementById('mobile-number_'+prefix).value != "+91"){
document.getElementById('mobilefield_'+prefix).style.display="none";
document.getElementById('emailfield_'+prefix).style.display="block";
$('#mobile-number_'+prefix).addClass('off_p');
if(eval("document."+prefix+".S_email").value==''){
eval("document."+prefix+".S_email").value="Enter your email:";
eval("document."+prefix+".S_email").classList.add("c11_p");
}
eval("document."+prefix+".S_mobile").value='';
if(prefix=='twostep_dataform')
document.twostep_dataform.S_mobile.value="";
}else{
document.getElementById('mobilefield_'+prefix).style.display="block";
document.getElementById('emailfield_'+prefix).style.display="none";
$('#mobile-number_'+prefix).removeClass('off_p');
if(eval("document."+prefix+".S_mobile").value==''){
eval("document."+prefix+".S_mobile").value="Enter your number:";
eval("document."+prefix+".S_mobile").classList.add("c11_p");
}
eval("document."+prefix+".S_email").value='';
if(prefix=='twostep_dataform')
document.twostep_dataform.S_email.value="";
}
}
if(document.getElementsByClassName("cnty_iso")[0] != null)
$(".cnty_iso").trigger("onchange");
}
// ============= For identifing IP of country ========
function get_ip(){
if(im_readCookie("ImeshVisitor") == ""){
$.get("/cgi/get_head.php", function(result){
if(result.country[0].value){
scountry=result.country[0].value;
sphonecode='+'+result.country[0].data.isd;
countryiso=result.country[0].data.iso;
scmob ='+'+result.country[0].data.isd;
contry =result.country[0].data.iso;
mobile_isd=result.country[0].data.isd;
sync_country_flag('+'+result.country[0].data.isd,result.country[0].data.iso,result.country[0].value);
}
}, 'json');
}
}
// +++++++++++++++ suggestor +++++++++++
function check_ss_frm(){
if(document.getElementById('3pv_desc').style.display =="none"){
return true;
}
if(document.zoom_dataform.ss_frm.value == ""){
document.zoom_dataform.ss_frm.value = "Product/Service";
document.zoom_dataform.ss_frm.classList.add("c11_p");
document.getElementById("s1").style.display="block";
document.getElementById("s1").innerHTML='Kindly Describe Your Requirement.';
return false;
}else{
document.getElementById("s1").style.display="none";
}
return true;
};
function check_ss_frm2(){
if(document.getElementById('3pv_desc').style.display =="none"){
return true;
}
if(document.zoom_dataform.ss_frm.value == ""){
document.zoom_dataform.ss_frm.value = "Product/Service";
document.zoom_dataform.ss_frm.classList.add("c11_p");
}
};
function searchClear_frm(){if(document.zoom_dataform.ss_frm.value=="Product/Service"){document.zoom_dataform.ss_frm.value="";
$('#ss_frm').removeClass('c11_p');document.getElementById("s1").style.display="none";
}}