
var whichPicInPopUp='';
//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=250;

/////No need to edit beyond here

		var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

		function showit(which){
			clear_delayhide()
			thecontent=(which==-1)? "" : submenu[which]
			if (document.getElementById||document.all)
				menuobj.innerHTML=thecontent
			else if (document.layers){
				menuobj.document.write(thecontent)
			menuobj.document.close()
			}
		}

		function resetit(e){
			if (document.all&&!menuobj.contains(e.toElement))
				delayhide=setTimeout("showit(-1)",delay_hide)
			else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
				delayhide=setTimeout("showit(-1)",delay_hide)
		}

		function clear_delayhide(){
			if (window.delayhide)
				clearTimeout(delayhide)
		}

		function contains_ns6(a, b) {
			while (b.parentNode)
				if ((b = b.parentNode) == a)
					return true;
					return false;
		}
		
		function show_cart_items() {
		     if (GetCookie("NumberOrdered") == null) {
			   return ('no items in the cart');
			 }else if (GetCookie("NumberOrdered") == '1') {
			   return ('1 item in the cart');
			 }else{
			   return (GetCookie("NumberOrdered")+ ' items in the cart');
			 }
			 
		}
		
		function displayPrice(numb){
  			if (parseFloat(numb)){
    			if (numb== Math.round(numb)){
      				return ( numb + ".00")
    			}
    			else {
      				numb=(numb + "0");
      				return (numb.substring(0,(numb.indexOf(".")+3)))
    			}
  			}
  			else{
    			return "0.00"
  			}
		}
		
		function show_product(productID) {
		  
		    var disprice=getDiscountAll(productID);
			var defaultcurrency="AUD";
			document.write ('<td valign="top" align="center"><table border="0" width="1"><tr><td width="1">&nbsp;</td>');
            document.write ('<td align="center" class="productdetails">');
	    	document.write ('<a href="javascript:popitup(\''+productID[8]+'\', \''+productID[7]+'\',\''+productID[9]+'\',\''+productID[1]+'\')"><img src="'+imagepath+productID[3]+'" BORDER=0></a><BR>');
			document.write ('<a href="javascript:popitup(\''+productID[8]+'\', \''+productID[7]+'\',\''+productID[9]+'\',\''+productID[1]+'\')"><img src="'+imagepath+'largeviewbutton.gif" border="0"></a><BR>');
			document.write ('</td><td width="1">&nbsp;</td></tr><tr><td width="1">&nbsp;</td><td align="center" class="productdetails">'+productID[1]+'<br><br></td><td width="1">&nbsp;</td></tr>');
	    	document.write ('<tr><td width="1">&nbsp;</td><td align="center" class="productdetails">'+productID[2]+'<br><br></td><td width="1">&nbsp;</td></tr><tr><td width="1">&nbsp;</td><td align="center" class="productdetails">');
			//prodprice =  (0.1*productID[4])+ productID[4];
			
			document.write ('AUD$'+ productID[4] +' incl GST<BR>');
			//Adds a link to convert currency
			document.write ('<A HREF="#" onclick=FiebaCustomPopUp(2064231774,'+ productID[4] +',"AUD",null); >Convert Currency</A><BR>');
			
			if (productID[6] == "SOLD") {
			  //if the item is sold just display sold
		      document.write ('<font COLOR="red">' +productID[6] + '</font>');
			} else {
			 //if the item is in stock then display price, discount, and set up fields and buttons
			  if (productID[4] != disprice) {
			    document.write ('<font COLOR="red">Discounted AUD$'+ displayPrice(disprice) +' incl GST</font><BR>');
			  }
			  document.write (productID[6]);
			  document.write ('<P><FORM NAME=order>');
        	  //document.write ('Quantity:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    		  //document.write ('<input type=text size=2 maxlength=3 name=QUANTITY onChange="this.value=CKquantity(this.value)" value="1">'); 	
			  if (productID[4] != disprice) {
			    document.write ('<input type=hidden name="PRICE" value="'+ displayPrice(disprice) +'">');
			  } else {
			    document.write ('<input type=hidden name="PRICE" value="'+ productID[4] +'">');
			  }
    		  document.write ('<input type=hidden name="NAME" value="'+ productID[1] +'">');
    		  document.write ('<input type=hidden name="ID_NUM" value="'+ productID[0] +'">');
    		  document.write ('<input type=hidden name="SHIPPING" value="'+ productID[5] +'">');
    		  document.write ('<input type=button value="  Add to Cart  " onClick= "AddToCart(this.form);">');
    		  document.write ('</FORM>');
			  }
		
	 	    document.write ('</td><td width="1">&nbsp;</td></tr></table></td>');	
		}
		
		function show_product_with_popup_description(productID,pWidth,pHeight) {
		  
		    var disprice=getDiscountAll(productID);
			
			document.write ('<td valign="top"><table border="0" width="100%"><tr>');
            document.write ('<th colspan="4" align="center" class="productdetails">');
	    	document.write ('<a href="javascript:popitup_with_description(\''+productID[8]+'\', \''+productID[7]+'\',\''+productID[9]+'\',\''+productID[1]+'\',\''+productID[2]+'\',\''+productID[4]+'\',\''+productID[6]+'\','+pWidth+','+pHeight+','+disprice+');"><img src="'+imagepath+productID[3]+'" BORDER=0></a><BR>');
			document.write ('<a href="javascript:popitup_with_description(\''+productID[8]+'\', \''+productID[7]+'\',\''+productID[9]+'\',\''+productID[1]+'\',\''+productID[2]+'\',\''+productID[4]+'\',\''+productID[6]+'\','+pWidth+','+pHeight+','+disprice+');"><img src="'+imagepath+'largeviewbutton.gif" border="0"></a><BR>');
			document.write ('</th></tr><tr><td width="20%">&nbsp;</td><td width="60%" align="center" class="productdetails">'+productID[1]+'<br><br>');
	    	//document.write (productID[2]+'<BR>');
			//prodprice =  (0.1*productID[4])+ productID[4];
			
			document.write ('AUD$'+ productID[4] +' incl GST<BR><BR>');
			//Adds a link to convert currency
			document.write ('<A HREF="#" onclick=FiebaCustomPopUp(2064231774,'+ productID[4] +',"AUD",null); >Convert Currency</A><BR>');
			
			if (productID[6] == "SOLD") {
			  //if the item is sold just display sold
		      document.write ('<font COLOR="red">' +productID[6] + '</font>');
			  document.write ('</td><td width="20%">&nbsp;</td></tr><tr><th colspan="4" align="center" class="productdetails">&nbsp;');
			} else {
			 //if the item is in stock then display price, discount, and set up fields and buttons
			  if (productID[4] != disprice) {
			    document.write ('<font COLOR="red">Discounted AUD$'+ displayPrice(disprice) +' incl GST</font><BR>');
			  }
			  document.write (productID[6]);
			  document.write ('<P><FORM NAME=order>');
        	  //document.write ('Quantity:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    		  //document.write ('<input type=text size=2 maxlength=3 name=QUANTITY onChange="this.value=CKquantity(this.value)" value="1">'); 	
			  if (productID[4] != disprice) {
			    document.write ('<input type=hidden name="PRICE" value="'+ displayPrice(disprice) +'">');
			  } else {
			    document.write ('<input type=hidden name="PRICE" value="'+ productID[4] +'">');
			  }
    		  document.write ('<input type=hidden name="NAME" value="'+ productID[1] +'">');
    		  document.write ('<input type=hidden name="ID_NUM" value="'+ productID[0] +'">');
    		  document.write ('<input type=hidden name="SHIPPING" value="'+ productID[5] +'">');
			  document.write ('</td><td width="20%">&nbsp;</td></tr><tr><th colspan="4" align="center" class="productdetails">');
    		  document.write ('<input type=button value="  Add to Cart  " onClick= "AddToCart(this.form);">');
    		  document.write ('</FORM>');
			  }
		
	 	    document.write ('</th></tr></table></td>');	
		}

		//-----------------------------------------------
		// Dynamic Content 2.0                          |
		//  Now supports IE, NS4, NS6                   |
		// (c) 2002 Premshree Pillai                    |
		// Web : http://www.qiksearch.com               |
		// E-mail :premshree@hotmail.com                |
		// Use freely as long as this message is intact |
		//-----------------------------------------------
		// Location of script : http://www.qiksearch.com/javascripts/dynamic-content20.htm
		
		var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
		var ns6=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
		var ns4=document.layers;
		
		function showContent(content)
		{
		 if(ie4)
		 {
		  showContentObj=document.all.qiksearch_div;
		 }
		 if(ns6)
		 {
		  showContentObj=document.getElementById("qiksearch_div");
		 }
		 if(ie4||ns6)
		 {
		  if(showContentObj.innerHTML!=content)
		  {
		   showContentObj.innerHTML=content;
		  }
		  else
		  {
		   showContentObj.innerHTML="";
		  }
		 }
		 if(ns4)
		 {
		  document.nsdiv.document.write(content);
		  document.nsdiv.document.close();
		 }
		}   
  
		function popitup(imageURL1,imageURL2,imageURL3,imageTitle) {
		    var bodystr="";
		    day = new Date();
            id = day.getTime();
			
		    if (imageURL2=="") {
			  if (imageURL3=="") {
			  //one image to display
			  newwindow2=window.open('','name','height=420,width=460');
			  newwindow2.resizeTo(460,420);
			  //eval("page"+id+" = window.open('','name','height=420,width=460');");
			  bodystr='<table bgcolor="#ffffff"><tr><td><img src="'+imagepath+imageURL1+'" border="0"></td></tr>';
              }
			} else {
			  if (imageURL3=="") {
			    //two images to display
			    newwindow2=window.open('','name','height=900,width=460');
				newwindow2.resizeTo(460,900);
				//eval("page"+id+" = window.open('','name','height=900,width=460');");
			    bodystr='<table bgcolor="#ffffff"><tr><td align="center"><img src="'+imagepath+imageURL1+'" border="0"></td></tr>' +
			                                   '<tr><td align="center"><img src="'+imagepath+imageURL2+'" border="0"></td></tr>';
			  } else {
			    //three images to display
			    newwindow2=window.open('','name','height=900,width=460,scrollbars=1');
				newwindow2.resizeTo(460,900);
				//eval("page"+id+" = window.open('','name','height=900,width=460,scrollbars=1');");
			    bodystr='<table bgcolor="#ffffff"><tr><td align="center"><img src="'+imagepath+imageURL1+'" border="0"></td></tr>'+
				         '<tr><td align="center"><img src="'+imagepath+imageURL2+'" border="0"></td></tr>' +
						 '<tr><td align="center"><img src="'+imagepath+imageURL3+'" border="0"></td></tr>';
			  }						   
			}
			
			var tmp = newwindow2.document;
			//eval("var tmp = "+"page"+id+".document;");
			tmp.write('<html><head><title>'+imageTitle+'</title>');
			tmp.write('<link rel="stylesheet" type="text/css" href="'+homepath+'popupboxstyle.css">');
			tmp.write('</head><body bgcolor="#ffffff" onLoad="window.focus();">');
			tmp.write(bodystr);
			tmp.write('</table>');
			tmp.write('</body></html>');
			tmp.close();
			
		}
		
		function popitup_with_description(imageURL1,imageURL2,imageURL3,imageTitle,productDesc,productPrice,productSOLD,pWidth,pHeight,disprice) {
		    var bodystr="";
			var leftPos=0;
			var topPos=0;
		    var wDimensions="top="+topPos+",left="+leftPos+",height="+pHeight+",width="+pWidth+",scrollbars=1";
			day = new Date();
            id = day.getTime();
		
		    if (imageURL2=="") {
			  if (imageURL3=="") {
			  //one image to display
			  newwindow2=window.open('','name',wDimensions);
			  newwindow2.resizeTo(pWidth,pHeight);
			  //eval("page"+id+" = window.open('','name','"+wDimensions+"');");
			  bodystr='<table bgcolor="#ffffff" border="0">'+
			          '<tr><td colspan="3" align="center"><img src="'+imagepath+imageURL1+'" border="0"></td>';
              }
			} else {
			  if (imageURL3=="") {
			    //two images to display
			    newwindow2=window.open('','name',wDimensions);
				newwindow2.resizeTo(pWidth,pHeight);
				//eval("page"+id+" = window.open('','name','"+wDimensions+"');");
			    bodystr='<table bgcolor="#ffffff" border="0">'+
				        '<tr width="100%"><td colspan="3" align="center"><img src="'+imagepath+imageURL1+'" border="0"><br><br>' +
			            '<img src="'+imagepath+imageURL2+'" border="0"></td>';
			  } else {
			    //three images to display
			    newwindow2=window.open('','name',wDimensions);
				newwindow2.resizeTo(pWidth,pHeight);
				//eval("page"+id+" = window.open('','name','"+wDimensions+"');");
			    bodystr='<table bgcolor="#ffffff" border="0">'+
				        '<tr><td colspan="3" align="center" width="1"><img src="'+imagepath+imageURL1+'" border="0"><br><br>'+
				        '<img src="'+imagepath+imageURL2+'" border="0"><br><br>' +
						'<img src="'+imagepath+imageURL3+'" border="0"></td>';
			  }						   
			}
			
			var tmp = newwindow2.document;
			//eval("var tmp = "+"page"+id+".document;");
			tmp.write('<html><head><title>'+imageTitle+'</title>');
			tmp.write('<link rel="stylesheet" type="text/css" href="'+homepath+'popupboxstyle.css">');
			tmp.write('</head><body bgcolor="#ffffff" onLoad="window.focus();">');
			tmp.write(bodystr);
			tmp.write('<td width="20">&nbsp;</td><td align="left" height="100%" width="100%"><table height="100%" width="100%" border="0"><tr><td><b>'+imageTitle+'</b><br><br>'+productDesc.substring(0,productDesc.length)+'<br><br>AUD$'+productPrice+' incl GST<br><hr size="1" color="#999999" width="100%">');
			if (productSOLD == "SOLD") {
			  //if the item is sold just display sold
		      tmp.write('<font COLOR="red">'+productSOLD+'</font><br>');
			} else {
			 //if the item is in stock then display price, discount, and set up fields and buttons
			  if (productPrice != disprice) {
			    tmp.write('<font COLOR="red">Discounted AUD$'+displayPrice(disprice)+' incl GST</font><br><br>');
			  }
			}
			
			//tmp.write('<hr size=1 noshade color="#999999">');
			tmp.write('</td></tr><tr valign="bottom"><td align="right"><a href="javascript:self.close()">[close]</a></td></tr></table></td><td width="20">&nbsp;</td></tr>');
			tmp.write('</table>');
			tmp.write('</body></html>');
			tmp.close();
			
		}
		
		function popUp(URL,vwidth,vheight) {
         day = new Date();
         id = day.getTime();
         eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+vwidth+",height="+vheight+"');");
        }
		
		function showEmail() {
		  return "sales&#64;ms-cranberi&#46;com";
		}
		
		function sendMailToSales() {
		 oName = "sales";
		 oDomain= "ms-cranberi.com";
		 email="mailto:" + oName + "@" + oDomain;
		
		 window.location=email;
		
		}