/* Useful Global Variables */
var pageName = document.URL.substring(document.URL.lastIndexOf('/')+1);
var pageNameNoExt = pageName.substring(0, pageName.lastIndexOf('.'));

/* Form Validation */
	function validateContactForm()
	{
		if (document.forms.contactForm.region.value == "!")
		{
			alert("Please select a region from the Regions drop-down.");
			document.forms.contactForm.region.focus();
			return false;
		}
		if (document.forms.contactForm.market.value == "!")
		{
			alert("Please select a market from the Markets drop-down.");
			document.forms.contactForm.market.focus();
			return false;
		}
		if (document.forms.contactForm.technology[0].checked == false
			&& document.forms.contactForm.technology[1].checked == false
			&& document.forms.contactForm.technology[2].checked == false)
		{
			alert("Please choose one or more coating technologies via the checkboxes.");
			//document.forms.contactForm.technology.focus();
			return false;
		}
		if (document.forms.contactForm.name.value == "")
		{
			alert("Please enter your name in the field provided.");
			document.forms.contactForm.name.focus();
			return false;
		}
		if (document.forms.contactForm.email.value == "")
		{
			alert("Please enter your email address in the field provided.");
			document.forms.contactForm.email.focus();
			return false;
		}
		
		return true;
	}


/* Roll-over, pop-up effects */
	function showPanel(id)
	{
		var element = document.getElementById(id);
		if (element != null)
		{
			element.style.display = 'block';
		}
	}

	function hidePanel(id)
	{
		var element = document.getElementById(id);
		if (element != null)
		{
			element.style.display = 'none';
		}
	}
	
	function setImage(id,imgSrc)
	{
		var btnImgElement = document.getElementById(id);
		if (btnImgElement != null)
		{
			btnImgElement.src = imgSrc;
		}
	}	
/* The following is for dynamic MSDS pullups */
function requestMsds(form, item) {
	//var msdsForm = eval('document.'+form);
	var msdsForm = document.forms[ form ];
	msdsForm.item.value = item;
	msdsForm.submit();
}
