
// this is the common file for the StoneLane Orchard website


/* 
All Scripts in this file: copyright 2004 by Brent Scott - ScottMedia.
These scripts may not be used without expressed permission of the author. 
Contact Brent Scott - brent@scott-media.com 
*/

document.cookie = "pagehit="+0;

function popupwindres(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=0,width=760,height=460,left = 132,top = 109');");
}

/*begin script added by terri*/
//Hide status bar msg script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

//configure status message to show
var statusmsg=""

function hidestatus(){
window.status=statusmsg
return true
}
/*end script added by terri*/


// Displays errors from the e-newsletter sign up form.
function signUpError(val)
{
	if (val > "") alert (val);
}



var site_check = true;
var NN_check = false;
var page_loaded = false;

if ((using_layers)&&(!NN_check)){
	alert('You are using the older Netscape 4 browser. This site should still be functional, but the appearance of the site may not be as intended.');
	NN_check = true;
}

if (!dhtml) {
  alert('You are using a non-standard or older browser.\n As a result, the layout of this page will not appear correctly, and many DHTML features will not work.\n Upgrade or use a different browser to take advantage of all this page\'s features.')
}

    if (using_layers == 1) {
        origWidth=self.innerWidth;
        origHeight=self.innerHeight;
		
    }
//image preloader

function setLoad() {
	page_loaded = true;
}

    // if using Netscape, reload the page if window size changes
    function reloadPage() {
        if (using_layers == 1) {
            if ((origWidth != self.innerWidth) || 
                (origHeight != self.innerHeight)) {
                self.location.reload();
            }
        }
    }

   if (using_layers == 1) onresize = reloadPage;



function imageswap(pic,inout,nested) {
  if (document.images) {
	if (using_layers == 1) {
      if (inout == 1) {
        document.layers[nested].document.images[pic].src = 'images/'+pic+'_ov.jpg';
	  }
	  else {
	    document.layers[nested].document.images[pic].src = 'images/'+pic+'.jpg';
	  }	  
	}
    else {
	  if (inout == 1) {
	    document.images[pic].src = 'images/'+pic+'_ov.jpg';
	  }
	  else {
	    document.images[pic].src = 'images/'+pic+'.jpg';
	  }
	}
  }
}

menu_array = new Array();
menu_array[0] = "menu1";
/*
menu_array[1] = "menu2";
menu_array[2] = "menu3";
menu_array[3] = "menu4";
menu_array[4] = "menu5";
menu_array[5] = "menu6";
menu_array[6] = "menu7";
menu_array[7] = "menu8";
menu_array[8] = "menu9";
menu_array[9] = "menu10";
*/

var isactive = false;
var glo_obj = "";	
var htimer;
var parental = "mainbox"

function showhide(obj,onlink) {
  // Forced this to true to work with the randomizer script. (B.K.)
  page_loaded = true;

 
// if((dhtml)&&(page_loaded)){
  fixed_obj = getObject(obj,parental,1);
  glo_obj = obj;	
  if (onlink) {

	clearTimeout(htimer);


  for (i=0; i < menu_array.length; i++) {
		temp_obj = getObject(menu_array[i],parental,1);
		if (temp_obj != null) {
			temp_obj.visibility = "hidden";
		}

	}
	

	if (fixed_obj != null) {
//		tempfixed = String(fixed_obj);
//		alert(tempfixed);
		fixed_obj.visibility = "visible";
	}
	isactive = true

  }

  if (!onlink) {
		  
	isactive=false;
	layerTimer()

  }
//    }
}
function layerCheck(flag) {
	if((dhtml)&&(page_loaded)){
		if (flag) {
			//alert('checking layer');
		    isactive = true;
			clearTimeout(htimer);
		}
		else {
			isactive = false;
    		layerTimer();
		}
	}
}
function layerTimer() {
	htimer = setTimeout("hideMenu()",300);
}

function hideMenu() {
	if (!isactive) {
		fixed_obj = getObject(glo_obj,parental,1);
		if (fixed_obj != null) {
			fixed_obj.visibility = "hidden";
		}
	}
}

function changeClass(obj,classn){
	if(page_loaded){
 		obj.className = classn;
	}
} 
