
var fontColour=new Array(2);var fontName=new Array(2);var pictureName=new Array(2);setUnitPrice=function(select,band1,band2,band3){var unit=select.value;var message="Unit Price: &pound;";if(unit>10){message+=band3;}else if(unit>3){message+=band2;}else{message+=band1;}
document.getElementById('unitprice').innerHTML=message;}
setPrices=function(select,band1,band1del,band1item,band2,band2del,band2item,band3,band3del,band3item){var unit=select.value;var message="Unit Price: &pound;";var totalmessage="Total Price (including delivery): &pound;";if(unit>10){message+=band3;sum=((100*band3del)+(unit*((band3*100)+(band3item*100))))/100;}else if(unit>5){message+=band2;sum=((100*band2del)+(unit*((band2*100)+(band2item*100))))/100;}else{message+=band1;sum=((100*band1del)+(unit*((band1*100)+(band1item*100))))/100;}
totalmessage+=sum.toFixed(2);document.getElementById('unitprice').innerHTML=message;document.getElementById('totalprice').innerHTML=totalmessage;}
setFontColour_old=function(name,value){document.forms[1].font_colour.value=value;if(fontColour)document.getElementById(fontColour).style.borderWidth="thin";document.getElementById(name).style.borderWidth="medium";fontColour=name;}
setFontColour=function(value,old,hiddenId,print_area){document.getElementById(hiddenId).value=value;if(fontColour[print_area]){document.getElementById("col-"+fontColour[print_area]).style.borderColor="#AAA";}else{fontColour[print_area]=value;document.getElementById("col-"+print_area+"-"+old).style.borderColor="#AAA";}
document.getElementById("col-"+print_area+"-"+value).style.borderColor="#CC0000";fontColour[print_area]=print_area+"-"+value;}
function setFontType(name,value,old,hiddenId,print_area){document.getElementById(hiddenId).value=value;document.getElementById('font-name').innerHTML="<img src=\"images/small/font/"+value+"/"+name+"\" title=\""+name+"\" />";if(fontName[print_area]){document.getElementById(fontName[print_area]).style.borderColor="#AAA";}else{fontName[print_area]="area-"+print_area+"-"+value;document.getElementById("area-"+print_area+"-"+old).style.borderColor="#AAA";}
document.getElementById("area-"+print_area+"-"+value).style.borderColor="#CC0000";fontName[print_area]="area-"+print_area+"-"+value;}
function check_style(print_area){if(document.getElementById('area_'+print_area+'__style-opt2').checked==true){document.getElementById('area_'+print_area+'__text-position-opt1').checked=true;document.getElementById('area_'+print_area+'__text-position-opt2').disabled=true;document.getElementById('area_'+print_area+'__text-position-opt3').disabled=true;document.getElementById('pos'+print_area+'-above').style.color="#AAA";document.getElementById('pos'+print_area+'-above-high').style.color="#AAA";document.getElementById('pos'+print_area+'-below').style.color="#AAA";document.getElementById('pos'+print_area+'-below-high').style.color="#AAA";}else{document.getElementById('area_'+print_area+'__text-position-opt2').disabled=false;document.getElementById('area_'+print_area+'__text-position-opt3').disabled=false;document.getElementById('pos'+print_area+'-above').style.color="";document.getElementById('pos'+print_area+'-above-high').style.color="";document.getElementById('pos'+print_area+'-below').style.color="";document.getElementById('pos'+print_area+'-below-high').style.color="";}}
function check_text_position(print_area){if(document.getElementById('area_'+print_area+'__text-position-opt2').checked==true||document.getElementById('area_'+print_area+'__text-position-opt3').checked==true){document.getElementById('area_'+print_area+'__style-opt1').checked=true;document.getElementById('area_'+print_area+'__style-opt2').disabled=true;document.getElementById('sty'+print_area+'-fill').style.color="#AAA";document.getElementById('sty'+print_area+'-fill-high').style.color="#AAA";}else{document.getElementById('area_'+print_area+'__style-opt2').disabled=false;document.getElementById('sty'+print_area+'-fill').style.color="";document.getElementById('sty'+print_area+'-fill-high').style.color="";}}
function check_picture(print_area,name,hiddenId,old){document.getElementById(hiddenId).value=name;if(pictureName[print_area]){document.getElementById("pic-"+print_area+":"+pictureName[print_area]).style.borderColor="#AAA";}else if(old!=""){document.getElementById("pic-"+print_area+":"+old).style.borderColor="#AAA";}
document.getElementById("pic-"+print_area+":"+name).style.borderColor="#CC0000";pictureName[print_area]=name;}
function switchTab(newId,hiddenId){var oldId=document.getElementById(hiddenId).value;if(newId!=oldId){document.getElementById(newId).className='live';document.getElementById(oldId).className='hidden';document.getElementById('tab-'+newId).className='active';document.getElementById('tab-'+oldId).className='';document.getElementById(hiddenId).value=newId;}}
function submitDesign(){document.getElementById('tools').style.height='1px';document.getElementById('tools').style.overflow='hidden';document.getElementById('loading').style.display='block';}
function checkFileUpload(){submitDesign();document.forms[0].submit();}