function validatefrmother() { if(document.frmother.txtname.value=="") { alert("Please enter your name."); document.frmother.txtname.focus(); return false; } if(document.frmother.txtcompany.value=="") { alert("Please enter your company."); document.frmother.txtcompany.focus(); return false; } if(document.frmother.txtphone.value=="") { alert("Please enter your phone number."); document.frmother.txtphone.focus(); return false; } iIntChk = "0123456789. -+()"; if (document.frmother.txtphone.value!="") { for ( i=0; i0) { var chk=confirm('Have you personalised the cards you have ordered. To do this just click the edit personalisation link below the card name.\nTo edit personalisation click Cancel, to continue to the checkout click OK.'); if(chk) { window.location.href='view_basket.php?do_action=checkout'; } else { return false; } } else { window.location.href='view_basket.php?do_action=checkout'; } } function showDescription(img_desc) { document.getElementById("img_desc_id").style.display=""; document.getElementById("img_desc_id").innerHTML=img_desc; } function showDesHide(img_desc) { document.getElementById("img_desc_id").style.display="none"; } function inputInkcolorName(spanId, TextVal, hidId, textId, totalCnt, cnt,deflt_colr_id,alter_price,deflt_price) { if(document.getElementById("card_raisedInk_span")) { if(textId==deflt_colr_id) document.getElementById("card_raisedInk_span").innerHTML = "Additional Price : £ "+deflt_price; else document.getElementById("card_raisedInk_span").innerHTML = "Additional Price : £ "+alter_price; document.form1.card_raisedInk_price_temp.value=document.getElementById("card_raisedInk_span").innerHTML; } if(document.getElementById(spanId)) { document.getElementById(spanId).innerHTML = TextVal; } if(document.getElementById(hidId)) { document.getElementById(hidId).value = textId; } for(var i=0;i < totalCnt;i++) { if(i == cnt) { if(document.getElementById('outerDiv_'+i)) { document.getElementById('outerDiv_'+i).className = 'textColorSelectedDiv'; } } else { if(document.getElementById('outerDiv_'+i)) { document.getElementById('outerDiv_'+i).className = 'textColorUnselectedDiv'; } } } } function inputFontcolorName(spanId, TextVal, hidId, textId, totalCnt, cnt,textMSG, var_mode) { if(document.getElementById(spanId)) { document.getElementById(spanId).innerHTML = TextVal; //var fontface=document.getElementById(spanId).innerHTML.replace(/<\/?[a-z][a-z0-9]*[^<>]*>/ig,""); if(!var_mode) { alert(textMSG); } } if(document.getElementById(hidId)) { document.getElementById(hidId).value = textId; } for(var i=0;i < totalCnt;i++) { if(i == cnt) { if(document.getElementById('outerFontDiv_'+i)) { document.getElementById('outerFontDiv_'+i).className = 'textFontColorSelectedDiv'; } } else { if(document.getElementById('outerFontDiv_'+i)) { document.getElementById('outerFontDiv_'+i).className = 'textFontColorUnselectedDiv'; } } } } function validate_HymnMusicBox(obj,span_id,item_id) { if(obj.checked==true) { document.getElementById(span_id).style.display="block"; } else { document.getElementById(span_id).style.display="none"; for(var i=0;i<=4;i++) { if(eval("document.form1.menuHymnItem"+item_id+"["+i+"]")){ radObj = eval("document.form1.menuHymnItem"+item_id+"["+i+"]"); radObj.checked=false; } } } } function validate_MemberRegistration() { var g = document.form1; if(trim(g.name.value)=="") { alert("Please enter your first name."); g.name.value = trim(g.name.value); g.name.focus(); return false; } if(trim(g.lastname.value)=="") { alert("Please enter your last name."); g.lastname.value = trim(g.lastname.value); g.lastname.focus(); return false; } if(trim(g.address.value)=="") { alert("Please enter your address."); g.address.value = trim(g.address.value); g.address.focus(); return false; } if(trim(g.postcode.value)=="") { alert("Please enter your postcode."); g.postcode.value = trim(g.postcode.value); g.postcode.focus(); return false; } if(trim(g.email.value)=="") { alert("Please enter your email."); g.email.value = trim(g.email.value); g.email.focus(); return false; } else if(!validate_email(trim(g.email.value))) { alert("Invalid your email, please re-enter."); g.email.value = trim(g.email.value); g.email.focus(); return false; } /* if(g.cemail && trim(g.cemail.value)=="") { alert("Please enter the Confirm E-Mail address."); g.cemail.value = trim(g.cemail.value); g.cemail.focus(); return false; } else if(g.cemail && !validate_email(trim(g.cemail.value))) { alert("Please enter the valid Confirm E-Mail address."); g.cemail.value = trim(g.cemail.value); g.cemail.focus(); return false; } if(g.cemail && trim(g.email.value)!=trim(g.cemail.value)) { alert("Please confirm your E-Mail address."); g.cemail.value = trim(g.cemail.value); g.cemail.focus(); return false; } */ if(g.pass && trim(g.pass.value)=="") { alert("Please enter your password."); g.pass.value = trim(g.pass.value); g.pass.focus(); return false; } /* if(g.cpass && trim(g.cpass.value)=="") { alert("Please confirm the Member Password."); g.cpass.value = trim(g.cpass.value); g.cpass.focus(); return false; } if(g.pass && trim(g.pass.value)!=trim(g.cpass.value)) { alert("Password and Confirm Passowrd should be same."); g.cpass.value = trim(g.cpass.value); g.cpass.focus(); return false; } */ if(trim(g.telno.value)=="") { alert("Please enter your telephone number."); g.telno.value = trim(g.telno.value); g.telno.focus(); return false; } if(g.country.value==-1) { alert("Please select country."); g.country.focus(); return false; } if(trim(g.city.value)=="") { alert("Please enter your city."); g.city.value = trim(g.city.value); g.city.focus(); return false; } if(trim(g.deladdress.value)=="" && g.chkdelivery.checked==true) { alert("Please enter your delivery address."); g.deladdress.value = trim(g.deladdress.value); g.deladdress.focus(); return false; } if(g.howufind.value==-1) { alert("Please select How You Find Us."); g.howufind.focus(); return false; } return true; } function chkdel(obj) { if(obj.chkdelivery.checked==true) { obj.deladdress.value = obj.address.value; } return true; } function validate_TradeMember() { var g = document.webform; if(trim(g.first_name.value)=="") { alert("Please enter first name."); g.first_name.focus(); return false; } if(trim(g.last_name.value)=="") { alert("Please enter last name."); g.last_name.focus(); return false; } if(trim(g.email_address.value)=="") { alert("Please enter email address."); g.email_address.focus(); return false; } else if(!validate_email(g.email_address.value)) { alert("Invalid email address, please re-enter email address."); g.email_address.focus(); return false; } if(trim(g.phone_number.value)=="") { alert("Please enter phone number."); g.phone_number.focus(); return false; } if(!isValidTelephone(g.phone_number.value)) { //alert("Invalid phone number, please re-enter phone number."); g.phone_number.focus(); return false; } if(trim(g.website_url.value)=="") { alert("Please enter website url."); g.website_url.focus(); return false; } if(isURL(g.website_url.value)==false) { alert("Invalid website url, please re-enter website url."); g.website_url.focus(); return false; } return true; } function validate_ContactUS() { var g = document.webform; if(trim(g.name.value)=="") { alert("Please enter the Name."); g.name.focus(); return false; } if(trim(g.email.value)=="") { alert("Please enter email address."); g.email.focus(); return false; } else if(!validate_email(g.email.value)) { alert("Invalid email address, please re-enter email address."); g.email.focus(); return false; } if(trim(g.phone.value)=="") { alert("Please enter phone."); g.phone.focus(); return false; } if(!isValidTelephone(g.phone.value)) { //alert("Invalid phone number, please re-enter phone."); g.phone.focus(); return false; } if(trim(g.message.value)=="") { alert("Please enter message."); g.message.focus(); return false; } } function validate_UserLoginForm() { var g = document.frmLogin; if(trim(g.username.value)=="") { alert("Please enter the Username."); g.username.value = trim(g.username.value); g.username.focus(); return false; } if(trim(g.password.value)=="") { alert("Please enter the Password."); g.password.value = trim(g.password.value); g.password.focus(); return false; } } function validate_ChangePassword() { var g = document.form1; if(trim(g.password.value)=="") { alert("Please enter the Current Password."); g.password.value = trim(g.password.value); g.password.focus(); return false; } if(trim(g.new_password.value)=="") { alert("Please enter the New Password."); g.new_password.value = trim(g.new_password.value); g.new_password.focus(); return false; } if(trim(g.retype_password.value)=="") { alert("Please enter the Retype New Password."); g.retype_password.value = trim(g.retype_password.value); g.retype_password.focus(); return false; } if(trim(g.retype_password.value)!=trim(g.new_password.value)) { alert("Password and Retype Password is not same."); g.new_password.value = trim(g.new_password.value); g.retype_password.value = trim(g.retype_password.value); g.retype_password.focus(); return false; } return true; } function validate_RequestBroucher() { var g = document.form1; if(trim(g.name.value)=='') { alert("Please enter your name."); g.name.value = trim(g.name.value); g.name.focus(); return false; } if(trim(g.address.value)=='') { alert("Please enter your address."); g.address.value = trim(g.address.value); g.address.focus(); return false; } if(trim(g.country.value)=='') { alert("Please enter your country."); g.country.value = trim(g.country.value); g.country.focus(); return false; } if(trim(g.postcode.value)=='') { alert("Please enter your post code."); g.postcode.value = trim(g.postcode.value); g.postcode.focus(); return false; } if(trim(g.telno.value)=='') { alert("Please enter your telephone no."); g.telno.value = trim(g.telno.value); g.telno.focus(); return false; } if(trim(g.email.value)=='') { alert("Please enter your email."); g.email.value = trim(g.email.value); g.email.focus(); return false; } if(!(validate_email(g.email.value))) { alert("Please enter valid E-mail Address."); g.email.value = trim(g.email.value); g.email.select(); return false; } if(trim(g.weddingdate.value)=='') { alert("Please enter your wedding date."); g.weddingdate.value = trim(g.weddingdate.value); g.weddingdate.focus(); return false; } if(g.howufind.selectedIndex<=0) { alert("Please select how you find our website."); g.howufind.focus(); return false; } } /* validate calender Popup*/ function validate_calendar(f,n) { var cal1 = new calendar1(document.forms[f].elements[n]); cal1.year_scroll = true; cal1.time_comp = false; cal1.popup(); } function validate_RequestAppointment() { var g = document.form1; if(trim(g.name.value)=='') { alert("Please enter your name."); g.name.value = trim(g.name.value); g.name.focus(); return false; } if(trim(g.daytime_tel.value)=='') { alert("Please enter your daytime telephone number."); g.daytime_tel.value = trim(g.daytime_tel.value); g.daytime_tel.focus(); return false; } if(trim(g.evening_tel.value)=='') { alert("Please enter your evening telephone number."); g.evening_tel.value = trim(g.evening_tel.value); g.evening_tel.focus(); return false; } if(trim(g.email.value)=='') { alert("Please enter your email."); g.email.value = trim(g.email.value); g.email.focus(); return false; } else if(!(validate_email(trim(g.email.value)))) { alert("Enter valid e-mail address."); g.email.value = trim(g.email.value); g.email.select(); return false; } if(trim(g.location.value)=='') { alert("Please enter your location."); g.location.value = trim(g.location.value); g.location.focus(); return false; } if(trim(g.weddingdate.value)=='') { alert("Please enter your wedding date."); g.weddingdate.value = trim(g.weddingdate.value); g.weddingdate.focus(); return false; } /* if(!isDate(trim(g.weddingdate.value))) { alert("Please enter your wedding date."); g.weddingdate.focus(); return false; } */ if(trim(g.locId.value)==-1) { alert("Please choose appointment location."); g.locId.focus(); return false; } } /* function plus(product_id) { ind = eval("document.form1.product_ind_"+product_id+".value"); ind = (ind*1)+1; product_discount = eval("document.form1.discount_value_"+product_id+".value"); gen_qty_increment = eval("document.form1.gen_qty_increment_"+product_id+".value")*1; var modifyMode = false; if(ind>8) { eval("document.form1.product_ind_"+product_id).value = ind; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)+(ProductPriceArray[product_id][9]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)+gen_qty_increment; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } else if(ProductPriceArray[product_id][ind] || ProductPriceArray[product_id][ind]>=0) { eval("document.form1.product_ind_"+product_id).value = ind; eval("document.form1.product_price_"+product_id).value = ProductPriceArray[product_id][ind]*1; calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)+ProductBandArray[product_id][ind]; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } if(modifyMode) { if(document.getElementById("span_product_price_"+product_id)){document.getElementById("span_product_price_"+product_id).innerHTML = return_RoundOff(calculated_price)}; if(document.getElementById("span_product_qty_"+product_id)){document.getElementById("span_product_qty_"+product_id).innerHTML = calculated_quantity}; if(document.getElementById("span_product_discount_"+product_id)){document.getElementById("span_product_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount)}; if(document.getElementById("span_product_total_"+product_id)){document.getElementById("span_product_total_"+product_id).innerHTML = return_RoundOff(calculated_total)}; update_PageTotal(); } return true; } */ /*function GetXmlHttpObject1() { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp }*/ function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } else return xmlHttp; } function placeASampleOrder(){ document.getElementById("tddispavailable").innerHTML="Processing........"; prodSampleCardId = document.getElementById("hdnSampleCardId").value; xmlHttp = GetXmlHttpObject(); var url= "addsample_to_basket.php"; xmlHttp.open("POST",url,true); xmlHttp.onreadystatechange = finaldoit; xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); xmlHttp.send("process=checkSample&prodId="+prodSampleCardId); } function finaldoit() { if(xmlHttp.readyState == 1) { document.getElementById("tddispavailable").innerHTML="Processing........"; } if(xmlHttp.readyState == 4) { responsestr=xmlHttp.responseText; window.location.href='view_basket.php'; //alert(responsestr) document.getElementById("tddispavailable").style.display=''; document.getElementById("tddispavailable").innerHTML=""; } } function placeASampleOrder_new(th){ var xmlHttp = GetXmlHttpObject(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 1) { document.getElementById("tddispavailable_"+th).innerHTML="Processing........"; } if(xmlHttp.readyState==4) //Complete { if(xmlHttp.readyState == 4) { responsestr=xmlHttp.responseText; window.location.href='view_basket.php'; //alert(responsestr) document.getElementById("tddispavailable_"+th).style.display=''; document.getElementById("tddispavailable_"+th).innerHTML=""; alert(responsestr); } } } url = "addsample_to_basket_new.php?process=checkSample&prodId="+th; //document.write(url); xmlHttp.open("POST",url,true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(); //document.getElementById("tddispavailable_"+th).innerHTML="Processing........"; //prodSampleCardId = document.getElementById("hdnSampleCardId_"+th).value; //xmlHttpgetname = GetXmlHttpObject(); //var url= "addsample_to_basket_new.php?process=checkSample&prodId="+th; //xmlHttpgetname.open("GET",url,true); //xmlHttpgetname.onreadystatechange = finaldoit_new(th); //xmlHttpgetname.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //xmlHttpgetname.send("process=checkSample&prodId="+prodSampleCardId); } function finaldoit_new(th) { if(xmlHttpgetname.readyState == 1) { document.getElementById("tddispavailable_"+th).innerHTML="Processing........"; } alert(th) if(xmlHttpgetname.readyState == 4) { responsestr=xmlHttpgetname.responseText; alert(responsestr) document.getElementById("tddispavailable_"+th).style.display=''; document.getElementById("tddispavailable_"+th).innerHTML=""; alert(responsestr); } } function plus(product_id) { ind = eval("document.form1.product_ind_"+product_id+".value"); ind = (ind*1)+1; //alert("ind ---"+ind); product_discount = eval("document.form1.discount_value_"+product_id+".value"); offer_discount = eval("document.form1.special_offer_discount_"+product_id+".value"); gen_qty_increment = eval("document.form1.gen_qty_increment_"+product_id+".value")*1; new_peritem_value = eval("document.form1.new_peritem_value_"+product_id+".value")*1; price_type = eval("document.form1.price_type_"+product_id+".value"); show_form_flag = eval("document.form1.show_form_flag_"+product_id+".value"); tempqty = eval("document.form1.product_qty_"+product_id+".value"); TempRange_from = eval("document.form1.range_from_"+product_id+".value"); requiredQty = eval("document.form1.special_offer_qty_"+product_id+".value"); offerType = eval("document.form1.special_offer_type_"+product_id+".value"); var dosplay_mode = eval("document.form1.display_mode_"+product_id+".value"); var modifyMode = false; var productPriceNewnet = 1; var calculated_price_new; var calculated_discount_new; var calculated_total_new; if(TempRange_from == "" && show_form_flag == ""){ if(document.getElementById("innovaAdditionOption")){ document.getElementById("innovaAdditionOption").style.display = "none"; document.getElementById("innovaAdditionOption1").style.display = "none"; } }else{ if(document.getElementById("innovaAdditionOption")){ document.getElementById("innovaAdditionOption").style.display = "block"; document.getElementById("innovaAdditionOption1").style.display = "block"; } } if((eval(tempqty) >= eval(TempRange_from)) && (show_form_flag==1)) { getMessage('putPopupDiv'); openSubWin('price_xmas.php?pid='+product_id+'&qty='+TempRange_from, 'test', 700, 600,200, 200, ''); } else { // alert(" price_type -- "+price_type); //if(price_type == 2 && ind > 20) if(price_type == 2 && ind > 500) { eval("document.form1.product_ind_"+product_id).value = ind; var productPriceNewnet = ProductPriceArray[product_id][20]*1; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)+(ProductPriceArray[product_id][20]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)+new_peritem_value; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } else if(price_type!=2 && ind > 8 && ProductPriceArray[product_id][9]) { eval("document.form1.product_ind_"+product_id).value = ind; var productPriceNewnet = ProductPriceArray[product_id][9]*1; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)+(ProductPriceArray[product_id][9]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); //alert(gen_qty_increment); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)+gen_qty_increment; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } else if(ProductPriceArray[product_id][ind] || ProductPriceArray[product_id][ind]>=0) { eval("document.form1.product_ind_"+product_id).value = ind; var productPriceNewnet = ProductPriceArray[product_id][ind]*1; eval("document.form1.product_price_"+product_id).value = ProductPriceArray[product_id][ind]*1; calculated_price = eval("document.form1.product_price_"+product_id+".value"); //alert(eval("document.form1.product_qty_"+product_id+".value") + "::" + ProductBandArray[product_id][ind]) calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)+ProductBandArray[product_id][ind]; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); // alert(ProductBandArray[product_id][ind] + "::" + ProductBandArray[product_id][ind]) calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } // special offer code here :: Start calculated_quantity = calculated_quantity*1; requiredQty = requiredQty * 1; if((calculated_quantity >= requiredQty ) && offerType=='discount') { if(dosplay_mode==1) { document.getElementById("span_specialoffer_gift_"+product_id).style.display = "none"; document.getElementById("span_specialoffer_label_"+product_id).style.display = ""; } calculated_price_new = eval("document.form1.product_price_"+product_id+".value"); calculated_discount_new = return_RoundOff((calculated_price*offer_discount)/100); if(document.getElementById("span_specialoffer_discount_"+product_id)){document.getElementById("span_specialoffer_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount_new)}; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price_new-calculated_discount_new); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } else if((calculated_quantity>=requiredQty) && offerType=='gift') { if(dosplay_mode==1) { document.getElementById("span_specialoffer_gift_"+product_id).style.display = ""; document.getElementById("span_specialoffer_label_"+product_id).style.display = "none"; } } // special offer code here :: End if(modifyMode) { if(document.getElementById("span_product_price_"+product_id)){document.getElementById("span_product_price_"+product_id).innerHTML = return_RoundOff(calculated_price)}; if(document.getElementById("span_product_qty_"+product_id)){document.getElementById("span_product_qty_"+product_id).innerHTML = calculated_quantity}; if(document.getElementById("span_product_discount_"+product_id)){document.getElementById("span_product_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount)}; if(document.getElementById("span_product_total_"+product_id)){document.getElementById("span_product_total_"+product_id).innerHTML = return_RoundOff(calculated_total)}; update_PageTotal(); } if(productPriceNewnet == 0) { plus(product_id); // recurrision function } } return true; } function minus(product_id) { ind = eval("document.form1.product_ind_"+product_id+".value"); ind = (ind*1)-1; product_discount = eval("document.form1.discount_value_"+product_id+".value"); gen_qty_increment = eval("document.form1.gen_qty_increment_"+product_id+".value")*1; new_peritem_value = eval("document.form1.new_peritem_value_"+product_id+".value")*1; price_type = eval("document.form1.price_type_"+product_id+".value"); range_from = eval("document.form1.range_from_"+product_id+".value"); offer_discount = eval("document.form1.special_offer_discount_"+product_id+".value"); requiredQty = eval("document.form1.special_offer_qty_"+product_id+".value"); offerType = eval("document.form1.special_offer_type_"+product_id+".value"); var dosplay_mode=eval("document.form1.display_mode_"+product_id+".value"); var modifyMode = false; var productPriceNewnet = 1; var calculated_price_new; var calculated_discount_new; var calculated_total_new; if(ind>-2) { //if(price_type == 2 && ind >19 ) if(price_type == 2 && ind >500 ) { eval("document.form1.product_ind_"+product_id).value = ind; var productPriceNewnet = ProductPriceArray[product_id][9]*1; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)-(ProductPriceArray[product_id][9]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)-new_peritem_value; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); } else if(price_type != 2 && ind >7 ) { eval("document.form1.product_ind_"+product_id).value = ind; var productPriceNewnet = ProductPriceArray[product_id][9]*1; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)-(ProductPriceArray[product_id][9]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)-gen_qty_increment; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); } else if(ProductPriceArray[product_id][ind] || ind == -1 || ProductPriceArray[product_id][ind]>=0) { eval("document.form1.product_ind_"+product_id).value = ind; if(ind == -1) { eval("document.form1.product_price_"+product_id).value = 0; } else { eval("document.form1.product_price_"+product_id).value = ProductPriceArray[product_id][ind]*1; } var productPriceNewnet = ProductPriceArray[product_id][ind]*1; var productQuantityNewnet = (eval("document.form1.product_qty_"+product_id+".value")*1)-ProductBandArray[product_id][ind+1]; eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)-ProductBandArray[product_id][ind+1]; calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); } // special offer code here :: Start calculated_quantity = calculated_quantity*1; requiredQty = requiredQty * 1; if( (calculated_quantity >0) && (calculated_quantity >= requiredQty ) && offerType=='discount') { if(dosplay_mode==1) { document.getElementById("span_specialoffer_gift_"+product_id).style.display = "none"; document.getElementById("span_specialoffer_label_"+product_id).style.display = ""; } calculated_price_new = eval("document.form1.product_price_"+product_id+".value"); calculated_discount_new = return_RoundOff((calculated_price*offer_discount)/100); if(document.getElementById("span_specialoffer_discount_"+product_id)){document.getElementById("span_specialoffer_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount_new)}; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price_new-calculated_discount_new); calculated_total = eval("document.form1.product_total_"+product_id+".value"); modifyMode = true; } else if(calculated_quantity ==0 || (calculated_quantity < requiredQty)) { if(document.getElementById("span_specialoffer_discount_"+product_id)){document.getElementById("span_specialoffer_discount_"+product_id).innerHTML = return_RoundOff(0)}; } else if((calculated_quantity>=requiredQty) && offerType=='gift') { if(dosplay_mode==1) { document.getElementById("span_specialoffer_gift_"+product_id).style.display = ""; document.getElementById("span_specialoffer_label_"+product_id).style.display = "none"; } } // special offer code here :: End if(document.getElementById("span_product_price_"+product_id)){document.getElementById("span_product_price_"+product_id).innerHTML = return_RoundOff(calculated_price)}; if(document.getElementById("span_product_qty_"+product_id)){document.getElementById("span_product_qty_"+product_id).innerHTML = calculated_quantity}; if(document.getElementById("span_product_discount_"+product_id)){document.getElementById("span_product_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount)}; if(document.getElementById("span_product_total_"+product_id)){document.getElementById("span_product_total_"+product_id).innerHTML = return_RoundOff(calculated_total)}; update_PageTotal(); if(productPriceNewnet <= 0 || productQuantityNewnet <= 0) { if(document.getElementById("innovaAdditionOption")){ document.getElementById("innovaAdditionOption").style.display = "none"; document.getElementById("innovaAdditionOption1").style.display = "none"; } }else{ if(document.getElementById("innovaAdditionOption")){ document.getElementById("innovaAdditionOption").style.display = "block"; document.getElementById("innovaAdditionOption1").style.display = "block"; } } if(productQuantityNewnet > 0 && productPriceNewnet == 0) { minus(product_id); } } return true; } function minus_limit(product_id,limit) { ind = eval("document.form1.product_ind_"+product_id+".value"); ind = (ind*1)-1; product_discount = eval("document.form1.discount_value_"+product_id+".value"); if(ind>-2) { if(ind>7) { if(((eval("document.form1.product_qty_"+product_id+".value")*1)-10)>=limit) { eval("document.form1.product_ind_"+product_id).value = ind; eval("document.form1.product_price_"+product_id).value = (eval("document.form1.product_price_"+product_id+".value")*1)-(ProductPriceArray[product_id][9]*1); calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)-10; eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); } else { return false; } } else if(ProductPriceArray[product_id][ind] || ind == -1 || ProductPriceArray[product_id][ind]>=0) { if(((eval("document.form1.product_qty_"+product_id+".value")*1)-ProductBandArray[product_id][ind+1])>=limit) { eval("document.form1.product_ind_"+product_id).value = ind; if(ind == -1) { eval("document.form1.product_price_"+product_id).value = 0; } else { eval("document.form1.product_price_"+product_id).value = ProductPriceArray[product_id][ind]*1; } eval("document.form1.product_qty_"+product_id).value = (eval("document.form1.product_qty_"+product_id+".value")*1)-ProductBandArray[product_id][ind+1]; calculated_price = eval("document.form1.product_price_"+product_id+".value"); calculated_discount = return_RoundOff((calculated_price*product_discount)/100); eval("document.form1.product_discount_"+product_id).value = calculated_discount; eval("document.form1.product_total_"+product_id).value = return_RoundOff(calculated_price-calculated_discount); calculated_quantity = eval("document.form1.product_qty_"+product_id+".value"); calculated_total = eval("document.form1.product_total_"+product_id+".value"); } else { return false; } } if(document.getElementById("span_product_price_"+product_id)){document.getElementById("span_product_price_"+product_id).innerHTML = return_RoundOff(calculated_price)}; if(document.getElementById("span_product_qty_"+product_id)){document.getElementById("span_product_qty_"+product_id).innerHTML = calculated_quantity}; if(document.getElementById("span_product_discount_"+product_id)){document.getElementById("span_product_discount_"+product_id).innerHTML = return_RoundOff(calculated_discount)}; if(document.getElementById("span_product_total_"+product_id)){document.getElementById("span_product_total_"+product_id).innerHTML = return_RoundOff(calculated_total)}; update_PageTotal(); } return true; } function validate_DesignownAdditionalPrice(price_array,product_id,price_div_id,product_quantity_id,isPriceband,field_value,text_ext) { var g = document.form1; if(isPriceband==1) { var product_quantity = document.getElementById(product_quantity_id).value; var price = return_DesignownPricebandPrice(price_array,product_id,product_quantity); if(eval("ProductDiscount['"+product_id+"']")) { var discount_value = eval("ProductDiscount['"+product_id+"']"); } else { discount_value = 0; } price = price - ((discount_value*price)/100); if(field_value>0 && document.getElementById(price_div_id) && price>0) { var show_price = true; } } else if(isPriceband==2) { if(eval(price_array+"['"+product_id+"']["+field_value+"]")) { var price = eval(price_array+"['"+product_id+"']["+field_value+"]"); if(field_value>0 && document.getElementById(price_div_id) && price>0) { var show_price = true; } } } else { if(eval(price_array+"['"+product_id+"']")) { var price = eval(price_array+"['"+product_id+"'][0]"); if(field_value>0 && document.getElementById(price_div_id) && price>0) { var show_price = true; } } } if(show_price) { price = return_RoundOff(price); document.getElementById(price_div_id).innerHTML = ""+text_ext+" £ "+price; document.getElementById(price_div_id).style.display='block'; if(document.getElementById(product_id+"_value")) { document.getElementById(product_id+"_value").value = price; } } else { document.getElementById(price_div_id).innerHTML = ""; document.getElementById(price_div_id).style.display='none'; if(document.getElementById(product_id+"_value")) { document.getElementById(product_id+"_value").value = 0; } } } function return_DesignownPricebandPrice(price_array,product_id,product_quantity) { if(eval("ProductBandArray['"+product_id+"']")) { product_quantity = product_quantity*1; var qty = 0; for(var i=0;i<9;i++) { qty = (qty*1); if(eval("ProductBandArray['"+product_id+"']["+i+"]") && product_quantity>=qty && product_quantity<=(qty + (eval("ProductBandArray['"+product_id+"']["+i+"]")*1))) { return eval(price_array+"['"+product_id+"']["+i+"]"); } qty = (qty*1)+eval("ProductBandArray['"+product_id+"']["+i+"]")*1; } price = eval(price_array+"['"+product_id+"'][8]"); pricePer10 = eval(price_array+"['"+product_id+"'][9]"); for(var i=qty;product_quantity>=i;i=((i*1)+10)) { qty = i; if(product_quantity>=qty && product_quantity<=(qty + 10)) { return (price*1) + (pricePer10*1); } price = (price*1) + (pricePer10*1); } } return false; } function update_PageTotal() { var g = document.form1; if(g.page_total) { var page_total = 0; for(var i=0;i0) { page_total = (page_total*1)+(g.elements[i].value*1); } } g.page_total.value = return_RoundOff(page_total); } return; } function validate_AddToBasket() { var g = document.form1; check_test = true; for(var i=0;i-1) { check_test = false; break; } } if(check_test) { alert("Please select any product."); return false; } else { return true; } } function validate_ViewBasket() { var g = document.form1; for(var i=0;i 0 && card_colour_id!=15 && card_colour_id!=defaultColourId) { document.getElementById(priceSpan_id).innerHTML = "Additional Price : £ "+price; eval("document.form1.card_colour_price").value = price; } else { document.getElementById(priceSpan_id).innerHTML = ""; eval("document.form1.card_colour_price").value = 0; } } else if(card_colour_id == -1) { document.getElementById(span_id).style.backgroundColor = "#FFFFFF"; } return; } function validate_ProductFontSpan(array_name,span_id,id,price,priceSpan_id) { price = return_RoundOff(price); if(eval(array_name+"["+id+"]")) { document.getElementById(span_id).innerHTML = eval(array_name+"["+id+"]"); if(price > 0) { document.getElementById(priceSpan_id).innerHTML = "Additional Price : £ "+price; eval("document.form1.card_font_price").value = price; } else { document.getElementById(priceSpan_id).innerHTML = ""; eval("document.form1.card_font_price").value = 0; } } else if(id == -1) { document.getElementById(span_id).innerHTML = ""; document.getElementById(priceSpan_id).innerHTML = ""; eval("document.form1.card_font_price").value = 0; } return; } function validate_ProductRaisedInkSpan(span_id,price,idValue,deflt_color_id,alter_color_id,alter_price) { var tmp_price= document.getElementById("card_raisedInk_price_temp").value; if(deflt_color_id == alter_color_id) { price = return_RoundOff(price); } else { price = return_RoundOff(alter_price); } if(price == 0) { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_raisedInk_price").value = 0; } else { if(idValue == 1) { if(tmp_price!="") { document.getElementById(span_id).innerHTML = tmp_price; } else { document.getElementById(span_id).innerHTML = "Additional Price : £ "+price; } eval("document.form1.card_raisedInk_price").value = tmp_price; } else { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_raisedInk_price").value = 0; } } return; } function validate_ProductRaisedInkSpanTemp(span_id,price,idValue,deflt_color_id,alter_color_id,alter_price) { if(deflt_color_id == alter_color_id) { price = return_RoundOff(price); } else { price = return_RoundOff(alter_price); } var tmp_price= document.getElementById("card_raisedInk_price_temp").value; if(price == 0) { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_raisedInk_price").value = 0; } else { if(idValue == 1) { document.getElementById(span_id).innerHTML = "Additional Price : £ "+price; eval("document.form1.card_raisedInk_price").value = tmp_price; } else { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_raisedInk_price").value = 0; } } return; } function validate_CardProofSpan(array_name,span_id,id) { if(eval(array_name+"['"+id+"']") && eval(array_name+"['"+id+"']")>0 && document.getElementById(span_id)) { document.getElementById(span_id).innerHTML = "Additional Price : £ "+eval(array_name+"['"+id+"']"); eval("document.form1.card_proof_price").value = eval(array_name+"['"+id+"']"); } else if(document.getElementById(span_id)) { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_proof_price").value = 0; } return; } function validate_ProductExpressFeeSpan(span_id,price,idValue) { price = return_RoundOff(price); if(price == 0) { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_expressFee_price").value = 0; } else { if(idValue == 1) { document.getElementById(span_id).innerHTML = "Additional Price : £ "+price; eval("document.form1.card_expressFee_price").value = price; } else { document.getElementById(span_id).innerHTML = ""; eval("document.form1.card_expressFee_price").value = 0; } } return; } function validate_TextWordingSpan(array_name,span_id,id) { if(eval(array_name+"["+id+"]")) { document.getElementById(span_id).value = validate_wording_text2(eval(array_name+"["+id+"]")); } else { document.getElementById(span_id).value = ""; } return; } function validate_wording_text2(text) { var myRegExp = /##/g; var str_value = text.replace(myRegExp,"\r\n"); return str_value; } function show_listFoiled(depObj,val,showObj,disp_val,showObj2) { if(depObj == val) { document.getElementById(showObj).style.display=disp_val; if(document.form1.foiled_color_select.value == 0 || disp_val=='none') { document.getElementById(showObj2).style.display=disp_val; } } validate_DesignownAdditionalPrice('ProductPriceArray','foiledHeading_price','foiledHeading_price_div_id','product_quantity_id',1,depObj,'Additional price due to Foiled Heading :'); return true; } function validate_foiledColor(depObj,showObj) { if(depObj == 0) { document.getElementById(showObj).style.display='block'; document.form1.foiled_color_other.focus(); } else { document.getElementById(showObj).style.display='none'; } return true; } function show_color_design(objValue,span_obj,arrId) { if(eval("color_array"+arrId+"["+objValue+"]")) { document.getElementById(span_obj).style.backgroundColor=eval("color_array"+arrId+"["+objValue+"]"); } if(arrId==1) { validate_DesignownAdditionalPrice('ProductPriceArray','cardColour_price','cardColour_price_div_id','product_quantity_id',0,objValue,'Additional price due to Card Colour :'); } else { validate_DesignownAdditionalPrice('ProductPriceArray','inkColour_price','inkColour_price_div_id','product_quantity_id',0,objValue,'Additional price due to Ink Colour :'); } return true; } function validate_frmDesignSet() { var g = document.form1; if(g.dyo_id && g.dyo_id.value==-1) { alert("please select the Card Type."); g.dyo_id.focus(); return false; } } function validate_frmDesign1() { var g = document.form1; if(g.card_orientation[0].checked == false && g.card_orientation[1].checked == false) { alert("Please select Card Orientation."); g.card_orientation[0].focus(); return false; } if(g.card_type[0].checked == false && g.card_type[1].checked == false && g.card_type[2].checked == false) { alert("Please select the type of the card."); g.card_type[0].focus(); return false; } if(g.card_size.value == -1) { alert("Please select Card Size."); g.card_size.focus(); return false; } if(g.cardcolor.value == -1) { alert("Please select Card Colour."); g.cardcolor.focus(); return false; } if(g.inkcolor.value == -1) { alert("Please select Ink Colour."); g.inkcolor.focus(); return false; } if(g.foil_heading && g.foil_heading[0].checked == true && g.foiled_color_select.value == -1) { alert("Please select Foiled Colour."); g.foiled_color_select.focus(); return false; } else if(g.foil_heading && g.foil_heading[0].checked == true && g.foiled_color_select.value == 0 && trim(g.foiled_color_other.value) == "") { alert("Please specify Foiled Colour."); g.foiled_color_other.value = trim(g.foiled_color_other.value); g.foiled_color_other.focus(); return false; } if(trim(g.card_heading.value) == "") { alert("Please specify Card Heading."); g.card_heading.value = trim(g.card_heading.value); g.card_heading.focus(); return false; } } function return_DesignownFontImage(font_id,span_id) { if(Script_fontArray[font_id]) { document.getElementById(span_id).innerHTML = "
"+Script_fontArray[font_id]+"
"; } validate_DesignownAdditionalPrice('ProductPriceArray','font_price','font_price_div_id','product_quantity_id',0,font_id,'Additional price due to Font :'); } function validate_frmDesign3(card_designID) { var g = document.form1; if(eval("document.form1.product_qty_"+card_designID+".value")==0) { alert("Please select the product quantity."); return false; } } function validate_SelectDesignownType(dyoId) { var g = document.form1; if(g.dyo_id.value != -1) { g.submit(); } else { g.dyo_id.value = dyoId; } return true; } function validate_ProductSearch() { var g = document.form1; if(g.category_id && g.category_id.value==-1) { alert("Please select the Category."); g.category_id.focus(); return false; } if(g.colour_id && g.colour_id.value==-1) { alert("Please select the Colour."); g.colour_id.focus(); return false; } if(g.budget_id && g.budget_id.value==-1) { alert("Please select the Price Band."); g.budget_id.focus(); return false; } } function validate_OtherProductUser() { var g = document.form1; if(g.product_qty_1 && g.product_qty_1.value==0) { alert("Please select the Product Quantity."); return false; } } function validate_OtherProductPrice() { var g = document.form1; if(g.otherproduct_qty && g.otherproduct_qty.value!="" && g.product_price) { //alert(g.otherproduct_qty.value); //alert(g.product_price.value); //return false; g.page_total.value = return_RoundOff(g.otherproduct_qty.value*g.product_price.value); } } function validate_weddingTablePlanUser() { var g = document.form1; if(trim(g.plan_title.value)=="") { alert("Please enter the Plan Title."); g.plan_title.value = trim(g.plan_title.value); g.plan_title.focus(); return false; } var count_checkedToDel = 0*1; for(var i=0;ig.table_num.value) { alert("Please select the table(s) to delete."); return false; } for(var i=0;i 12) { // check month range alert("Month must be between 1 and 12."); return false; } if (day < 1 || day > 31) { alert("Day must be between 1 and 31."); return false; } if ((month==4 || month==6 || month==9 || month==11) && day==31) { alert("Month "+month+" doesn`t have 31 days!") return false; } if (month == 2) { // check for february 29th var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day > 29 || (day==29 && !isleap)) { alert("February " + year + " doesn`t have " + day + " days!"); return false; } } return true; // date is valid } function popitup(url) { newwindow=window.open(url,'name','height=200,width=150'); if (window.focus) {newwindow.focus()} return false; } function openSubWin(url, nm, w, h,x, y, atts) { nm = nm || "subwindow"; atts = atts || "menubar,resizable,scrollbars"; w = w || 600; h = h || 450; x = (typeof x=="number")? x: window.opera? 100: Math.round( (screen.availWidth - w)/2 ); y = (typeof y=="number")? y: window.opera? 20: Math.round( (screen.availHeight - h)/2 ); atts += ',width='+w+',height='+h+',left='+x+',top='+y; var win = window.open(url, nm, atts); if (win) { if (!win.closed) {win.resizeTo(w,h); win.moveTo(x,y); win.focus(); return false; } } return true; } function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } if (Char =='.' && ValidChars.indexOf(Char)!=ValidChars.lastIndexOf(Char)) { IsNumber=false; } } return IsNumber; } function validString(myString) { var valid_string = new String("1234567890"); for(var i=0;i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i