function validate_email ( )
{
    valid = true;
    if ( document.myform.Customer_Name.value == "" )
    {
        alert ( "Please fill in your Name." );
        document.myform.Customer_Name.focus();
        return false;
    }
    if ( document.myform.Email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.myform.Email.focus();
        return false;
    }
    if ( document.myform.Comments.value == "" )
    {
        alert ( "Please fill in the Comments field." );
        document.myform.Comments.focus();
        return false;
    }
}

function validate_email2 ( )
{
    valid = true;
    if ( document.myform2.Customer_Name.value == "" )
    {
        alert ( "Please fill in your Name." );
        document.myform2.Customer_Name.focus();
        return false;
    }
    if ( document.myform2.Email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.myform2.Email.focus();
        return false;
    }
    if ( document.myform2.Comments.value == "" )
    {
        alert ( "Please fill in the Comments field." );
        document.myform2.Comments.focus();
        return false;
    }
    if ( document.myform2.cap.value == "" )
    {
        alert ( "Please fill in the SPAM Guard." );
        document.myform2.cap.focus();
        return false;
    }

}

function checkName() {
      if (document.valid.address.value=="" || document.valid.address.value==" Product Search") {
         alert("You must enter an email address before submitting");
         return false;
      }
   }

function clearDefaultandCSS(el) {
	if (el.defaultValue==el.value) el.value = ""
	// If Dynamic Style is supported, clear the style
	if (el.style) el.style.cssText = ""
}

function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address Format")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

 		 return true
	}



function ValidateForm(){
	var emailID=document.myform.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please make sure you have entered a vaild email address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function ValidateForm2(){
	var emailID=document.myform2.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please make sure you have entered a vaild email address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

 function ValidateForm3(){
	var emailID=document.myform3.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please make sure you have entered a vaild email address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


x = 420;
y = 40;

function ShowPromo(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
function movePromo(obj)
{
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	setTimeout("movePromo('promolayer')",500);
}

window.onLoad = setTimeout("movePromo('promolayer')",500);



