function reDo() { 
 window.location.reload(); 
 } 

window.onresize = reDo;

//Define global variables
var timerID = null;
var timeron = false;
var timecount = 1000;
// Change this to the time delay that you desire
var what = null;
var newbrowser = true;
var check = false;

function init() { 
	showMenuOption();
 if (document.layers) { 
 layerRef="document.layers"; 
 styleSwitch=""; 
 visibleVar="show"; 
 what ="ns4"; 
 } 
 else if(document.all) { 
 layerRef="document.all"; 
 styleSwitch=".style"; 
 visibleVar="visible"; 
 what ="ie4"; 
 } 
 else if(document.getElementById) { 
 layerRef="document.getElementByID"; 
 styleSwitch=".style"; 
 visibleVar="visible"; 
 what="dom1"; 
 } 
 else { 
 what="none"; 
 newbrowser = false; 
 } 
check = true; 
}
 
function findPosition( oLink ) {
  if( oLink.offsetParent ) {
    for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
      posX += oLink.offsetLeft;
      posY += oLink.offsetTop;
    }
    return [ posX, posY ];
  } else {
    return [ oLink.x, oLink.y ];
  }
}

// Toggles the layer visibility on 
function showLayer(layerName) {
	
 if(check) { 
 if (what =="none") { 
 return; 
 } 
 else if (what == "dom1") {
 document.getElementById(layerName).style.visibility="visible"; 
 } 
 else { 
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"'); 
 } 
 } 
 else { 
 return; 
 } 
 } 
// Toggles the layer visibility off 
function hideLayer(layerName) { 
 if(check) { 
 if (what =="none") { 
 return; 
 } 
 else if (what == "dom1") {
 document.getElementById(layerName).style.visibility="hidden"; 
 } 
 else { 
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); 
 } 
 } 
 else { 
 return; 
 } 
 } 

//function hideAll() { 
// hideLayer('mymenu'); 
 //Put all layers used in the nav here. 
 //Copy the hideLayer() function above. 
 //} 

function startTime() { 
 if (timeron == false) { 
 timerID=setTimeout( "hideAll()" , timecount); 
 timeron = true; 
 } 
 } 

function stopTime() { 
 if (timeron) { 
 clearTimeout(timerID); 
 timerID = null; 
 timeron = false; 
 } 
 } 

function onLoad() { 
 init(); 
 } 
 
 function modalDialog(html, divid, classname, top, left, width) { 
	promptbox = document.createElement('div'); 
	promptbox.setAttribute ('id' , divid) ;
	document.getElementsByTagName('body')[0].appendChild(promptbox);
	document.getElementById(divid).className= classname;
	var dump;
	dump = "document.getElementById(\""+divid+"\").style";
	//document.write(dump);
	css = eval(dump);
	promptbox = css;
	promptbox.position = 'absolute'; 
	promptbox.top = top;
	promptbox.visibility = 'hidden';
	promptbox.left = left;
	promptbox.width = 100;
	promptbox.height = 50;
	document.getElementById(divid).innerHTML = html;
	return promptbox;
}



