//<script>

if (self.location != top.location) top.location = self.location;


var lowerpostage=6.20;
var higherpostage=9.50;
var discountpercent=5;
var discountthreshold=100; 
var postsize2=2;

var ua = navigator.userAgent.toLowerCase(); 
if (ua.indexOf("safari") != -1 ) var Safari=1;

var formcounter=0; 
var poundsign="£";
var addthis_config = {ui_cobrand:'eFoam',data_track_linkback:true,data_use_cookies:false,data_use_flash:false}


function footer(enviro) {
document.write('<div align="center" style="font-size:12px; font-family:Arial; padding:0px;">');
if (enviro!="recommend") document.write('<div style="margin-bottom:2px; font-weight:700;"><a href="javascript:bookmarksite()">> <u>Add this page to your Favourites</u> <</a>&nbsp; &nbsp; <a href="recommend.html">> <u>Recommend this page to a friend</u> <</a>&nbsp; &nbsp; <a href="/forum">> <u>Our foam discussion forum</u> <</a></div>');
document.write('All our furniture grade foams comply with the Furniture & Furnishings fire Regulations 1988 & amendments.<BR>');
document.write('eFoam.co.uk & Phoenix Foam Products are trading names of Simply Foam Products Ltd, UK reg. No. 3988665.<div style="margin:2px 0 4px 0;">');
if (enviro=="enviro") document.write('For more information about us please <a href="about.html"><u>click here</u></a></div>');
else document.write('eFoam does not produce any waste, all remnants are recycled, here is our <a href="environment.html"><u>Environmental Policy</u></a>.</div>');
document.write('</div><table width="100%" cellspacing=0 cellpadding=0><td width="67%" align=right style="font-size:12px;">&copy; 2000-2009 Simply Foam Products Ltd.</td>');
// new google analytics
if (window.addEventListener) window.addEventListener("load", load_ga, false);
else if (window.attachEvent) window.attachEvent("onload", load_ga);
// addthis
document.write('<td align="right">');
document.write('<div class="addthis_toolbox addthis_default_style num" id="quote" style="width:149px; overflow:hidden; border:1px brown solid; background:beige; margin:0 3px 0 40px; text-align:center;">');
document.write('<a class="addthis_button_compact custom_images" style="margin-right:7px;" addthis:ui_click=true title="More services">Share</a>');
document.write('<a class="addthis_button_facebook"></a>');
document.write('<a class="addthis_button_myspace"></a>');
document.write('<a class="addthis_button_google"></a>');
document.write('<a class="addthis_button_twitter"></a></div></td></table>');
}


function load_ga() { 
 var gaJsHost  = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 var s    = document.createElement('script');
 s.src    = gaJsHost + "google-analytics.com/ga.js";
 s.type    = "text/javascript";
 document.getElementsByTagName("head")[0].appendChild(s);
 var i    = 0;
 run_ga();
 
 function run_ga() {
  if (typeof _gat == "object")  {var pageTracker = _gat._getTracker("UA-2866803-1");pageTracker._initData();pageTracker._trackPageview();}
  else if (i < 20)  {i++;setTimeout(run_ga, 500);}
 }
}



function IsEmpty(a) {
   if ((a.value.length==0) || (a.value==null) || (isNaN(a.value*1))) return true;
   else { if (a.value*1>0.01) return false; } 
   return true;
}	

function IsEmptyT(aTextField) {
   if ((aTextField.value.length==0) || (aTextField.value==null))  return true;
   else return false; 
}

function checkf(arr) {
for (var i = 0; i < arr.length; i++) {
     if (IsEmpty(arr[i])) {alert('Please enter a number for this dimension'); arr[i].focus(); return true;}
	 }
return false;
}				



function dec2(a)
{
  var b, c=new String(Math.round(a*100));
  while (c.length<3) {c='0'+c;}
  return c.substr(0, b=(c.length-2)) + '.' + c.substr(b, 2);
}

function rsp(a) {return a.replace(/&nbsp;/g, ""); }




function bookmarksite(){
var title="eFoam, all sorts of foam cut to size";
if (document.all)
window.external.AddFavorite("http://www.efoam.co.uk", title);
else if (window.sidebar)
window.sidebar.addPanel(title, "http://www.efoam.co.uk", "");
}



function displaypb(pname,price1,size1,price2,size2,price3,size3,price4,size4,price5,size5,price6,size6,price7,size7,price8,size8,price9,size9,price10,size10) {

document.write('<form action="http://www.romancart.com/cart.asp" method="post">');
document.write('<table cellspacing=0 cellpadding=0><tr><td colspan=2 align="center"><font style="font-size:12px;"><i>Please select your size from the following list</i></font></td><td>&nbsp;</td></tr>');
document.write('<tr><td valign=center><b><font style="font-size:15px;">Size&nbsp;</font></b></td>');

price1 = dec2(price1);
document.write('<td valign=top><select name="itemname" style="font-family:Tahoma; font-size:14px;"><option value="'+pname+', '+rsp(size1)+' {'+price1+'}">'+size1+', £'+price1);
if (size2) {price2=dec2(price2); document.write('<option value="'+pname+', '+rsp(size2)+' {'+price2+'}">'+size2+', £'+price2);}
if (size3) {price3=dec2(price3); document.write('<option value="'+pname+', '+rsp(size3)+' {'+price3+'}">'+size3+', £'+price3);}
if (size4) {price4=dec2(price4); document.write('<option value="'+pname+', '+rsp(size4)+' {'+price4+'}">'+size4+', £'+price4);}
if (size5) {price5=dec2(price5); document.write('<option value="'+pname+', '+rsp(size5)+' {'+price5+'}">'+size5+', £'+price5);}
if (size6) {price6=dec2(price6); document.write('<option value="'+pname+', '+rsp(size6)+' {'+price6+'}">'+size6+', £'+price6);}
if (size7) {price7=dec2(price7); document.write('<option value="'+pname+', '+rsp(size7)+' {'+price7+'}">'+size7+', £'+price7);}
if (size8) {price8=dec2(price8); document.write('<option value="'+pname+', '+rsp(size8)+' {'+price8+'}">'+size8+', £'+price8);}
if (size9) {price9=dec2(price9); document.write('<option value="'+pname+', '+rsp(size9)+' {'+price9+'}">'+size9+', £'+price9);}
if (size10) {price10=dec2(price10); document.write('<option value="'+pname+', '+rsp(size10)+', {'+price10+'}">'+size10+', £'+price10);}	
document.write('</select></td>');

document.write('<td valign=top><input type="image" hspace=20 style="cursor:pointer;" src="img/addtobasket.png" width=116 height=24 border=0 name="submit"></td></tr></table>');
document.write('<input type=hidden name=storeid value="27328">');
document.write('<input type=hidden name=quantity value="1"></form>');
}



function addbasketp(desc,price) {
document.write("<b>"+desc+" £"+dec2(price)+"</b> ");
addbasketbutton(desc,price)
}

function qchange2(obj,a) {
if (obj.howmany.value.match(/\D/)) {obj.howmany.value = obj.howmany.value.replace(/\D/g,""); return}
if (obj.howmany.value>999) obj.howmany.value=999
var b=obj.howmany.value*1; 
if (!(b>0)) b=1;
var c=a*(b+1); a=a*b;
if (b>=postsize2) a+=higherpostage; else a+=lowerpostage;
if ((b+1)>=postsize2) c+=higherpostage; else c+=lowerpostage;
if (c>=discountthreshold) c=c-c*discountpercent/100;
if (a<discountthreshold) {if ((c-a)>0) obj.discxx.value="Buy another one for only £"+dec2(c-a)+"!"; else obj.discxx.value="";} 
else { obj.discxx.value="Over £"+discountthreshold+"! Included discount: £"+dec2(a*discountpercent/100); a=a-a*discountpercent/100;}
obj.price.value=dec2(a);  
}

function QuoteForm2(obj) {
qchange2(obj,obj.initprice.value);
obj.itemname.value=(obj.howmany.value>1)?"Set of "+obj.howmany.value+" x "+obj.inititemname.value:obj.inititemname.value;
return true; }

function addbaskettdQ(desc,price) {
document.write('<form name="f'+formcounter+'" action="http://www.romancart.com/cart.asp" method="post" onsubmit="return QuoteForm2(this);"><b>'+desc+'<BR>');
document.write('<input type="hidden" name="initprice" value="'+price+'">');
document.write('  Quantity: <input name="howmany" type="text" size=1 value="1" maxlength=3 onkeyup="qchange2(this.form,this.form.initprice.value);" class="quantity">&nbsp; ');
document.write('Price: £<input name="price" type="text" class="formnum" style="width:64px;" Readonly value="'+price+'"></b>&nbsp;');
document.write('<span style="position:absolute; padding-top:2px;" title="Click to buy another one">');
document.write('<input type="text" name="discxx" class="formnum" Readonly value="" id="add_discount" style="text-align:left; width:260px;" onclick="this.form.howmany.value++;qchange2(this.form,this.form.initprice.value);"></span></td>'); 
document.write('<td><input type="image" style="cursor:pointer;" src="img/addtobasket.png" width=116 height=24 border=0 name="submit">');
document.write('<input type="hidden" name="itemname" value="">');
document.write('<input type="hidden" name="inititemname" value="'+desc+'">');
document.write('<input type="hidden" name="quantity" value=1>'); 
document.write('<input type="hidden" name="storeid" value=27328></td>');
document.write("</form><script type='text/javascript'>qchange2(document.f"+formcounter+","+price+");</script>");
formcounter++;
}

function addaqua(desc,price) {
document.write('<form name="f'+formcounter+'" action="http://www.romancart.com/cart.asp" method="post" onsubmit="return QuoteForm2(this);">');
document.write('<input type="hidden" name="initprice" value="'+price+'">');
document.write('<input name="howmany" type="text" size=1 value="" maxlength=3 onkeyup="qchange2(this.form,this.form.initprice.value);" class="quantity"></td>');
document.write('<td align="center" valign="bottom"><b>£</b><input name="price" type="text" class="formnum" style="width:64px; text-align:center;" Readonly value="'+price+'"></td>');
document.write('<input type="hidden" name="discxx" Readonly value="">'); 
document.write('<td><input type="image" style="cursor:pointer;" src="img/buy2.png" width=33 height=20 border=0 align="absmiddle" name="submit">');
document.write('<input type="hidden" name="itemname" value="">');
document.write('<input type="hidden" name="inititemname" value="'+desc+'">');
document.write('<input type="hidden" name="quantity" value=1>'); 
document.write('<input type="hidden" name="storeid" value=27328>');
document.write("<script type='text/javascript'>qchange2(document.f"+formcounter+","+price+");</script>");
formcounter++;
}


function addbasketbutton(desc,price) {
document.write('<form action="http://www.romancart.com/cart.asp" method="post">');
document.write('<input type="image" style="cursor:pointer;" align="absmiddle" src="img/addtobasket.png" width=116 height=24 border=0 name="submit"><BR>');
document.write('<input type="hidden" name="itemname" value="'+desc+'">');
document.write('<input type="hidden" name="price" value="'+price+'">');
document.write('<input type="hidden" name="quantity" value="1">');
document.write('<input type="hidden" name="storeid" value="27328"></form>');
}

function addbasketi(desc,price) {
document.write('<form action="http://www.romancart.com/cart.asp" method="post" name="vinput" onsubmit="javascript:return !IsEmpty(this.price)">');
document.write('<input type="text" size=4 maxlength=6 name="price" value=""> ');
document.write('<input type="hidden" name="tangible" value="no">');
document.write('<input type="image" style="cursor:pointer;" align="absmiddle" src="img/addtobasket.png" width=116 height=24 border=0 name="submit"><BR>');
document.write('<input type="hidden" name="itemname" value="'+desc+'">');
document.write('<input type="hidden" name="quantity" value="1">');
document.write('<input type="hidden" name="storeid" value="27328"></form>');
document.vinput.price.focus();
}





function showw(winid) {
var dom=document.getElementById;
objref=(dom)? document.getElementById(winid) : document.all.winid;
if (objref.filters){objref.filters[0].Apply(); objref.filters[0].Play();}
objref.style.visibility="visible";
}

function hidew(winid) {
var dom=document.getElementById;
objref=(dom)? document.getElementById(winid) : document.all.winid;
objref.style.visibility="hidden";
}


 
