/*
	copy right Oomph Events Inc. 2006
*/
/*
	The following lines generate the main site menu 
*/
var menuTop=146;
var browserName=navigator.appName;
var broserVersion=navigator.appVersion;

if(browserName == 'Netscape') {
	menuTop = menuTop - 11;
}

new ypSlideOutMenu("about", "down", 90, menuTop, 140, 200);
new ypSlideOutMenu("program", "down", 158, menuTop, 140, 200);
new ypSlideOutMenu("fun", "down", 240, menuTop, 140, 200);
new ypSlideOutMenu("mapgallery", "down", 297, menuTop, 140, 200);
new ypSlideOutMenu("sponsors", "down", 397, menuTop, 140, 200);
new ypSlideOutMenu("register", "down", 555, menuTop, 140, 200);

ypSlideOutMenu.writeCSS();

var selectedMenu = 'undefined';

/*
	The following scripts call the  
	setFooter function when the 
	document is first loaded and 
	when the browser is resized.
*/
window.onload = function() {
  MM_preloadImages('/images/home_2.gif','/images/about_2.gif','main_nav_bar_template_r1_c3_f2.gif','/images/program_2.gif','/images/fun_2.gif','/images/gallery_2.gif','images/sponsor_2.gif','/images/register_2.gif');
  
  if(selectedMenu != 'undefined') {
	MM_swapImage(selectedMenu,'','../images/' + selectedMenu +'2.gif',1);
  }
  setFooter();
  
}
window.onresize = function() {
	 setFooter();
}


/*
	Macromedia geneerated scripts for role over menu
*/
function MM_findObj(n, d) { //v4.01
  var p;
  var i;
  var x;  
  
  if(!d) { 
    d=document; 
  }
  
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  
  if(!(x=d[n])&&d.all) {
    x=d.all[n];
  }
	
  for (i=0;!x&&i<d.forms.length;i++) {
    x=d.forms[i][n];
  }
  
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) {
    x=MM_findObj(n,d.layers[i].document);
  }
  
  if(!x && d.getElementById) {
    x=d.getElementById(n); 
  }
  
  return x;
}
function MM_swapImage() { //v3.0
  var i;
  var j=0;
  var x;
  var a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  
  for(i=0;i<(a.length-2);i+=3) {
   if ((x=MM_findObj(a[i]))!=null){
     document.MM_sr[j++]=x; 
	 if(!x.oSrc) { 
	  x.oSrc=x.src; 
	 }
	 x.src=a[i+2];
	}
  }
}

function MM_swapImgRestore() { //v3.0
  var i
  var x;
  var a=document.MM_sr;
  for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {
	if(x.name != selectedMenu) {
  	  x.src=x.oSrc;
	}
  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/*
	The following function sets the 
	height of the main content area 
	of the web page.
*/
function setFooter() {

	if (document.getElementById) {
	var windowHeight=getWindowHeight();
		if(windowHeight>0){
			var headerElement=document.getElementById('header');
			var headerHeight=headerElement.offsetHeight;
			if(windowHeight-headerHeight>=0) {
				var footerElement=document.getElementById('footer');
				var useableContent=document.getElementById('content');
				var totalContent=document.getElementById('main_content_cell');
				var footerHeight=footerElement.offsetHeight;
				var useableContentHeight=useableContent.offsetHeight;
				var totalContentHeight=useableContentHeight+33;
				footerElement.style.position='relative';
				if(windowHeight-(headerHeight+useableContentHeight)>=0){
					totalContentHeight=windowHeight-headerHeight;
					totalContent.style.height=totalContentHeight+'px';	
					if((totalContentHeight-33)>useableContentHeight){
						footerElement.style.top=totalContentHeight-useableContentHeight-footerHeight+'px';
					}
					else {
						footerElement.style.top=0+'px';
					}
				}
			}
		}
	}
}

/*	
	the following script will retrieve 
	the window height of almost any 
	modern browser correctly:
*/

function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}
	else {
		if (document.documentElement&&
		document.documentElement.clientHeight) {
		windowHeight=document.documentElement.clientHeight;
		}
		else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}


/*
	the following function sets the 
	display property of nested div tag
*/

/*
function toggleDisplayStyle(divElement) {
	var divChild = document.getElementById(divElement); 
	
	for(i=0; i< divElement.childNodes.length; i++) {
		if(divElement.childNodes[i].nodeName == 'DIV'){
			var currentDisplay = divElement.childNodes[i].style.display;
			if(currentDisplay==""){
				divElement.childNodes[i].style.display='block';
			}
			else {
				currentDisplay=='none'?divElement.childNodes[i].style.display='block':divElement.childNodes[i].style.display='none';
			}
		}
	}
	setFooter();
}
*/