// JavaScript Document

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}


window.onload = function(e) {
	var browser = navigator.appName;
	if (browser=="Microsoft Internet Explorer") {
		if (document.documentElement.clientWidth >= 960 ) {
			setActiveStyleSheet('ie1024');
		} else {
			setActiveStyleSheet('ie760');
		}
	}
}

window.onresize = function(e) {
	var browser = navigator.appName;
	if (browser=="Microsoft Internet Explorer") {
		if (document.documentElement.clientWidth >= 960 ) {
			setActiveStyleSheet('ie1024');
		} else {
			setActiveStyleSheet('ie760');
		}
	}
}

function split_popup(url)
{
window.open(url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=760, height=480")
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//** ##################################################################################
function navigation(formName,selectBoxName){
	
	//alert(formName + ' ' + 	selectBoxName);

 	var w = eval("document." + formName + "." + selectBoxName + ".selectedIndex");
 
 	var url_add = eval("document. "+ formName + "." + selectBoxName +".options[w].value");
 	
	//alert(url_add); 
 	
	eval("document." +  formName + ".submit()");
	// window.location.href = url_add;
}

//** ##################################################################################
function confirmRemove(){

	var agree = confirm("Are you sure you want to remove this record?\n\n Warning: This will erase the record completely from the database");
	
	if (agree) {
		return true;
	} else {
		return false;
	}

}

//** ##################################################################################
function nav(){
  	 var w = document.form1.ws_year.selectedIndex;
  	 var year = document.form1.ws_year.options[w].value;
	 //alert(year);
	 document.form1.submit();
  	 // window.location.href = url_add;
}

//** ##################################################################################
function toggleDiv(divid){
	if(document.getElementById(divid).style.display == 'none'){
      document.getElementById(divid).style.display = 'block';
    }else{
      document.getElementById(divid).style.display = 'none';
   
  }
	
}


