// JavaScript Document
// Leiladay.com javascripts, includes a menu and photo-changer script

var currentdiv = null;
var timerID = null;
ns4 = (document.layers)? true:false;
ie6 = (document.all)? true:false;
W3C = document.getElementById ? 1 : 0;

function hideAll(){
 timerID = setTimeout('hideAll2()',3000)
} 

function hideAll4(){
 timerID = setTimeout('hideAll2()',10)
} 

function clearAll(){
 clearTimeout(timerID)
} 

function hideAll2(){
	 if (ns4) {
		eval("document."+currentdiv+".visibility = 'hide'");
	} else if (ie6) {
		eval("document.all."+currentdiv+".style.visibility = 'hidden'");
	} else if (W3C) {
		eval("document.getElementById('"+currentdiv+"').style.visibility = 'hidden'");
	}
} 

function hideAll3(){
clearTimeout(timerID);
  if (currentdiv != null){
	 if (ns4) {
		eval("document."+currentdiv+".visibility = 'hide'");
	} else if (ie6) {
		eval("document.all."+currentdiv+".style.visibility = 'hidden'");
	} else if (W3C) {
		eval("document.getElementById('"+currentdiv+"').style.visibility = 'hidden'");
	}
  }
} 

function showObject(div) {
clearTimeout(timerID);
	 if (ns4) {
		eval("document."+div+".visibility = 'show'");
	} else if (ie6) {
		eval("document.all."+div+".style.visibility = 'visible'");
	} else if (W3C) {
		eval("document.getElementById('"+div+"').style.visibility = 'visible'");
	}
currentdiv = div;
}

function randomphoto() {
	var ran_number=Math.floor(Math.random()*4)+1;
	imagestring = '<img src="images/homephotos/large/' + ran_number + '.jpg" width="284" height="357" alt="Photo" />';
	document.write(imagestring);
	
}

//navigator.appCodeName
strBrowserVersion = navigator.appVersion;
strExtension = ".png";

if (strBrowserVersion.indexOf('MSIE') !=-1)
{
	strStartIE = strBrowserVersion.indexOf('MSIE');
	strIEString = strBrowserVersion.substring((strStartIE+5),(strStartIE+6));
	if ((strIEString*1)<7) {
		strExtension = ".gif";
	}
}

function photocorner() {
	document.write('<img src="images/homephotos/photocorner' + strExtension + '" width="46" height="43" />');
}
