function checkName() {
      if (document.valid.address.value=="" || document.valid.address.value==" 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 = ""
}


top.window.moveTo(0,0);
if (document.all) {
 top.window.resizeTo(screen.availWidth,screen.availHeight);
}else if (document.layers || document.getElementById){
   if (top.window.outerHeight < screen.availHeight || top.window.outerWidth <
screen.availWidth){
       top.window.outerHeight = top.screen.availHeight;
       top.window.outerWidth = top.screen.availWidth;
    }
}



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 valid email address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }



function pass_form ( )
{
    valid = true;
    if ( document.myform.FirstName.value == "" )
    {
        alert ( "Please fill in your First Name." );
        document.myform.FirstName.focus();
        return false;
    }
    if ( document.myform.LastName.value == "" )
    {
        alert ( "Please fill in your Last Name." );
        document.myform.LastName.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 Email Comments." );
        document.myform.Comments.focus();
        return false;
    }
    if ( document.myform.cap.value == "" )
    {
        alert ( "Please fill in the SPAM guard Answer." );
        document.myform.cap.focus();
        return false;
    }


}


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=425,height=380');");
}


function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=600');");
}


   function checkName() {
      if (document.valid.strSearch1.value=="") {
         alert("You must have a value to search for entered before submitting");
         return false;
      }
   }


