/* Copyright (C) 2010 tagfire.com */
if(top!=self){top.location.href=self.location.href}function pop(a,b,c){var d="new_wnd";var e=1;var f=0;var g=0;var h=0;if(screen){g=(screen.width/2)-(b/2);h=(screen.height/2)-(c/2)}var i=window.open("/pop.html?"+a,d,"height="+c+",width="+b+",status=0,toolbar=0,resizable="+e+",scrollbars="+f+",menubar=0,location=0,directories=0,left="+g+",top="+h+"")}function showStock(a,b,c){var d="new_wnd";var e=1;var f=0;var g=0;var h=0;if(screen){g=(screen.width/2)-(b/2);h=(screen.height/2)-(c/2)}var i=window.open("/stockpop.php?s="+a,d,"height="+c+",width="+b+",status=0,toolbar=0,resizable="+e+",scrollbars="+f+",menubar=0,location=0,directories=0,left="+g+",top="+h+"")}function formatCurrency(a){var b=new RegExp("(-?[0-9]+)([0-9]{3})");a=a.toString().replace(/\,/g,"");a=!isNaN(a)?Math.round(a*100)/100:0;while(/\.\d{0,1}$/.test(a)){a+="0"}while(b.test(a)){a=a.toString().replace(b,"$1,$2")}return a}function calc(){var a=document.getElementById("fields").value.split(",");var b=parseFloat(document.getElementById("baseprice").value);for(var i=0;i<a.length;i++){if(document.getElementById(a[i]).checked){b=b+parseFloat(document.getElementById(a[i]).value)}}document.getElementById("total").innerHTML="&pound;"+formatCurrency(b)}function calc2(){var a=document.getElementById("fields").value.split(",");var b=parseFloat(document.getElementById("baseprice").value);for(var i=0;i<a.length;i++){if(document.getElementById(a[i]).checked){b=b+parseFloat(document.getElementById(a[i]).value)}}document.getElementById("total").innerHTML="&pound;"+formatCurrency2(b)}function formatCurrency2(a){var b=new RegExp("(-?[0-9]+)([0-9]{3})");a=a.toString().replace(/\,/g,"");a=!isNaN(a)?Math.round(a*100)/100:0;a.toString().indexOf(".")==-1?a+=".00":void 0;while(/\.\d{0,1}$/.test(a)){a+="0"}while(b.test(a)){a=a.toString().replace(b,"$1,$2")}return a}function clearField(a,b){if(document.getElementById(a).value==b){document.getElementById(a).value=""}}function leaveField(a,b){if(document.getElementById(a).value==""){document.getElementById(a).value=b}}