function validate_required(field,alerttxt)
{
	with (field)
	{
		if (value==null||value=="")
			{alert(alerttxt);return false}
		else {return true}
	}
}

function toggleLayer(whichLayer)
{
	 if (document.getElementById)
	 {
		  // this is the way the standards work
		  var style2 = document.getElementById(whichLayer).style;
		  style2.display = style2.display? "":"block";
	 }
	 else if (document.all)
	 {
		  // this is the way old msie versions work
		  var style2 = document.all[whichLayer].style;
		  style2.display = style2.display? "":"block";
	 }
	 else if (document.layers)
	 {
		  // this is the way nn4 works
		  var style2 = document.layers[whichLayer].style;
		  style2.display = style2.display? "":"block";
	 }
}

function toggleLayer2(whichLayer)
{
	 if (document.getElementById)
	 {
		  // this is the way the standards work
		  var style2 = document.getElementById(whichLayer).style;
		  style2.display = style2.display? "":"inline";
	 }
	 else if (document.all)
	 {
		  // this is the way old msie versions work
		  var style2 = document.all[whichLayer].style;
		  style2.display = style2.display? "":"inline";
	 }
	 else if (document.layers)
	 {
		  // this is the way nn4 works
		  var style2 = document.layers[whichLayer].style;
		  style2.display = style2.display? "":"inline";
	 }
}

	function verifyPW(field1, field2, result_id, match_html, nomatch_html) {
	 this.field1 = field1;
	 this.field2 = field2;
	 this.result_id = result_id;
	 this.match_html = match_html;
	 this.nomatch_html = nomatch_html;
	
	 this.check = function() {
	
	   // Make sure we don't cause an error
	   // for browsers that do not support getElementById
	   if (!this.result_id) { return false; }
	   if (!document.getElementById){ return false; }
	   r = document.getElementById(this.result_id);
	   if (!r){ return false; }
	
	   if (this.field1.value != "" && this.field1.value == this.field2.value) {
		 r.innerHTML = this.match_html;
	   } else {
		 r.innerHTML = this.nomatch_html;
	   }
	 }
	}
	//Gets the browser specific XmlHttpRequest Object
	function getXmlHttpRequestObject() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest(); //Not IE
		} else if(window.ActiveXObject) {
			return new ActiveXObject("Microsoft.XMLHTTP"); //IE
		} else {
			//Display your error message here. 
			//and inform the user they might want to upgrade
			//their browser.
			alert("Your browser doesn't support the XmlHttpRequest object.  Better upgrade to Firefox or IE 6+.");
		}
	}			

function confirmSubmit(message)
	{
	var agree=confirm(message);
	if (agree)
		return true ;
	else
		return false ;
	}