function searchCheck() 
{
    if (trim(document.search.search.value).length == 0 || trim(document.search.search.value) == ".")
    {
	    alert("Please enter a product or company name to search for.");
	    return false;
    }
}

function EmailAlerts_submit_onClick()
{
	var strCheckedInterest; 
	strCheckedInterest = false;
	
	for(count=0 ; count < nl.elements("typeid").length ; count++)
	{
		if(nl.elements("typeid",count).checked == true)
		{
			strCheckedInterest = true;
		}
	}
	if (strCheckedInterest == false)
	{
		alert("Please select at least one e-mail alert.");
		nl.typeid[0].focus();
		return false;
	}
	if ( trim(nl.email.value).length == 0 )
	{
		alert("Please enter your e-mail address.");
		nl.email.focus();
		return false;
	}
	
	// additional e-mail validations added on 01/31/2005 by Preeti
	if ((nl.email.value.indexOf('@') <= 0) || ((trim(nl.email.value).charAt(trim(nl.email.value).length-4) != '.') && (trim(nl.email.value).charAt(trim(nl.email.value).length-3) != '.')) || (trim(nl.email.value).indexOf(' ') > 0)  || (trim(nl.email.value).indexOf(',') > 0) || (trim(nl.email.value).indexOf(';') > 0) ) 
	{
		alert("Please enter a valid e-mail address.");
		nl.email.focus();
		return false;
	}

	var h_streml = trim(nl.email.value);
	var h_arrchk = h_streml.split("@");
	if ( h_arrchk.length > 2)
	{
		alert("Please enter a single valid e-mail address.");
		nl.email.focus();
		return false;
	}

	nl.submit();
}
