// JavaScript Document
function checkUrlNew(theUrl){
  if(theUrl.value.match(/^(http|ftp)\:\/\/\w+([\.\-]\w+)*\.\w{2,4}(\:\d+)*([\/\.\-\?\&\%\#]\w+)*\/?$/i) ||
     theUrl.value.match(/^mailto\:\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w{2,4}$/i)){
    return true;
  } else {
    return false;
  }
}

function ValidateForgotPasswordForm()
{
	if(trim(document.getElementById('UserEmailId').value) == '')
	{
		alert("Please enter your email.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();
		return false;
	}else if (echeck(trim(document.getElementById('UserEmailId').value)) == false){
		
		alert("Email address is not valid.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();

		return false;
	}else{
		document.ForgotPasswordForm.submit();
	}
}
function ValidateChangePasswordForm(){
	if(trim(document.getElementById('UserOldPasswdId').value) == '')
	{
		alert("Please enter current password.");
		document.getElementById('UserOldPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserOldPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserOldPasswdId').focus();
		return false;
	}else if(trim(document.getElementById('UserPasswdId').value) == '')
	{
		alert("Please enter new password.");
		
		document.getElementById('UserConfirmPasswdId').style.backgroundColor = '#FFFFFF';
		document.getElementById('UserConfirmPasswdId').style.color = '#000000';

		document.getElementById('UserPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserPasswdId').focus();
		return false;
	}else if(trim(document.getElementById('UserPasswdId').value).length < 7)
	{
		alert("Password must contain atleast seven characters.");
		
		document.getElementById('UserConfirmPasswdId').style.backgroundColor = '#FFFFFF';
		document.getElementById('UserConfirmPasswdId').style.color = '#000000';

		document.getElementById('UserPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserPasswdId').focus();
		
		return false;
	}else if(document.getElementById('UserConfirmPasswdId').value != document.getElementById('UserPasswdId').value)
	{
		alert(document.getElementById('UserConfirmPasswdId').value);
		alert(document.getElementById('UserPasswdId').value);
		alert("Password does not match.");
		
		document.getElementById('UserPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserPasswdId').style.color = '#FFFFFF';
		
		document.getElementById('UserConfirmPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserConfirmPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserConfirmPasswdId').focus();
		return false;
	}else{
		document.ChangePasswordForm.submit();
	}
}
function ValidateRegistrationForm()
{
	var alphaExp = /^[0-9]{4}\s[A-Z]{2}$/;
	var numericExpression = /^[0-9]+$/;
	
	document.getElementById('UserEmailId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserEmailId').style.color = '#000000';
	
	document.getElementById('UserTitleId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserTitleId').style.color = '#000000';
	
	document.getElementById('UserPasswdId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserPasswdId').style.color = '#000000';
	
	document.getElementById('ConfirmPasswdId').style.backgroundColor = '#FFFFFF';
	document.getElementById('ConfirmPasswdId').style.color = '#000000';
	
	document.getElementById('UserFnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserFnameId').style.color = '#000000';
		
	document.getElementById('UserLnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserLnameId').style.color = '#000000';
		
	document.getElementById('UserMobileId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserMobileId').style.color = '#000000';
	
	document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('MobileCountryCodeId').style.color = '#000000';
		
	document.getElementById('CountryId').style.backgroundColor = '#FFFFFF';
	document.getElementById('CountryId').style.color = '#000000';
	
	document.getElementById('StateId').style.backgroundColor = '#FFFFFF';
	document.getElementById('StateId').style.color = '#000000';
		
	document.getElementById('CompanyId').style.backgroundColor = '#FFFFFF';
	document.getElementById('CompanyId').style.color = '#000000';

	document.getElementById('NoOfEmployeesId').style.backgroundColor = '#FFFFFF';
	document.getElementById('NoOfEmployeesId').style.color = '#000000';
	
	document.getElementById('BusinessPhCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhCountryCodeId').style.color = '#000000';
	
	document.getElementById('BusinessPhAreaCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhAreaCodeId').style.color = '#000000';
	
	document.getElementById('BusinessPhoneId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhoneId').style.color = '#000000';
	
	document.getElementById('BusinessAddress1Id').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessAddress1Id').style.color = '#000000';
	
	document.getElementById('BusinessFxCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFxCountryCodeId').style.color = '#000000';
	
	document.getElementById('BusinessFxAreaCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFxAreaCodeId').style.color = '#000000';
	
	document.getElementById('BusinessFaxId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFaxId').style.color = '#000000';
	
	document.getElementById('BusinessWebsiteId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessWebsiteId').style.color = '#000000';
	
	document.getElementById('BusinessCityId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessCityId').style.color = '#000000';
	
	document.getElementById('BusinessBlogId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessBlogId').style.color = '#000000';
	
	document.getElementById('BusinessPostalCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPostalCodeId').style.color = '#000000';
	
	if(trim(document.getElementById('UserEmailId').value) == '')
	{
		alert("Please enter your email.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();
		return false;
	}else if (echeck(trim(document.getElementById('UserEmailId').value)) == false){
		
		alert("Email is not valid.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();

		return false;
	}else if(trim(document.getElementById('UserPasswdId').value) == '')
	{
		alert("Please enter password.");
		
		document.getElementById('UserPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserPasswdId').focus();
		return false;
	}else if(trim(document.getElementById('UserPasswdId').value).length < 7)
	{
		alert("Password must contain atleast seven characters.");
		
		document.getElementById('UserPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('UserPasswdId').style.color = '#FFFFFF';
		document.getElementById('UserPasswdId').focus();
		
		return false;
	}else if(document.getElementById('UserPasswdId').value != document.getElementById('ConfirmPasswdId').value)
	{
		alert("Password does not match.");
		
		document.getElementById('ConfirmPasswdId').style.backgroundColor = '#FF0000';
		document.getElementById('ConfirmPasswdId').style.color = '#FFFFFF';
		document.getElementById('ConfirmPasswdId').focus();
		return false;
	}else if(trim(document.getElementById('MobileCountryCodeId').value) == '')
	{
		alert("Please enter country code.");
		
		document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('MobileCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('MobileCountryCodeId').focus();
		return false;
	}else if(!(document.getElementById('MobileCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter valid country code.");
		
		document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('MobileCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('MobileCountryCodeId').focus();
		return false;
	}else if(trim(document.getElementById('UserMobileId').value) == '')
	{
		alert("Please enter mobile number.");
		
		document.getElementById('UserMobileId').style.backgroundColor = '#FF0000';
		document.getElementById('UserMobileId').style.color = '#FFFFFF';
		document.getElementById('UserMobileId').focus();
		return false;
	}else if(!(document.getElementById('UserMobileId').value).match(numericExpression))
	{
		alert("Please enter valid mobile number.");
		
		document.getElementById('UserMobileId').style.backgroundColor = '#FF0000';
		document.getElementById('UserMobileId').style.color = '#FFFFFF';
		document.getElementById('UserMobileId').focus();
		return false;
	}else if(trim(document.getElementById('UserTitleId').value) == '')
	{
		alert("Please select title.");
		
		document.getElementById('UserTitleId').style.backgroundColor = '#FF0000';
		document.getElementById('UserTitleId').style.color = '#FFFFFF';
		document.getElementById('UserTitleId').focus();
		return false;
	}else if(trim(document.getElementById('UserFnameId').value) == '')
	{
		alert("Please enter first name.");
		document.getElementById('UserFnameId').style.backgroundColor = '#FF0000';
		document.getElementById('UserFnameId').style.color = '#FFFFFF';
		document.getElementById('UserFnameId').focus();
		return false;
	}else if(trim(document.getElementById('UserLnameId').value) == '')
	{
		alert("Please enter last name.");
		
		document.getElementById('UserLnameId').style.backgroundColor = '#FF0000';
		document.getElementById('UserLnameId').style.color = '#FFFFFF';
		document.getElementById('UserLnameId').focus();
		return false;
	}else if(trim(document.getElementById('CountryId').value) == '')
	{
		alert("Please select country.");
		
		document.getElementById('CountryId').style.backgroundColor = '#FF0000';
		document.getElementById('CountryId').style.color = '#FFFFFF';
		document.getElementById('CountryId').focus();
		return false;
	}else if(trim(document.getElementById('StateId').value) == '' && trim(document.getElementById('OtherStateId').value) == '')
	{
		alert("Please select state.");
		
		document.getElementById('StateId').style.backgroundColor = '#FF0000';
		document.getElementById('StateId').style.color = '#FFFFFF';
		document.getElementById('StateId').focus();
		return false;
	}else if(trim(document.getElementById('CompanyId').value) == '')
	{
		alert("Please enter your company.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('CompanyId').style.backgroundColor = '#FF0000';
		document.getElementById('CompanyId').style.color = '#FFFFFF';
		document.getElementById('CompanyId').focus();
		return false;
	}else if(document.getElementById('NoOfEmployeesId').value && !(document.getElementById('NoOfEmployeesId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('NoOfEmployeesId').style.backgroundColor = '#FF0000';
		document.getElementById('NoOfEmployeesId').style.color = '#FFFFFF';
		document.getElementById('NoOfEmployeesId').focus();
		return false;
	}else if(document.getElementById('BusinessPhCountryCodeId').value && !(document.getElementById('BusinessPhCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessPhCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhCountryCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessPhAreaCodeId').value && !(document.getElementById('BusinessPhAreaCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessPhAreaCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhAreaCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhAreaCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessPhoneId').value && !(document.getElementById('BusinessPhoneId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessPhoneId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhoneId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhoneId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessAddress1Id').value) == '')
	{
		alert("Please enter business address.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessAddress1Id').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessAddress1Id').style.color = '#FFFFFF';
		document.getElementById('BusinessAddress1Id').focus();
		return false;
	}else if(document.getElementById('BusinessFxCountryCodeId').value && !(document.getElementById('BusinessFxCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessFxCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFxCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessFxCountryCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessFxAreaCodeId').value && !(document.getElementById('BusinessFxAreaCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessFxAreaCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFxAreaCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessFxAreaCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessFaxId').value && !(document.getElementById('BusinessFaxId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessFaxId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFaxId').style.color = '#FFFFFF';
		document.getElementById('BusinessFaxId').focus();
		return false;
	}else if(document.getElementById('BusinessWebsiteId').value && document.getElementById('BusinessWebsiteId').value != 'http://' && !checkUrlNew(document.getElementById('BusinessWebsiteId')))
	{
		alert("Please enter valid website url.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessWebsiteId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessWebsiteId').style.color = '#FFFFFF';
		document.getElementById('BusinessWebsiteId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessCityId').value) == '')
	{
		alert("Please enter business city.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessCityId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessCityId').style.color = '#FFFFFF';
		document.getElementById('BusinessCityId').focus();
		return false;
	}else if(document.getElementById('BusinessBlogId').value && document.getElementById('BusinessBlogId').value != 'http://' && !checkUrlNew(document.getElementById('BusinessBlogId')))
	{
		alert("Please enter valid website blog url.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessBlogId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessBlogId').style.color = '#FFFFFF';
		document.getElementById('BusinessBlogId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessPostalCodeId').value) == '')
	{
		alert("Please enter postal/zip code.");
		if(document.getElementById('one').style.visibility == "hidden")	
			spin('one');
		document.getElementById('BusinessPostalCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPostalCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPostalCodeId').focus();
		return false;
	}else{
		return true;
	}
}
function DeleteUserContactDetails(path)
{
	var answer = confirm("Are you sure, you want to delete this user details?")
	if (answer){
		window.location = path;
	}
}
function ValidateContactUsForm()
{
	document.getElementById('FnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('FnameId').style.color = '#000000';
		
	document.getElementById('LnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('LnameId').style.color = '#000000';
		
	document.getElementById('EmailId').style.backgroundColor = '#FFFFFF';
	document.getElementById('EmailId').style.color = '#000000';
	
	document.getElementById('SubjectId').style.backgroundColor = '#FFFFFF';
	document.getElementById('SubjectId').style.color = '#000000';
		
	document.getElementById('MessageId').style.backgroundColor = '#FFFFFF';
	document.getElementById('MessageId').style.color = '#000000';
		
	if(trim(document.getElementById('FnameId').value) == '')
	{
		alert("Please enter first name.");
		document.getElementById('FnameId').style.backgroundColor = '#FF0000';
		document.getElementById('FnameId').style.color = '#FFFFFF';
		document.getElementById('FnameId').focus();
		return false;
	}else if(trim(document.getElementById('LnameId').value) == '')
	{
		alert("Please enter last name.");
		
		document.getElementById('LnameId').style.backgroundColor = '#FF0000';
		document.getElementById('LnameId').style.color = '#FFFFFF';
		document.getElementById('LnameId').focus();
		return false;
	}else if(trim(document.getElementById('EmailId').value) == '')
	{
		alert("Please enter your email.");
		
		document.getElementById('EmailId').style.backgroundColor = '#FF0000';
		document.getElementById('EmailId').style.color = '#FFFFFF';
		document.getElementById('EmailId').focus();
		return false;
	}else if (echeck(trim(document.getElementById('EmailId').value)) == false){
		
		alert("Email is not valid.");
		
		document.getElementById('EmailId').style.backgroundColor = '#FF0000';
		document.getElementById('EmailId').style.color = '#FFFFFF';
		document.getElementById('EmailId').focus();

		return false;
	}else if(trim(document.getElementById('SubjectId').value) == '')
	{
		alert("Please enter subject.");
		
		document.getElementById('SubjectId').style.backgroundColor = '#FF0000';
		document.getElementById('SubjectId').style.color = '#FFFFFF';
		document.getElementById('SubjectId').focus();
		return false;
	}else if(trim(document.getElementById('MessageId').value) == '')
	{
		alert("Please enter your message.");
		
		document.getElementById('MessageId').style.backgroundColor = '#FF0000';
		document.getElementById('MessageId').style.color = '#FFFFFF';
		document.getElementById('MessageId').focus();
		return false;
	}else{
		document.ContactUsForm.submit();
	}
}
function ValidateUserForm()
{
	var alphaExp = /^[0-9]{4}\s[A-Z]{2}$/;
	var numericExpression = /^[0-9]+$/;
	
	document.getElementById('UserEmailId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserEmailId').style.color = '#000000';
	
	document.getElementById('UserTitleId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserTitleId').style.color = '#000000';
	
	document.getElementById('UserFnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserFnameId').style.color = '#000000';
		
	document.getElementById('UserLnameId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserLnameId').style.color = '#000000';
		
	document.getElementById('UserMobileId').style.backgroundColor = '#FFFFFF';
	document.getElementById('UserMobileId').style.color = '#000000';
	
	document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('MobileCountryCodeId').style.color = '#000000';
		
	document.getElementById('CountryId').style.backgroundColor = '#FFFFFF';
	document.getElementById('CountryId').style.color = '#000000';
	
	document.getElementById('StateId').style.backgroundColor = '#FFFFFF';
	document.getElementById('StateId').style.color = '#000000';
		
	document.getElementById('CompanyId').style.backgroundColor = '#FFFFFF';
	document.getElementById('CompanyId').style.color = '#000000';

	document.getElementById('NoOfEmployeesId').style.backgroundColor = '#FFFFFF';
	document.getElementById('NoOfEmployeesId').style.color = '#000000';
	
	document.getElementById('BusinessPhCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhCountryCodeId').style.color = '#000000';
	
	document.getElementById('BusinessPhAreaCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhAreaCodeId').style.color = '#000000';
	
	document.getElementById('BusinessPhoneId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPhoneId').style.color = '#000000';
	
	document.getElementById('BusinessAddress1Id').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessAddress1Id').style.color = '#000000';
	
	document.getElementById('BusinessFxCountryCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFxCountryCodeId').style.color = '#000000';
	
	document.getElementById('BusinessFxAreaCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFxAreaCodeId').style.color = '#000000';
	
	document.getElementById('BusinessFaxId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessFaxId').style.color = '#000000';
	
	document.getElementById('BusinessWebsiteId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessWebsiteId').style.color = '#000000';
	
	document.getElementById('BusinessCityId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessCityId').style.color = '#000000';
	
	document.getElementById('BusinessBlogId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessBlogId').style.color = '#000000';
	
	document.getElementById('BusinessPostalCodeId').style.backgroundColor = '#FFFFFF';
	document.getElementById('BusinessPostalCodeId').style.color = '#000000';
	
	if(trim(document.getElementById('UserEmailId').value) == '')
	{
		alert("Please enter your email.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();
		return false;
	}else if (echeck(trim(document.getElementById('UserEmailId').value)) == false){
		
		alert("Email is not valid.");
		
		document.getElementById('UserEmailId').style.backgroundColor = '#FF0000';
		document.getElementById('UserEmailId').style.color = '#FFFFFF';
		document.getElementById('UserEmailId').focus();

		return false;
	}else if(trim(document.getElementById('MobileCountryCodeId').value) == '')
	{
		alert("Please enter country code.");
		
		document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('MobileCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('MobileCountryCodeId').focus();
		return false;
	}else if(!(document.getElementById('MobileCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter valid country code.");
		
		document.getElementById('MobileCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('MobileCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('MobileCountryCodeId').focus();
		return false;
	}else if(trim(document.getElementById('UserMobileId').value) == '')
	{
		alert("Please enter mobile number.");
		
		document.getElementById('UserMobileId').style.backgroundColor = '#FF0000';
		document.getElementById('UserMobileId').style.color = '#FFFFFF';
		document.getElementById('UserMobileId').focus();
		return false;
	}else if(!(document.getElementById('UserMobileId').value).match(numericExpression))
	{
		alert("Please enter valid mobile number.");
		
		document.getElementById('UserMobileId').style.backgroundColor = '#FF0000';
		document.getElementById('UserMobileId').style.color = '#FFFFFF';
		document.getElementById('UserMobileId').focus();
		return false;
	}else if(trim(document.getElementById('UserTitleId').value) == '')
	{
		alert("Please select title.");
		
		document.getElementById('UserTitleId').style.backgroundColor = '#FF0000';
		document.getElementById('UserTitleId').style.color = '#FFFFFF';
		document.getElementById('UserTitleId').focus();
		return false;
	}else if(trim(document.getElementById('UserFnameId').value) == '')
	{
		alert("Please enter first name.");
		document.getElementById('UserFnameId').style.backgroundColor = '#FF0000';
		document.getElementById('UserFnameId').style.color = '#FFFFFF';
		document.getElementById('UserFnameId').focus();
		return false;
	}else if(trim(document.getElementById('UserLnameId').value) == '')
	{
		alert("Please enter last name.");
		
		document.getElementById('UserLnameId').style.backgroundColor = '#FF0000';
		document.getElementById('UserLnameId').style.color = '#FFFFFF';
		document.getElementById('UserLnameId').focus();
		return false;
	}else if(trim(document.getElementById('CountryId').value) == '')
	{
		alert("Please select country.");
		
		document.getElementById('CountryId').style.backgroundColor = '#FF0000';
		document.getElementById('CountryId').style.color = '#FFFFFF';
		document.getElementById('CountryId').focus();
		return false;
	}else if(trim(document.getElementById('StateId').value) == '' && trim(document.getElementById('OtherStateId').value) == '')
	{
		alert("Please select state.");
		
		document.getElementById('StateId').style.backgroundColor = '#FF0000';
		document.getElementById('StateId').style.color = '#FFFFFF';
		document.getElementById('StateId').focus();
		return false;
	}else if(trim(document.getElementById('CompanyId').value) == '')
	{
		alert("Please enter your company.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('CompanyId').style.backgroundColor = '#FF0000';
		document.getElementById('CompanyId').style.color = '#FFFFFF';
		document.getElementById('CompanyId').focus();
		return false;
	}else if(document.getElementById('NoOfEmployeesId').value && !(document.getElementById('NoOfEmployeesId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('NoOfEmployeesId').style.backgroundColor = '#FF0000';
		document.getElementById('NoOfEmployeesId').style.color = '#FFFFFF';
		document.getElementById('NoOfEmployeesId').focus();
		return false;
	}else if(document.getElementById('BusinessPhCountryCodeId').value && !(document.getElementById('BusinessPhCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessPhCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhCountryCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessPhAreaCodeId').value && !(document.getElementById('BusinessPhAreaCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessPhAreaCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhAreaCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhAreaCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessPhoneId').value && !(document.getElementById('BusinessPhoneId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessPhoneId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPhoneId').style.color = '#FFFFFF';
		document.getElementById('BusinessPhoneId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessAddress1Id').value) == '')
	{
		alert("Please enter business address.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessAddress1Id').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessAddress1Id').style.color = '#FFFFFF';
		document.getElementById('BusinessAddress1Id').focus();
		return false;
	}else if(document.getElementById('BusinessFxCountryCodeId').value && !(document.getElementById('BusinessFxCountryCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessFxCountryCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFxCountryCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessFxCountryCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessFxAreaCodeId').value && !(document.getElementById('BusinessFxAreaCodeId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessFxAreaCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFxAreaCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessFxAreaCodeId').focus();
		return false;
	}else if(document.getElementById('BusinessFaxId').value && !(document.getElementById('BusinessFaxId').value).match(numericExpression))
	{
		alert("Please enter numeric value.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessFaxId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessFaxId').style.color = '#FFFFFF';
		document.getElementById('BusinessFaxId').focus();
		return false;
	}else if(document.getElementById('BusinessWebsiteId').value && document.getElementById('BusinessWebsiteId').value != 'http://' && !CheckURL(document.getElementById('BusinessWebsiteId').value))
	{
		alert("Please enter valid website url.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessWebsiteId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessWebsiteId').style.color = '#FFFFFF';
		document.getElementById('BusinessWebsiteId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessCityId').value) == '')
	{
		alert("Please enter business city.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessCityId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessCityId').style.color = '#FFFFFF';
		document.getElementById('BusinessCityId').focus();
		return false;
	}else if(document.getElementById('BusinessBlogId').value && document.getElementById('BusinessBlogId').value != 'http://' && !checkUrlNew(document.getElementById('BusinessBlogId')))
	{
		alert("Please enter valid website blog url.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessBlogId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessBlogId').style.color = '#FFFFFF';
		document.getElementById('BusinessBlogId').focus();
		return false;
	}else if(trim(document.getElementById('BusinessPostalCodeId').value) == '')
	{
		alert("Please enter postal/zip code.");
		//if(document.getElementById('one').style.visibility == "hidden")	
			//spin('one');
		document.getElementById('BusinessPostalCodeId').style.backgroundColor = '#FF0000';
		document.getElementById('BusinessPostalCodeId').style.color = '#FFFFFF';
		document.getElementById('BusinessPostalCodeId').focus();
		return false;
	}else{
		return true;
	}
}
function ValidateUserUploadForm()
{
	document.getElementById('TitleId').style.backgroundColor = '#FFFFFF';
	document.getElementById('TitleId').style.color = '#000000';
	
	document.getElementById('TagId').style.backgroundColor = '#FFFFFF';
	document.getElementById('TagId').style.color = '#000000';
	
	if(trim(document.getElementById('TitleId').value) == '')
	{
		alert("Please enter image title.");
		
		document.getElementById('TitleId').style.backgroundColor = '#FF0000';
		document.getElementById('TitleId').style.color = '#FFFFFF';
		document.getElementById('TitleId').focus();
		return false;
	}else if(trim(document.getElementById('TagId').value) == '')
	{
		alert("Please enter image tag.");
		
		document.getElementById('TagId').style.backgroundColor = '#FF0000';
		document.getElementById('TagId').style.color = '#FFFFFF';
		document.getElementById('TagId').focus();
		return false;
	}else if(trim(document.getElementById('FileNameId').value) == '' && trim(document.getElementById('UploadId').value) == '')
	{
		alert("Please browse the image.");
		document.getElementById('FileNameId').focus();
		return false;
	}else{
		document.UserUploadForm.submit();
	}
}
function DeletePicture(path)
{
	var answer = confirm("Are you sure, you want to delete this picture?")
	if (answer){
		window.location = path;
	}
}