// JavaScript Document
function check()
	{
		//alert("done");
	if (document.getElementById("firstName").value.split(' ').join('')==""){
		alert("Please, enter your first name");
		document.getElementById("firstName").focus();
		return false;
	}
	if (document.getElementById("lastName").value.split(' ').join('')==""){
		alert("Please enter your last name");
		document.getElementById("lastName").focus();
		return false;
	}
	if (document.getElementById("organization").value.split(' ').join('')==""){
		alert("Please enter organization");
		document.getElementById("organization").focus();
		return false;
	}
	if (document.getElementById("addressOne").value.split(' ').join('')==""){
		alert("Please enter address");
		document.getElementById("addressOne").focus();
		return false;
	}
	if (document.getElementById("city").value.split(' ').join('')==""){
		alert("Please enter city");
		document.getElementById("city").focus();
		return false;
	}
	if (document.getElementById("stateNew").value==""){
		alert("Please enter state");
		document.getElementById("stateNew").focus();
		return false;
	}

	if (document.getElementById("zipCode").value==""){
		alert("Please enter Zip Code");
		document.getElementById("zipCode").focus();
		return false;
	}

	if (document.getElementById("country").value==""){
	alert("Please enter country");
	document.getElementById("country").focus();
	return false;
    }

	if(document.getElementById("email").value=="")
  {
	  alert("Please enter a correct email address");
	  document.getElementById("email").focus();
	  return false;
  } 
   else if (document.getElementById("email").value.length >0)
	 {   		
		 i=document.getElementById("email").value.indexOf("@")
		 j=document.getElementById("email").value.indexOf(".",i)
		 k=document.getElementById("email").value.indexOf(",")
		 kk=document.getElementById("email").value.indexOf(" ")
		 jj=document.getElementById("email").value.lastIndexOf(".")+1
		 len=document.getElementById("email").value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3))
			 {
	
 			}
			else 
			{
				alert("Please enter an exact email address." );
				document.getElementById("email").focus();
				return false;
			}
	}	
}

function checknum(e)
{											//checking numeric keys
	evt=e || window.event;
	var keypressed=evt.which || evt.keyCode;
	//alert(keypressed);
	if(keypressed!="48" &&  keypressed!="49" && keypressed!="50" && keypressed!="51" && keypressed!="52" && keypressed!="53" && keypressed!="54" && keypressed!="55" && keypressed!="8" && keypressed!="56" && keypressed!="57" && keypressed!="45" && keypressed!="46" && keypressed!="37" && keypressed!="39" && keypressed!="9")
	{
 		return false;
	}

}


function fun(num)
{
 switch(num)
 {
 case 1:
		  if (document.getElementById("d1").style.display=="none")
		  {document.getElementById("d1").style.display="block";}
		 else 
		  {document.getElementById("d1").style.display="none";}
 		 break;
 case 2:
		  if (document.getElementById("d2").style.display=="none")
		  {document.getElementById("d2").style.display="block";}
		 else 
		  {document.getElementById("d2").style.display="none";}
		  break;
 }
}


function validation(){
/*if((window.document.getElementById("m_email ").value=="") || (window.document.getElementById("m_email ").value=="Your Email")){
alert("Please enter your email address");
window.document.getElementById("m_email ").focus();
return false;
}*/

if ((window.document.getElementById("m_email ").value=="") || (window.document.getElementById("m_email ").value.length == 0) || (window.document.getElementById("m_email ").value=="Your Email"))
	  {
        alert("Please enter a correct email address");
        window.document.getElementById("m_email ").focus();
		return false;
	  }
	  else if (document.getElementById("m_email ").value.length >0)
	 {   		
		 i=document.getElementById("m_email ").value.indexOf("@")
		 j=document.getElementById("m_email ").value.indexOf(".",i)
		 k=document.getElementById("m_email ").value.indexOf(",")
		 kk=document.getElementById("m_email ").value.indexOf(" ")
		 jj=document.getElementById("m_email ").value.lastIndexOf(".")+1
		 len=document.getElementById("m_email ").value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3))
			 {
	
 			}
			else 
			{
				alert("Please enter an exact email address." );
				document.getElementById("m_email ").focus();
				return false;
			}
	}	

alert("Thank you for subscribing to our Newsletter");
return true;
}
