
function doOpaque(inid,inopacity){mozopac=inopacity/100;x=document.getElementById(inid);x.style.filter="alpha(opacity="+inopacity+")";x.style.opacity=mozopac;}
function menucolor(id,col){x=document.getElementById(id);x.style.background=col;}
function changecol(col,inid){x=document.getElementById(inid);x.style.background=col;y="i"+inid;z=document.getElementById(y);if(col=="#223955"){z.className="lightnavigation";}else{z.className="navigation";}}
function textclear(id,text){x=document.getElementById(id);if(x.value==text){x.value="";}else{}}
function printpage(){window.print();}
function emailpage(thelocation){lovechild=window.open("send_to_a_friend.php?uri="+thelocation,"babywindow","height=480,width=640,toobar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizeable=0");}
function toggleover(inid){x=document.getElementById(inid);x.style.color="#000000";}
function toggleout(inid){x=document.getElementById(inid);x.style.color="#ffffff";}
function togglemenu(menuid){smenuid="m"+menuid;ssmenuid="m"+smenuid;sssmenuid="m"+ssmenuid;x=document.getElementById(menuid);y=document.getElementById(smenuid);z=document.getElementById(ssmenuid);zz=document.getElementById(sssmenuid);if(x.className=="navigationactive"){x.className="navigation";y.className="navigationinactive";z.className="subnavigationno";zz.className="subnavfooterno";ajaxFunctionSess(menuid,'1');}else{x.className="navigationactive";y.className="navigationactive";z.className="subnavigation";zz.className="subnavfooter";ajaxFunctionSess(menuid,'0');}}
function calc_total(cost,quantity){amount=cost*quantity;alert(amount);}
function update_total(inid){alert(inid);special_quantity=eval("document.cart_quantity.special_quantity_"+inid);special_price=eval("document.cart_quantity.special_price_"+inid);the_special_quantity=0;if(special_quantity){the_special_quantity=parseInt(special_quantity.value,10);the_special_price=parseFloat(special_price.value,10);}
outputid="total_"+inid;var selectBox=document.cart_quantity.elements[0];samount=selectBox.options[selectBox.selectedIndex].text;option_special=(samount.lastIndexOf("SPECIAL OFFER BUY "));if(option_special>-1){the_special_quantity_end=(samount.indexOf(" ",(option_special+18)));the_special_quantity=parseInt(samount.substring((option_special+18),the_special_quantity_end));option_special=(samount.lastIndexOf("FOR ONLY £"));the_special_price_end=(samount.indexOf(" ",(option_special+10)));the_special_price=parseFloat(samount.substring((option_special+10),the_special_price_end));}
cutstart=(samount.lastIndexOf("("))+2;cutend=samount.length-1;samount=samount.substring(cutstart,cutend);samount=parseFloat(samount,10);var selectBox=document.cart_quantity.cart_quantity;syear=selectBox.options[selectBox.selectedIndex].value;if(the_special_quantity>0){outtotal=(syear%the_special_quantity)*samount;outtotal+=(Math.floor((syear/the_special_quantity))*the_special_price);outtotal=outtotal.toFixed(2);}else{outtotal=(samount*syear).toFixed(2);}
document.getElementById(outputid).innerHTML="Total: &pound;"+(outtotal);}
function update_named_total(inid,formid){special_quantity=eval("document."+formid+".special_quantity_"+inid);special_price=eval("document."+formid+".special_price_"+inid);the_special_quantity=0;if(special_quantity){the_special_quantity=parseInt(special_quantity.value,10);the_special_price=parseFloat(special_price.value,10);}
outputid="total_"+inid;var selectBox=eval("document."+formid+".elements[0]");samount=selectBox.options[selectBox.selectedIndex].text;option_special=(samount.lastIndexOf("SPECIAL OFFER BUY "));if(option_special>-1){the_special_quantity_end=(samount.indexOf(" ",(option_special+18)));the_special_quantity=parseInt(samount.substring((option_special+18),the_special_quantity_end));option_special=(samount.lastIndexOf("FOR ONLY £"));the_special_price_end=(samount.indexOf(" ",(option_special+10)));the_special_price=parseFloat(samount.substring((option_special+10),the_special_price_end));}
cutstart=(samount.lastIndexOf("("))+2;cutend=samount.length-1;samount=samount.substring(cutstart,cutend);samount=parseFloat(samount,10);var selectBox=eval("document."+formid+".cart_quantity");syear=selectBox.options[selectBox.selectedIndex].value;if(the_special_quantity>0){outtotal=(syear%the_special_quantity)*samount;outtotal+=(Math.floor((syear/the_special_quantity))*the_special_price);outtotal=outtotal.toFixed(2);}else{outtotal=(samount*syear).toFixed(2);}
document.getElementById(outputid).innerHTML="Total: &pound;"+(outtotal);}
function ajaxFunction(formid,id){var selectBox=eval("document."+formid+".elements['payment_type']");samount=selectBox.options[selectBox.selectedIndex].value;formout="awesomeform"+id;var x=document.getElementById(formout);var xmlHttp;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function(){if((xmlHttp.readyState==4)){x.innerHTML=xmlHttp.responseText;}}
params="id="+samount;xmlHttp.open("GET","formwork.php?"+params,true);xmlHttp.send(params);}
function ajaxFunctionSess(id,val){var xmlHttp;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function(){if((xmlHttp.readyState==4)){}}
params="id="+id+"&val="+val;xmlHttp.open("GET","sesswork.php?"+params,true);xmlHttp.send(params);}