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);}
function MozOpacityUp(id){x=document.getElementById(id);value=parseFloat(x.style.opacity);value+=0.04;x.style.opacity=String(value);x.style.MozOpacity=String(value)+"%;";if(over[id]==1){if(value<1.00){var t=setTimeout("MozOpacityUp('"+id+"')",10);}}}
function MozOpacityDown(id){x=document.getElementById(id);value=parseFloat(x.style.opacity);value-=0.01;x.style.opacity=String(value);x.style.MozOpacity=String(value)+"%;";if(over[id]==0){if(value>0.00){var t=setTimeout("MozOpacityDown('"+id+"')",10);}}}
function OpacityUp(id){x=document.getElementById(id);invalue=x.style.filter;invaluet=invalue.split("=");strlen=(invaluet[1].length)-1;value=parseInt(invaluet[1].substr(0,strlen),10);value+=4;x.style.filter="alpha(opacity="+String(value)+")";if(over[id]==1){if(value<100){var t=setTimeout("OpacityUp('"+id+"')",10);}}}
function OpacityDown(id){x=document.getElementById(id);invalue=x.style.filter;invaluet=invalue.split("=");strlen=(invaluet[1].length)-1;value=parseInt(invaluet[1].substr(0,strlen),10);value-=4;x.style.filter="alpha(opacity="+String(value)+")";if(over[id]==0){if(value>0){var t=setTimeout("OpacityDown('"+id+"')",10);}}}
function toggleexpand(divid){menudivid="x"+divid;x=document.getElementById(divid);y=document.getElementById(menudivid);if(x.style.backgroundImage=="url(expand_arrow.gif)"){x.style.backgroundImage="url(contract_arrow.gif)";y.style.visibility="visible";y.style.display="block";}else{x.style.backgroundImage="url(expand_arrow.gif)";y.style.visibility="hidden";y.style.display="none";}}
function linker(url){location.href=url;}
function visit(uri){document.location=uri;}
function screenWidth(){var x = 0;if (self.innerHeight){x = self.innerWidth;} else if (document.documentElement && document.documentElement.clientHeight){x = document.documentElement.clientWidth;} else if (document.body){x = document.body.clientWidth;}return x;}
function screenHeight(){var y = 0;if (self.innerHeight){y = self.innerHeight;} else if (document.documentElement && document.documentElement.clientHeight){y = document.documentElement.clientHeight;} else if (document.body){y = document.body.clientHeight;}return y;}
function removeEl(inid){
remEl = document.getElementById(inid);
document.body.removeChild(remEl);
}


function loadVideo(videourl){
doRotate = 0;
videodiv = document.createElement("div");
videodiv.id="videodiv";
videodiv.style.padding="10px";
videodiv.style.border = "5px solid #0066b2";
videodiv.style.borderRadius = "10px";
videodiv.style.background = "#fff";
videodiv.style.zIndex="900";
videodiv.style.width="560px";
videodiv.style.height="350px";
videodiv.style.display="block";
videodiv.style.position = "fixed";
videodiv.style.boxShadow = "5px 5px 5px rgba(68,68,68,0.6)";
videodiv.style.left = parseInt((screenWidth()/2)-280) + "px";
videodiv.style.top = parseInt((screenHeight()/2)-175) + "px";
videodiv.innerHTML = "<p onclick=\"removeEl('videodiv');\" class=\"right click nopad\">Click Here to Close</p><iframe width=\"560\" height=\"315\" src=\""+videourl+"\" frameborder=\"0\" allowfullscreen><\/iframe>";
document.body.appendChild(videodiv);
}
