//<script="javascript">
if (self.location != top.location) top.location = self.location;

var frm1="<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"  onsubmit=\"this.target='paypal'; return CalcPrice(this);\">";


function makewave(obj1) {
obj1.filters.item(0).Phase += 5;
}

function CalcPrice (form1) {
var a= form1.os0.value.indexOf("£");
form1.amount.value= form1.os0.value.substring(a+1);
if (form1.on0) {if (form1.on0.value=="dummy") {form1.on0.value=form1.on1.value;
                                               form1.os0.value=form1.os1.value;
                       						   form1.on1.value="";} }
}

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 displayfp(pcode,pname,price) {
var zoompic=pcode.charAt(pcode.length-1);
if (zoompic=="_") pcode=pcode.substring(0,pcode.length-1);
document.write('<td width=120><div class="topi">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
if (zoompic=="_") {document.write('<div id="zoom'+pcode+'" class="zoomimg"><img src="img/'+pcode+'Z.jpg" border=0 width=320 height=480></div>');}
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price));
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div style="height:17px; text-align:center; cursor:hand; cursor:pointer;">');
if (zoompic=="_") {var t1="zoompic('zoom"+pcode+"','"+pcode+".jpg',0,20);"; 
                   var t2="closepic('zoom"+pcode+"');"; 
				   document.write('<img src="../img/zoom.png" onmouseover="'+t1+'" onmouseout="'+t2+'" width=120 height=17 alt="Zoom" border=0>');}
document.write('</div></td>');
writeendform(pcode,pname);
}

function displaypic0(pcode,pname,pdesc,price,op1,op2,op3,op4,op5,op6,op7,op8,op9) {
document.write('<td ><div style="text-align:center; height:108px;">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
document.write('<i>'+pdesc+'</i><BR>');
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price)+'<BR>');
if (op1) {document.write('<input type="hidden" name="on0" value="dummy">');
          document.write('<input type="hidden" name="on1" value="type"><select class="selectwidth" name="os1">');
          document.write('<option value="'+op1+'">'+op1);
		  if (op2) document.write('<option value="'+op2+'">'+op2);
		  if (op3) document.write('<option value="'+op3+'">'+op3);
		  if (op4) document.write('<option value="'+op4+'">'+op4);
		  if (op5) document.write('<option value="'+op5+'">'+op5);
		  if (op6) document.write('<option value="'+op6+'">'+op6);
		  if (op7) document.write('<option value="'+op7+'">'+op7);
		  if (op8) document.write('<option value="'+op8+'">'+op8);
		  if (op9) document.write('<option value="'+op9+'">'+op9);
     	  document.write('</select><BR>');
    	  }
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div></td>');
writeendform(pcode,pname);
}

function displayp200(pcode,pname,price,op1,op2,op3,op4,op5,op6,op7,op8,op9) {
document.write('<td width=120><div class="topi" style="height:96px;">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
var p1=price; if (p1>100000) price=price-100000;
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price));
if (op1) {document.write('<input type="hidden" name="on0" value="dummy">');
          document.write('<input type="hidden" name="on1" value="type"><select name="os1">');
          document.write('<option value="'+op1+'">'+op1);
		  if (op2) document.write('<option value="'+op2+'">'+op2);
		  if (op3) document.write('<option value="'+op3+'">'+op3);
		  if (op4) document.write('<option value="'+op4+'">'+op4);
		  if (op5) document.write('<option value="'+op5+'">'+op5);
		  if (op6) document.write('<option value="'+op6+'">'+op6);
		  if (op7) document.write('<option value="'+op7+'">'+op7);
		  if (op8) document.write('<option value="'+op8+'">'+op8);
		  if (op9) document.write('<option value="'+op9+'">'+op9);
     	  document.write('</select><BR>');
    	  }
if (p1<100000) document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
        else   document.write('<div class="outofstock">Out of Stock!</div></div>'); 
document.write('<div><img src="img/'+pcode+'.jpg" border=0 width=120 height=200 alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname);
}


function displaypxo(picx,picy,pcode,pname,ptype,pdesc,price,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10,op11,op12,op13,op14,op15,op16,op17,op18,op19,op20,op21,op22,op23) {
var tdheight=170+1*picy;
if (pdesc=="V") {tdheight=210+1*picy; pdesc="";}
if (pdesc=="X") {tdheight=130+1*picy; pdesc="";}
if (pdesc=="Y") {tdheight=100+1*picy; pdesc="";}
if (pdesc=="Z") {tdheight=84+1*picy; pdesc="";}
if (pdesc.charAt(0)==">") {tdheight=1*pdesc.substr(1,pdesc.length); pdesc="";}

document.write('<td width='+picx+' height='+tdheight+' valign="top"><div align="center" style="height:'+(tdheight-1*picy-45)+'px;">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
document.write('<img src="../img/e.gif" width=1 height=3 border=0><BR><div align="center" valign="center" style="padding-left:2px;"><font color="#404080">'+ptype+'</font></div>');		  
document.write('<img src="../img/e.gif" width=1 height=1 border=0><BR><div align="left" style="padding-left:2px;"><font color="#000080"><i>'+pdesc+'</i></font></div></div>');
document.write('<div align="center" style="height:45px;">');		  
if (op1) {document.write('<input type="hidden" name="on0" value="dummy">');
          document.write('<input type="hidden" name="on1" value="type"><select class="selectwidth" name="os1">');
          document.write('<option value="'+op1+'">'+op1);
		  if (op2) document.write('<option value="'+op2+'">'+op2);
		  if (op3) document.write('<option value="'+op3+'">'+op3);
		  if (op4) document.write('<option value="'+op4+'">'+op4);
		  if (op5) document.write('<option value="'+op5+'">'+op5);
		  if (op6) document.write('<option value="'+op6+'">'+op6);
		  if (op7) document.write('<option value="'+op7+'">'+op7);
		  if (op8) document.write('<option value="'+op8+'">'+op8);
		  if (op9) document.write('<option value="'+op9+'">'+op9);
		  if (op10) document.write('<option value="'+op10+'">'+op10);
		  if (op11) document.write('<option value="'+op11+'">'+op11);		  
		  if (op12) document.write('<option value="'+op12+'">'+op12);
		  if (op13) document.write('<option value="'+op13+'">'+op13);
		  if (op14) document.write('<option value="'+op14+'">'+op14);
		  if (op15) document.write('<option value="'+op15+'">'+op15);
		  if (op16) document.write('<option value="'+op16+'">'+op16);
		  if (op17) document.write('<option value="'+op17+'">'+op17);
		  if (op18) document.write('<option value="'+op18+'">'+op18);
		  if (op19) document.write('<option value="'+op19+'">'+op19);
		  if (op20) document.write('<option value="'+op20+'">'+op20);
		  if (op21) document.write('<option value="'+op21+'">'+op21);
		  if (op22) document.write('<option value="'+op22+'">'+op22);
		  if (op23) document.write('<option value="'+op23+'">'+op23);		  	  		  
     	  document.write('</select><BR>');
    	  }
    else  document.write('<img src="../img/e.gif" width=1 height=22 border=0><BR>'); 
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price));		  
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div><img src="img/'+pcode+'.jpg" border=0 width='+picx+' height='+picy+' alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname);
}


function displaypx(picx,picy,pcode,pname,pdesc,price,height) {
if (price) var c="topi2";
else {var c="topi"; price=pdesc; pdesc="";}
if ((picy==300) || (picy==185)) var c="topi4";
if ((picy==140) || (picy==250)) var c="topi5";
if (height) c+='" style="height:'+height+'px;';
document.write('<td width='+picx+'><div class="'+c+'">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
if (pdesc) document.write('<img src="../img/e.gif" width=1 height=4 border=0><BR><div align="left" style="padding-left:2px;"><font color="#000080"><i>'+pdesc+'</i></font></div>');
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price));
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div><img src="img/'+pcode+'.jpg" border=0 width='+picx+' height='+picy+' alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname);
}

function displaybook(pcode,pname,author,desc,price) {
document.write('<td width=200><div class="topi2">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
document.write('<i>'+author+'</i><BR><img src="../img/e.gif" width=1 height=4 border=0><BR>'+desc+'<BR>');
document.write('<input type="hidden" name="os0" value="£'+ price +'">£'+dec2(price));
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div><img src="img/'+pcode+'.jpg" border=0 width=200 height=200 alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname+((author)?" :  ":"")+author);
}


function displayp(pcode,pname,price1,size1,size2,size3,size4,size5) {
var zoompic=pcode.charAt(pcode.length-1);
if (zoompic=="_") pcode=pcode.substring(0,pcode.length-1);
if (price1 == 0.70) {var price3="1.80"; var price12="6.00";}
else if (price1 == 0.80) {var price3="2.00"; var price12="8.00";}
else if (price1 == 0.85) {var price3="2.10"; var price12="8.00";}
else if (price1 == 0.90) {var price3="2.30"; var price12="8.00";}
else if (price1 == 0.95) {var price3="2.45"; var price12="10.00";}
else if (price1 == 1.00) {var price3="2.50"; var price12="9.00";}
else if (price1 == 1.05) {var price3="2.70"; var price12="10.00";}
else if (price1 == 1.10) {var price3="3.00"; var price12="12.00";}
else if (price1 == 1.25) {var price3="3.20"; var price12="12.00";}
price1 = dec2(price1);
document.write('<td valign="top"><div class="lefti');
if ((pcode>=78) && (pcode<=91)) {document.write("V"); h=100; v=140;}
else {h=120; v=100;}
document.write('">'+frm1+pcode+'<BR>');
var f=pname.charAt(0); if (f=="^") pname=pname.substring(1,pname.length);
document.write(pname+"<BR>");
document.write('<input type="hidden" name="on0" value="packsize"><select name="os0"><option value="1 for £'+price1+'">&nbsp; 1 for £'+price1+'<option value="3 for £'+price3+'">&nbsp; 3 for £'+price3+'<option value="12 for £'+price12+'">12 for £'+price12+'</select><BR>');
if (size1) {document.write('<input type="hidden" name="on1" value="size"><select name="os1"');
            document.write((size2>0) ? ">" : "disabled>");
            document.write('<option value="'+size1+'">Size '+size1);
			if (size2) {document.write('<option value="'+size2+'">Size '+size2);}
			if (size3) {document.write('<option value="'+size3+'">Size '+size3);}
			if (size4) {document.write('<option value="'+size4+'">Size '+size4);}
			if (size5) {document.write('<option value="'+size5+'">Size '+size5);}
			document.write('</select>');
			if (!f=="^") document.write("<BR>");
			}
document.write('<input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div class="righti">');
if (zoompic=="_") document.write('<a href="javascript:void(null);" onClick="popupwin(\''+pcode+'Z\',360,300);"><img style="background-image: url(img/'+pcode+'.jpg);" src="../img/zoom.gif" width=120 height=100 alt="Click here to zoom" border=0></a>');
else document.write('<img src="img/'+pcode+'.jpg" border=0 height='+v+' width='+h+' alt="'+pcode+' '+pname+'">');
document.write('</div></td>');
writeendform(pcode,pname);
}

function displayp2(pcode,pname,ptype,price) {
document.write('<td><div class="lefti">' + frm1 + pcode +'<BR>'+ pname +'<BR><i>'+ ptype +'</i><BR>');
document.write('<input type="hidden" name="os0" value="£'+ dec2(price) +'">£'+dec2(price));
document.write(' &nbsp; <input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=2 border=0 value="buy"></div>');
document.write('<div class="righti"><img src="img/'+pcode+'.jpg" border=0 width=120 height=100 alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname+", "+ptype);
}


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

document.write('<td><div class="leftib">' + frm1);
document.write(pcode+"<BR>");
document.write(pname+"<BR>");

price1 = dec2(price1);
document.write('<input type="hidden" name="on0" value="sizecolour">');
if (size2) {document.write('<select name="os0"><option value="'+size1+', £'+price1+'">'+size1+', £'+price1);
    if (size2) {price2=dec2(price2); document.write('<option value="'+size2+', £'+price2+'">'+size2+', £'+price2);}
    if (size3) {price3=dec2(price3); document.write('<option value="'+size3+', £'+price3+'">'+size3+', £'+price3);}
    if (size4) {price4=dec2(price4); document.write('<option value="'+size4+', £'+price4+'">'+size4+', £'+price4);}
    if (size5) {price5=dec2(price5); document.write('<option value="'+size5+', £'+price5+'">'+size5+', £'+price5);}
	if (size6) {price6=dec2(price6); document.write('<option value="'+size6+', £'+price6+'">'+size6+', £'+price6);}
	if (size7) {price7=dec2(price7); document.write('<option value="'+size7+', £'+price7+'">'+size7+', £'+price7);}
    if (size8) {price8=dec2(price8); document.write('<option value="'+size8+', £'+price8+'">'+size8+', £'+price8);}
	if (size9) {price9=dec2(price9); document.write('<option value="'+size9+', £'+price9+'">'+size9+', £'+price9);}
	if (size10) {price10=dec2(price10); document.write('<option value="'+size10+', £'+price10+'">'+size10+', £'+price10);}	
    document.write('</select><BR>');}
else {document.write('<center><div class="singles"><input type="hidden" name="os0" value="'+((!size1)?"":(size1+', '))+'£'+price1+'">'+((!size1)?"":(size1+', '))+'£'+price1+'</div></center>');}

document.write('<input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');
document.write('<div class="righti">');
document.write('<img src="img/'+pcode+'.jpg" border=0 height=100 width=120 alt="'+pcode+' '+pname+'"></div></td>');
writeendform(pcode,pname);
}


function displaypbx(picx,picy,tdspace,pcode,pname,pdesc,price1,size1,price2,size2,price3,size3,price4,size4,price5,size5,price6,size6,price7,size7,price8,size8,price9,size9,price10,size10) {

var zoompic=pcode.charAt(pcode.length-1);
if (zoompic=="_") pcode=pcode.substring(0,pcode.length-1);
if (pcode.indexOf(".gif")>0) {var pic=pcode; pcode=pcode.slice(0,pcode.indexOf(".gif"));} else var pic=pcode+".jpg"; 
var tdheight=tdspace+1*picy;
if (picx>0) {document.write('<td width='+picx+' height='+tdheight+' valign="top"><div align="center" style="height:'+(tdspace-45)+'px;">' + frm1 + pcode +'<BR>'+ pname +'<BR>');
   			 document.write('<img src="../img/e.gif" width=1 height=2 border=0><BR><div align="center"><font color="#000080"><i>'+pdesc+'</i></font></div></div>');
			 }
        else document.write(frm1);
document.write('<div align="center" style="height:45px;">');		  

price1 = dec2(price1);
document.write('<input type="hidden" name="on0" value="type">');
if (size2) {document.write('<select name="os0"><option value="'+size1+', £'+price1+'">'+size1+', £'+price1);
    if (size2) {price2=dec2(price2); document.write('<option value="'+size2+', £'+price2+'">'+size2+', £'+price2);}
    if (size3) {price3=dec2(price3); document.write('<option value="'+size3+', £'+price3+'">'+size3+', £'+price3);}
    if (size4) {price4=dec2(price4); document.write('<option value="'+size4+', £'+price4+'">'+size4+', £'+price4);}
    if (size5) {price5=dec2(price5); document.write('<option value="'+size5+', £'+price5+'">'+size5+', £'+price5);}
	if (size6) {price6=dec2(price6); document.write('<option value="'+size6+', £'+price6+'">'+size6+', £'+price6);}
	if (size7) {price7=dec2(price7); document.write('<option value="'+size7+', £'+price7+'">'+size7+', £'+price7);}
    if (size8) {price8=dec2(price8); document.write('<option value="'+size8+', £'+price8+'">'+size8+', £'+price8);}
	if (size9) {price9=dec2(price9); document.write('<option value="'+size9+', £'+price9+'">'+size9+', £'+price9);}
	if (size10) {price10=dec2(price10); document.write('<option value="'+size10+', £'+price10+'">'+size10+', £'+price10);}	
    document.write('</select><BR>');}
else {document.write('<div class="singles" align="center"><input type="hidden" name="os0" value="'+size1+', £'+price1+'">'+size1+', £'+price1+'</div>');}

document.write('<input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></div>');

if (zoompic=="_") document.write('<a href="javascript:void(null);" onClick="popupwin(\''+pcode+'Z\','+picx*3+','+picy*3+');"><img style="background-image: url(img/'+pcode+'.jpg);" src="../img/zoom'+picx+''+picy+'.gif" width='+picx+' height='+picy+' alt="Click here to zoom" border=0></a>');
else if (picx>0) document.write('<div><img src="img/'+pic+'" border=0 width='+picx+' height='+picy+' alt="'+pcode+' '+pname+'">'); 
document.write('</div></td>');
writeendform(pcode,pname);
}


function buynowtab(pname,pcode,rating,feet,inches,pieces,price) {
document.write(frm1+'<input type="hidden" name="os0" value="£'+ price +'">');
document.write('<tr><td>'+pcode+'</td><td>'+rating+'</td><td>'+feet+'\''+inches+'\"</td><td>'+pieces+'</td><td>£'+price+'</td><td>');
document.write('<input type="image" name="submit" src="../img/buy2.png" height=20 width=33 align="absmiddle" vspace=1 border=0 value="buy"></td></tr>');
writeendform(pcode,pname);
}


function writeendform(pcode,pname) {
pname = pname.replace(/<BR>/g, "; ");
document.write('<input type="hidden" name="add" value="1">');
document.write('<input type="hidden" name="cmd" value="_cart">');
document.write('<input type="hidden" name="business" value="info@alburygameangling.co.uk">');
document.write('<input type="hidden" name="item_name" value="'+pcode+' '+pname+'">');
document.write('<input type="hidden" name="amount" value="0.00">');
document.write('<input type="hidden" name="no_shipping" value="2">');
document.write('<input type="hidden" name="return" value="http://www.alburygameangling.co.uk/paid.shtml">');
document.write('<input type="hidden" name="cancel_return" value="http://www.alburygameangling.co.uk">');
document.write('<input type="hidden" name="cn" value="Optional Comments">');
document.write('<input type="hidden" name="currency_code" value="GBP">');
document.write('<input type="hidden" name="lc" value="GB">');
document.write('<input type="hidden" name="bn" value="PP-ShopCartBF">');
document.write('</form>');
}




var ie = document.all && !window.opera;
var openwin=0;

function displaywin(winid,leftx,topy){
openwin= winid;
var dom=document.getElementById;
objref=(dom)? document.getElementById(winid) : document.all.winid;
var iebody = (document.compatMode=="CSS1Compat")? document.documentElement : document.body;
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset;
var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
objref.style.left = leftx + docwidth/2-objref.offsetWidth/2+"px";
objref.style.top = topy + scroll_top+"px";
if (objref.filters){objref.filters[0].Apply(); objref.filters[0].Play();}
objref.style.visibility="visible";
}

function closewin(){
if (openwin) {
var dom=document.getElementById;
objref=(dom)? document.getElementById(openwin) : document.all.openwin;
objref.style.visibility="hidden"; openwin=0;
}
}

function openvpic(imgurl,imgid,sizex,sizey) {
document.abc.src=imgurl;
document.abc.width=sizex;
document.abc.height=sizey;
}

function popupwin(imgname,sx,sy) {
window.open("img/"+imgname+".jpg",'popupWindow',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+sx+",height="+sy+",top=200,left=200");
}

function zoompic(winid,imgname,leftx,topy) {
var dom=document.getElementById;
objref=(dom)? document.getElementById(winid) : document.all.winid;
var iebody = (document.compatMode=="CSS1Compat")? document.documentElement : document.body;
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset;
var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
objref.style.left = leftx + docwidth/2-objref.offsetWidth/2+"px";
objref.style.top = topy + scroll_top+"px";
if (objref.filters) {objref.filters[0].Apply(); objref.filters[0].Play();}
objref.style.visibility="visible"; 
}

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