
function nextStep( )
{
	var objFV = new FormValidator("frmRegister");
	
	if (!objFV.validate("txtEmail", "B,E", "Please enter your valid Email Address."))
		return false;		
		
	if (!objFV.validate("txtConfirmEmail", "B,E", "Please confirm your Email Address."))
		return false;
		
	if (objFV.value("txtEmail") != objFV.value("txtConfirmEmail"))
	{
		alert("The Confirm Email does not MATCH with the Email provided.");

		objFV.focus("txtConfirmEmail");
		objFV.select("txtConfirmEmail");

		return false;
	}		
		
	if (!objFV.validate("txtPassword", "B,L(5)", "Please enter your Password (Min Length = 5)."))
		return false;
		
	if (!objFV.validate("txtConfirmPassword", "B,L(5)", "Please enter the Confirm Password (Min Length = 5)."))
		return false;
		
	if (objFV.value("txtPassword") != objFV.value("txtConfirmPassword"))
	{
		alert("The Confirm Password does not MATCH with the Password provided.");

		objFV.focus("txtConfirmPassword");
		objFV.select("txtConfirmPassword");

		return false;
	}
	
	if (!objFV.validate("txtFirstName", "B", "Please enter your First Name."))
		return false;		
		
	if (!objFV.validate("txtLastName", "B", "Please enter your Last Name."))
		return false;		

	if (!objFV.validate("txtCompany", "B", "Please enter your Company Name."))
		return false;
		
	if (!objFV.validate("txtPosition", "B", "Please enter your Position."))
		return false;		
		
	if (!objFV.validate("ddCountry", "B", "Please select your Country."))
		return false;	
		
	if (!objFV.validate("txtPhone", "B", "Please enter your Phone No."))
		return false;
		
	if (objFV.value("filePicture") != "")
	{
		if (!checkImage(objFV.value("filePicture")))
		{
			alert("Invalid File Format. Please select an image file of type jpg, gif or png.");

			objFV.focus("filePicture");
			objFV.select("filePicture");

			return false;
		}
	}
	
	if (!objFV.validate("txtProfile", "B", "Please enter your brief Business Profile."))
		return false;
		
	document.getElementById('Step1').style.display = "none";
	document.getElementById('Step2').style.display = "block";
	
	objFV.focus("txtInterestSector1");
}

function validateForm( )
{
	var objFV = new FormValidator("frmRegister");
	
	if (!objFV.validate("txtEmail", "B,E", "Please enter your valid Email Address."))
		return false;		
		
	if (!objFV.validate("txtConfirmEmail", "B,E", "Please confirm your Email Address."))
		return false;
		
	if (objFV.value("txtEmail") != objFV.value("txtConfirmEmail"))
	{
		alert("The Confirm Email does not MATCH with the Email provided.");

		objFV.focus("txtConfirmEmail");
		objFV.select("txtConfirmEmail");

		return false;
	}		
		
	if (!objFV.validate("txtPassword", "B,L(5)", "Please enter your Password (Min Length = 5)."))
		return false;
		
	if (!objFV.validate("txtConfirmPassword", "B,L(5)", "Please enter the Confirm Password (Min Length = 5)."))
		return false;
		
	if (objFV.value("txtPassword") != objFV.value("txtConfirmPassword"))
	{
		alert("The Confirm Password does not MATCH with the Password provided.");

		objFV.focus("txtConfirmPassword");
		objFV.select("txtConfirmPassword");

		return false;
	}
	
	if (!objFV.validate("txtFirstName", "B", "Please enter your First Name."))
		return false;		
		
	if (!objFV.validate("txtLastName", "B", "Please enter your Last Name."))
		return false;		

	if (!objFV.validate("txtCompany", "B", "Please enter your Company Name."))
		return false;
		
	if (!objFV.validate("txtPosition", "B", "Please enter your Position."))
		return false;		
		
	if (!objFV.validate("ddCountry", "B", "Please select your Country."))
		return false;	
		
	if (!objFV.validate("txtPhone", "B", "Please enter your Phone No."))
		return false;
		
	if (objFV.value("filePicture") != "")
	{
		if (!checkImage(objFV.value("filePicture")))
		{
			alert("Invalid File Format. Please select an image file of type jpg, gif or png.");

			objFV.focus("filePicture");
			objFV.select("filePicture");

			return false;
		}
	}
	
	if (!objFV.validate("txtProfile", "B", "Please enter your brief Business Profile."))
		return false;	
	
	if (!objFV.validate("txtInterestSector1", "B", "Please enter your Sectros of Interest # 1"))
		return false;		
		
	if (!objFV.validate("txtInterestSector2", "B", "Please enter your Sectros of Interest # 2"))
		return false;		
		
	if (!objFV.validate("txtInterestSector3", "B", "Please enter your Sectros of Interest # 3"))
		return false;		
		
	if (!objFV.validate("txtRegionalInterest1", "B", "Please enter your Regional Interest # 1"))
		return false;		

	if (!objFV.validate("txtRegionalInterest2", "B", "Please enter your Regional Interest # 2"))
		return false;	
		
	if (!objFV.validate("txtCompanyIndustry", "B", "Please enter your Industry Type."))
		return false;		
		
	if (!objFV.validate("txtCompanyProfile", "B", "Please enter the brief Company Profile."))
		return false;				
		
	if (!objFV.validate("txtCompanyPhone", "B", "Please enter the Company Phone No."))
		return false;						
	
	if (!objFV.isChecked("cbAgree") == true)
	{
		alert("Please confirm that you have read and agreed with the site Terms & Conditions.");
		
		return false;
	}	
	
	return true;
}

function checkImage(sFile)
{
	var iDotPosition = sFile.lastIndexOf(".");
	
	if (iDotPosition == -1)
		return false;

	var sExtension = sFile.substring((iDotPosition + 1)).toLowerCase( );

	if (sExtension != "jpg" && sExtension != "jpeg" && sExtension != "gif" && sExtension != "png")
		return false;

	return true;
}