function submedia()
{
var n= document.f.media.value;
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( document.f.firstname.value == "" )
    {
	alert( "Please enter your first name." );
	document.f.firstname.focus();
	return false;
    }
    else if( document.f.lastname.value == "" )
    {
	alert( "Please enter your last name." );
	document.f.lastname.focus();
	return false;
    }
    else if( emailID.value==null || emailID.value=="" )
    {
	alert( "Please Enter your Email Address" );
	emailID.focus();
	return false;
    }
    else if( echeck( emailID.value ) == false )
    {
	alert( "You have entered an invalid email address. Please re-enter it." );
	emailID.focus();
	return false;
    }
    else if( document.f.street.value == "" )
    {
	alert( "Please enter your street address." );
	document.f.street.focus();
	return false;
    }
    else if( document.f.city.value == "" )
    {
	alert( "Please enter your city." );
	document.f.city.focus();
	return false;
    }
    else if( document.f.zip.value == "" )
    {
	alert( "Please enter your zipcode." );
	document.f.zip.focus();
	return false;
    }
    else if( document.f.state.value == "" )
    {
	alert( "Please select the state you are in." );
	document.f.state.focus();
	return false;
    }
    else if( document.f.phone.value == "" )
    {
	alert( "Please enter your phone number." );
	document.f.phone.focus();
	return false;
    }
    else if( document.f.terms.checked == false )
    {
	alert("You must agree with the Terms and Conditions in order to continue.");
	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( form )
{
  if( form.servicetype.value == "" )
  {
	alert( "Please select a service type" );
	form.servicetype.focus();
	return( false );
  }
  else if( form.priority.value == "" )
  {
	alert( "Please select a priority" );
	form.priority.focus();
	return( false );
  }
  else if( form.capacity.value == "" )
  {
	alert( "Please select a capacity" );
	form.capacity.focus();
	return( false );
  }
  else if( form.quantity.value == "" )
  {
	alert( "Please select a quantity" );
	form.quantity.focus();
	return( false );
  }
  else if( form.media.value == "" )
  {
	alert( "Please select a media type" );
	form.media.focus();
	return( false );
  }
  else if( form.systype.value == "" )
  {
	alert( "Please select a sytem type" );
	form.systype.focus();
	return( false );
  }
  else if( form.sysop.value == "" )
  {
	alert( "Please select an operating system" );
	form.sysop.focus();
	return( false );
  }
  else if( form.terms.checked == false )
  { 
	alert("Please agree with the Terms and Conditions.");
	form.terms.focus();
	 return( false );
  }
 
   return( true );
}

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