if(window.ActiveXObject){
	var isIE=1;
}else{
	var isIE=0;
}



var menutimer;
var i;
function show_menu(x){
	clearTimeout(menutimer);
	for(i=0;i<13;i++){
		if(document.getElementById('menu_'+i)){
			if(i == x){
				document.getElementById('menu_'+i).style.visibility='visible';
			}else{
				document.getElementById('menu_'+i).style.visibility='hidden';
			}
		}
		if(i == x){
			document.getElementById('nav_'+i+'_cell').style.backgroundColor='#999999';
		}else{
			document.getElementById('nav_'+i+'_cell').style.backgroundColor='#666665';
		}
	}
}
function hide_menu(x){
	menutimer=setTimeout("wipe("+x+")",400);
}
function wipe(x){
	clearTimeout(menutimer);
	if(document.getElementById('menu_'+x)){
		document.getElementById('menu_'+x).style.visibility='hidden';
	}
	document.getElementById('nav_'+x+'_cell').style.backgroundColor='#666665';
}



if(isIE){
	var window_width=window.screen.width;
}else{
	var window_width=window.innerWidth;
}



var nav_left_position=(((window_width - 768) / 2) + 130);
document.write("<STYLE>.NavMenu{left:"+nav_left_position+"px;}</STYLE>");
//alert(nav_left_position);




function loginlink(){
	document.write("<A HREF=\"/login.html\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">log in</A>");
}

function editlogout(x,y){
	document.write("<A HREF=\"/logout.html\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">log out</A>&nbsp;|&nbsp;");
	document.write("<A HREF=\"/admin.html\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">site administration</A>");
	if(y>0){
		document.write("&nbsp;|&nbsp;<span STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#cccccc;text-decoration:underline;\">edit page</span>");
	}else{
		document.write("&nbsp;|&nbsp;<A HREF=\"/nce/index.html?url="+x+"\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">edit page</A>");
	}
}

function editlogout_demo(x,y){
	document.write("<A HREF=\"/logout.html\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">log out</A>&nbsp;|&nbsp;");
	document.write("<span STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#cccccc;text-decoration:underline;\">site administration</span>");
	if(y>0){
		document.write("&nbsp;|&nbsp;<span STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#cccccc;text-decoration:underline;\">edit page</span>");
	}else{
		document.write("&nbsp;|&nbsp;<A HREF=\"/nce/index.html?url="+x+"\" STYLE=\"font-family:arial,geneva,sans-serif;font-size:9px;color:#50626b;\">edit page</A>");
	}
}



// validation for the "Site Eval" form at the bottom of the template
function evalformCheck(form){
	if(!form.name.value){
		alert("ERROR:\n\nPlease enter your name in the spae provided.");
		return false;
	}
	if(!form.email.value){
		alert("ERROR:\n\nPlease enter your email address in the spae provided.");
		return false;
	}
	if(!form.phone.value){
		alert("ERROR:\n\nPlease enter your phone number in the spae provided.");
		return false;
	}
	
	return true;
}