// ************************** Contact Page Validation Starts ***************************************//

function funcValidateContactPage(objForm)
{
	var bCorrect = true;
	
	if(funcTrim(objForm.txtEmail.value) == "")
	{
		bCorrect = false;
		alert("Please give email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if email null check
	
	if(bCorrect && !funcIsEmail(objForm.txtEmail.value))
	{
		bCorrect = false;
		alert("Please give valid email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if valid email check
	
	return bCorrect;
	
}//end funcValidateContactPage 

// ************************** Contact Page Validation Ends ***************************************//



// ************************** Add Email Addresses  Page Validation Starts ***************************************//

function funcValidateAddEmail(objForm)
{
	var bCorrect = true;
	
	
		
	if(funcTrim(objForm.txtEmail.value) == "")
	{
		bCorrect = false;
		alert("Please give email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if email null check
	
	if(bCorrect && !funcIsEmail(objForm.txtEmail.value))
	{
		bCorrect = false;
		alert("Please give valid email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if valid email check
	
	//Validating 5 set of email,password and confrim passwrod ~ starts
	var objEmail,objPassword,ObjConfirmPassword;
	
	for(var iLoop = 1; iLoop <= 5; iLoop++)
	{
		var bCorrectEmail = false;
		//Email validating ~ Starts
		objEmail	= document.getElementById("txtEmail" + iLoop );
		
		if(bCorrect && funcTrim(objEmail.value) != "")
		{
			if(bCorrect && !funcIsEmail(objEmail.value))
			{
				bCorrect = false;
				alert("Please give valid email address");
				objEmail.focus();
				objEmail.select();
			}//end check email
			else
			{
				bCorrectEmail = true;
			}//end else
		}//end if check not null
		//Email validating ~ Ends
		
		//Password Validating ~ Starts 
		objPassword			= document.getElementById("txtPassword" 		+ iLoop );
		ObjConfirmPassword	= document.getElementById("txtConfirmPassword" 	+ iLoop );
		
		if(bCorrectEmail)
		{
			if(bCorrect && funcTrim(objPassword.value) != "")
			{
				if(bCorrect && funcTrim(ObjConfirmPassword.value) != "" )
				{
					if(funcTrim(objPassword.value) !== funcTrim(ObjConfirmPassword.value))
					{
						bCorrect = false;
						alert("Confirm password is wrong");
						ObjConfirmPassword.focus();
						ObjConfirmPassword.select();
						break;
						
					}
				}//end if
				else
				{
					bCorrect = false;
					alert("Please give confirm password");
					ObjConfirmPassword.focus();
					ObjConfirmPassword.select();
					break;
				}//end else
				
			}//end if
			else
			{
				bCorrect = false;
				alert("Please give password");
				objPassword.focus();
				objPassword.select();
				break;
			}//end else
		}//end if bCorrectEmail checking
		//Password Validating ~ Ends 
		
	}//end for
	//Validating 5 set of email,password and confrim passwrod ~ starts
	
	return bCorrect;
}//end funcValidateAddEmail

// ************************** Add Email Addresses  Page Validation Ends ***************************************//



// ************************** Personal Web Space  Page Validation Starts ***************************************//

function funcValidateWebsite(objForm)
{
	var bCorrect = true;
	
	if(funcTrim(objForm.txtEmail.value) == "")
	{
		bCorrect = false;
		alert("Please give email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if email null check
	
	if(bCorrect && !funcIsEmail(objForm.txtEmail.value))
	{
		bCorrect = false;
		alert("Please give valid email address");
		objForm.txtEmail.focus();
		objForm.txtEmail.select();
	}//end if valid email check
	
	return bCorrect;
}//end funcValidateWebsite
// ************************** Personal Web Space  Page Validation Ends ***************************************//


// ************************** Change Account Info  Page Validation Starts ***************************************//

function funcValidateMContact(objForm)
{
	var bCorrect = true;
	
	if(funcTrim(objForm.txtCurrentEmail.value) == "")
	{
		bCorrect = false;
		alert("Please give current email address");
		objForm.txtCurrentEmail.focus();
		objForm.txtCurrentEmail.select();
	}//end if email null check
	
	if(bCorrect && !funcIsEmail(objForm.txtCurrentEmail.value))
	{
		bCorrect = false;
		alert("Please give valid email address");
		objForm.txtCurrentEmail.focus();
		objForm.txtCurrentEmail.select();
	}//end if valid email check
	
	if(bCorrect && funcTrim(objForm.txtCurrentEmail.value) == "")
	{
		bCorrect = false;
		alert("Please give email address");
		objForm.txtCurrentEmail.focus();
		objForm.txtCurrentEmail.select();
	}//end if email null check
	
	if(bCorrect && !funcIsEmail(objForm.txtCurrentEmail.value))
	{
		bCorrect = false;
		alert("Please give valid email address");
		objForm.txtCurrentEmail.focus();
		objForm.txtCurrentEmail.select();
	}//end if valid email check
	
	return bCorrect;
}//end funcValidateMContact

// ************************** Change Account Info  Page Validation Ends ***************************************//
