function validateForm(el) {

	var bRet = true;

	

	for (ii=0;ii<el.length;ii++) {

		if (el[ii].getAttribute('required')=='yes') {

			if (el[ii].value.length ==0) {

				bRet = false;

				alert('One or more required fields have been left blank. Please complete all required fields and try again.');

				el[ii].focus();

				break;

			}

		}

	}

	return bRet;

}


function checkForm(formName){

	if (validateForm(document.getElementById(formName).elements)==true) {
	//if the form vaildates as true, do something.

		return true;
	} else{
		return false;
	}
}



function toggleVis(popup, type){
	if(document.getElementById(popup).style.display=='none'){
		document.getElementById(popup).style.display=type;
	} else{
		document.getElementById(popup).style.display='none';
	}
}



	function fixPng() {
		if ((version >= 5.5) && (document.body.filters))
		{
		   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" && img.id!='crest_top')
			  {
			 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 + "\');\"></span>"// + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
			 img.outerHTML = strNewHTML
			 i = i-1
			  } else if (img.id=='crest_top') {
			 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 + "\');\"></span>"
			 img.outerHTML = strNewHTML
			 i = i-1
			  }
		   }
		}
	}
