
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/


		
var menuwidth='75px' //default menu width
var menubgcolor='#FAF2EB'  //menu bgcolor
var disappeardelay=100  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

function declareArray(menu)
{
	var menu=new Array();
	return menu;
}

function addToArray(menu, item, filename)
{
	x = menu.length;
	menu[x]='<a href=' + filename + '>' + item + '</a>';
	return menu;
}


//Contents for customer care menu
var menu_cc=new Array()
menu_cc[0]='<a href="/index.php?dest=privacy">privay policy</a>'
menu_cc[1]='<a href="/index.php?dest=shipping">shipping info</a>'
menu_cc[2]='<a href="/index.php?dest=return">return policy</a>'
menu_cc[3]='<a href="/index.php?dest=orderstatus">order status</a>'
menu_cc[4]='<a href="/index.php?dest=preorder">pre-order</a>'
menu_cc[5]='<a href="/index.php?dest=contact">contact us</a>'
/////No further editting needed

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

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" 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 showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

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){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
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){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
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 (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)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu



/***********************************************
* Validate forms javascripts/
***********************************************/

// whitespace characters
var whitespace = " \t\n\r";

// Check whether string s is empty.
function isEmpty(s)
  { return ((s == null) || (s.length == 0)) }
  
function isWhitespace (s)
      {
           var i;

           // Is s empty?
           if (isEmpty(s)) return true;

           // Search through string's characters one by one
           // until we find a non-whitespace character.
           // When we do, return false; if we don't, return true.

           for (i = 0; i < s.length; i++)
           {
                // Check that current character isn't whitespace.
                var c = s.charAt(i);

                if (whitespace.indexOf(c) == -1) return false;
           }

           // All characters are whitespace.
           return true;
      }

  
function ForceEntry(val, str) {
           var strInput = new String(val.value);
           if (isWhitespace(strInput)) {
                alert(str);

                return false;
           } else
                return true;

      }
      
function ValidateRanking() {
           // This function ensures document.forms[0].nRanking.value >=1 && <= 10

           if (parseInt(document.forms[0].nRanking.value) >= 1 && parseInt(document.forms[0].nRanking.value) <=10)
                return true;
           else
                return false;
      }     
      
      
function validateTextData(i,j,str) {
           var CanSubmit = false;
           // Check to make sure that the full name field is not empty.
           CanSubmit = ForceEntry(document.forms[i].elements[j],str);
           return CanSubmit;

     }
     
function validateSelectData() {

	
	       // Check to make sure ranking is between 1 and 10
           if (CanSumbit) CanSubmit = ValidRanking();
           return CanSubmit;
	}
function validateStock(str) {
		var CanSubmit = true;
		if (document.forms[str].elements[0].value == 0)
			{	
				CanSubmit = false;
				alert ("This item is in back order. Please check back in a few days to see if it's back in stock.");
			};
		return CanSubmit;	

	}

function turnBlockOn(tid) {
document.getElementById(tid).style.display = "";
}


function turnBlockOff(tid) {
document.getElementById(tid).style.display = "none";
}






  
function checkForm2AutoSelect(element1,value1)				// this function will auto-select the options in the select forms
	{
		for(var i=0; i < element1.options.length; i++)
			{
				if(element1.options[i].value == value1)
					{
						element1.options[i].selected = true;	
					}
			}
	}
  

function openInfoWindow (url,name,features)
	{
		window.open (url, name, features);

	}
  
  
<!-- This script prevent right click on the webpage -->

function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("copy & paste are disabled");
return false;
}
return true;
}

// document.onmousedown=right;
// document.onmouseup=right;
// if (document.layers) window.captureEvents(Event.MOUSEDOWN);
// if (document.layers) window.captureEvents(Event.MOUSEUP);
// window.onmousedown=right;
// window.onmouseup=right;
<!-- End of right click prevention script -->  
   
function goToExpressCheckout(ship)
{
	location.href="https://www.forestandzoe.com/paypalexpresscheckout.php?action=start&ship="+ship;
}
  
  
function randomImage()
{
	var ran_number=Math.round(Math.random()*3);
	switch (ran_number)
	{
	case 0:
		document.write("<img src='/images/home_pix0.jpg' width='529' height='424' style='border-width:0px; margin:0px;' usemap='#pic0' alt='homepix' />")
		break
	case 1:
		document.write("<img src='/images/home_pix1.jpg' width='529' height='424' style='border-width:0px; margin:0px;' usemap='#pic1' alt='homepix' />")
		break
	case 2:
		document.write("<img src='/images/home_pix2.jpg' width='529' height='424' style='border-width:0px; margin:0px;' usemap='#pic2' alt='homepix' />")
		break
	case 3:
		document.write("<img src='/images/home_pix3.jpg' width='529' height='424' style='border-width:0px; margin:0px;' usemap='#pic3' alt='homepix' />")
		break
	}
}  
  

function addRegistry(price, name, link)
{
	alert(document.addtocart.inv_id.value);
	alert (price);
	alert (name);
	alert (link);


}
    
  
  
  
  
