var domList = new Array(".com",".org",".gov",".net",".mil",".edu",".cc",".biz",".sh",".zj",".js",".sd",".gd",".fj",".it",".gs",".yzjs",".hn",".co",".ln",".xj",".ne",".sn",".xa",".sx",".or",".he",".be",".cn",".ha",".de",".ah",".icn",".jx");

function submit_form(theForm)
{
	theForm.action = theForm.action + "?username=" + theForm.uName.value;	
	theForm.submit();
}

function reset_form(theForm)
{
	theForm.reset();
}

function afterlogin(theForm)
{
	theForm.action = theForm.action + "?username=" + theForm.uName.value;
	return true;
}

function check_pwd(theForm)
{
	if (theForm.OlduPwd.value == "")
  	{
    		alert("Please enter \"Old password\".");
    		theForm.OlduPwd.focus();
    		return (false);
  	}
  		
	if (theForm.uPwd.value == "")
  	{
    		alert("Please enter \"New password\".");
    		theForm.uPwd.focus();
    		return (false);
  	}
	else
	{
		if (checkMinLen(theForm.uPwd, 'New password', 6) == false)
	    		return (false);
	}

	if (theForm.uConfirm.value == "")
  	{
    		alert("Please enter \"Confirm password\".");
    		theForm.uConfirm.focus();
    		return (false);
  	}
	else
	{
		if (checkPwd(theForm.uConfirm,theForm.uPwd, 'Confirm password', 'New password') == false)
	    		return (false);
	}
}

function validate_userinfo(theForm,atWhere)
{
	// check choices
	if (atWhere == 0)
	{
		theForm.prod_list.value = "";
			
	  	// compose the product list for saving
		for (j=0; j < theForm.myptype.length; j++)
		{
			if (theForm.myptype.options[j].selected)
			{
	  			if (theForm.prod_list.value != "")
	  				theForm.prod_list.value += ",";
	
				theForm.prod_list.value += theForm.myptype.options[j].value;  						
			}
		}
	
		ChkChoice = 0;
	  	for (i=1; i <= 3; i++)
	  	{
	  		tmpV = "theForm.ch"+i+".checked";
	  		if (eval(tmpV))
				ChkChoice = 1;
		}
	  	
	  	if (ChkChoice == 0)
	  	{
		    	alert("Please specify \"what do you want to know more\".");
		    	theForm.ch1.focus();
		    	return (false);  		
		}
	}
		
	// check aes enquiry
	if (atWhere == 1)
	{
		theForm.prod_list.value = "";
				
	  	// compose the product list for saving
		for (j=0; j < theForm.myptype.length; j++)
		{
			if (theForm.myptype.options[j].selected)
			{
	  			if (theForm.prod_list.value != "")
	  				theForm.prod_list.value += ",";
	
				theForm.prod_list.value += theForm.myptype.options[j].value;  						
			}
		}
				
		theForm.show_list.value = "";
	
		ChkExh1 = 0;
	  	for (i=1; i <= 2; i++)
	  	{
	  		tmpV = "theForm.exhc"+i+".checked";
	  		if (eval(tmpV))
				ChkExh1 = 1;
		}
	  	
	  	if (ChkExh1 == 0)
	  	{
		    	alert("Please specify \"your wish of Exhibitions\".");
		    	theForm.exhc1.focus();
		    	return (false);  		
		}	
	}

	// check aes enquiry event
	if (atWhere == 7)
	{
		theForm.prod_list.value = "";
				
	  	// compose the product list for saving
		for (j=0; j < theForm.myptype.length; j++)
		{
			if (theForm.myptype.options[j].selected)
			{
	  			if (theForm.prod_list.value != "")
	  				theForm.prod_list.value += ",";
	
				theForm.prod_list.value += theForm.myptype.options[j].value;  						
			}
		}
	}
	
	// check aes enquiry
	if (atWhere == 6)
	{
		theForm.prod_list.value = "";
				
	  	// compose the product list for saving
		for (j=0; j < theForm.myptype.length; j++)
		{
			if (theForm.myptype.options[j].selected)
			{
	  			if (theForm.prod_list.value != "")
	  				theForm.prod_list.value += ",";
	
				theForm.prod_list.value += theForm.myptype.options[j].value;  						
			}
		}
				
		ChkExh1 = 0;
	  	for (i=1; i <= 2; i++)
	  	{
	  		tmpV = "theForm.exhc"+i+".checked";
	  		if (eval(tmpV))
				ChkExh1 = 1;
		}
	  	
	  	if (ChkExh1 == 0)
	  	{
		    	alert("Please specify \"your wish of Exhibitions\".");
		    	theForm.exhc1.focus();
		    	return (false);  		
		}
		else
		{
			if (theForm.exhc1.checked)
			{
				ChkExh1a = 0;
			  	for (i=1; i <= 3; i++)
			  	{
			  		tmpV = "theForm.exhc1"+i+".checked";
			  		if (eval(tmpV))
						ChkExh1a = 1;
				}
			  	
			  	if (ChkExh1a == 0)
			  	{
				    	alert("Please specify \"Exhibitions\".");
				    	theForm.exhc11.focus();
				    	return (false);  		
				}
			}
			
			if (theForm.exhc2.checked)
			{
				ChkExh1b = 0;
			  	for (i=1; i <= 3; i++)
			  	{
			  		tmpV = "theForm.exhc2"+i+".checked";
			  		if (eval(tmpV))
						ChkExh1b = 1;
				}
			  	
			  	if (ChkExh1b == 0)
			  	{
				    	alert("Please specify \"Exhibitions\".");
				    	theForm.exhc21.focus();
				    	return (false);  		
				}
			}			
		}
	}
	
	// check pub enquiry
	if (atWhere == 2)
	{
		ChkPub1 = 0;
	  	for (i=1; i <= 5; i++)
	  	{
	  		tmpV = "theForm.pubi"+i+".checked";
	  		if (eval(tmpV))
				ChkPub1 = 1;
		}
	  	
	  	if (ChkPub1 == 0)
	  	{
		    	alert("Please specify \"your interest of Industry\".");
		    	theForm.pubi1.focus();
		    	return (false);  		
		}
	
		ChkPub2 = 0;
	  	for (i=1; i <= 4; i++)
	  	{
	  		tmpV = "theForm.pubc"+i+".checked";
	  		if (eval(tmpV))
				ChkPub2 = 1;
		}
	  	
	  	if (ChkPub2 == 0)
	  	{
		    	alert("Please specify \"your interest of Publication\".");
		    	theForm.pubc1.focus();
		    	return (false);  		
		}	
	}

	// check pub magazine enquiry
	if (atWhere == 3)
	{
		ChkCh1 = 0;
		for (i=0; i < theForm.mylnofbiz.length; i++)
		{
			if (theForm.mylnofbiz.options[i].selected)
			{
				ChkCh1 = 1;					
			}
		}
	  	
	  	if (ChkCh1 == 0)
	  	{
		    	alert("Please specify \"Line Of Business\".");
		    	theForm.mylnofbiz.focus();
		    	return (false);  		
		}
	  	else
	  	{
	  		theForm.lnofbiz_list.value = "";
	  		
			for (j=0; j < theForm.mylnofbiz.length; j++)
			{
				if (theForm.mylnofbiz.options[j].selected)
				{
		  			if (theForm.lnofbiz_list.value != "")
		  				theForm.lnofbiz_list.value += ",";
		
					theForm.lnofbiz_list.value += theForm.mylnofbiz.options[j].value;  						
				}
			}  	
	  	}

	  	theForm.purchase_list.value = "";
	  		
		for (j=0; j < theForm.mypurchase.length; j++)
		{
			if (theForm.mypurchase.options[j].selected)
			{
				if (theForm.purchase_list.value != "")
					theForm.purchase_list.value += ",";
		
				theForm.purchase_list.value += theForm.mypurchase.options[j].value;  						
			}
		}  	
	  		  				
		ChkPub2 = 0;
	  	for (i=1; i <= 4; i++)
	  	{
	  		tmpV = "theForm.pubc"+i+".checked";
	  		if (eval(tmpV))
				ChkPub2 = 1;
		}
	  	
	  	if (ChkPub2 == 0)
	  	{
		    	alert("Please specify \"your interest of Publication\".");
		    	theForm.pubc1.focus();
		    	return (false);  		
		}	
	}

	if (atWhere == 4)
	{
		theForm.prod_list.value = "";
				
	  	// compose the product list for saving
		for (j=0; j < theForm.myptype.length; j++)
		{
			if (theForm.myptype.options[j].selected)
			{
	  			if (theForm.prod_list.value != "")
	  				theForm.prod_list.value += ",";
	
				theForm.prod_list.value += theForm.myptype.options[j].value;  						
			}
		}
				
		ChkWeb1 = 0;
	  	for (i=1; i <= 2; i++)
	  	{
	  		tmpV = "theForm.webc"+i+".checked";
	  		if (eval(tmpV))
				ChkWeb1 = 1;
		}
	  	
	  	if (ChkWeb1 == 0)
	  	{
		    	alert("Please specify \"your interest of Online Services\".");
		    	theForm.webc1.focus();
		    	return (false);  		
		}		
	}
		
	// company information
	if (theForm.mLName.value == "")
  	{
    		alert("Please enter \"Last name\".");
    		theForm.mLName.focus();
    		return (false);
  	}
	else
	{
		if (checkNameN(theForm.mLName, 'Last name', 1) == false)
	    		return (false);
	}  	

	if (theForm.mFName.value == "")
  	{
    		alert("Please enter \"First name\".");
    		theForm.mFName.focus();
    		return (false);
  	}
	else
	{
		if (checkNameN(theForm.mFName, 'First name', 1) == false)
	    		return (false);
	} 

	if (atWhere == 4)
	{
		if (theForm.Gender_id.options[theForm.Gender_id.selectedIndex].value == "")	
	  	{
	    		alert("Please enter \"Salutation\".");
	    		theForm.Gender_id.focus();
	    		return (false);
	  	}
	}
	
	if (theForm.mEmail.value == "")
  	{
    		alert("Please enter \"Email address\".");
    		theForm.mEmail.focus();
    		return (false);
  	}
	else
	{
		if(!Validate_Email(theForm.mEmail))
		{
			alert('Please enter a valid \"Email\".');
			theForm.mEmail.focus();
			return(false);
		}
	}

	if (theForm.mCname.value == "")
  	{
    		alert("Please enter \"Company name\".");
    		theForm.mCname.focus();
    		return (false);
  	}

	if (theForm.mCadd1.value == "")
  	{
    		alert("Please enter \"Company address\".");
    		theForm.mCadd1.focus();
    		return (false);
  	}
  	else if (checkaddr(theForm.mCadd1) == false)
  	{
  		return false;
  	}

	if (theForm.Country_id.options[theForm.Country_id.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Country\".");
    		theForm.Country_id.focus();
    		return (false);
  	}
  	else if (theForm.Country_id.selectedIndex == 44)	
  	{
  		if (theForm.Province_id.options[theForm.Province_id.selectedIndex].value == 0)
  		{
	    		alert("Please enter \"Province\".");
	    		theForm.Province_id.focus();
	    		return (false);
  		} 
  		
		if (theForm.mCpostal.value == "")
	  	{
	    		alert("Please enter \"Postal Code\".");
	    		theForm.mCpostal.focus();
	    		return (false);
	  	}  		
	}
  	else if (theForm.Country_id.selectedIndex == 223)	
  	{
		if (theForm.mCpostal.value == "")
	  	{
	    		alert("Please enter \"Postal Code\".");
	    		theForm.mCpostal.focus();
	    		return (false);
	  	}  		
	}	

	// telephone number
	if (theForm.Country_id.selectedIndex != 96)
	{
		if (theForm.mTelAC.value == "")
	  	{
	    		alert("Please enter \"area code\".");
	    		theForm.mTelAC.focus();
	    		return (false);
	  	}
	  	else
	  	{
			if (!isNum(theForm.mTelAC)) {
	          		alertBox("Please use digits (0-9)", theForm.mTelAC)
	          		return false;
	    		}  		
	  	}
	}

	if (theForm.mTel.value == "")
  	{
    		alert("Please enter \"number\".");
    		theForm.mTel.focus();
    		return (false);
  	}
  	else
	{
		if (checkTel(theForm.mTel) == false)
	    		return (false);
	}  	  	

	if (theForm.Title_id.options[theForm.Title_id.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Title/Position\".");
    		theForm.Title_id.focus();
    		return (false);
  	}
  	else if (theForm.Title_id.selectedIndex == (theForm.Title_id.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.Title_other.value == "")
  		{
	    		alert("Please specify your \"Title/Position\".");
	    		theForm.Title_other.focus();
	    		return (false);
  		}
  	}

	if (theForm.department.options[theForm.department.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Department\".");
    		theForm.department.focus();
    		return (false);
  	}
  	else if (theForm.department.selectedIndex == (theForm.department.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.Dept_other.value == "")
  		{
	    		alert("Please specify your \"Department\".");
	    		theForm.Dept_other.focus();
	    		return (false);
  		}
  	}
  	  	  	
	if (theForm.bizNature.options[theForm.bizNature.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Business nature\".");
    		theForm.bizNature.focus();
    		return (false);
  	}
  	else if (theForm.bizNature.selectedIndex == (theForm.bizNature.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.bizNature_other.value == "")
  		{
	    		alert("Please specify \"Business nature\".");
	    		theForm.bizNature_other.focus();
	    		return (false);
  		}
  	}

	if (theForm.Ownership.options[theForm.Ownership.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Ownership\".");
    		theForm.Ownership.focus();
    		return (false);
  	}
  	else if (theForm.Ownership.selectedIndex == (theForm.Ownership.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.Owner_other.value == "")
  		{
	    		alert("Please specify \"Ownership\".");
	    		theForm.Owner_other.focus();
	    		return (false);
  		}
  	}

	if (theForm.noemp.options[theForm.noemp.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Total No. of Employee\".");
    		theForm.noemp.focus();
    		return (false);
  	}
  			
	return (true);
}

function validate_form2info(theForm)
{
	if (theForm.ch1.value == "1")
	{
		theForm.show_list.value = "";
	
		ChkExh1 = 0;
	  	for (i=1; i <= 2; i++)
	  	{
	  		tmpV = "theForm.exhc"+i+".checked";
	  		if (eval(tmpV))
				ChkExh1 = 1;
		}
	  	
	  	if (ChkExh1 == 0)
	  	{
		    	alert("Please specify \"your wish of Exhibitions\".");
		    	theForm.exhc1.focus();
		    	return (false);  		
		}
	
		ChkExh2 = 0;
		for (i=0; i < theForm.myshow.length; i++)
		{
			if (theForm.myshow.options[i].selected)
			{
				ChkExh2 = 1;					
			}
		}
	  	
	  	if (ChkExh2 == 0)
	  	{
		    	alert("Please specify \"your interest of Exhibitions\".");
		    	theForm.myshow.focus();
		    	return (false);  		
		}
	  	else
	  	{
			for (j=0; j < theForm.myshow.length; j++)
			{
				if (theForm.myshow.options[j].selected)
				{
		  			if (theForm.show_list.value != "")
		  				theForm.show_list.value += ",";
		
					theForm.show_list.value += theForm.myshow.options[j].value;  						
				}
			}  	
	  	}
	}

	if (theForm.ch2.value == "1")
	{
		ChkPub1 = 0;
	  	for (i=1; i <= 5; i++)
	  	{
	  		tmpV = "theForm.pubi"+i+".checked";
	  		if (eval(tmpV))
				ChkPub1 = 1;
		}
	  	
	  	if (ChkPub1 == 0)
	  	{
		    	alert("Please specify \"your interest of Industry\".");
		    	theForm.pubi1.focus();
		    	return (false);  		
		}
	
		ChkPub2 = 0;
	  	for (i=1; i <= 3; i++)
	  	{
	  		tmpV = "theForm.pubc"+i+".checked";
	  		if (eval(tmpV))
				ChkPub2 = 1;
		}
	  	
	  	if (ChkPub2 == 0)
	  	{
		    	alert("Please specify \"your interest of Publication\".");
		    	theForm.pubc1.focus();
		    	return (false);  		
		}
	}

	if (theForm.ch3.value == "1")
	{
		ChkWeb1 = 0;
	  	for (i=1; i <= 2; i++)
	  	{
	  		tmpV = "theForm.webc"+i+".checked";
	  		if (eval(tmpV))
				ChkWeb1 = 1;
		}
	  	
	  	if (ChkWeb1 == 0)
	  	{
		    	alert("Please specify \"your interest of Online Services\".");
		    	theForm.webc1.focus();
		    	return (false);  		
		}
	}
			
	return (true);
}

function validate_search(theForm)
{
	FormInput = 0
	if (theForm.myIndustry_id.options[theForm.myIndustry_id.selectedIndex].value != "")	
		FormInput = 1;
	if (theForm.myCountry_id.options[theForm.myCountry_id.selectedIndex].value != "")	
		FormInput = 1;
	if (theForm.smonth.options[theForm.smonth.selectedIndex].value != "")	
		FormInput = 1;
	if (theForm.syear.options[theForm.syear.selectedIndex].value != "")	
		FormInput = 1;
	if (theForm.emonth.options[theForm.emonth.selectedIndex].value != "")	
		FormInput = 1;
	if (theForm.eyear.options[theForm.eyear.selectedIndex].value != "")	
		FormInput = 1;
		
	if (FormInput == 0)
	{
		    alert("Please select any one of the search criteria.");
		    theForm.myIndustry_id.focus();
		    return (false);		
	}
	else		
		return (true);
}

function validate_press(theForm)
{
	// company information
	if (theForm.mLName.value == "")
  	{
    		alert("Please enter \"Last name\".");
    		theForm.mLName.focus();
    		return (false);
  	}
	else
	{
		if (checkNameN(theForm.mLName, 'Last name', 1) == false)
	    		return (false);
	}  	

	if (theForm.mFName.value == "")
  	{
    		alert("Please enter \"First name\".");
    		theForm.mFName.focus();
    		return (false);
  	}
	else
	{
		if (checkNameN(theForm.mFName, 'First name', 1) == false)
	    		return (false);
	} 

	if (theForm.mEmail.value == "")
  	{
    		alert("Please enter \"Email address\".");
    		theForm.mEmail.focus();
    		return (false);
  	}
	else
	{
		if(!Validate_Email(theForm.mEmail))
		{
			alert('Please enter a valid \"Email\".');
			theForm.mEmail.focus();
			return(false);
		}
	}

	if (theForm.mCname.value == "")
  	{
    		alert("Please enter \"Name of Media\".");
    		theForm.mCname.focus();
    		return (false);
  	}

	if (theForm.mCadd1.value == "")
  	{
    		alert("Please enter \"Address\".");
    		theForm.mCadd1.focus();
    		return (false);
  	}
  	else if (checkaddr(theForm.mCadd1) == false)
  	{
  		return false;
  	}

	if (theForm.Country_id.options[theForm.Country_id.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Country\".");
    		theForm.Country_id.focus();
    		return (false);
  	}
  	else if (theForm.Country_id.selectedIndex == 44)	
  	{
  		if (theForm.Province_id.options[theForm.Province_id.selectedIndex].value == 0)
  		{
	    		alert("Please enter \"Province\".");
	    		theForm.Province_id.focus();
	    		return (false);
  		} 
  		
		if (theForm.mCpostal.value == "")
	  	{
	    		alert("Please enter \"Postal Code\".");
	    		theForm.mCpostal.focus();
	    		return (false);
	  	}  		
	}
  	else if (theForm.Country_id.selectedIndex == 223)	
  	{
		if (theForm.mCpostal.value == "")
	  	{
	    		alert("Please enter \"Postal Code\".");
	    		theForm.mCpostal.focus();
	    		return (false);
	  	}  		
	}	

	// telephone number
	if (theForm.mTelAC.value == "")
  	{
    		alert("Please enter \"area code\".");
    		theForm.mTelAC.focus();
    		return (false);
  	}
  	else
  	{
		if (!isNum(theForm.mTelAC)) {
          		alertBox("Please use digits (0-9)", theForm.mTelAC)
          		return false;
    		}  		
  	}

	if (theForm.mTel.value == "")
  	{
    		alert("Please enter \"number\".");
    		theForm.mTel.focus();
    		return (false);
  	}
  	else
	{
		if (checkTel(theForm.mTel) == false)
	    		return (false);
	}  	  	
  	
	ChkChoice = 0;
  	for (i=1; i <= 8; i++)
  	{
  		tmpV = "theForm.m"+i+".checked";
  		if (eval(tmpV))
			ChkChoice = 1;
	}
  	
  	if (ChkChoice == 0)
  	{
	    	alert("Please specify \"Media Category\".");
	    	theForm.m1.focus();
	    	return (false);  		
	}

	ChkChoice2 = 0;
  	for (i=1; i <= 3; i++)
  	{
  		tmpV = "theForm.lm"+i+".checked";
  		if (eval(tmpV))
			ChkChoice2 = 1;
	}
  	
  	if (ChkChoice2 == 0)
  	{
	    	alert("Please specify \"Language of the Media\".");
	    	theForm.lm1.focus();
	    	return (false);  		
	}

	ChkChoice3 = 0;
  	for (i=1; i <= 3; i++)
  	{
  		tmpV = "theForm.exhc"+i+".checked";
  		if (eval(tmpV))
			ChkChoice3 = 1;
	}
  	
  	if (ChkChoice3 == 0)
  	{
	    	alert("Please specify \"your interest\".");
	    	theForm.exhc1.focus();
	    	return (false);  		
	}
		
	return (true);	
}

function validate_prereg(theForm)
{
	// company information
	if (theForm.mCname.value == "")
  	{
    		alert("Please enter \"Company\".");
    		theForm.mCname.focus();
    		return (false);
  	}
  		
	if (theForm.mContact.value == "")
  	{
    		alert("Please enter \"Contact Person\".");
    		theForm.mContact.focus();
    		return (false);
  	}

	if (theForm.mTitle.value == "")
  	{
    		alert("Please enter \"Title\".");
    		theForm.mTitle.focus();
    		return (false);
  	}

	if (theForm.department.options[theForm.department.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Department\".");
    		theForm.department.focus();
    		return (false);
  	}
  	else if (theForm.department.selectedIndex == (theForm.department.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.Dept_other.value == "")
  		{
	    		alert("Please specify your \"Department\".");
	    		theForm.Dept_other.focus();
	    		return (false);
  		}
  	}
  	
	// telephone number
	if (theForm.mTelAC.value == "")
  	{
    		alert("Please enter \"area code\".");
    		theForm.mTelAC.focus();
    		return (false);
  	}
  	else
  	{
		if (!isNum(theForm.mTelAC)) {
          		alertBox("Please use digits (0-9)", theForm.mTelAC)
          		return false;
    		}  		
  	}

	if (theForm.mTel.value == "")
  	{
    		alert("Please enter \"number\".");
    		theForm.mTel.focus();
    		return (false);
  	}
  	else
	{
		if (checkTel(theForm.mTel) == false)
	    		return (false);
	}

	// fax number
	if (theForm.mFaxAC.value == "")
  	{
    		alert("Please enter \"area code\".");
    		theForm.mFaxAC.focus();
    		return (false);
  	}
  	else
  	{
		if (!isNum(theForm.mFaxAC)) {
          		alertBox("Please use digits (0-9)", theForm.mFaxAC)
          		return false;
    		}  		
  	}

	if (theForm.mFax.value == "")
  	{
    		alert("Please enter \"number\".");
    		theForm.mFax.focus();
    		return (false);
  	}
  	else
	{
		if (checkTel(theForm.mFax) == false)
	    		return (false);
	}

	if (theForm.mEmail.value == "")
  	{
    		alert("Please enter \"Email\".");
    		theForm.mEmail.focus();
    		return (false);
  	}
		else
		{
			ChkEmail1 = 0;
			ChkEmail2 = 0;
			for (j=0; j < theForm.mEmail.value.length; j++)
			{
				if (theForm.mEmail.value.charAt(j) == "@")
					ChkEmail1 = 1;
				if (theForm.mEmail.value.charAt(j) == ".")
					ChkEmail2 = 1;				
			}
			
		  	if (ChkEmail1 == 0 || ChkEmail2 == 0)
		  	{
			    	alert("Not a valid email address.");
			    	theForm.mEmail.focus();
			    	return (false);  		
			}  			
		}  
  		
	if (theForm.mCadd1.value == "")
  	{
    		alert("Please enter \"Address\".");
    		theForm.mCadd1.focus();
    		return (false);
  	}
  	else if (checkaddr(theForm.mCadd1) == false)
  	{
  		return false;
  	}

	if (theForm.Country_id.options[theForm.Country_id.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Country/Region\".");
    		theForm.Country_id.focus();
    		return (false);
  	}
  	
	if (theForm.mScope.value == "")
  	{
    		alert("Please enter \"Scope of Products\".");
    		theForm.mScope.focus();
    		return (false);
  	}	  	
  	
	ChkChoice = 0;
  	for (i=1; i <= theForm.bn_no.value; i++)
  	{
  		tmpV = "theForm.b"+i+".checked";
  		if (eval(tmpV))
			ChkChoice = 1;
	}
  	
  	if (ChkChoice == 0)
  	{
	    	alert("Please specify \"Product / Service Sector\".");
	    	theForm.b1.focus();
	    	return (false);  		
	}
	else
	{
	  	tmpV = "theForm.b"+theForm.bn_no.value+".checked";
	  	if (eval(tmpV))
	  	{
	  		if (theForm.BOthers.value == "")
	  		{
		    		alert("Please specify \"Product / Service Sector\".");
		    		theForm.BOthers.focus();
		    		return (false);  			
	  		}
	  	}
	  	
	  	theForm.bn_list.value = "";
	  	for (j=1; j <= theForm.bn_no.value; j++)
	  	{
	  		tmpV1 = "theForm.b"+j+".checked";
	  		if (eval(tmpV1))
	  		{
	  			if (theForm.bn_list.value != "")
	  				theForm.bn_list.value += ",";
	  			
	  			tmpV2 = "theForm.b"+j+".value";
				theForm.bn_list.value += eval(tmpV2);  			
	  		}
		}		
	}

	if (theForm.Owner_id.options[theForm.Owner_id.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Ownership\".");
    		theForm.Owner_id.focus();
    		return (false);
  	}
  	else if (theForm.Owner_id.selectedIndex == (theForm.Owner_id.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.Owner_other.value == "")
  		{
	    		alert("Please specify \"Ownership\".");
	    		theForm.Owner_other.focus();
	    		return (false);
  		}
  	}
  		
	if (theForm.PreregBizNature.options[theForm.PreregBizNature.selectedIndex].value == "")	
  	{
    		alert("Please enter \"Business nature\".");
    		theForm.PreregBizNature.focus();
    		return (false);
  	}
  	else if (theForm.PreregBizNature.selectedIndex == (theForm.PreregBizNature.length-1))
  	{
  		// select others, but didn't fill in the text box
  		if (theForm.bizNature_other.value == "")
  		{
	    		alert("Please specify \"Business nature\".");
	    		theForm.bizNature_other.focus();
	    		return (false);
  		}
  	}

	  theForm.expList.value = "";
	  for (j=1; j <= theForm.exp_no.value; j++)
	  {
	  	tmpV1 = "theForm.expc"+j+".checked";
	  	if (eval(tmpV1))
	  	{
	  		if (theForm.expList.value != "")
	  			theForm.expList.value += ",";
	  		
	  		tmpV2 = "theForm.expc"+j+".value";
			theForm.expList.value += eval(tmpV2);  			
	  	}
	}
	
	return (true);	
}

function Validate_Email(obj) {
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		return filter.test(obj.value);
}
