

			   
var activeSub=0;
var SubNum=0;

function reDo() { window.location.reload() }

window.onresize = reDo;

//Define global variables

var timerID = null;
var timerOn = false;
var timecount = 1000;
var what = null;
var newbrowser = true;
var initover_flag = false;

function menuinit(){
	if (document.layers) {
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		screenSize = window.innerWidth;
		what ="ns4";
	} else if(document.all) {
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		screenSize = document.body.clientWidth + 18;
		what ="ie";
	} else if(document.getElementById) {
		layerRef="document.getElementByID";
		styleSwitch=".style";
		visibleVar="visible";
		what="moz";
	} else {
		what="none";
		newbrowser = false;
	}
		window.status='CELP';

 

	return(initover_flag = true);
}

// Turns the layers on and off
function showSubnavigator(index) {
	stopTime();
	hideAll();
	showLayer('layer' + index);

	window.status='celpsystems - natural intelligence';
}


// Turns the layers on and off
function showLayer(layerName){
	if(initover_flag){
		if (what =="none"){
			return;
		} else if (what == "moz"){
			document.getElementById(layerName).style.visibility="visible";
		} else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
}

function hideLayer(layerName){
	if(initover_flag){
		if (what =="none") {
			return;
		} else if (what == "moz") {
			document.getElementById(layerName).style.visibility="hidden";
		} else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
}



function hideAll(){
 
  hideLayer('layer1');
 
  hideLayer('layer2');
 
  hideLayer('layer3');
 
}


function startTime() {
	if (timerOn == false) {
		timerID=setTimeout( "hideAll()" , timecount);
 		timerOn = true;
	}
}


function stopTime() {
	if (timerOn) {
 		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

function onLoad(){
	menuinit();
}

 
