var brow=navigator.appName;
if (brow=="Netscape")
	brow="NN";
else brow="IE";
var agent=navigator.userAgent;
if (agent.indexOf("Opera")!=-1)
	brow="Opera";
var ver=parseInt(navigator.appVersion);
if (brow=="IE")
	ver=parseInt(agent.substring(agent.indexOf("MSIE")+4, agent.indexOf("MSIE")+8));
if (brow=="Opera" || ver>4){
    //set expire time for cookie to one year
	var date = new Date();   
    date.setTime(date.getTime()+(365*24*60*60*1000));   
    var expires = " expires=" + date.toGMTString() + ";";   
	
	var cookietemp = document.cookie;
	var urlstring = new String(window.location.search);
	var textSize = new String("");
	var css = new String("");
	//alert(cookietemp);
	if (urlstring.indexOf('textSize')>0) {
		textSize = urlstring.substring(urlstring.indexOf('textSize')+9,urlstring.length );
	}
	if (urlstring.indexOf('css')>0) {
		css = urlstring.substring(urlstring.indexOf('css')+4,urlstring.length );
	}

	//alert(textSize);
	//alert(css);
	//alert(cookietemp.indexOf('Stylesheet'));
	// select text size normal, large or extra large
	if (textSize=='') {
		if (cookietemp.indexOf('Stylesheet')>=0) {
			//alert("read cookie");
			textSize = cookietemp.substring(cookietemp.indexOf('Stylesheet')+11,cookietemp.indexOf('Stylesheet')+13);
			//alert(textSize);
		} else {
			//alert("set cookie to default");
			textSize = "no";
			document.cookie = "Stylesheet=no; path=/;" + expires
		}
	} else {
		if (textSize=='normal') {
			textSize='no';
		} else if (textSize=='larger'){
			textSize='la';
		} else if (textSize=='largest'){
			textSize='xl';		
		}
	}
	// select css regular or high contrast
	if (css=='') {
		if (cookietemp.indexOf('css')>=0) {
			//alert("read cookie");
			css = cookietemp.substring(cookietemp.indexOf('css')+4,cookietemp.indexOf('css')+6);
			//alert(css);
		} else {
			//alert("set cookie to default");
			css = "re";
			document.cookie = "css=re; path=/;" + expires
		}
	} else {
		if (css=='regular') {
			css='re';
		} else if (css=='highvis'){
			css='hv';
		}
	}


	//alert("textsize=" + textSize);
	//alert("css=" + css);	
	if (css=="re") {
		
		document.cookie = "css=re; path=/;"  + expires
		if (textSize=="no") {
			document.cookie = "Stylesheet=no; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="normal.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="jobs.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');
		} else if (textSize=="la") {
			document.cookie = "Stylesheet=la; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="large.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="jobs.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');
		} else if (textSize=="xl") {
			document.cookie = "Stylesheet=xl; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="extralarge.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="jobs.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');		
		}
		
	} else if (css=="hv") {
		
		document.cookie = "css=hv; path=/;"  + expires
		if (textSize=="no") {
			document.cookie = "Stylesheet=no; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="normal.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="zoom.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');
		} else if (textSize=="la") {
			document.cookie = "Stylesheet=la; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="large.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="zoom.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');
		} else if (textSize=="xl") {
			document.cookie = "Stylesheet=xl; path=/;"  + expires
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="extralarge.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="screen" href="zoom.css" />');
			document.writeln('<li'+'nk rel="stylesheet" type="text/css" media="print" href="print.css" />');		
		}
	}
}
/*
function popUp(page, width, height){
	win = eval('window.open("' + page + '","popup","width='+width+',height='+height+', resizable, scrollbars=no")');
	win.focus();
}
function clearInput(box,text){
if (box.value==text)
	 box.value="";
}

function deleteObj(ID, obj){
	var msg;
	if (obj == 'E')
		msg = 'Are you sure you want to delete this employment record?';
	if (obj == 'M')
		msg = 'Are you sure you want to delete this membership record?';
	if (obj == 'Q')
		msg = 'Are you sure you want to delete this qualification record?';
	if (obj == 'U')
		msg = 'Are you sure you want to close your registration?';
	if (obj == 'A')
		msg = 'Are you sure you want to delete this email alert?';
		
	if (confirm(msg))
		window.location.href = 'delete.asp?ID=' + ID + '&obj=' + obj;

}*/
