function inputupdate(formid,ourid,checkval){var txt=eval("document.forms['"+formid+"']."+ourid+".value");if(txt==checkval){eval("document.forms['"+formid+"']."+ourid+".value = \"\"");}}
function menucolor(id,col){x=document.getElementById(id);x.style.background=col;}
function calc_total(cost,quantity){amount=cost*quantity;alert(amount);}
function update_total(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);}
var opacity=0;var display=1;function updatetext(){display++;if(display==total){display=0;}
y=document.getElementById("cosstick");y.innerHTML=contents[display];var t=setTimeout("fadein()",7000);}
function fadein(){if(opacity<11){value=(10-opacity);y=document.getElementById("cosstick");y.style.opacity=value/10;y.style.filter='alpha(opacity='+value*10+')';var t=setTimeout("fadein()",50);opacity++;}else{updatetext();fadeout();}}
function fadeout(){if(opacity>-1){y=document.getElementById("cosstick");value=(10-opacity);y.style.opacity=value/10;y.style.filter='alpha(opacity='+value*10+')';opacity--;var t=setTimeout("fadeout()",50);}else{}}
function wishlist(productsid){x="i"+productsid+"-"+2;scol=0;ssize=0;if(selectBox=document.getElementById(x)){scol=selectBox.options[selectBox.selectedIndex].value;}
x="i"+productsid+"-"+1;if(selectBox=document.getElementById(x)){ssize=selectBox.options[selectBox.selectedIndex].value;}
window.location="http://whispurr.co.uk/wishlist-w-"+productsid+"{2}"+scol+"{1}"+ssize+".html";}
function copyToBuffer(){CopiedTxt=document.selection.createRange();CopiedTxt.execCommand("Copy");}
function goto(url){window.location=url;}


function ajaxFunction(invar, scriptname, divtarget){
var xmlHttp;
try{
// Firefox, Opera 8.0+, Safari
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)){document.getElementById(divtarget).innerHTML = xmlHttp.responseText;

} else {
document.getElementById(divtarget).innerHTML = "Updating Please Wait...";
}

}

params = invar;
xmlHttp.open("GET",scriptname +"?"+ params,true);xmlHttp.send(params);
}
