
// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var timeout2	= 500;
var closetimer	= 0;
var closetimer2	= 0;
var ddmenuitem	= 0;
var ddmenuitem2	= 0;

// open hidden layer
function mopen(id)
{
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
function mopen2(id)
{
	// cancel close timer
	mcancelclosetime2();

	// get new layer and show it
	ddmenuitem2 = document.getElementById(id);
	ddmenuitem2.style.visibility = 'visible';

}



// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	if(ddmenuitem2) ddmenuitem2.style.visibility = 'hidden';
}

function mclose2()
{
	if(ddmenuitem2) ddmenuitem2.style.visibility = 'hidden';
}

function IsNumeric(strString)
   //  check for valid numeric strings
   {
   var strValidChars = "0123456789-+() ";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function emailcheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
		   return false
		 }

		 if (str.indexOf(" ")!=-1){
 		   alert("You have not entered a valid email address.  \n\nPlease check the address and try again.")
                   return false
		 }

 		 return true
	}



// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}
function mclosetime2()
{
	closetimer2 = window.setTimeout(mclose2, timeout);
}




// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
function mcancelclosetime2()
{
	if(closetimer2)
	{
		window.clearTimeout(closetimer2);
		closetimer2 = null;
	}
}


// close layer when click-out
document.onclick = mclose;




<!-- Start of JavaScript code --------
//
// Description: Randomly change background color every 5 seconds
//
// NewcWare 1997
// Author: Scott Newcomer 3/1997
// Email: nuke@bright.net
//

firstTime = true

function setbackground(){

window.setTimeout( "setbackground()", 5000); // 5000 milliseconds delay

if ( firstTime ) {
	index = 1;
	firstTime = false;
	}

if(index == 9){
showGraphic = "trees"; //trees
index=1;
}
if(index == 8){
showGraphic = "newgrass"; //newgrass
index=9;
}
if(index == 7){
showGraphic = "knocker"; //knocker
index=8;
}
if(index == 6){
showGraphic = "grass"; //grass
index=7;
}
if(index == 5){
showGraphic = "door"; //door
index=6;
}
if(index == 4){
showGraphic = "cracks"; //cracks
index=5;
}
if(index == 3){
showGraphic = "icy"; //ice
index=4;
}
if(index == 2){
showGraphic = "brick"; //brick
index=3;
}
if(index == 1){
showGraphic = "blossom"; //blossom
index=2;
}

//document.getElementById("mainGraphic").src = "../images/maingraphic/" + showGraphic + ".jpg";
document.getElementById("mainGraphic").background = "../images/maingraphic/" + showGraphic + ".jpg";

}
// -- End of JavaScript code -------------- -->

