function isValidemail1(emailid){		
		var l=emailid.length;
		if(l==0)
		{
			return false;	
		}
		if(l!=0)
		{
				str = emailid;
				at_the_rate = 0;
				//Check for Space
				for (var i = 0; i < str.length; i++)
				{
						var ch = str.substring(i, i + 1);
						if(ch == "<")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == ">")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == ",")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "?")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "/")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "[")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "]")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "{")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "}")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "(")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == " ") 
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "@") 
						{
							at_the_rate += 1
							
							if(at_the_rate>1)
							{
								alert ("You have entered an invalid email address.");
								return false;
							}
						}
				}
				var a=emailid.indexOf('@');
				var d=emailid.lastIndexOf('.');
				var checkDomain=emailid.indexOf('yahoo.') & emailid.indexOf('gmail.') & emailid.indexOf('aol.') & emailid.indexOf('msn.') & emailid.indexOf('hotmail.') & emailid.indexOf('earthlink.');
				//var checkValiddomain=emailid.indexOf('.com') & emailid.indexOf('.org') & emailid.indexOf('.net') & emailid.indexOf('.gov') & emailid.indexOf('.mil') & emailid.indexOf('.biz') & emailid.indexOf('.info') & emailid.indexOf('.mobi') & emailid.indexOf('.name') & emailid.indexOf('.aero') & emailid.indexOf('.jobs') & emailid.indexOf('.museum') & emailid.indexOf('.edu') & emailid.indexOf('.co.uk') & emailid.indexOf('.co.de') & emailid.indexOf('.co.fr') & emailid.indexOf('.uk') & emailid.indexOf('.de') & emailid.indexOf('.fr') & emailid.indexOf('.ru') & emailid.indexOf('.su') & emailid.indexOf('.bg') & emailid.indexOf('.cn') & emailid.indexOf('.gov.at') & emailid.indexOf('.ac') & emailid.indexOf('.an') & emailid.indexOf('.au') & emailid.indexOf('.be') & emailid.indexOf('.br') & emailid.indexOf('.bs') & emailid.indexOf('.ca') & emailid.indexOf('.ch') & emailid.indexOf('.cl') & emailid.indexOf('.dk') & emailid.indexOf('.dz') & emailid.indexOf('.es') & emailid.indexOf('.nl') & emailid.indexOf('.at') & emailid.indexOf('.pl') & emailid.indexOf('.me') & emailid.indexOf('.pro') & emailid.indexOf('.kz') & emailid.indexOf('.ua') ;
				//alert(checkValiddomain);
				var checkValiddomain=1;
				//alert(checkValiddomain);
				var str1=emailid.substr(0,a);
				var str2=emailid.substr(a+1,d-a-1);
				var str3=emailid.substr(d+1,l);
				var len1=str1.length;
				var len2=str2.length;
				var len3=str3.length;
//				if(checkDomain>0)
//			{
//					alert("You have entered an email account from a free email service or one of the high-volume consumer service providers (i.e. AOL, gmail, Yahoo, MSN, Hotmail, Earthlink, SBC, etc). In an effort to provide you with the best possible access to our products, we require that you enter your corporate email address. Please update your email account below and press the submit button. ");
//					return false;
//				}
				if(checkValiddomain>0)
				{
//					alert("Domain is Correct");
					return true;
				}
				else if (checkValiddomain<0)
				{
//					alert("Domain is Incorrect");
					alert ("You have entered an invalid email address.");
					return false;
				}
				if(a<0 || d<2)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}
				else if (a>d)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}				
				if (len1<=1 || len2<=1 || len3 <=1)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}				
		}
		return true;
}
function isValidemail(emailid){		
		var l=emailid.length;
		if(l==0)
		{
				return false;	
		}
		if(l!=0)
		{
				str = emailid;
				at_the_rate = 0;
				//Check for Space
				for (var i = 0; i < str.length; i++)
				{
						var ch = str.substring(i, i + 1);
						
						if(ch == "<")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == ">")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == ",")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "?")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "/")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "[")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "]")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "{")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "}")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "(")
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == " ") 
						{
							alert ("You have entered an invalid email address.");
							return false;
						}
						if(ch == "@") 
						{
							at_the_rate += 1
							if(at_the_rate>1)
							{
								alert ("You have entered an invalid email address.");
								return false;
							}
						}
				}
				var a=emailid.indexOf('@');
				var d=emailid.lastIndexOf('.');
				var checkDomain=emailid.indexOf('yahoo.') & emailid.indexOf('gmail.') & emailid.indexOf('aol.') & emailid.indexOf('msn.') & emailid.indexOf('hotmail.') & emailid.indexOf('earthlink.');
				//var checkValiddomain=emailid.indexOf('.com') & emailid.indexOf('.org') & emailid.indexOf('.net') & emailid.indexOf('.gov') & emailid.indexOf('.mil') & emailid.indexOf('.biz') & emailid.indexOf('.info') & emailid.indexOf('.mobi') & emailid.indexOf('.name') & emailid.indexOf('.aero') & emailid.indexOf('.jobs') & emailid.indexOf('.museum') & emailid.indexOf('.edu') & emailid.indexOf('.co.uk') & emailid.indexOf('.co.de') & emailid.indexOf('.co.fr') & emailid.indexOf('.uk') & emailid.indexOf('.de') & emailid.indexOf('.fr') & emailid.indexOf('.ru') & emailid.indexOf('.su') & emailid.indexOf('.bg') & emailid.indexOf('.cn') & emailid.indexOf('.gov.at') & emailid.indexOf('.ac') & emailid.indexOf('.an') & emailid.indexOf('.au') & emailid.indexOf('.be') & emailid.indexOf('.br') & emailid.indexOf('.bs') & emailid.indexOf('.ca') & emailid.indexOf('.ch') & emailid.indexOf('.cl') & emailid.indexOf('.dk') & emailid.indexOf('.dz') & emailid.indexOf('.es') & emailid.indexOf('.nl') & emailid.indexOf('.at') & emailid.indexOf('.pl') & emailid.indexOf('.me') & emailid.indexOf('.pro') & emailid.indexOf('.kz') & emailid.indexOf('.ua') ;
				//alert(checkValiddomain);
				var checkValiddomain=1;
				//alert(checkValiddomain);
				var str1=emailid.substr(0,a);
				var str2=emailid.substr(a+1,d-a-1);
				var str3=emailid.substr(d+1,l);
				var len1=str1.length;
				var len2=str2.length;
				var len3=str3.length;
				if(checkDomain>0)
				{
					alert("You have entered an email account from a free email service or one of the high-volume consumer service providers (i.e. AOL, gmail, Yahoo, MSN, Hotmail, Earthlink, SBC, etc). In an effort to provide you with the best possible access to our products, we require that you enter your corporate email address. Please update your email account below and press the submit button. ");
					return false;
				}
				if(checkValiddomain>0)
				{
//					alert("Domain is Correct");
					return true;
				}
				else if (checkValiddomain<0)
				{
//					alert("Domain is Incorrect");
					alert ("You have entered an invalid email address.");
					return false;
				}
				if(a<0 || d<2)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}
				else if (a>d)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}				
				if (len1<=1 || len2<=1 || len3 <=1)
				{
						alert ("You have entered an invalid email address.");
						return false;
				}				
		}
		return true;
}
function textValidate(incomingString, defaultValue)
{
  if(trimSpace(incomingString).length == 0 || incomingString.search(/[^a-zA-Z ]/g) != -1 || incomingString==defaultValue)
  {
    return false;
  }
  else
    return true;
}
function trimSpace(x)
{
  var emptySpace = / /g;
  var trimAfter = x.replace(emptySpace,"");
  return(trimAfter);
}
function alphanumeric(incomingString, defaultValue)
{
  if(trimSpace(incomingString).length == 0 || incomingString.search(/[^0-9a-zA-Z]/g) != -1 || incomingString==defaultValue)
  {
    return false;
  }
  else
    return true;
}
function numberValidate(incomingString, defaultValue)
{
   if(trimSpace(incomingString).length == 0 || incomingString.search(/[^0-9xX ]/g) != -1 || incomingString==defaultValue || parseInt(incomingString, 10) <= 0 )
   {
  return false;
   }
   else
   return true;
}
function numberValidate2(incomingString)
{
  if(trimSpace(incomingString).length == 0 || incomingString.search(/[^0-9\.\-]/g) != -1 || parseInt(incomingString, 10) < 0 )
  {
    return false;
  }
  else
    return true;
}
function emailValidate(incomingString, defaultValue)
{
  if(trimSpace(incomingString).length == 0 || incomingString.search(/[\_\-\d]*[A-Za-z]+[\w\_\-]*[\@][\d]*[A-Za-z]+[\w\-]*[\.][A-Za-z]+/g) == -1 || incomingString==defaultValue)
  {
    return false;
  }
  else
	return true;
}

function checkValidations_1()
{
    var opclass;
	var opclass1;
	var op;

   if(document.frmKeynoteInfo.FirstName.value=='Name' || trimSpace(document.frmKeynoteInfo.FirstName.value)=="")
  {
    alert("Please Enter Your First Name");
    document.frmKeynoteInfo.FirstName .focus();
    return false;
  }
  if((!textValidate(document.frmKeynoteInfo.FirstName .value, 'Name')))
  {
    alert("Please Enter Alphabets Only");
    document.frmKeynoteInfo.FirstName.focus();
    return false;
  } 
 if(document.frmKeynoteInfo.LastName.value=='Name' || trimSpace(document.frmKeynoteInfo.LastName.value)=="")
  {
    alert("Please Enter Your Last Name");
    document.frmKeynoteInfo.LastName.focus();
    return false;
  }
  

   if(document.frmKeynoteInfo.Title.value=='Title' || trimSpace(document.frmKeynoteInfo.Title.value)=="")
  {
    alert("Please Enter Your Title");
    document.frmKeynoteInfo.Title.focus();
    return false;
  }
  
  if(document.frmKeynoteInfo.Company.value=='Company' || trimSpace(document.frmKeynoteInfo.Company.value)=="")
  {
    alert("Please Enter Your Company");
    document.frmKeynoteInfo.Company.focus();
    return false;
  }
 
  
  if(document.frmKeynoteInfo.Industry.value=='Select Industry')
  {
    alert("Please Select Your Industry");
    document.frmKeynoteInfo.Industry.focus();
    return false;
  }  
  
     if(document.frmKeynoteInfo.Phone.value=='Phone' || trimSpace(document.frmKeynoteInfo.Phone.value)=="")
  {
    alert("Please Enter Your Phone");
    document.frmKeynoteInfo.Phone.focus();
    return false;
  }
 
  
if(document.frmKeynoteInfo.Country.value=='Select Country')
  {
    alert("Please Select Your Country");
    document.frmKeynoteInfo.Country.focus();
    return false;
  } 
if(document.frmKeynoteInfo.State.value=='' || document.frmKeynoteInfo.State.value=='0' && document.frmKeynoteInfo.State.value !='N/A')
  {
    alert("Please Select Your State");
    document.frmKeynoteInfo.State.focus();
    return false;
  }    
  
var email =document.frmKeynoteInfo.email.value;
		  if(email.length == 0)
		  {
		       alert("Please Enter email Id");
			   document.frmKeynoteInfo.email.focus();
			   return false;
		  }
		  if(isValidemail(email) == 0)
		  {
		   document.frmKeynoteInfo.email.focus();
		   return false;		  
		  }

	var infoValue = [];
	infoValue['mb']=""; 
	infoValue['wlt'] =""; 
	infoValue['wsm']=""; 
	if(document.getElementById('wsm').checked == true)
	{
	  var opclass="WPM";
	  infoValue['wsm']=opclass;
	}
	if (document.getElementById('wlt').checked == true)
	{
		var opclass1="WPT";
		   infoValue['wlt']=opclass1;
		}
	else
	{
	 var opclass="";
	// var opclass1="";
	}
	var opclassM ;
	//alert(opclass);
	if(document.getElementById('mcam').checked == true || document.getElementById('mcamt').checked == true ||document.getElementById('ntam').checked ==true)
	{
	 opclassM="Mobile";
	    infoValue['mb']=opclassM;

	   
	}
	else
	{
	opclassM="";
	}
	
	var mySign=";";

	if(opclass=="" || opclass1=="" || opclassM=="")
	{
		mySign="";
	}
	op=opclass+ mySign +opclass1+ mySign +opclassM;

	if(op=='' || op==';')
	{
	op="WPM";
	}
if(infoValue['mb'] =="" && infoValue['wlt'] =="" &&  infoValue['wsm'] ==""  )
	{
		document.getElementById('PrimaryOpportunityClass').value="WPM";
	document.getElementById('OtherOpportunityClasses').value="";
	}else{	
	if(infoValue['mb'] !="" || infoValue['wlt'] !="" ||  infoValue['wsm'] !=""  )
	{
if(infoValue['mb'] =="" && (infoValue['wlt'] !="" ||  infoValue['wsm'] !="")){
	
	//for double selction
	if(infoValue['wlt'] !="" &&  infoValue['wsm'] !=""){
	
		document.getElementById('PrimaryOpportunityClass').value=infoValue['wsm'];	
		document.getElementById('OtherOpportunityClasses').value=infoValue['wlt'];
	
	}
	else{
	
	if(infoValue['wlt'] !=""){
		document.getElementById('PrimaryOpportunityClass').value=infoValue['wlt'] ;
		document.getElementById('OtherOpportunityClasses').value="";
		}
		if(infoValue['wsm'] !=""){
			document.getElementById('PrimaryOpportunityClass').value=infoValue['wsm'];
			document.getElementById('OtherOpportunityClasses').value="";
		}
	
	
	}
	}
	else{
	// for only mobile option
	if(infoValue['wlt'] !="" && infoValue['wsm'] !=""){
		document.getElementById('PrimaryOpportunityClass').value=infoValue['wsm'];
		document.getElementById('OtherOpportunityClasses').value=infoValue['wlt']+";"+infoValue['mb'];
	}
	else{
	if(infoValue['wlt'] !="" && infoValue['wsm'] ==""){
		document.getElementById('PrimaryOpportunityClass').value=infoValue['wlt'];
		document.getElementById('OtherOpportunityClasses').value=infoValue['mb'];
		}if(infoValue['wsm'] !="" && infoValue['wlt'] ==""){
		
		document.getElementById('PrimaryOpportunityClass').value=infoValue['wsm'];
		document.getElementById('OtherOpportunityClasses').value=infoValue['mb'];
		}
		if(infoValue['wsm'] =="" && infoValue['wlt'] =="" && infoValue['mb']!=""){
		if((document.getElementById('mcam').checked == true && document.getElementById('mcamt').checked == false && document.getElementById('ntam').checked ==false)|| (document.getElementById('mcam').checked == false && document.getElementById('mcamt').checked == true && document.getElementById('ntam').checked ==false) || (document.getElementById('mcam').checked == false && document.getElementById('mcamt').checked == false && document.getElementById('ntam').checked ==true))
	{ document.getElementById('PrimaryOpportunityClass').value=infoValue['mb'];
		document.getElementById('OtherOpportunityClasses').value=""; 
		} else{
		document.getElementById('PrimaryOpportunityClass').value=infoValue['mb'];
		document.getElementById('OtherOpportunityClasses').value=infoValue['mb']; 
		}
		
		}
	}	
	
	}
}

}	
	return true;
}

//function for contact request form

function checkValidations_2()
{
    var opclass;
	var opclass1;
	var op;

   if(document.frmKeynoteInfo.FirstName.value=='Name' || trimSpace(document.frmKeynoteInfo.FirstName.value)=="")
  {
    alert("Please Enter Your First Name");
    document.frmKeynoteInfo.FirstName .focus();
    return false;
  }
  if((!textValidate(document.frmKeynoteInfo.FirstName .value, 'Name')))
  {
    alert("Please Enter Alphabets Only");
    document.frmKeynoteInfo.FirstName.focus();
    return false;
  } 
 if(document.frmKeynoteInfo.LastName.value=='Name' || trimSpace(document.frmKeynoteInfo.LastName.value)=="")
  {
    alert("Please Enter Your Last Name");
    document.frmKeynoteInfo.LastName.focus();
    return false;
  }
  

   if(document.frmKeynoteInfo.Title.value=='Title' || trimSpace(document.frmKeynoteInfo.Title.value)=="")
  {
    alert("Please Enter Your Title");
    document.frmKeynoteInfo.Title.focus();
    return false;
  }
  
  if(document.frmKeynoteInfo.Company.value=='Company' || trimSpace(document.frmKeynoteInfo.Company.value)=="")
  {
    alert("Please Enter Your Company");
    document.frmKeynoteInfo.Company.focus();
    return false;
  }
 
  
  if(document.frmKeynoteInfo.Industry.value=='Select Industry')
  {
    alert("Please Select Your Industry");
    document.frmKeynoteInfo.Industry.focus();
    return false;
  }  
  
  if(document.frmKeynoteInfo.Phone.value=='Phone' || trimSpace(document.frmKeynoteInfo.Phone.value)=="")
  {
    alert("Please Enter Your Phone");
    document.frmKeynoteInfo.Phone.focus();
    return false;
  }
 
  
if(document.frmKeynoteInfo.Country.value=='Select Country')
  {
    alert("Please Select Your Country");
    document.frmKeynoteInfo.Country.focus();
    return false;
  } 
  
if(document.frmKeynoteInfo.State.value=='' || document.frmKeynoteInfo.State.value=='0' && document.frmKeynoteInfo.State.value !='N/A')
  {
    alert("Please Select Your State");
    document.frmKeynoteInfo.State.focus();
    return false;
  }    
  
var email =document.frmKeynoteInfo.email.value;
		  if(email.length == 0)
		  {
		       alert("Please Enter email Id");
			   document.frmKeynoteInfo.email.focus();
			   return false;
		  }
		  if(isValidemail(email) == 0)
		  {
		   document.frmKeynoteInfo.email.focus();
		   return false;		  
		  }

	var infoValue = [];
	var infoValue1 = [];
	infoValue['wsm']=""; 
	infoValue['wlt'] =""; 
	infoValue['mm']=""; 
	infoValue['kps'] =""; 
	infoValue['out']="";	
	infoValue['kcr']="";
	infoValue['vs']="";	
	var intii=0;
	
	//alert(document.getElementById('mcam').checked);
	//alert(document.getElementById('wsm').checked);
	//alert(document.getElementById('wlt').checked);
	//alert(document.getElementById('out').checked);
	//alert(document.getElementById('kcr').checked);
	
		
	if(document.getElementById('mcam').checked == false && 
	   document.getElementById('wsm').checked == false && 
	   document.getElementById('wlt').checked == false && 
	   document.getElementById('out').checked == false && 
	   document.getElementById('kcr').checked == false )
	{
	alert("Please select at least one product");
	return false;
	}
	
	if(document.getElementById('wsm').checked == true)
	{
	
	  var opclass="WPM";
	  infoValue['wsm']=opclass;
	  intii++;
	  infoValue1[intii]="WPM"; 
	}
	
	if (document.getElementById('wlt').checked == true)
	{
		var opclass1="WPT";
		   infoValue['wlt']=opclass1;
		     intii++;
		infoValue1[intii]="WPT"; 
		}
		if (document.getElementById('mcam').checked == true)
	{
		var opclass2="Mobile";
		   infoValue['mm']=opclass2;
		      intii++;
		infoValue1[intii]="Mobile"; 
		}
		if (document.getElementById('kps').checked == true)
	{
		var opclass3="CC";
		   infoValue['kps']=opclass3;
		     intii++;
		infoValue1[intii]="CC"; 
		}
		if (document.getElementById('out').checked == true)
	{
		var opclass4="CEM";
		   infoValue['out']=opclass4;
		    intii++;
		infoValue1[intii]="CEM"; 
		}
		if (document.getElementById('kcr').checked == true)
	{
		var opclass5="COMPINT";
		   infoValue['kcr']=opclass5;
		      intii++;
		infoValue1[intii]="COMPINT"; 
		}
		if (document.getElementById('vs').checked == true)
	{
		var opclass6="VoIP";
		   infoValue['vs']=opclass6;
		     intii++;
		infoValue1[intii]="VoIP"; 
		}
		
	
	var conct="";
	if(infoValue1.length==0){
	document.getElementById('PrimaryOpportunityClass').value="WPM";
	
}else{
document.getElementById('PrimaryOpportunityClass').value=infoValue1[1];
	
}
	
for (i = 2; i < infoValue1.length; i++){
	conct +=infoValue1[i];
	
if((infoValue1.length-1) > i){
conct +=';';
}	
}

document.getElementById('OtherOpportunityClasses').value=conct; 
		
	return true;
}

