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 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