function submedia()
{
//alert();
var n= document.f.media.value;
//alert(n);
if(n=="Digital Device - Mobile")
{
//alert();
document.f.media1.style.visibility="visible";
document.f.media1.disabled = false;
}
else
{
document.f.media1.style.visibility="hidden";
document.f.media1.disabled = true;
}
}


function otherstate()
{
//alert();
var n= document.f.country.value;
//alert(n);
if(n=="Other")
{
//alert();
document.f.state1.style.visibility="visible";
document.f.state1.disabled = false;
/*document.f.state.style.visibility="hidden"; */
document.f.state.selectedIndex=0;
document.f.state.disabled = true;
document.f.country1.style.visibility="visible";
document.f.country1.disabled = false;
}
else if(n=="USA")
{
/*document.f.state.style.visibility="visible";*/
document.f.state.disabled = false;
document.f.state1.style.visibility="hidden";
document.f.state1.disabled = true;
document.f.state.selectedIndex=0;

document.f.country1.style.visibility="hidden";
document.f.country1.disabled = true;

document.f.country1.value="";
document.f.state1.value="";

}

else if(n=="CANADA")
{
/*document.f.state.style.visibility="visible";*/
document.f.state.disabled = false;
document.f.state1.style.visibility="hidden";
document.f.state1.disabled = true;
document.f.state.selectedIndex=68;
document.f.country1.style.visibility="hidden";
document.f.country1.disabled = true;

document.f.country1.value="Enter Country";
document.f.state1.value="Enter State";
}
}

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 ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr-1){
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1){
		    alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

 		 return true					
	}


function checkform(f)

{
  var emailID=document.f.email;
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false){
		//emailID.value="";
		emailID.focus();
		return false;
	}  
  
  if(document.f.terms.checked==false)
  { 
  alert("Please agree with the Terms and Conditions.");
  document.f.terms.focus();
	 return false;
	 
  }
 
   return (true);
}

function checkform1(f2)

{
  var emailID=document.f2.email;
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false){
		//emailID.value="";
		emailID.focus();
		return false;
	}  
  
   return (true);
}

function checkform2(f)

{
  if(document.f.terms.checked==false)
  { 
  alert("Please agree with the Terms and Conditions.");
  document.f.terms.focus();
	 return false;
	 
  }
 
   return (true);
}

function hide()
{
	alert("sSS");
}