// JavaScript Document

function printHeader(cartLink, coLink) {
  var inner = true;
  if(cartLink == '' && coLink == '') { inner = false; }
  document.write(' <div id="header">');
  document.write(' <table cellpadding="0" cellspacing="0" width="778" height="117" border="0">');
  document.write(' <tr>');
  document.write(' <td valign="top" colspan="2" height="90"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"');
  document.write('WIDTH="778" HEIGHT="90" id="myMovieName">');
  document.write('<PARAM NAME=movie VALUE="wholesale_nav.swf">');
  document.write('<PARAM NAME=quality VALUE=high>');
  document.write('<EMBED src="wholesale_nav.swf" quality=high bgcolor=#FFFFFF WIDTH="778" HEIGHT="90"');
  document.write('NAME="wholesale_nav" ALIGN="" TYPE="application/x-shockwave-flash"');
  document.write('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
  document.write('</EMBED>');
  document.write('</OBJECT></td>');
  document.write('     </tr>');
  document.write('	 <tr id="lowerlinklistrow">');
  document.write('	   <td id="phonenumber" width="40%">020 7580 7580</td>');
  document.write('     <td><table id="lowerlinklist"><tr>');
  



if(inner) {
    document.write('       <td><a href="News.html"><span>news</span></a></td>');	  
    document.write('       <td><a href="index.html"><span>products</span></a></td>');
  } else {
    document.write('       <td><span>products</span></td>');
  }
  if(inner) {
    document.write('       <td><a href="Marketing.html"><span>marketing materials</a></span></td>');
  } else {
    document.write('       <td><a href="Benefits.html"><span>benefits</a></span></td>');
  }


  
document.write('       <td><a href="FAQ.html"><span>faq</span></a></td>');
  document.write('       <td><a href="ContactUs.html"><span>contact us</span></a></td>');
  
if(inner) {
  //  document.write('       <td><a href="Marketing.html"><span>marketing</span></a></td>');
    document.write('       <td><a href="'+cartLink+'"><span>view cart</span></a></td>');
    document.write('       <td><a href="'+coLink+'"><span>check out</span></a></td>');
  }
  document.write('     </tr></table></td>');
  document.write('    </tr> ');
  document.write('  </table>');


/* Cart Contents */  
  document.write('  <div id="cartcontents"><span>');
  document.write('<span id="cartblock">Cart:</span>&nbsp;&nbsp;Items:&nbsp;'+ getCartItem(3)+'&nbsp;&nbsp;&nbsp;');
  document.write("Value:&nbsp;" + getCartItem(1)+"&nbsp;</span>");


  document.write('  </div>');
  document.write('</div>');
}


function printNavMenu() {
  document.write('<div id="navmenu">');
  document.write('<table class="brands">');
  document.write('  <tr>');
  document.write('    <td class="navmenuhead"><span>Petlondon Wholesale</span></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_Shop_By_Collection.html">Shop by Collection</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_clothing.html">Apparel</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_Organic.html">Organic</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_bedtime.html">Bed Time</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_travel.html">Travel</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_accessories.html">Accessories</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_play_time.html">Play Time</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_bathtime.html">Bath Time</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_harnesses.html">Harnesses</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_collars.html">Collars</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_treats.html">Treats</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_display.html">Display</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_seasonal.html">Seasonal</a></td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="navmenuitem"><a href="cat_personalised.html">Personalised</a></td>');
  document.write('  </tr>');
  document.write('</table>');
  document.write('<table class="specialoffers">');
  document.write('  <tr>');
  document.write('    <td><a href="special_offers.html">Special Offers</a></td>');
  document.write('  </tr>');
  document.write('</table>');  
 // document.write('<table class="categories">');
//  document.write('  <tr>');
//  document.write('    <td class="navmenuhead"><span>categories</span></td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
 // document.write('    <td class="navmenuitemunique"><a href="../cgi-bin/ss000001.pl?PAGE=SEARCH&TB=A&S_STATUS1_0=h&GB=A&ACTION=Search">//hot items</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_accessories.html">accessories</a></td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_bathtime.html">bath time</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_bedtime.html">bed time</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_clothing.html">clothing</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_display.html">display</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_play_time.html">play time</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_seasonal.html">seasonal</a></td>');
 // document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_treats.html">treats</a></td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
//  document.write('    <td class="navmenuitem"><a href="cat_travel.html">travel</a></td>');
//  document.write('  </tr>');
 // document.write('  <tr>');
 // document.write('    <td class="navmenuitem"><a href="cat_walkies.html">walkies</a></td>');
//  document.write('  </tr>');
//  document.write('</table>');
//  document.write('<table class="callus">');
//  document.write('  <tr>');
//  document.write('    <td class="infobox"><span>To order by phone, please call<br>020 7580 7580</span></td>');
//  document.write('  </tr>');
//  document.write('</table>');  
 document.write('</div>');
}

function displayOtherPics(otherPics) {
	
	if(otherPics == "") {
		return;
	}
	
	var picArray = otherPics.split(',');
	
	for(var i=0; i<picArray.length; i++) {
		if(picArray[i] != "") {
			document.write('<img class="extrapicture" onMouseOver="swapPics(this);" src="../'+picArray[i]+'">');
		}
	}
}


function swapPics(pic) {
	
	
	var temp = new Image();
	temp.src = pic.src;

	var newWidth = temp.width;
	var newHeight = temp.height;
	var bigPic = document.getElementById('picturex');
	//alert('Switch from '+bigPic.src+'\nto '+pic.src);
	/*
	temp.src = bigPic.src;
	document.getElementById('picturex').src=pic.src;
	pic.src=temp.src;//document.write(pic.src);	
	*/
	bigPic.src = pic.src;
	bigPic.width=newWidth;
	bigPic.height=newHeight;
	//alert('Should be '+newWidth+'x'+newHeight);
	//alert('Now '+bigPic.src+' at '+bigPic.width+'x'+bigPic.height);
}


function siblingLink(actualText, replacementText) {

  if(actualText.length > 9) {
     document.write(actualText); 
  } else {
	 document.write('  ');
  }
}


function showStatus(status) {
	var imgName;
	
	if(status == "") { return; }
	
	else if(status == "h") { imgName = "hot2.gif"; }
	
	else if(status == "bd") { imgName = "bigdogs.gif"; }
	
	else if(status == "n") { imgName = "new.jpg"; }
	

	document.write('<img src="../pimg/'+imgName+'">');
}
