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

var menu1=new Array()
menu1[0]='<a href="giftsets.html">Cotton gift set</a>'
menu1[1]='<a href="giftsets.html#bbathtime">Baby bathtime set</a>'
menu1[2]='<a href="giftsets.html#bathrobe">Baby bathrobe & teddy</a>'
menu1[3]='<a href="giftsets.html#twins">Twins gift set</a>'
menu1[4]='<a href="giftsets.html#nitenite">Nite-nite gift set</a>'
menu1[5]='<a href="giftsets.html#sheep">Sheep fleece set</a>'
var menu2=new Array()
menu2[0]='<a href="teddybears.html">Big teddy</a>'
menu2[1]='<a href="teddybears.html#little">Little & smiley</a>'
menu2[2]='<a href="teddybears.html#pj">PJ bear</a>'
menu2[3]='<a href="teddybears.html#cbear">Christening</a>'
menu2[4]='<a href="teddybears.html#twins">Twin bears</a>'
var menu3=new Array()
menu3[0]='<a href="bathtime.html#bathtowel">Bath towel</a>'
menu3[1]='<a href="bathtime.html#bbathrobe">Baby bathrobe</a>'
menu3[2]='<a href="bathtime.html#bhooded">Baby hooded towel</a>'
menu3[4]='<a href="bathtime.html#bbathtime">Baby bathtime set</a>'
menu3[5]='<a href="bathtime.html#teddyset">Bathrobe & teddy set</a>'
menu3[6]='<a href="bathtime.html#dolphin">Dolphin swimming towel</a>'
var menu4=new Array()
menu4[0]='<a href="blankets.html">First cotton blanket</a>'
menu4[1]='<a href="blankets.html#fleece">Fleece blanket</a>'
menu4[2]='<a href="blankets.html#sheep">Sheep fleece blanket</a>'
menu4[3]='<a href="blankets.html#horse">Rocking horse shawl</a>'
menu4[4]='<a href="blankets.html#ribbon">Ribbon & lace blanket</a>'
menu4[5]='<a href="blankets.html#pod">Twins blanket</a>'
var menu5=new Array()
menu5[0]='<a href="sleepsuits.html">Cotton sleep suit</a>'
var menu6=new Array()
menu6[0]='<a href="christening.html">Christening card</a>'
menu6[1]='<a href="christening.html#bib">Bib in box</a>'
menu6[2]='<a href="christening.html#bear">Teddy bear</a>'
menu6[3]='<a href="christening.html#horse">Rocking horse shawl</a>'
menu6[4]='<a href="christening.html#ribbon">Ribbon & lace blanket</a>'
var menu7=new Array()
menu7[0]='<a href="albums.html#tbox">Treasury boxes</a>'
var menu8=new Array()
menu8[0]='<a href="twins.html">Twins card</a>'
menu8[1]='<a href="twins.html#bears">Twin teddy bears</a>'
menu8[2]='<a href="twins.html#sleep">Peas in a pod sleep suit</a>'
menu8[3]='<a href="twins.html#blanket">Peas in a pod blanket</a>'
menu8[4]='<a href="twins.html#giftset">Twins gift set</a>'



var menurowheight=22;		
var disappeardelay=250;


var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}



function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ 
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) 
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
dropmenuobj.x=getposOffset(obj,"left")+ ((ie4)? 0:8);
dropmenuobj.y=getposOffset(obj,"top")+ ((ie4)? -5:0);
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px";
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px";

if (ie4 && !(window.opera && window.print)) {
   myIFrame = document.getElementById('iFrameIEHack'); 
   myIFrame.style.width = menuwidth.substr(0,menuwidth.length-2)*1+2+8+"px";
   myIFrame.style.height = menucontents.length * menurowheight+2+8+"px";
   myIFrame.style.left= dropmenuobj.style.left;
   myIFrame.style.top= dropmenuobj.style.top;
   myIFrame.style.visibility= "visible";}
if (e.type=="click" && obj.visibility=="hidden" || e.type=="mouseover") {
   if (dropmenuobj.filters){
       dropmenuobj.filters[0].Apply();
       dropmenuobj.filters[0].Play();}
   dropmenuobj.style.visibility="visible";
   }
else if (e.type=="click") dropmenuobj.style.visibility="hidden";
}

if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (ie4) {myIFrame = document.getElementById('iFrameIEHack');
          myIFrame.style.visibility="hidden";}
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

document.onclick=hidemenu





function addf() { 
url= location.href;
title = document.title;
if (window.sidebar) {window.sidebar.addPanel(title, url,"");}
else if (window.external) {window.external.AddFavorite( url, title); }	
else if (window.opera && window.print) {return true; }
}

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 displayp(desclong,descshort,price,drop1,drop2,text1,text1l,text2,text2l,text3,text3l,text4,text4l,text5,text5l,text6,text6l,text7,text7l,text8,text8l) {
document.write('<table width="100%"><tr><td colspan=2><img src="img/bullet.gif" width=16 height=13 border=0> '+desclong+' <b>£'+dec2(price)+'</b></td></tr>');
document.write('<tr><td width="70%"><table width="100%">');
document.write('<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target=\'paypal\'; return ReadForm(this);">');

if (drop1) printdlist(drop1,1);
if (drop2) printdlist(drop2,2);
if (text1) printtfield(text1,text1l,1);
if (text2) printtfield(text2,text2l,2);
if (text3) printtfield(text3,text3l,3);
if (text4) printtfield(text4,text4l,4);
if (text5) printtfield(text5,text5l,5);
if (text6) printtfield(text6,text6l,6);
if (text7) printtfield(text7,text7l,7);
if (text8) printtfield(text8,text8l,8);
document.write('</table></td><td valign="bottom" align="left">');
document.write('<input type="image" src="https://www.paypal.com//en_GB/i/btn/sc-but-03.gif" border=0 name="submit"><BR><img src="img/e.gif" width=1 height=3 border=0></td></tr></table>');
document.write('<input type="hidden" name="item_name" value="'+descshort+'">');
document.write('<input type="hidden" name="on0" value="">');
document.write('<input type="hidden" name="os0" value="">');
document.write('<input type="hidden" name="on1" value="">');
document.write('<input type="hidden" name="os1" value="">');
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="clare@bespokeembroidery.co.uk">');
document.write('<input type="hidden" name="initamount" value="'+price+'">');
document.write('<input type="hidden" name="amount" value="">');
document.write('<input type="hidden" name="no_shipping" value="2">');
document.write('<input type="hidden" name="return" value="http://www.bespokebabygifts.co.uk/paid.html">');
document.write('<input type="hidden" name="cancel_return" value="http://www.bespokebabygifts.co.uk/index.html">');
document.write('<input type="hidden" name="cn" value="Where did you hear about us">');
document.write('<input type="hidden" name="currency_code" value="GBP">');
document.write('<input type="hidden" name="lc" value="GB"></form>');
}

function printdlist(dropx,n) {
document.write('<tr valign="middle"><td width="50%" align="right" style="z-index:0;"><input type="hidden" name="drop'+n+'" value="'+dropx[0]+'">'+dropx[0]+'</td>');
document.write('<td><select name="drop'+n+'v">');
i=1;
while (dropx[i]) {document.write('<option value="'+dropx[i]+'">'+dropx[i]); i++;}
document.write('</select></td></tr>');
}

function printtfield(textx,textlen,n) {
document.write('<tr><td width="50%" align="right" valign="middle">');
if (textx.substr(0,1)=="|") {textx=textx.substr(1);
   				             document.write('<input type="hidden" name="tickboxv" value="'+textlen+'">'+textx+'</td>');
							 document.write('<td><input type="checkbox" style="margin-left:0;" name="tickbox" value="'+textx+'"> +£'+dec2(textlen)+'</td></tr>');
							 return;}
document.write('<input type="hidden" name="text'+n+'" value="'+textx+'">'+textx+'</td>');
if (textlen>20) document.write('<td><textarea name="text'+n+'v" maxlength='+textlen+' rows='+textlen/20+' cols=20 onKeyDown="textCounter(this.form.text'+n+'v,'+textlen+');" onKeyUp="textCounter(this.form.text'+n+'v,'+textlen+');"></textarea></td></tr>');
else document.write('<td><input type="text" name="text'+n+'v" maxlength='+textlen+'></td></tr>');
}   


function ReadForm (form) {
var on1=""; var os1="";
if (form.drop1) form.on0.value= form.drop1.value +"= "+ form.drop1v.value;
if (form.drop2) form.os0.value= "| "+form.drop2.value +"= "+ form.drop2v.value;
if (form.text1) on1 = form.text1.value +"= "+ form.text1v.value;
if (form.text2) os1 = form.text2.value +"= "+ form.text2v.value;
           else if (on1) {on1=form.text1.value; os1=form.text1v.value;}
if (form.text3) os1+= ", "+form.text3.value +"= "+ form.text3v.value;
if (form.text4) os1+= ", "+form.text4.value +"= "+ form.text4v.value;
if (form.text5) os1+= ", "+form.text5.value +"= "+ form.text5v.value;
if (form.text6) os1+= ", "+form.text6.value +"= "+ form.text6v.value;
if (form.text7) os1+= ", "+form.text7.value +"= "+ form.text7v.value;
if (form.text8) os1+= ", "+form.text8.value +"= "+ form.text8v.value;

form.amount.value=form.initamount.value;
if (form.tickbox) {if (form.tickbox.checked) {os1+= ", "+form.tickbox.value; form.amount.value=form.amount.value*1+form.tickboxv.value*1;} }
	
if (form.drop1) {
   if (on1.length>0) form.on1.value= on1;
   if (os1.length>0) form.os1.value= os1;
   return;}
if (on1.length>0) form.on0.value= on1;
if (os1.length>0) form.os0.value= os1;
}


function textCounter(field, maxlen) {
if (field.value.length > maxlen) field.value = field.value.substring(0, maxlen);
}






function nextpic(imgid,imglist,counter){
counter++;
if (counter==imglist.length) counter=0;
if (document.all && document.images[imgid].filters) document.images[imgid].filters[0].apply();
document.images[imgid].src = "img/"+imglist[counter]+".jpg";
if (document.all && document.images[imgid].filters) document.images[imgid].filters[0].play();
return counter;
}


var picdelay=4000;

function showpic(title,firstpic,i){
document.write('</td><td width=280 align="center">');
var a= "window.open('big/'+piclist"+i+"[pc"+i+"]+'.jpg','','"+((title.charAt(title.length-1)=="V")?"width=520,height=660":"width=690,height=600")+",resizable=yes,toolbar=no,menubar=no')";
document.write('<a href="#1" onClick='+a+' onMouseOver="window.status=\'Click to enlarge\'; return true" onMouseOut="window.status=\' \'">');
var x=270; var y=198;
if (title.charAt(title.length-1)=="V") {title=title.substr(0,title.length-1); x=198;y=270;}
document.write('<img ID="p'+i+'" src="img/'+firstpic+'.jpg" class="prodpic" width='+x+' height='+y+' alt="'+title+'" border=1><BR>');
document.write('<img src="img/enlarge.gif" width="133" height="14" alt="Click image to enlarge" border=0>');
}




function viewcart(){
document.write('<div style="margin:16px 0 14px 0;"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">');
document.write('<input type="hidden" name="cmd" value="_cart">');
document.write('<input type="hidden" name="business" value="clare@bespokeembroidery.co.uk">');
document.write('<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit">');
document.write('<input type="hidden" name="display" value="1">');
document.write('</form></div>');
//special product
document.write('<a href="teddybears.html"><b>New Product</b><BR>');
document.write('<img src="img/9728n.jpg" class="indeximg" style="width:135px;height:99px;" alt="Teddy bears" border="0" align=""></a><BR>&nbsp; <BR>');
// favorites
document.write('<a href="javascript:void(0);" onclick="addf()" class="fimg3"><img src="img/add.png" width=116 height=18 alt="Add this site to your favorites" border=0></a><BR>');
// Recommend
document.write('<a href="recommend/recommend.php"><div class="recommendation">Recommend this site</div></a><BR>');

if (ie4 && !(window.opera && window.print)) document.write('<iframe id="iFrameIEHack" src="javascript:false" style="filter:Alpha(Opacity=0);position:absolute;width:1px;height:1px;z-index:5;" scrolling="No" marginwidth=0 marginheight=0 frameborder=0></iframe>');
}
