// JavaScript Document

var currentdiv = null;
var timerID = null;
ns4 = (document.layers)? true:false;
ie4 = (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 (ie4) {
		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 (ie4) {
		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 (ie4) {
		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" />');
}

function makeMenu() {
	document.write('<div id="menubar">');
  document.write('<div class="menuleftpad">&nbsp;</div>');
  document.write('<div class="menuitem"><a href="index.html" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">Home</a></div>');
  document.write('<div class="divider" style="background-color:#006600"></div>');
  document.write('<div class="menuitem"><a href="history.html" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">History</a></div>');
  document.write('<div class="divider" style="background-color:#f5ac10"></div>');  
  document.write('<div class="menuitem">');
  document.write('<DIV ID="submenu_programs" class="submenu" onMouseOver="clearAll()" onMouseOut="hideAll4()">');
  document.write('<a href="programs_fullday.html">Full Day Preschool</a><br>');
  document.write('<a href="programs_morning.html">Morning Program</a><br>');
  document.write('<a href="programs_kindergarten.html">Kindergarten</a><br>');
  document.write('<a href="programs_afterschool.html">After School Program</a><br>');
document.write('</DIV>');
document.write('<a href="#" ONMOUSEOVER="hideAll3();showObject(\'submenu_programs\');return true;" ONMOUSEOUT="hideAll();return true;">Programs</a></div>');
  document.write('<div class="divider" style="background-color:#660000"></div>');
  document.write('<div class="menuitem"><a href="apply.html" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">How to Apply</a></div>');
  document.write('<div class="divider" style="background-color:#99CCFF"></div>');
  document.write('<div class="menuitem"><a href="events.html" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">Special Events</a></div>');
  document.write('<div class="divider" style="background-color:#FF3300"></div>');
  document.write('<div class="menuitem"><a href="LeilaDayCalendar.pdf" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">School Calendar</a></div>');
  document.write('<div class="divider" style="background-color:#999900"></div>');
  document.write('<div class="menuitem"><a href="give.html" ONMOUSEOVER="hideAll3();return true;" ONMOUSEOUT="hideAll();return true;">Give to Leila Day</a></div>');
  document.write('</div>');

}