// JavaScript Document
	// Insure that web site is always in the top layered frame
	
	if (top.location !=self.location) {
			top.location=self.location;
	}
	
	// Create array for the days of the week
	// See "date.js" file for date insertion 
	dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	
	// Create array for the months of the year
	// see "date.js" file for date insertion
	monName = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");
	
	// create variable that represents current date
	var now = new Date;
				
	// Create varibles that will be used for the navigation rollovers
	if (document.images) {
		homeOn = new Image;
		homeOff = new Image;
		programsOn = new Image;
		programsOff = new Image;
		jr_scienceOn = new Image;
		jr_scienceOff = new Image;
		linksOn = new Image;
		linksOff = new Image;
		about_usOn = new Image;
		about_usOff = new Image;
		contact_usOn = new Image;
		contact_usOff = new Image;
		
		// point the rollover sources to navigation images for mouseovers and mouseouts
		homeOn.src = "images/home_button_on.gif";
		homeOff.src = "images/home_button_off.gif";
		programsOn.src = "images/the_show_button_on.gif";
		programsOff.src = "images/the_show_button_off.gif";
		jr_scienceOn.src = "images/jr_scientists_button_on.gif";
		jr_scienceOff.src = "images/jr_scientists_button_off.gif";
		linksOn.src = "images/kids_sites_button_on.gif";
		linksOff.src = "images/kids_sites_button_off.gif";
		about_usOn.src = "images/about_us_button_on.gif";
		about_usOff.src = "images/about_us_button_off.gif";
		contact_usOn.src = "images/contact_us_button_on.gif";
		contact_usOff.src = "images/contact_us_button_off.gif";
	}
	
	// Create a function to produce rollover functionality
	function chgImg(imgField,newImg) {
		if (document.images) {
			document[imgField].src = eval(newImg + ".src");
		}
	}	
	
	// Create scripting for rollover menus under "The Show" (Programs)
	var programsMenu = new Array()
		programsMenu[0]='<a href="calendar.html" title="Keep updated on our up-coming shows"><div class="dropmenu">Event Calendar<\/div><\/a>'
		programsMenu[1]='<a href="galleries.html" title="View our Media Gallery"><div class="dropmenu">Media Galleries<\/div><\/a>' 
		programsMenu[2]='<a href="testimonies.html" title="See what others have to say about Professor Cool"><div class="dropmenu">Testimonies<\/div><\/a>'
		programsMenu[3]='<a href="invitation.html" title="Invite us to come to your school\'s, church\'s, or organization\'s function"><div class="dropmenu">Invite Us<\/div><\/a>'
				
	var menubgcolor = '#ffffff';
	var menuwidth = '112px';
	var disappeardelay = 250;
	var hidemenu_onclick = "yes";
	
	var ie4 = document.all
	var ns6 = document.getElementById && !document.all
	
	if(ie4 || ns6) {
		document.write('<div id="mainMenu" style="visibility: hidden; width: ' + menuwidth + '; background-color: ' + menubgcolor + '; text-align: center;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
	}
	
	function getposOffset(what, offsettype) {
		var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop;
		var parentEl = what.offsetParent;
		while (parentEl != null) {
			totaloffset = (offsettype == "left") ? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
			parentEl = parentEl.offsetParent;
		}
		return totaloffset;
	}
		
	function showhide(obj, e, visible, hidden, menuwidth){
		if(ie4 || ns6) {
			dropmenuobj.style.left = dropmenuobj.style.top=-500
		}
		
		if (menuwidth != "") {
			dropmenuobj.widthobj = dropmenuobj.style
			dropmenuobj.widthobj.width = menuwidth
		}
		
		if (e.type == "click" && obj.visibility == hidden || e.type == "mouseover") {
			obj.visibility = visible
		}
		else if (e.type == "click") {
				obj.visibility = hidden
		}
	}
	
	function iecompattest() {
		return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body 
	}
	
	function clearbrowseredge(obj, whichedge) {
		var edgeoffset = 0
		
		if (whichedge == "rightedge") {
			var windowedge = ie4 & !window.opera ? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
			dropmenuobj.contentmeasure = dropmenuobj.offsetWidth
			
			if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) {
				edgeoffset = dropmenuobj.contentmeasure-obj.offsetWidth
			}
		}
		else {
			var windowedge = ie4 && !window.opera ? iecompattest().scrollTop + iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
			dropmenuobj.contentmeasure = dropmenuobj.offsetHeight
			
			if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) {
				edgeoffset = dropmenuobj.contentmeasure+obj.offsetHeight
			}
		}
		return edgeoffset
	}
	
	function populatemenu(what) {
		if (ie4 || ns6) {
			dropmenuobj.innerHTML = what.join("")
		}
	}
	
	function dropdownmenu(obj, e, menucontents, menuwidth) {
		if (window.event) {
			event.cancelBubble = true
		}
		else if (e.stopPropagation) {
				e.stopPropagation()
		}
		
		clearhidemenu()
		dropmenuobj = document.getElementById ? document.getElementById("mainMenu") : mainMenu
		populatemenu(menucontents)
		
		if (ie4 || ns6) {
			showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth) 
			dropmenuobj.x = getposOffset(obj, "left")
			dropmenuobj.y = getposOffset(obj, "top")
			dropmenuobj.style.left = dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
			dropmenuobj.style.top = dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
		}
		return true
	}
	
	function contains_ns6(a, b) {
		while (b.parentNode) {
			if ((b = b.parentNode) == a) {
				return true;
			}
			return false;
		}
	}
	
	function dynamichide(e) {
		if (ie4 && !dropmenuobj.contains(e.toElement)) {
			delayhidemenu()
		}
		else if (ns6 && e.currentTarget != e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget)) {
				delayhidemenu()
		}
	}
	
	function hidemenu(e) {
		if (typeof dropmenuobj != "undefined") {
			if (ie4 || ns6) {
				dropmenuobj.style.visibility = "hidden"
			}
		}
	}
	
	function delayhidemenu(){
		if (ie4 || ns6) {
			delayhide = setTimeout("hidemenu()", disappeardelay)
		}
	}
	
	function clearhidemenu(){
		if (typeof delayhide != "undefined") {
			clearTimeout(delayhide)

		}
	}
	
	if (hidemenu_onclick == "yes") {
		document.onclick = hidemenu
	}
	
	// Script for Google Ads Formatting
	google_ad_client = "pub-2483118194642758";
	google_ad_width = 120;
	google_ad_height = 240;
	google_ad_format = "120x240_as";
	google_ad_type = "text_image";
	google_ad_channel ="";
	google_color_border = "ffffff";
	google_color_bg = "";
	google_color_link = "003366";
	google_color_text = "cc3333";
	google_color_url = "003366";