function eqHeight(elem1,elem2)	{
	//(lnav,inner_hd_background)

	var sumH = 301;
	$('#innercontent').children().each(function() { 
  sumH += $(this).height();
	});
	
	var sumL = 700;
	$('div.nav').each(function() { 
  sumL += $(this).height();
	});
	
	//establish height as absolute minimum
	var minHeight = sumL > sumH ? sumL : sumH;
	
	$(elem1).css({'height': minHeight + 20});
	$(elem2).css({'height': minHeight + 20});
	
}

function printCurrentPage(){

	window.open ("?section="+document.getElementById("sessionSection").innerHTML+"&page="+document.getElementById("sessionPage").innerHTML+"&print=true");

}

columnCheck = setInterval("eqHeight('#lnav','#inner_hd_background');", 200);

function changeLinks(id){

		if(document.getElementById("pngType").value == 'pngAlpha'){
		
			//fix png images
		for(var i=0; i<document.images.length; i++)
   			{
      			var img = document.images[i]
      			var imgName = img.src.toUpperCase()
      			if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
         			var imgID = (img.id) ? "id='" + img.id + "' " : ""
         			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         			var imgStyle = "display:inline-block;" + img.style.cssText 
         			if (img.align == "left") imgStyle = "float:left;" + imgStyle
         			if (img.align == "right") imgStyle = "float:right;" + imgStyle
         			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         			var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         			img.outerHTML = strNewHTML
         			i = i-1
      			}
   			}
		
		}
	
		$('#innercontent div a').each(function(index) {
			//alert(index + ': ' + $(this).text());
		
			if($(this).hasClass('mailto'))
				{
					$(this).attr('href', '#');
					$(this).attr('alt', 'email ' + $(this).attr('rel'));
					$(this).attr('title', 'email ' + $(this).attr('rel'));
					$(this).click(function(){OpenEmail($(this).attr('rel'), $(this).attr('rev'));});		
				}else{
					if($(this).attr('rel') && $(this).attr('rev')){
						$(this).attr('href', '#');	
						$(this).attr('href', '#/' + $(this).attr('rel') + '/' + $(this).attr('rev'));
						$(this).click(function(){browse($(this).attr('rel'),$(this).attr('rev'));});
					}//end onclick
				}
		
		});

}//end function

function IsNumeric(sText)

{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

function ql_browse(href){
	if(href.substring(0,7) == "http://"){
		window.location = href;
	}else{
		var splitResult = href.split("/");
		window.location.hash = "/" + splitResult[0] + "/" + splitResult[1];
		browse(splitResult[0],splitResult[1]);
	}
}

function browse(section,page,pagebgcolor,textcolor){
		
	if(section != document.getElementById('sessionSection').innerHTML){
		//var props = {};
		//props["backgroundColor"] = '#' + pagebgcolor;
		//$('body').animate(props, 2000, 'swing');
		var prev = document.getElementById('section').innerHTML; 
		
		if($('#' + section).hasClass('invisible')) {
			$('#' + section).removeClass('invisible').addClass('visible');
			$('#' + prev).removeClass('visible').addClass('invisible');
			
			if($('#div_' + section + '_body')){

				document.getElementById('section').innerHTML = section; 
				
				if($('#div_' + prev + '_body')){
					$('#div_' + section + '_body').show();
					$('#div_' + prev + '_body').hide();
				}else{
					$('#div_' + section + '_body').show();
				}
			}
		}
	}

	document.getElementById("sessionSection").innerHTML = section;
	document.getElementById("sessionPage").innerHTML = page;								
	
	if($('#div_' + document.getElementById("section").innerHTML + '_body')){
			
		var li_list=$('#div_' + document.getElementById("section").innerHTML + '_body li');//array containing the LI elements within the previous section UL
	
		for (var x=0; x<li_list.length; x++){ //loop through each LI
			$('#'+li_list[x].getAttributeNode("id").value).removeClass('selected').addClass('unselected');				
		}//end turning off previous 
			
	}//end if 
			
	$('#li_' + page).removeClass('unselected').addClass('selected');
			
	var url = '/safety/includes/pages/content/' + section + '/' + page + '.cfm?newpage=' + page;

	if(url != document.getElementById('status').innerHTML){
					//alert(url);		
		document.getElementById('status').innerHTML = url;


		if(section == page){
			$.address.value(section);
		}else{
			$.address.value(section + '/' + page);
		}
		//Google Analytics
    	pageTracker._trackPageview("/"+section+"/"+page+".cfm");
	}//end if the clicked link doesn't lead to this same page
}//end function: browse

$.address.change(function(event) {  
    var url_hash = event.value;
    if(url_hash.lastIndexOf('/') == 0){
    	url_hash += '/' + url_hash.substring(1);	
    }
    $('#innercontent').load('/safety/includes/pages/content/' + url_hash + '.cfm', function(){
    		eqHeight('#lnav','#innercontent');
    		changeLinks('#innercontent');
    	});
});

function imgOn(id, extension) {
	if(!pngAlpha){
	document.getElementById(id).src = '/safety/graphics/' + id + '_over' + extension;}
}

function imgOff(id, extension) {
if(!pngAlpha){	document.getElementById(id).src = '/safety/graphics/' + id + extension;}
}
   
function setCookie(name,value,days) {
	if (days) {
   	 var date = new Date();
     date.setTime(date.getTime()+(days*24*60*60*1000));
     var expires = ";expires="+date.toGMTString();
    }else{
   	 expires = "";
    }
    document.cookie = name+"="+value+expires+";path=/";
}

function readCookie(name) {
	var needle = name + "=";
    var cookieArray = document.cookie.split(';');
    for(var i=0;i <cookieArray.length;i++) {
  	  var pair = cookieArray[i];
      while (pair.charAt(0)==' ') {
  	    pair = pair.substring(1, pair.length);
      }
      if (pair.indexOf(needle) == 0) {
  	    return pair.substring(needle.length, pair.length);
      }
    }
 	return null;
 }
      
// Browser Detect  v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser engine name
   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

   // browser name
   this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIcab        = (ua.indexOf('icab') != -1); 
   this.isAol         = (ua.indexOf('aol') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirefox     = (ua.indexOf('firefox/') != -1 || ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // rendering engine versions
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   }
   else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   }
   else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetect();

// if IE5.5+, IE6 on Win32, then display PNGs with AlphaImageLoader
if ((browser.isIE55 || browser.isIE6x) && browser.isWin32) {
	var pngAlpha = true;
// else, if the browser can display PNGs normally, then do that
} else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin	&& browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac	&& browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIE6up) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isSafari) || (browser.isDreamcast)) {
	var pngNormal = true;
}

/* functions to synthesize and e-mail address and load a form (or a mailto:
   url on the fly when a USER clicks a form button
   created by Jim Lewis with form window programmed by Adam Critchley
   10/2006
   Modified 10/30/06 by Lewis to accept specific form label message and to specify specific box width, if none given, defaults to width in SendMail class style
   Modified 01/10/07 by Adam to dynamically build string used for input tag based on whether fwidth or addstyle have been defined
*/
function OpenEmail(nam1,nam2) 
{
  var prefix;
  //nam2 for a work study is "" so following IF is O.K.
  if (nam2 == ""){
	 prefix = nam1;
  //   lastpart="lonestar.utsa.edu";
 }else {
 	 prefix = nam1+'.'+nam2;
     
  }
  lastpart="utsa.edu";
  var site='http://www.utsa.edu/safety/includes/pages/mailto.htm?mail='+prefix+'%40'+lastpart+'&name='+nam1+'%20'+nam2;
  window.open( site , 'SendEmail','resizable=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,width=500,height=300');	
}

function myPadDate( num )
	{
		if( num < 10 )
		{
			num = "0" + num;
		}
		
		return num;
	}

	function myGetDate()
	{
		var currentTime = new Date();
		var day = myPadDate( currentTime.getDate() );
		var month = myPadDate( currentTime.getMonth() + 1 );
		var year = currentTime.getFullYear();
        var hour = myPadDate( currentTime.getHours() );
        var minute = myPadDate( currentTime.getMinutes() );
        var second = myPadDate( currentTime.getSeconds() );
        return (month+"/"+day+"/"+year+"_"+hour+":"+minute+":"+second);
	}

	function performSubmit()
	{
		var myBuilding = document.bioform.building.value;
		
		if( document.bioform.generator.value.length < 1 )
		{
			alert( "Please provide the Name of the Generator.");
			document.bioform.generator.focus();
		}
		else if( document.bioform.emailaddress.value.length < 1 )
		{
			alert( "Please provide your email address.");
			document.bioform.emailaddress.focus();
		}
		else if(!isEmail(document.bioform.emailaddress.value) )
		{
			alert( "Your email address appears to be incorrectly formatted.");
			document.bioform.emailaddress.focus();
		}
		else if( document.bioform.phone.value.length < 1 )
		{
			alert( "Please provide a way for Contacting the Generator.");
			document.bioform.phone.focus();
		}
		else if( document.bioform.numboxes.value.length < 1 )
		{
			alert( "Please indicate the number of boxes.");
			document.bioform.numboxes.focus();
		}
		else if( document.bioform.room.value.length < 1 )
		{
			alert( "Please provide the Room where the Biohazard is to be picked up.");
			document.bioform.room.focus();
		}
		else if( myBuilding.length < 1 )
		{
			alert( "Please provide the Building where the Biohazard is to be picked up.");
			document.bioform.building.focus();
		}
		else
		{
			document.bioform.submitButton.disabled = true;
			document.bioform.submitButton.value = "Submitting...";
			document.bioform.building.value = myBuilding.toUpperCase();
            document.bioform.date.value = myGetDate();
            document.bioform.submit();
        }
	}
function mySubmit()
	{
		var myBuilding = document.hazform.building.value;
		
		if( document.hazform.generator.value.length < 1 )
		{
			alert( "Please provide the Name of the Generator.");
			document.hazform.generator.focus();
		}
		else if( document.hazform.emailaddress.value.length < 1 )
		{
			alert( "Please provide your email address.");
			document.hazform.phone.focus();
		}
		else if(!isEmail(document.hazform.emailaddress.value) )
		{
			alert( "Your email address appears to be incorrectly formatted.");
			document.hazform.phone.focus();
		}
		else if( document.hazform.phone.value.length < 1 )
		{
			alert( "Please provide a way for Contacting the Generator.");
			document.hazform.phone.focus();
		}
		else if( document.hazform.numboxes.value.length < 1 )
		{
			alert( "Please indicate the number of boxes.");
			document.hazform.numboxes.focus();
		}
		else if( document.hazform.room.value.length < 1 )
		{
			alert( "Please provide the Room where the Chemical is to be picked up.");
			document.hazform.room.focus();
		}
		else if( document.hazform.chemicals.value.length < 1 )
		{
			alert( "Please provide the Name and Concentrations of the Chemicals.");
			document.hazform.chemicals.focus();
		}
		else if( myBuilding.length < 1 )
		{
			alert( "Please provide the Building where the Chemical is to be picked up.");
			document.hazform.building.focus();
		}
		else
		{
			document.hazform.submitButton.disabled = true;
			document.hazform.submitButton.value = "Submitting...";
			document.hazform.building.value = myBuilding.toUpperCase();
            document.hazform.date.value = myGetDate();
            document.hazform.submit();
        }
	}
	
	
function hideOthers(element_id){
	
	$(element_id).removeClass("info_row");
		$('.info_row').hide();
	$(element_id).addClass("info_row");
	
}

function activateTD(element_id){
	
	if($('.activeTD').length){
	$('.activeTD').style.backgroundColor='';
	$('.activeTD').removeClass("activeTD");}
	$(element_id).addClass("activeTD");
	//alert($(element_id).attr("id"));
	$(element_id).style.backgroundColor='#F47321';

}

function OHPriskassessSubmit(){

//alert("Submit");

	var fields = $('input');
	var list = "";
	var errors = 0;
	for (var i in fields){
	
		switch(fields[i].type)
		{
		case "text":
			if(fields[i].value=="" && (fields[i].name == "UTEID" || fields[i].name == 
			"Last_name" || fields[i].name == 
			"First_name" || fields[i].name == 
			"Date_of_birth" || fields[i].name == 
			"Job_title" || fields[i].name == 
			"Supervisor" && fields[i].name != 
			"Email")){
			
				list += fields[i].name.replace(/_/g, " ") + " is required. \r\n";
				errors++;
				
			}
			break;
			
		
		case "checkbox":
		
			if((fields[i].name == "ack_risk_exposure" || fields[i].name == 
			"ack_mandatory_participation") && fields[i].checked == false ){
			
				list += "You must fully complete the Acknowledgement and Waiver statement. \r\n";
				errors++;
				
			}
		
		
		break;
		
		}
	}
	
	
		if(document.ohpform.gender[0].checked == false && document.ohpform.gender[1].checked == false) {
	
		list += "Please specify your gender. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.formaldehyde_exposure[0].checked == false && document.ohpform.formaldehyde_exposure[1].checked == false) {
	
		list += "Please specify whether you handle or are exposed to formaldehyde. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.blood_exposure[0].checked == false && document.ohpform.blood_exposure[1].checked == false) {
	
		list += "Please specify whether you work with human or non-human primate blood, tissue or cells. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.infectious_agent_exposure[0].checked == false && document.ohpform.infectious_agent_exposure[1].checked == false) {
	
		list += "Please specify whether you work with any infectious agents. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.biotoxin_exposure[0].checked == false && document.ohpform.biotoxin_exposure[1].checked == false) {
	
		list += "Please specify whether you work with biological toxins. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Anesthetic_gas_exposure[0].checked == false && document.ohpform.Anesthetic_gas_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Anesthetic gases. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Antineoplastic_exposure[0].checked == false && document.ohpform.Antineoplastic_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Anti-neoplastic Drugs. \r\n";
			errors++;
		
	}
	
	if(document.ohpform.Carcinogen_exposure[0].checked == false && document.ohpform.Carcinogen_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Carcinogens. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Highly_Toxic_Chemical_exposure[0].checked == false && document.ohpform.Highly_Toxic_Chemical_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Highly Toxic Chemicals. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Heavy_Metal_exposure[0].checked == false && document.ohpform.Heavy_Metal_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Heavy Metals. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Mutagens_Teratogen_exposure[0].checked == false && document.ohpform.Mutagens_Teratogen_exposure[1].checked == false) {
	
		list += "Please specify whether you work with Reproductive Hazards: Mutagens/Teratogens. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.heavy_machinery[0].checked == false && document.ohpform.heavy_machinery[1].checked == false) {
	
		list += "Please specify whether you work with Heavy Machinery. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.noisy_environment[0].checked == false && document.ohpform.noisy_environment[1].checked == false) {
	
		list += "Please specify whether you work in a Noisy Environment. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.class3b4_lasers[0].checked == false && document.ohpform.class3b4_lasers[1].checked == false) {
	
		list += "Please specify whether you work with Class 3b or 4 Lasers. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.radiation_producing_devices[0].checked == false && document.ohpform.radiation_producing_devices[1].checked == false) {
	
		list += "Please specify whether you work with Radiation Producing Devices. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Radioisotopes[0].checked == false && document.ohpform.Radioisotopes[1].checked == false) {
	
		list += "Please specify whether you work with Radioisotopes. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.radioactive_materials_handling_frequency[0].checked == false && document.ohpform.radioactive_materials_handling_frequency[1].checked == false && document.ohpform.radioactive_materials_handling_frequency[2].checked == false && document.ohpform.radioactive_materials_handling_frequency[3].checked == false) {
	
		list += "Please specify your Radioactive Materials Handling Frequency. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.animal_waste_exposure[0].checked == false && document.ohpform.animal_waste_exposure[1].checked == false) {
	
		list += "Please specify whether you are exposed to Animal Waste. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.sharps_exposure[0].checked == false && document.ohpform.sharps_exposure[1].checked == false) {
	
		list += "Please specify whether you are exposed to Needles/Scalpels/Sharps. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.latex_allergy[0].checked == false && document.ohpform.latex_allergy[1].checked == false) {
	
		list += "Please specify whether you are allergic to latex. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Animal_contact[0].checked == false && document.ohpform.Animal_contact[1].checked == false) {
	
		list += "Please specify whether you have contact with animals. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Insect_contact[0].checked == false && document.ohpform.Insect_contact[1].checked == false) {
	
		list += "Please specify whether you have contact with insects. \r\n";
		errors++;
		
	}
	
	if(document.ohpform.Plant_contact[0].checked == false && document.ohpform.Plant_contact[1].checked == false) {
	
		list += "Please specify whether you have contact with potentially harmful plants or fungi. \r\n";
		errors++;
		
	}
			
	if(document.ohpform.participation_choice[0].checked == false && document.ohpform.participation_choice[1].checked == false && document.ohpform.participation_choice[2].checked == false) {
	
		list += "Please select a participation choice. \r\n";
		errors++;
		
	}
	
	//var reg = new RegExp("^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$");
	
	//if(!regIsEmail(document.ohpform.Email.value)){
	
	//	list += "Your email address appears to be invalid. \r\n";
		//errors++;
	
	//}
	
	//if(!regIsEmail(document.ohpform.supervisorEmail.value)){
	
	//	list += "The supervisor email address appears to be invalid. \r\n";
	//	errors++;
	
	//}
				
	if(errors > 0) {
		alert("Attention: " + errors + " errors found. \r\n\r\n" + list + "\r\n Please correct and re-submit.");
	}else{
		document.ohpform.submitButton.disabled = true;
		document.ohpform.submitButton.value = "Submitting...";
		document.ohpform.date.value = myGetDate();
        document.ohpform.submit();
        document.ohpform.submitButton.disabled = false;
	}
}

function isEmail(email){
        return /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/.test( email );
}
