// JavaScript Document. They claim the scripts have runtime errors. check this out.

//this is the main navigation drop down.

sfHover = function() {
	var sfEls = document.getElementById("main_navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

	
function clearField(){if(this.value==this.defaultValue) this.value='';}
/*this is where the computer classes' secret popup will go. Mrs. G has diabled this now.*/
function secretLayer(){
	$('#container').append('<div class=\"secret\"></div>');
	if ('div.secret'){
	 	$('div.secret').hide();
		$('div.secret').html('<span class=\"hide_button\"><a href=\"#\">X</a></span><img src=\"images/pow.png\" width=\"300\" height=\"200\" /><br />Want to see what students are learning in Web Development?.<br /> Click <a href=\"http://www.wchs-web.com"\"> here!</a>'); /*popup text*/
		if ( window.addEventListener ) {
    	    var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; /*hehe. gets the magic keypresses. */
        	window.addEventListener("keydown", function(e){
                kkeys.push( e.keyCode );
                if ( kkeys.toString().indexOf( konami ) >= 0 ){
						$("div.secret").toggle("fast");
						kkeys = [];
				}
  	     	}, true);
		}
		$("a.show_button").click(function(event){$("div.secret").show("slow");});
	}

	
	$("div.secret > span.hide_button > a").click(function(event){$("div.secret").hide();});
}
function toggleLayer(whichLayer)
{
if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	}
	
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
}

/*This is the rounded corners script */
if(DomCheck()){ 
		DomCorners("main_navigation","images/nav.png", 10);
}


$(document).ready(function(){
	secretLayer();
	if ('#site_map'){
		$("#site_map").click(function(event){$("div#site_map").toggle("normal")});
	}
	$("#search_field").onfocus = clearField;
	$("#primary").prepend("<div id=\"bread\">" + breadcrumb() + "</div>"); /*mixing jquery with javascript*/
	if (window.attachEvent) window.attachEvent("onload", sfHover);

});

// JavaScript Document. This is for the swap image script from the 2007 site layout. Go to the 2007 folder on the remote server to see what it does.


<!-- hide from old browsers
	  /*function swapImage() { 
				theImages = new Array(
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f2.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f3.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f4.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f5.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f6.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f7.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f8.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/top_main_photo_f9.jpg"); 
			whichImage = Math.floor(Math.random()*theImages.length); 
			document.write('<IMG SRC="' +theImages[whichImage]+ '">'); 
			} 
//-->*/

<!-- hide from old browsers 
	  function swapImage2() { 
				theImages2 = new Array(
"http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f2.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f3.jpg", "http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f4.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f5.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f6.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f7.jpg",
"http://www.mcps.k12.md.us/schools/churchillhs/images/right_photo_f8.jpg"); 
			whichImage2 = Math.floor(Math.random()*theImages2.length); 
			document.write('<IMG SRC="' +theImages2[whichImage2]+ '">'); 
			} 
//-->
 <!-- hide from old browsers
 
 //This is for the Did you Know box on the right side--updates the date automatically each day.
  function GetDay(intDay){
    var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                         "Thursday", "Friday", "Saturday")
    return DayArray[intDay]
    }

  function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
    }
  function getDateStrWithDOW(){
    var today = new Date()
    var todayStr = GetDay(today.getDay()) + ", "
    todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
    return todayStr
    }
//-->

//i really want to know what this does

 <!-- hide from old browsers
function toggleLayer(whichLayer)
{
if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	}
	
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
}
//-->

