/*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 += '
");
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";
}}