/* ----------------------------- BROWSER SNIFFING VARS ----------------------------- */
var agt      = navigator.userAgent.toLowerCase();
var appVer   = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);

var is_opera = (agt.indexOf("opera") != -1);

var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
   is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
   is_major = parseInt(is_minor);
}
var is_ie   = (iePos!=-1);
var is_ie5   = (is_ie && is_major == 5);

var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_ie5up = (is_ie && is_minor >= 5);

// write special styles from sniffer
if (is_mac){
	document.write('<style type="text/css">#tnav { font-size: 10px; }</style>');
}

// drop down menu script
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace("over", "");
   }
   }
  }
 }
}
window.onload=startList;

//popup
function popup(url,title,w,h,r,s,m,t) {
	//if vars aren't provided, use these defaults
	if (title==null) {
		title = 'popup';
	} if (w==null) {
		w=600;
	} if (h==null) {
		h=400;
	} if (r==null) {
		r='yes';
	} if (s==null) {
		s='yes';
	} if (m==null) {
		m='no';
	} if (t==null) {
		t='no';
	}
	vars = 'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+',menubar='+m+',toolbar='+t;
	var newWin = window.open(url,title,vars);
	newWin.focus();
	return false;
}

//toggle view on and off (used in program schedules)
function toggle_view(id) {
	fobj = document.apnc.boxshow;
	pat = eval('/' + id + ',/');
	if (pat.exec(fobj.value)) {
		fobj.value = fobj.value.replace(pat,'');
	} else {
		fobj.value = fobj.value + id + ',';
	}

	var list = document.getElementById(id);
	if (list) {
		//alert(list.style.display);
		if (list.style.display == "none") {
			list.style.display = "block";
		} else {
			list.style.display = "none";
		}			
	}
	return false;
}

function redirect_results(path,formobj) {
	var tmpstr = "1";
	obj = formobj.date.options;
	obj2 = formobj.general_id.options;
	len = obj.length;
	len2 = obj2.length;
	for (var i =0; i < len; i++) {	
		if (obj[i].selected) {			
			tmpstr = tmpstr + '_' + obj[i].value;
			break;
		}	
	}
	for (var i =0; i < len2; i++) {	
		if (obj2[i].selected) {			
			tmpstr = tmpstr + '_' + obj2[i].value;
			break;
		}	
	} 

	redirstr = '' + path + '/0,,' + tmpstr + ',00.html'

	window.location.href = redirstr;

	return false;
}	
function printIt2() {
	var url = document.location.href;

	var printView = window.open(url,'printView','width=680,height=450,location=no,menubar=yes,resize=yes,scrollbars=yes,toolbar=yes');
	printView.focus();
}

function ieFloatFix(headerHeight){
	// do nothing.  this is only here because the call to it is in the prof footer and produces a js error if function doesn't exist.
}
