/*----phone code start----*/ var phonecode = new Array(); phonecode[0] = ""; phonecode[1] = "61"; phonecode[2] = "43"; phonecode[3] = "32"; phonecode[4] = "1"; phonecode[5] = "420"; phonecode[6] = "45"; phonecode[7] = "33"; phonecode[8] = "49"; phonecode[9] = "91"; phonecode[10] = "52"; phonecode[11] = "64"; phonecode[12] = "47"; phonecode[13] = "34"; phonecode[14] = "41"; phonecode[15] = "44"; phonecode[16] = "1"; phonecode[17] = ""; phonecode[18] = "93"; phonecode[19] = "355"; phonecode[20] = "213"; phonecode[21] = "1-684"; phonecode[22] = "376"; phonecode[23] = "244"; phonecode[24] = "1-264"; phonecode[25] = "672"; phonecode[26] = "1-268"; phonecode[27] = "54"; phonecode[28] = "7"; phonecode[29] = "297"; phonecode[30] = "61"; phonecode[31] = "43"; phonecode[32] = "994"; phonecode[33] = "1-242"; phonecode[34] = "973"; phonecode[35] = "880"; phonecode[36] = "1-246"; phonecode[37] = "375"; phonecode[38] = "32"; phonecode[39] = "501"; phonecode[40] = "229"; phonecode[41] = "1-441"; phonecode[42] = "975"; phonecode[43] = "591"; phonecode[44] = "387"; phonecode[45] = "267"; phonecode[46] = "55"; phonecode[47] = "246"; phonecode[48] = "673"; phonecode[49] = "359"; phonecode[50] = "226"; phonecode[51] = "257"; phonecode[52] = "855"; phonecode[53] = "237"; phonecode[54] = "1"; phonecode[55] = "238"; phonecode[56] = "1-345"; phonecode[57] = "236"; phonecode[58] = "235"; phonecode[59] = "56"; phonecode[60] = "86"; phonecode[61] = "852"; phonecode[62] = "853"; phonecode[63] = "61"; phonecode[64] = "672"; phonecode[65] = "57"; phonecode[66] = "269"; phonecode[67] = "242"; phonecode[68] = "682"; phonecode[69] = "506"; phonecode[70] = "225"; phonecode[71] = "385"; phonecode[72] = "53"; phonecode[73] = "357"; phonecode[74] = "420"; phonecode[75] = "243"; phonecode[76] = "45"; phonecode[77] = "253"; phonecode[78] = "1-767"; phonecode[79] = "1-809"; phonecode[80] = "670"; phonecode[81] = "593"; phonecode[82] = "20"; phonecode[83] = "503"; phonecode[84] = "240"; phonecode[85] = "291"; phonecode[86] = "372"; phonecode[87] = "251"; phonecode[88] = "500"; phonecode[89] = "298"; phonecode[90] = "679"; phonecode[91] = "358"; phonecode[92] = "33"; phonecode[93] = "594"; phonecode[94] = "689"; phonecode[95] = "262"; phonecode[96] = "241"; phonecode[97] = "995"; phonecode[98] = "49"; phonecode[99] = "233"; phonecode[100] = "350"; phonecode[101] = "30"; phonecode[102] = "299"; phonecode[103] = "1-473"; phonecode[104] = "590"; phonecode[105] = "1-671"; phonecode[106] = "502"; phonecode[107] = "224"; phonecode[108] = "245"; phonecode[109] = "592"; phonecode[110] = "509"; phonecode[111] = "672"; phonecode[112] = "39"; phonecode[113] = "504"; phonecode[114] = "36"; phonecode[115] = "354"; phonecode[116] = "91"; phonecode[117] = "62"; phonecode[118] = "98"; phonecode[119] = "964"; phonecode[120] = "353"; phonecode[121] = "972"; phonecode[122] = "39"; phonecode[123] = "1-876"; phonecode[124] = "81"; phonecode[125] = "962"; phonecode[126] = "7"; phonecode[127] = "254"; phonecode[128] = "686"; phonecode[129] = "82"; phonecode[130] = "850"; phonecode[131] = "965"; phonecode[132] = "996"; phonecode[133] = "856"; phonecode[134] = "371"; phonecode[135] = "961"; phonecode[136] = "266"; phonecode[137] = "231"; phonecode[138] = "218"; phonecode[139] = "423"; phonecode[140] = "370"; phonecode[141] = "352"; phonecode[142] = "389"; phonecode[143] = "261"; phonecode[144] = "265"; phonecode[145] = "60"; phonecode[146] = "960"; phonecode[147] = "223"; phonecode[148] = "356"; phonecode[149] = "692"; phonecode[150] = "596"; phonecode[151] = "222"; phonecode[152] = "230"; phonecode[153] = "269"; phonecode[154] = "52"; phonecode[155] = "691"; phonecode[156] = "373"; phonecode[157] = "377"; phonecode[158] = "976"; phonecode[159] = "382"; phonecode[160] = "1-664"; phonecode[161] = "212"; phonecode[162] = "258"; phonecode[163] = "95"; phonecode[164] = "264"; phonecode[165] = "674"; phonecode[166] = "977"; phonecode[167] = "31"; phonecode[168] = "599"; phonecode[169] = "687"; phonecode[170] = "64"; phonecode[171] = "505"; phonecode[172] = "227"; phonecode[173] = "234"; phonecode[174] = "683"; phonecode[175] = "672"; phonecode[176] = "1-670"; phonecode[177] = "47"; phonecode[178] = "968"; phonecode[179] = "92"; phonecode[180] = "680"; phonecode[181] = "970"; phonecode[182] = "507"; phonecode[183] = "675"; phonecode[184] = "595"; phonecode[185] = "51"; phonecode[186] = "63"; phonecode[187] = "872"; phonecode[188] = "48"; phonecode[189] = "351"; phonecode[190] = "1"; phonecode[191] = "974"; phonecode[192] = "262"; phonecode[193] = "40"; phonecode[194] = "7"; phonecode[195] = "250"; phonecode[196] = "290"; phonecode[197] = "1-869"; phonecode[198] = "1-758"; phonecode[199] = "508"; phonecode[200] = "1-784"; phonecode[201] = "685"; phonecode[202] = "378"; phonecode[203] = "239"; phonecode[204] = "966"; phonecode[205] = "221"; phonecode[206] = "381"; phonecode[207] = "381"; phonecode[208] = "248"; phonecode[209] = "232"; phonecode[210] = "65"; phonecode[211] = "421"; phonecode[212] = "386"; phonecode[213] = "677"; phonecode[214] = "252"; phonecode[215] = "27"; phonecode[216] = "995"; phonecode[217] = "34"; phonecode[218] = "94"; phonecode[219] = "249"; phonecode[220] = "597"; phonecode[221] = "47"; phonecode[222] = "268"; phonecode[223] = "46"; phonecode[224] = "41"; phonecode[225] = "963"; phonecode[226] = "886"; phonecode[227] = "992"; phonecode[228] = "255"; phonecode[229] = "66"; phonecode[230] = "220"; phonecode[231] = "228"; phonecode[232] = "690"; phonecode[233] = "676"; phonecode[234] = "1-868"; phonecode[235] = "216"; phonecode[236] = "90"; phonecode[237] = "993"; phonecode[238] = "1-649"; phonecode[239] = "688"; phonecode[240] = "256"; phonecode[241] = "380"; phonecode[242] = "971"; phonecode[243] = "44"; phonecode[244] = "1"; phonecode[245] = "1"; phonecode[246] = "598"; phonecode[247] = "998"; phonecode[248] = "678"; phonecode[249] = "58"; phonecode[250] = "84"; phonecode[251] = "1-284"; phonecode[252] = "1-340"; phonecode[253] = "681"; phonecode[254] = "212"; phonecode[255] = "967"; phonecode[256] = "38"; phonecode[257] = "260"; phonecode[258] = "263"; /*----phone code end----*/ /*----form validation start----*/ function set(enq_name) { var prd =''; var cart_details='\n==========================================\n'; if((cookie = getCartCookie("CART_SESSION")) > "") { var myCart = eval("(" + cookie + ")"); var p = myCart[0]; var quant = p.length; for(var j=0; j < quant; j++) { prd = document.getElementById('product'+j).value; var qty = document.getElementById('qty'+j).value; if(qty) { prd = prd+' x '+qty; } cart_details = cart_details+prd+'\n'; } } cart_details=cart_details+'==========================================\n'; if(prd == '') { document.getElementById('cart_details').value = ''; } else { document.getElementById('cart_details').value = cart_details; } if(document.dataform.Description.value == "") { alert ("Kindly describe your requirement."); document.dataform.Description.focus(); return false; } if (document.dataform.Description.value.length>3500) { alert("Kindly describe your requirement within the limit of 3500 characters."); document.dataform.Description.focus(); return false; } var temp2 =document.dataform.Description.value; var temp3 = temp2.replace(/\s/gi,""); if(temp3.length == 0) { alert ("Kindly describe your requirement."); document.dataform.Description.value=''; document.dataform.Description.focus(); return false; } if(enq_name == "Travel Enquiry page") { if(typeof(document.dataform.check_in) != "undefined") { if (document.dataform.check_in.value == "") { alert ("Kindly select your expected arrival."); document.dataform.check_in.focus(); return false; } } } else { if(typeof(document.dataform.check_in) != "undefined") { if (document.dataform.check_in.value == "") { alert ("Kindly select your Check-in date."); document.dataform.check_in.focus(); return false; } } } if(typeof(document.dataform.Duration) != "undefined") { if (document.dataform.Duration.selectedIndex == "") { alert ("Kindly select your duration."); document.dataform.Duration.focus(); return false; } } if(typeof(document.dataform.dept_Date) != "undefined") { if (document.dataform.dept_Date.value == "") { alert ("Kindly select your Check-out date."); document.dataform.dept_Date.focus(); return false; } } if(typeof(document.dataform.adult) != "undefined") { if (document.dataform.adult.selectedIndex == "") { alert ("Kindly select number of persons."); document.dataform.adult.focus(); return false; } } if(typeof(document.dataform.Budget) != "undefined") { if (document.dataform.Budget.selectedIndex == "") { alert ("Kindly select your budget."); document.dataform.Budget.focus(); return false; } } if (document.dataform.S_name.value.length == 0) { alert ("Kindly enter your name."); document.dataform.S_name.focus(); return false; } if(document.dataform.S_name.value == "First Name" ) { alert("Kindly enter your Name."); document.dataform.S_name.focus(); return false; } var temp =document.dataform.S_name.value; var temp1 = temp.replace(/ /gi,""); if(temp1.length == 0) { alert ("Kindly enter your name."); document.dataform.S_name.value=''; document.dataform.S_name.focus(); return false; } var iChars = "!@#$%^&*()+=-[]1234567890\\\';,./{}|\":<>?"; for (var i = 0; i < document.dataform.S_name.value.length; i++) { if (iChars.indexOf(document.dataform.S_name.value.charAt(i)) != -1) { alert ("Kindly enter your name without special character & numeric value"); document.dataform.S_name.value=''; document.dataform.S_name.focus(); return false; } } for (var i = 0; i < document.dataform.S_lname.value.length; i++) { if (iChars.indexOf(document.dataform.S_lname.value.charAt(i)) != -1) { alert ("Kindly enter your name without special character & numeric value"); document.dataform.S_lname.value=''; document.dataform.S_lname.focus(); return false; } } var sname=document.dataform.S_name.value.length; var lname=0; if(document.dataform.S_lname.value == "Last Name" ) { lname=0; } else { lname=document.dataform.S_lname.value.length; } var totleng=sname+lname; if(totleng > 76) { alert("Kindly enter your name within the limit of 80 characters."); document.dataform.S_name.focus(); return false; } if(document.dataform.S_email.value == '') { alert("Kindly enter your Email ID."); document.dataform.S_email.focus(); return false; } if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.dataform.S_email.value))) { alert("Invalid Email ID. Kindly enter the correct ID."); document.dataform.S_email.focus(); return (false); } if(document.dataform.S_email.value.length >60) { alert("Kindly enter your Email ID within the limit of 60 characters."); document.dataform.S_email.focus(); return false; } if(document.dataform.S_organization.value != '') { var temp1 = document.dataform.S_organization.value.replace(/ /gi,""); if(temp1 == '') { document.dataform.S_organization.value = ''; } } if(document.dataform.S_organization.value.length >80) { alert("Kindly enter your Company Name within the limit of 80 characters."); document.dataform.S_organization.focus(); return false; } if(document.dataform.Website.value != '') { var temp1 = document.dataform.Website.value.replace(/ /gi,""); if(temp1 == '') { document.dataform.Website.value = ''; } } if(document.dataform.S_city.value != '') { var temp1 = document.dataform.S_city.value.replace(/ /gi,""); if(temp1 == '') { document.dataform.S_city.value = ''; } } if(document.dataform.S_city.value.length >50) { alert("Kindly enter your City within the limit of 50 characters."); document.dataform.S_city.focus(); return false; } if(document.dataform.country.options[document.dataform.country.selectedIndex].value == 'IN') { document.dataform.country_iso.value = document.dataform.country.options[document.dataform.country.selectedIndex].value; document.dataform.S_country.value = document.dataform.country.options[document.dataform.country.selectedIndex].text; } else { if((document.dataform.S_country.value == "") || (document.dataform.country.options[document.dataform.country.selectedIndex].value == '')) { alert("Kindly select the Country."); document.dataform.country.focus(); return false; } } if (document.dataform.S_country.value.length > 50) { alert ("Kindly select the Country Name within the limit of 30 characters."); document.dataform.S_country.focus(); return false; } if (document.dataform.S_phone_country_code.value.length == 0) { alert ("Kindly enter your country code ."); document.dataform.S_phone_country_code.value=''; document.dataform.S_phone_country_code.focus(); return false; } var country_phone_clnt = document.dataform.S_phone_country_code.value.replace(/ /gi, ""); if (country_phone_clnt.length == 0) { alert ("Kindly enter your country code other than space."); document.dataform.S_phone_country_code.value=''; document.dataform.S_phone_country_code.focus(); return false; } var c_code = document.dataform.S_phone_country_code.value.replace(/-/gi, ""); if ((isNaN(c_code) && (document.dataform.S_phone_country_code.value.length != 0)) && (document.dataform.S_phone_country_code.value.length != 0)) { alert ("Kindly enter your country code for phone number in numeric form only."); document.dataform.S_phone_country_code.value= ''; document.dataform.S_phone_country_code.focus(); return false; } if(document.dataform.S_phone_area_code.value.length !=0 && document.dataform.S_phone_area_code.value != 'Area Code') { document.dataform.S_phone_area_code.value = document.dataform.S_phone_area_code.value.replace(/ /gi,""); if(isNaN(document.dataform.S_phone_area_code.value)) { alert("Kindly enter your area code in numeric form only"); document.dataform.S_phone_area_code.value=''; document.dataform.S_phone_area_code.focus(); return false; } } if (((document.dataform.S_phone.value.length == 0) && (document.dataform.S_mobile.value.length==0)) || ((document.dataform.S_phone.value == "Phone Number") && (document.dataform.S_mobile.value =="Mobile / Cell Phone Number")) || ((document.dataform.S_phone.value == "Phone Number") && (document.dataform.S_mobile.value.length==0)) || ((document.dataform.S_phone.value.length == 0) && (document.dataform.S_mobile.value =="Mobile / Cell Phone Number"))) { alert ("Kindly enter your phone number or mobile number."); document.dataform.S_phone.value= ''; document.dataform.S_phone.focus(); return false; } else { if ((document.dataform.S_phone.value.length != 0) && (document.dataform.S_phone.value != "Phone Number")) { if (document.dataform.S_phone.value.length == 0) { alert ("Kindly enter your phone number."); document.dataform.S_phone.value= ''; document.dataform.S_phone.focus(); return false; } if (document.dataform.S_phone.value == "Phone Number") { alert ("Kindly enter your phone number."); document.dataform.S_phone.value= ''; document.dataform.S_phone.focus(); return false; } var phone_clnt = document.dataform.S_phone.value.replace(/ /gi, ""); if (phone_clnt.length == 0) { alert ("Kindly enter your phone number other than space."); document.dataform.S_phone.value=''; document.dataform.S_phone.focus(); return false; } var x= phone_clnt.match("e|E"); if(x) { alert ("Kindly enter your phone number in numeric only.."); document.dataform.S_phone.value=''; document.dataform.S_phone.focus(); return false; } if (isNaN(document.dataform.S_phone.value)) { alert ("Kindly enter your phone number in numeric only."); document.dataform.S_phone.value= ''; document.dataform.S_phone.focus(); return false; } } if ((document.dataform.S_mobile.value.length != 0) && (document.dataform.S_mobile.value != "Mobile / Cell Phone Number")) { var mobile_clnt = document.dataform.S_mobile.value.replace(/ /gi, ""); if (mobile_clnt.length == 0) { alert ("Kindly enter your mobile number other than space."); document.dataform.S_mobile.value=''; document.dataform.S_mobile.focus(); return false; } var z= mobile_clnt.match("e|E"); if(z) { alert ("Kindly enter your mobile number in numeric only."); document.dataform.S_mobile.value= ''; document.dataform.S_mobile.focus(); return false; } if (isNaN(document.dataform.S_mobile.value) && (document.dataform.S_mobile.value !="Mobile / Cell Phone Number")) { alert ("Kindly enter your mobile number in numeric only."); document.dataform.S_mobile.value= ''; document.dataform.S_mobile.focus(); return false; } } else { if ((document.dataform.S_mobile.value.length!=0) && (document.dataform.S_mobile.value !="Mobile / Cell Phone Number") || (document.dataform.S_mobile.value.length == 0) && (document.dataform.S_mobile.value !="Mobile / Cell Phone Number")) { if (document.dataform.S_mobile.value.length == 0) { alert ("Kindly enter your mobile number."); document.dataform.S_mobile.value= ''; document.dataform.S_mobile.focus(); return false; } if (document.dataform.S_mobile.value == "Mobile / Cell Phone Number") { alert ("Kindly enter your mobile number."); document.dataform.S_mobile.value= ''; document.dataform.S_mobile.focus(); return false; } var mobile_clnt = document.dataform.S_mobile.value.replace(/ /gi, ""); if (mobile_clnt.length == 0) { alert ("Kindly enter your mobile number other than space."); document.dataform.S_mobile.value=''; document.dataform.S_mobile.focus(); return false; } var y= mobile_clnt.match("e|E"); if(y) { alert ("Kindly enter your mobile number in numeric only."); document.dataform.S_mobile.value=''; document.dataform.S_mobile.focus(); return false; } if (isNaN(document.dataform.S_mobile.value)) { alert ("Kindly enter your mobile number in numeric only."); document.dataform.S_mobile.value= ''; document.dataform.S_mobile.focus(); return false; } } } } var S_phone_area_code=0; var S_phone_country_code=0; var S_phone=0; S_phone_country_code=document.dataform.S_phone_country_code.value.length; if(document.dataform.S_phone_area_code.value == "Area Code") { S_phone_area_code=0; } else { S_phone_area_code=document.dataform.S_phone_area_code.value.length; } if (document.dataform.S_phone.value == "Phone Number") { S_phone=0; } else { S_phone=document.dataform.S_phone.value.length; } totleng=S_phone_area_code+S_phone_country_code+S_phone; if(totleng > 60) { alert ("Kindly enter your telephone number including country code,area code and phone number within the limit of 60 characters."); document.dataform.S_phone.focus(); return false; } var S_mobile=0; var S_cmobile=0; S_cmobile=document.dataform.S_cmobile.value.length; if (document.dataform.S_mobile.value == "Mobile / Cell Phone Number") { S_mobile=0; } else { S_mobile=document.dataform.S_mobile.value.length; } totleng=S_cmobile+S_mobile; if(totleng > 60) { alert ("Kindly enter your mobile number including country code and mobile / cell phone within the limit of 60 characters."); document.dataform.S_mobile.focus(); return false; } if(enq_name != "prdpage"){ var val=document.dataform.S_attachment.value.substring(document.dataform.S_attachment.value.length-4,document.dataform.S_attachment.value.length); var val1=document.dataform.S_attachment.value.substring(document.dataform.S_attachment.value.length-5,document.dataform.S_attachment.value.length); if(val!='.jpg'&&val!='.JPG'&&val!='.gif'&&val!='.GIF'&&val!='.png'&&val!='.PNG'&&val!='.txt'&&val!='.TXT'&&val!='.pdf'&&val!='.PDF'&&val!='.rtf'&&val!='.RTF'&&val1!='.jpeg'&&val1!='.JPEG'&&val1!='') { alert(val+' is not a valid file only .jpg .gif .png .txt .pdf .rtf files are allowed'); return false; }} if (document.dataform.captcha_text.value.length == 0) { alert ("Kindly enter security code as shown in image."); document.dataform.captcha_text.focus(); return false; } if (document.dataform.S_lname.value == "Last Name") { document.dataform.S_lname.value=""; } if (document.dataform.S_city.value == "City") { document.dataform.S_city.value=""; } if (document.dataform.S_phone_area_code.value == "Area Code") { document.dataform.S_phone_area_code.value=""; } if (document.dataform.S_cmobile.value == "Country Code") { document.dataform.S_cmobile.value=""; } if (document.dataform.S_phone.value == "Phone Number") { document.dataform.S_phone.value=""; } if (document.dataform.S_mobile.value == "Mobile / Cell Phone Number") { document.dataform.S_mobile.value=""; } setGlobalCookie('ImeshVisitor', makeCookie()); check_cart(); } function check_cart() { var myCart; if((cookie = getCartCookie("CART_SESSION")) > "") { myCart = eval("(" + cookie + ")"); var itemsArr = myCart[0]; //In below condition modref_id hidden field updated with product displayid of first product selected in cart if(itemsArr.length > 0) { var pitemid=[]; var pdisplayid=[]; var itemid=product.itemid; var displayid=product.displayid; pitemid=itemid.split(","); pdisplayid=displayid.split(","); for(i=0;i