// JavaScript Document
<!-- 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
} 


/*New Code feb092009 [Start]*/
/*Check for alpha-numeric characters*/
function checkAlphanumeric(obj){ 
	var re = /^[a-z_0-9]$/;
	var sFlag = true; 	
	for (var i = 0; i < obj.length; i++) {
		if (re.test(obj.charAt(i)) == false){			 
			sFlag = false;
			break;
		} 
	}	
	return sFlag; 
}
function emailCheck(emailStr) { 
	//var domain=indexOf(
	var emailPat=/^(.+)@(.+)$/; 
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; 
	var validChars="\[^\\s" + specialChars + "\]"; 
	var quotedUser="(\"[^\"]*\")"; 
	var ipDomainPat="/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/"; 
	var atom=validChars + '+'; 
	var word="(" + atom + "|" + quotedUser + ")";  
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); 
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); 
	var matchArray=emailStr.match(emailPat);
	/*var invaliddomains=new Array("hotmail.com","gmail.com","yahoo.com","yahoo.co.in","in.com","rediff.com","rediffmail.com")
	for(i=0;i<invaliddomains.length;i++)
	{
		var kk=emailStr.match(invaliddomains[i])
		if(kk!=null)
			{
				return false;
				break;
			}
	}*/
	if (matchArray==null) { 
		return false
	}
	
	var user=matchArray[1]
	var domain=matchArray[2] 
	if (user.match(userPat)==null) { 
		return false
	} 
	
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) { 
		  for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) { 
			return false
			}
		}
		return true
	} 
	var domainArray=domain.match(domainPat)
	if (domainArray==null) { 
		return false
	} 
	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	
	if (domArr[domArr.length-1].length<2 || 
		domArr[domArr.length-1].length>3) { 
	   return false
	}
	 
	if (len<2) {
	   var errStr="This address is missing a hostname!" 
	   return false
	}
	 
	return true;
}

function doformregister(cCount,scCount1,scCount2){	

	var frmFC       = document.frmRegister; 
	var f_category  = false;
 	var f_subcategory  = false;
	var f_subcategory1  = false;
	var f_email     = frmFC.reg_remail;
	//var f_email2    = frmFC.reg_remail2;
	var f_firstname = frmFC.reg_rfirstname;
	var f_surname   = frmFC.reg_rsurname;
	var f_company    = frmFC.reg_rcompany;
	var f_designation    = frmFC.reg_rdesignation;
	var f_city      = frmFC.reg_rcity;
	var f_country   = frmFC.reg_rcountry;
	var f_preMessEnter   = "Please enter ";
	var f_preMessSelect  = "Please select ";
	var f_flagS = false;	
	
    if(alltrim(f_firstname.value) == ""){
		alert(f_preMessEnter + "the first name");
		f_firstname.focus();
		return false;
	}
	else if(alltrim(f_surname.value) == ""){
		alert(f_preMessEnter + "the last name");
		f_surname.focus();
		return false;
	}
	else if(alltrim(f_company.value) == ""){
		alert(f_preMessEnter + "the company name");
		f_company.focus();
		return false;
	}
	else if(alltrim(f_designation.value) == ""){
		alert(f_preMessEnter + "the designation");
		f_designation.focus();
		return false;
	}
	else if(alltrim(f_email.value) == ""){
		alert(f_preMessEnter + "the email address");
		f_email.focus();
		return false;
	}
/*	else if(alltrim(f_email2.value) == ""){
		alert(f_preMessEnter + "the email address");
		f_email2.focus();
		return false;
	}	*/
	else if(alltrim(f_city.value) == ""){
		alert(f_preMessEnter + "the State");
		f_city.focus();
		return false;
	}
	else if(alltrim(f_country.value) == ""){
		alert(f_preMessSelect + "the country");
		f_country.focus();
		return false;
	}
	else{
		f_flagS = true;
	}
	
	if(f_flagS == true){ 	
	
		if(alltrim(f_email.value) != ""){	
		
			if(emailCheck(f_email.value) == false){
				alert("Invalid email address! Please re-enter again");	
				//alert(f_email.value);
				f_email.focus();
				f_flagS = false;
				return false;
			}	 
		}
		/*if(alltrim(f_email2.value) != ""){		
			if(emailCheck(f_email2.value) == false){
				alert("Invalid email address! Please re-enter again");	
				f_email2.focus();
				flagS = false;
				return false;
			}	 
		} 		
		if((alltrim(f_email.value) != "") && (alltrim(f_email2.value) != "")){
			if(alltrim(f_email.value) != alltrim(f_email2.value)){
				alert("Email addresses do not match! Please re-enter again");
				f_email.value  = ""; 
				f_email.focus();
				flagS = false;
				return false;
			}
		}	*/	
		for(var f_count = 0;f_count < Number(cCount);f_count++){ 
			f_category  = eval("frmFC.reg_rcategory"+f_count).checked;  	 
			if(f_category == true) break;
		}
		for(var f_count = 0;f_count <Number(scCount1);f_count++){ 
			f_subcategory  = eval("frmFC.reg_rcategory1"+f_count).checked;  	 
			if(f_subcategory == true) break;
		}
		for(var f_count = 0;f_count < Number(scCount2);f_count++){ 
			f_subcategory1  = eval("frmFC.reg_rcategory2"+f_count).checked;  	 
			if(f_subcategory1 == true) break;
		}
		if(f_category==false ) {
			alert("Please choose atleast one category");
			return false;
		}		
		if(f_subcategory==false && f_subcategory1==false) {
			alert("Please choose atleast one course ");
			//alert(Number(scCount1) );
			return false;
		}
		if(f_flagS == true){ 
			frmFC.reg_flag.value = "Y";
			frmFC.action = "register.php";  
		} 
	}	 
}
/*New Code feb092009 [End]*/
//-->

function alltrim(str){
	return str.replace(/^\s+|\s+$/g, '');
}
		
function fncSubmit(fnForm){	
 	var frmHome    = "document."+fnForm; 
    var fUsername  = eval(frmHome +".inp_username");
	var fPassword  = eval(frmHome +".inp_password");
	var fRemember  = eval(frmHome +".inp_remember");
	var usertrim;
	var passtrim;
	
	if(fUsername){
		usertrim = alltrim(fUsername.value); 
		fUsername.value = usertrim; 
	}	 
	if(fPassword){
		passtrim  = alltrim(fPassword.value); 		
		fPassword.value = passtrim;
	}
	if(usertrim=="" || usertrim.toLowerCase()=="username" || passtrim==""){
		alert("Please enter the username and password");
		return false;
	}
	else{
		document.frmLogin.action="index.php"; 
	}
} 
function fncUpdates(fnForm,fnOut){	
 	var frmHome    = "document."+fnForm; 
    var fUpdatesEmail  = eval(frmHome +".inp_sign"); 
	if(fUpdatesEmail){
		var emailtrim = alltrim(fUpdatesEmail.value); 
		//fUpdatesEmail.value = emailtrim;		
		if(emailCheck(emailtrim) == false){			
			alert("Invalid email address! Please re-enter again");	
 			fUpdatesEmail.focus();  
			return false;
		}		 
	} 
	if(fnOut =='A')
	document.frmNews.action="req_email_updates.php";  
	
} 
function fncForgotmess(){
	var stremail=document.frmForgot.for_email.value;
	if (emailCheck(stremail)==false)		// calling email validation function
	{
		alert("Please enter the correct email address");
		document.frmForgot.for_email.focus();
		return false;
	}	
	document.frmForgot.action="forgotpassword.php";
} 

function fncCheckStates(fnVar,fnLvl){		
	//alert(fnVar);	
	var fURL;
	if(fnLvl=="A") 
	 fURL = "index.php?mod=accounts&opr=modifymember";
	else if(fnLvl=="ME")
	 fURL = "index.php?mod=managers&opr=modifymanager";	
	 else if(fnLvl == "MgP"){
	 fURL = "index.php?mod=profile&opr=myprofile";
	 }else{
		 fURL = "index.php?mod=profile&opr=myprofile";
	 }
	document.frmProfile.action = fURL;
	document.frmProfile.submit();	
}

function fncCheckState(fnVar,fnLvl){		
// 	alert(fnVar);	
// 	alert(fnLvl);

	var fURL;
	switch(fnLvl){	
		case "A":
			fURL = "index.php?mod=accounts&opr=addmember";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;
		case "M":
			fURL = "index.php?mod=profile&opr=myprofile";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;
		case "W":
			fURL = "index.php?mod=accounts&opr=addenterprise";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;
		case "T":			
			fURL = "index.php?mod=accounts&opr=addzip";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;
		case "Q":
			fURL = "quick_tips.php";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;
		case "RT":
			fURL = "research_tips.php";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;	
		case "R":
			fURL = "multimember.php";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();
			break;	
		case "WU":
			fURL = "news_and_events.php";	
			document.frmAddMemWU.action = fURL;
			document.frmAddMemWU.submit();
			break;
		case "WP":
			fURL = "webinars.php";	
			document.frmAddMemWP.action = fURL;
			document.frmAddMemWP.submit();
			break;
		case "TU":
			fURL = "news_and_events.php";	
			document.frmAddMemTU.action = fURL;
			document.frmAddMemTU.submit();
			break;
		case "TP":	
			fURL = "news_and_events.php";	
			document.frmAddMemTP.action = fURL;
			document.frmAddMemTP.submit();
			break;
		case "PQ":
			fURL = "index.php";	
			document.frmAddMemPQ.flagPP.value = "Q";
			document.frmAddMemPQ.action = fURL;
			document.frmAddMemPQ.submit();
			break;
		case "PT":
			fURL = "index_step.php";	
			document.frmAddMemPQ.flagPP.value = "T";
			document.frmAddMemPQ.action = fURL;
			document.frmAddMemPQ.submit();
			break;	
		case "PE":		
			if(document.frmAddMemPE.flagType.value == 'step'){
				fURL = "index_step.php";	
			}
			else
				fURL = "index.php";	
			document.frmAddMemPE.flagPP.value = "E";
			document.frmAddMemPE.action = fURL;
			document.frmAddMemPE.submit();
			break;	
		case "PS":		
			fURL = "enterprise_evaluation.php";	
			document.frmAddMemPE.flagPP.value = "E";
			document.frmAddMemPE.action = fURL;
			document.frmAddMemPE.submit();
			break;
		case "G":
			fURL = "index.php?mod=managers&opr=addmanager";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();		
			break;
		case "J":
			fURL = "index.php?mod=accounts&opr=addevaluation";
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit();		
			break;
		default:
			fURL = "index.php?mod=profile&opr=myprofile";	
			document.frmAddMem.action = fURL;
			document.frmAddMem.submit(); 
			break;  
	}
	/*if(fnLvl=="A"){ 
	 fURL = "index.php?mod=accounts&opr=addmember";
	 document.frmAddMem.action = fURL;
	 document.frmAddMem.submit();
	}
	else if(fnLvl=="M") {
	 fURL = "index.php?mod=profile&opr=myprofile";
	 document.frmAddMem.action = fURL;
	 document.frmAddMem.submit();
	}
	else if(fnLvl=="Q"){
	 fURL = "quick_tips.php";
	 document.frmAddMem.action = fURL;
	 document.frmAddMem.submit();
	}
	else if(fnLvl=="WU" || fnLvl=="WP" || fnLvl=="TU" || fnLvl=="TP"){
	 fURL = "news_and_events.php";	
  	 document.frmAddMem.action = fURL;
	 document.frmAddMem.submit();
	}
	else{
	 fURL = "index.php?mod=profile&opr=myprofile";	
   	 document.frmAddMem.action = fURL;
	 document.frmAddMem.submit(); 
	} */
}

function fncLogout(){ 
	document.frmLog.action="logout.php";
	document.frmLog.submit();
}

function fncSubmitProf(fnLvl){
	
	var frmReg 	   = document.frmProfile; 
	var password   = frmReg.prof_password;  
	var firstname  = frmReg.prof_firstname;
	var lastname   = frmReg.prof_lastname;
	var jobtitle   = frmReg.prof_jobtitle;
	var emailid    = frmReg.prof_emailid;
	var phone  	   = frmReg.prof_phone;
	var company    = frmReg.prof_company;
	var noofemp    = frmReg.prof_noofemp;
	var country    = frmReg.prof_country;
	var state  	   = frmReg.prof_state;
	var salescnt   = frmReg.prof_salescnt;
	var signupnews = frmReg.prof_signupnews;
   	var flagSubmit = false;
    if(password.value.length==0) 
	{
		alert("Please enter the password");
		password.focus();
		return false;
	}
	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}		
	else if(company.value.length==0) 
	{
		alert("Please enter the company name");
		company.focus();
		return false;
	}		
	else if(noofemp.value.length==0) 
	{
		alert("Please select the number of employees");
		noofemp.focus();		
		return false;
	}	
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}
	  
	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			} 
		}	
	}
	
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	var fURL;
	if(fnLvl=="A") 
	 fURL = "index.php?mod=accounts&opr=modifymember";
	else if(fnLvl=="M") 
	 fURL = "index.php?mod=profile&opr=myprofile";		 
	else
	 fURL = "index.php?mod=profile&opr=myprofile";	
	 
	if(flagSubmit == true){		
		document.frmProfile.flagEdit.value = "Y";
		document.frmProfile.action = fURL; //"index.php?mod=profile&opr=myprofile";
	} 
}

/*venkat*/
function fncMangerEdit(fnLvl){
	
	var frmReg 	   = document.frmProfile; 
	var password   = frmReg.prof_password;  
	var firstname  = frmReg.prof_firstname;
	var lastname   = frmReg.prof_lastname;
	var jobtitle   = frmReg.prof_jobtitle;
	var emailid    = frmReg.prof_emailid;
	var phone  	   = frmReg.prof_phone;
	var country    = frmReg.prof_country;
	var state  	   = frmReg.prof_state;
	/*var salescnt   = frmReg.prof_salescnt;
	var signupnews = frmReg.prof_signupnews;*/
   	var flagSubmit = false;
    if(password.value.length==0) 
	{
		alert("Please enter the password");
		password.focus();
		return false;
	}
	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}		
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}
	  
	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			} 
		}	
	}
	
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	var fURL;
	if(fnLvl == 'MgP'){
		fURL = "index.php?mod=profile&opr=myprofile";	
	}else{
	 fURL = "index.php?mod=managers&opr=modifymanager";	
	}
	 
	if(flagSubmit == true){		
		document.frmProfile.flagEdit.value = "Y";
		document.frmProfile.action = fURL; //"index.php?mod=profile&opr=myprofile";
	} 
}


function fncAddMemSubmit(fnLvl){
	
	var frmReg 	   = document.frmAddMem; 
	var username   = frmReg.reg_username;
	var password   = frmReg.reg_password;  
	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;
	var company    = frmReg.reg_company;	
	var jobtitle   = frmReg.reg_jobtitle;
	var emailid    = frmReg.reg_emailid;
	var phone  	   = frmReg.reg_phone;
	var noofemp    = frmReg.reg_noofemp;
	var country    = frmReg.reg_country;
	var state  	   = frmReg.reg_state;
	var salescnt   = frmReg.reg_salescnt;
	var signupnews = frmReg.reg_signupnews;
   	var flagSubmit = false;
	
	if(username.value.length==0) 
	{
		alert("Please enter the username");
		username.focus();
		return false;
	}
	else if(password.value.length==0) 
	{
		alert("Please enter the password");
		password.focus();
		return false;
	}
	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}	
	else if(company.value.length==0) 
	{
		alert("Please enter the company name");
		company.focus();
		return false;
	}
	else if(noofemp.value.length==0) 
	{
		alert("Please select the number of employees");
		noofemp.focus();		
		return false;
	}	
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	
	var fURL;
	if(fnLvl=="A") 
	 fURL = "index.php?mod=accounts&opr=addmember";
	else if(fnLvl=="M") 
	 fURL = "index.php?mod=profile&opr=myprofile";		 		 	
	else
	 fURL = "index.php?mod=profile&opr=myprofile";	
  
	if(flagSubmit == true){		
		document.frmAddMem.flagAdd.value = "Y";		
		document.frmAddMem.action = fURL; //"index.php?mod=profile&opr=myprofile";
	}     
}

function fncAddMngSubmit(fnLvl){
	
	var frmReg 	   = document.frmAddMem; 
	var username   = frmReg.reg_username;
	var password   = frmReg.reg_password;  
	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;	
	var jobtitle   = frmReg.reg_jobtitle;
	var emailid    = frmReg.reg_emailid;
	var phone  	   = frmReg.reg_phone;	
	var country    = frmReg.reg_country;
	var state  	   = frmReg.reg_state;
	
   	var flagSubmit = false;
	
	if(username.value.length==0) 
	{
		alert("Please enter the username");
		username.focus();
		return false;
	}
	else if(password.value.length==0) 
	{
		alert("Please enter the password");
		password.focus();
		return false;
	}
	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}	
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	
	var fURL; 
	fURL = "index.php?mod=managers&opr=addmanager";		  
  
	if(flagSubmit == true){		
		document.frmAddMem.flagAdd.value = "Y";		
		document.frmAddMem.action = fURL; //"index.php?mod=profile&opr=myprofile";
	}     
}


function fncAddEnterSubmit(fnLvl){
	
	var frmReg 	   = document.frmAddMem; 
	var username   = frmReg.eps_username;
	var password   = frmReg.eps_password;  
	var firstname  = frmReg.eps_firstname;
	var lastname   = frmReg.eps_lastname;
	var company    = frmReg.eps_company;	
	var jobtitle   = frmReg.eps_jobtitle;
	var emailid    = frmReg.eps_emailid;
	var phone  	   = frmReg.eps_phone;
	var noofemp    = frmReg.eps_noofemp;
	var country    = frmReg.eps_country;
	var state  	   = frmReg.eps_state;
	var salescnt   = frmReg.eps_salescnt;
	var signupnews = frmReg.eps_signupnews;
   	var flagSubmit = false;

	
	if(username.value.length==0) 
	{
		alert("Please enter the username");
		username.focus();
		return false;
	}
	else if(password.value.length==0) 
	{
		alert("Please enter the password");
		password.focus();
		return false;
	}
	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}	
	else if(company.value.length==0) 
	{
		alert("Please enter the company name");
		company.focus();
		return false;
	}
	else if(noofemp.value.length==0) 
	{
		alert("Please select the number of employees");
		noofemp.focus();		
		return false;
	}	
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	
	var fURL; 
	if(fnLvl=='W')
		fURL = "index.php?mod=accounts&opr=addenterprise"; 
	else if(fnLvl=='T')
		fURL = "index.php?mod=accounts&opr=addzip"; 
	else if(fnLvl=='J')
		fURL = "index.php?mod=accounts&opr=addevaluation";
	if(flagSubmit == true){		
		document.frmAddMem.flagAdd.value = "Y";
		document.frmAddMem.action = fURL; //"index.php?mod=profile&opr=myprofile";
		
	}     


}

function fncAddQTipsSubmit(fnLvl){
	
	var frmReg 	   = document.frmAddMem; 
 	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;
 	var emailid    = frmReg.reg_emailid;
 	var country    = frmReg.reg_country;
	var state  	   = frmReg.reg_state;
	var salescnt   = frmReg.reg_salescnt;
	var signupnews = frmReg.reg_signupnews;
   	var flagSubmit = false;
	
 	if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
	
	var fURL; 
	if(fnLvl == "U")
		fURL = "quick_tips.php";	
	else if(fnLvl == "RT")
		fURL = "research_tips.php";
	
  	//alert(flagSubmit);
	
	if(flagSubmit == true){		
		document.frmAddMem.flagAdd.value = "Y";		
		document.frmAddMem.action = fURL; //"index.php?mod=profile&opr=myprofile";
	}     
}


//rrrr1
function fncAddPopSubmit(fnLvl,fnType){ 
	
 //alert(fnLvl);
 //alert(fnType);
	
	if(fnLvl=='E' || fnLvl=='S')
		var frmReg = document.frmAddMemPE; 
	else if(fnLvl=='Q' || fnLvl=='T')
		var frmReg = document.frmAddMemPQ;  
	
//	var username   = frmReg.reg_username;
//	var password   = frmReg.reg_password;  
	var firstname  = frmReg.tri_firstname;
	var lastname   = frmReg.tri_lastname; 
	var jobtitle   = frmReg.tri_jobtitle;
	var emailid    = frmReg.tri_emailid;
	var country    = frmReg.tri_country;
	var state  	   = frmReg.tri_state;
	
	if(fnLvl=='E' || fnLvl=='S'){
		var company    = frmReg.tri_company;
		var phone  	   = frmReg.tri_phone;
		var noofemp    = frmReg.tri_noofemp;
	}
	
	var salescnt   = frmReg.tri_salescnt;
	var signupnews = frmReg.tri_signupnews;
	
   	var flagSubmit = false;
	var flagSubmit1 = false;
	var flagSubmit2 = false;
	var flagSubmit3 = false;
	
	if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else{
		flagSubmit1 = true;		
	}
	
	if(fnLvl=='E' || fnLvl=='S'){
		if(phone.value.length==0) 
		{
			alert("Please enter the phone of mobile number");
			phone.focus();
			return false;
		}	
		else if(company.value.length==0) 
		{
			alert("Please enter the company name");
			company.focus();
			return false;
		}
		else if(noofemp.value.length==0) 
		{
			alert("Please select the number of employees");
			noofemp.focus();		
			return false;
		}
		else{
			flagSubmit2 = true;		
		}
	}
	if(country.value.length==0)
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit3 = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit);
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}
			else{
				flagSubmit = true;
			}
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 
//	alert(flagSubmit1);alert(flagSubmit3);alert(flagSubmit);
	var fURL;
	if(fnLvl=='S'){
		fURL = "enterprise_evaluation.php";
	}
	else if(fnLvl=='T'){
		fURL = "index_step.php";
	}
	else{
		fURL = "index.php";	  		
	}
 
	if((fnLvl == "E" || fnLvl == "S") && (flagSubmit1 == true && flagSubmit2 == true && flagSubmit3 == true   && flagSubmit == true)){	
		//flagST
		document.frmAddMemPE.flagPP.value = "E";
		document.frmAddMemPE.flagAdd.value = "Y";
		if(document.frmAddMemPE.flagType.value == 'step' && fnLvl!='S')
			fURL = "index_step.php";
		else 
			fURL = fURL;
		document.frmAddMemPE.action = fURL; 
		
	}
	else if((fnLvl == "Q" || fnLvl == "T") && (flagSubmit1 == true && flagSubmit3 == true  && flagSubmit == true)){	 
		document.frmAddMemPQ.flagPP.value = "Q";
		document.frmAddMemPQ.flagAdd.value = "Y";		
		document.frmAddMemPQ.action = fURL;    
	} 
	
}

//rrrr2


//---------
function fncAddNewsEvents(fnLvl){
	
	if(fnLvl=='WU'){
		var frmReg 	   = document.frmAddMemWU;
	}
	else if(fnLvl=='WP'){
		var frmReg 	   = document.frmAddMemWP;		
	}
	else if(fnLvl=='TU'){
		var frmReg 	   = document.frmAddMemTU;  
	}
	else if(fnLvl=='TP'){
		var frmReg 	   = document.frmAddMemTP;  
	}    
  
	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;
	var emailid    = frmReg.reg_emailid;
	var country    = frmReg.reg_country;
	var state  	   = frmReg.reg_state; 
   	var flagSubmit = false;
	
 	if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 

	if(fnLvl == 'WP'){
		var webn  	   = frmReg.reg_web; 
		if(webn.value.length==0) 
		{
			alert("Please enter the webinar");
			webn.focus();
			flagSubmit = false;	
			return false;
		}	
 	}
	var fURL; 
	fURL = "news_and_events.php";	
  
	if(flagSubmit == true){		
		if(fnLvl=='WU'){
			document.frmAddMemWU.flagAdd.value = "Y";		
			document.frmAddMemWU.action = fURL; //"index.php?mod=profile&opr=myprofile";
		}
		else if(fnLvl=='WP'){
			document.frmAddMemWP.flagAdd.value = "Y";		
			document.frmAddMemWP.action = "webinars.php"; //"index.php?mod=profile&opr=myprofile";
		}
		else if(fnLvl=='TU'){
			document.frmAddMemTU.flagAdd.value = "Y";		
			document.frmAddMemTU.action = fURL; //"index.php?mod=profile&opr=myprofile";
		}
		else if(fnLvl=='TP'){
			document.frmAddMemTP.flagAdd.value = "Y";		
			document.frmAddMemTP.action = fURL; //"index.php?mod=profile&opr=myprofile";
		}  
	}    
}
//---------
//####

function fncAddMemberSubmit(fnLvl){
	
	var frmReg 	   = document.frmAddMem;  
	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;
	var company    = frmReg.reg_company;	
	var jobtitle   = frmReg.reg_jobtitle;
	var emailid    = frmReg.reg_emailid;
	var phone  	   = frmReg.reg_phone;
	var noofemp    = frmReg.reg_noofemp;
	var country    = frmReg.reg_country;
	var state  	   = frmReg.reg_state; 
   	var flagSubmit = false;
	
 
 	if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(jobtitle.value.length==0) 
	{
		alert("Please enter the job title");
		jobtitle.focus();
		return false;
	} 
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else if(phone.value.length==0) 
	{
		alert("Please enter the phone of mobile number");
		phone.focus();
		return false;
	}	
	else if(company.value.length==0) 
	{
		alert("Please enter the company name");
		company.focus();
		return false;
	}
	else if(noofemp.value.length==0) 
	{
		alert("Please select the number of employees");
		noofemp.focus();		
		return false;
	}	
	else if(country.value.length==0) 
	{
		alert("Please select the country");
		country.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

	if(country.value!=""){  
		if((country.value!='CA') && (country.value!='IN') && (country.value!='US') && (country.value!='AU') && (country.value!='CN') && (country.value!='HK') && (country.value!='SG')){
			flagSubmit = true;
			//alert("de1" + flagSubmit); 
		}
		else{		 
			//'CA,IN,US,AU,CN,HK,SG'
			if(state.value ==''){  
				alert("Please select the state");
				state.focus();
				flagSubmit = false;
				return false;	
			}  
		}	
	}
 
 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	} 

	var fURL;
	if(fnLvl=="R") 
	 fURL = "multimember.php"; 	 	
	else
	 fURL = "multimember.php";	
  	//alert(fURL);
	if(flagSubmit == true){		
		document.frmAddMem.flagAdd.value = "M";		
		document.frmAddMem.action = fURL; //"index.php?mod=profile&opr=myprofile";
	}     
}   
//####

function fncValidGo(fnVar1){
	if(document.frmAttList.searchBy.value==""){
		alert("Please select any search option");
		return false;
	}
	else if(document.frmAttList.txtSearch.value==""){
		alert("Please enter any keyword");
		return false;		
	}
	document.frmAttList.action=fnVar1;
	document.frmAttList.submit();
}

function fncOpenPopup(fnVar){	  

	var bt_course_height = 600;
	var bt_left = 0;
	var bt_top = 0;
	var bt_menu_bar = "no";
	var bt_tool_bars = "no";
	var bt_show_status = "no";
	var bt_scroll_bars = "yes";
	
	if(fnVar=="A"){
		var bt_course_width = 750;
		//window.open("trial/index.php","boostpopwin1","width="+bt_course_width+",height=600,left="+bt_left+",top="+bt_top+",menubar="+ bt_menu_bar +",toolbar="+bt_tool_bars+",status="+bt_show_status+",scrollbars='"+bt_scroll_bars+"',fullscreen=0");
		window.open("trial/index.php"); //,"boostpopwin1","top=0,left=0,height='600',scrollbars=yes"
	}
	else if(fnVar == "B"){
		var bt_course_width = 750;
		//window.open("trial/enterprise_evaluation.php","boostpopwin2","width="+bt_course_width+",height=600,left="+bt_left+",top="+bt_top+",menubar="+ bt_menu_bar +",toolbar="+bt_tool_bars+",status="+bt_show_status+",scrollbars='"+bt_scroll_bars+"',fullscreen=0");
		window.open("trial/enterprise_evaluation.php");//,"boostpopwin2","top=0,left=0,height='600',scrollbars=yes");
	}
	else if(fnVar == "C"){
		var bt_course_width = 750;
	//	window.open("trial/index.php","boostpopwin3","width="+bt_course_width+",height="+bt_course_height+",left="+bt_left+",top="+bt_top+",menubar="+ bt_menu_bar +",toolbar="+bt_tool_bars+",status="+bt_show_status+",scrollbars='"+bt_scroll_bars+"',fullscreen=0");
		window.open("trial/index.php");//,"boostpopwin3","top=0,left=0,height='600',scrollbars=yes");
	}
	else if(fnVar == "D"){ 
		window.open('trial/index_step.php');//,"boostpopwin4","top=0,left=0,width=100%,height='600',scrollbars=yes"
	}
}

function fncReq(fnVar){	
	if(fnVar=='Y'){		
		//alert("CCCCCCC");
		document.frmTrial.action = "enterprise_evaluation.php";
	}
	else if(fnVar=='N'){		
		self.close();   
	}  
	return true;
}

function fncView(fnVar,fnOpt){
//	alert(fnVar);
	fnVar = eval(fnVar);
	fnVar.txtView.value = fnOpt;
	fnVar.action = 'index.php?mod=catalog&opr=lessons'; 
	fnVar.submit();
}
function fncAccept(fnFormname){
	fnVar = eval(fnFormname);
	fnVar.action = 'index.php?mod=trial_courses&opr=agree'; 
	fnVar.submit();			
}

//venkat new code added on apr282009
function fnDecline(fnFormname){
	
	fnVar = eval(fnFormname);
	fnVar.action = 'member.php'; 
	fnVar.submit();
}
function fncAddpayMember(){
	
	var frmReg 	   = document.frmAddpayMem;  
	var username   = frmReg.reg_username;
	var password   = frmReg.reg_password;
	var firstname  = frmReg.reg_firstname;
	var lastname   = frmReg.reg_lastname;
	var emailid   = frmReg.reg_emailid;
   	var flagSubmit = false;
	
  if(username.value.length==0) 
	{
		alert("Please enter the username");
		username.focus();
		return false;
	}
	else if(password.value.length==0) 
	{
		alert("Please enter the password");
		firstname.focus();
		return false;
	} 
 	else if(firstname.value.length==0) 
	{
		alert("Please enter the first name");
		firstname.focus();
		return false;
	}
	else if(lastname.value.length==0) 
	{
		alert("Please enter the last name");
		lastname.focus();
		return false;
	}	
	else if(emailid.value.length==0) 
	{
		alert("Please enter the email address");
		emailid.focus();
		return false;
	}
	else{
		flagSubmit = true;	
	}

 	if(emailid.value!="")
	{
		var stremail=emailid.value;
		if (emailCheck(stremail)==false)
		{
			alert("Invalid email address! Please re-enter again");
			emailid.focus();
			flagSubmit = false;
			return false; 
		}
	}  
}   
function fncZip(fnVar){ 
	window.open(fnVar,'_blank');
}
/*New Code Jun222009 [S]*/
function fncLmsView_removed(fnVar,fnOpt){
	fnVar = eval(fnVar);
	if(fnOpt!= ""){
		window.open("catalog/view_lms.php?c="+fnOpt+"","vwlms","top=0,left=0,scrollbars=no,width=950,height=580");
	}  
} 
/*New Code Jun222009 [E]*/

//venkat new code end added on apr282009
