//Validating Login Details
function validateLoginDetails()
{
		with(document.formobject)
		{		
				if (txtUserName.value=="")
				{
					alert("Please Enter the Username");
					txtUserName.focus();
					return false;
				}else if(txtPassword.value=="")
				{
					alert("Please Enter the Password");
					txtPassword.focus();
					return false;
				}
				eventflag.value="true";
		}
	return true;
}


//Validating User Group
function ValidateUserGroup()
{
		with(document.formobject)
		{		
				if (txtGroupName.value=="")
				{
					alert("Please Enter the Group Name");
					txtGroupName.focus();
					return false;
				}
				ValidateUserGroupeventflag.value="true";
		}
	return true;
}

//Validating Group Permissions
function ValidateGrouPermissions()
{
		with(document.formobject)
		{		
				ValidateGrouPermissionsflag.value="true";
		}
	return true;
}



//Checking User Name
function checkUserName()
{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return false;
		}
		username=document.formobject.txtUserName.value;	 
		var url='CheckUserName.php';
		url=url+"?username="+username;		
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);		
		xmlHttp.send(null);
		return false;
	
}

function stateChanged() 
{ 
		if (xmlHttp.readyState==4)
		{ 	
				document.getElementById("usernamecheck").innerHTML=xmlHttp.responseText;
				if(xmlHttp.responseText=="Username Available")
				{
					document.formobject.usernamehiddencheck.value=1;
				}else if(xmlHttp.responseText=="Username Unavailable")
				{
					document.formobject.usernamehiddencheck.value=0;
				}
				alert(document.formobject.usernamehiddencheck.value);
		}
}
//Ajax Main Function
function GetXmlHttpObject()
{
		var xmlHttp=null;
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{
		// Internet Explorer
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
}
//Validating System Users
function ValidateSystemUser(flag)
{
		with(document.formobject)
		{		
				if (GroupID.value==-1)
				{
					alert("Please Select the User Group");
					GroupID.focus();
					return false;
				}else if (txtUserName.value=="")
				{
					alert("Please Enter the User Name");
					txtUserName.focus();
					return false;
				}else if(txtFirstName.value=="")
				{
					alert("Please Enter the First Name");
					txtFirstName.focus();
					return false;
				}else if(txtLastName.value=="")
				{
					alert("Please Enter the Last Name");
					txtLastName.focus();
					return false;
				}else if(Gender.value==-1)
				{
					alert("Please Select the Gender");
					Gender.focus();
					return false;
				}else if(txtEmail.value=="")
				{
					alert("Please Enter the Email");
					txtEmail.focus();
					return false;
				}else if(!(isEmail(txtEmail.value)))
				{
					alert("Please Enter the Email (abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if(AccountStatus.value==-1)
				{
					alert("Please Select the Account Status");
					AccountStatus.focus();
					return false;
				}else if(flag==0)
				{
						if(txtPassword.value=="")
						{
							alert("Please Enter the Password");
							txtPassword.focus();
							return false;
						}
				}
				ValidateSystemUserflag.value="true";
		}
	return true;	
}

//Validating User Permissions

function ValidateUserPermissions()
{
		with(document.formobject)
		{		
				ValidateUserPermissionsflag.value="true";
		}
	return true;
}


//Validating CMS

function ValidateCmsPage()
{
		with(document.formobject)
		{		
				if (MasterLinkID.value==-1)
				{
					alert("Please Select the Master Link");
					MasterLinkID.focus();
					return false;
				}else if (txtLinkTitle.value=="")
				{
					alert("Please Enter the Link Title");
					txtLinkTitle.focus();
					return false;
				}else if(txtPageTitle.value=="")
				{
					alert("Please Enter the Page Title");
					txtPageTitle.focus();
					return false;
				}else if(Sequence.value=="")
				{
					alert("Please Enter the Page Sequence");
					Sequence.focus();
					return false;
				}else if(txtImage.value.length>5)
				{
						if(ImagePositionID.value==-1)
						{
							alert("Please Select the Image Position");
							ImagePositionID.focus();
							return false;
						}
				}
				ValidateCmsPageflag.value="true";
		}
	return true;	
}

//Validating News Articles

function ValidateNews()
{
		with(document.formobject)
		{		
				if (txtNewsTitle.value=="")
				{
					alert("Please Enter the News Title");
					txtNewsTitle.focus();
					return false;
				}else if(BriefDescription.value=="")
				{
					alert("Please Enter the Breif Description");
					BriefDescription.focus();
					return false;
				}else if(txtImage.value.length>5)
				{
						if(ImagePositionID.value==-1)
						{
							alert("Please Select the Image Position");
							ImagePositionID.focus();
							return false;
						}
				}
				ValidateNewsflag.value="true";
		}
	return true;	
}

//Validating Uploads

function ValidateUploads()
{
		with(document.formobject)
		{		
				ValidateUploadsflag.value="true";
		}
	return true;		
}


//Validating City Name

function ValidateCity()
{
		with(document.formobject)
		{		
				if (txtCityName.value=="")
				{
					alert("Please Enter the City");
					txtCityName.focus();
					return false;
				}else if(CountryID.value==-1)
				{
					alert("Please Select the Country");
					CountryID.focus();
					return false;
				}
				ValidateCityflag.value="true";
		}
	return true;	
}


//Validating Development Details

function ValidateDevelopment()
{
		with(document.formobject)
		{		
				if (txtDevelopmentName.value=="")
				{
					alert("Please Enter the Development Name");
					txtDevelopmentName.focus();
					return false;
				}else if (BriefDescription.value=="")
				{
					alert("Please Enter the Brief Description");
					BriefDescription.focus();
					return false;
				}else if(MasterDeveloperID.value==-1)
				{
					alert("Please Select the Master Developer");
					MasterDeveloperID.focus();
					return false;
				}else if(txtArea.value=="")
				{
					alert("Please Enter the Area");
					txtArea.focus();
					return false;
				}else if(CityID.value==-1)
				{
					alert("Please Select the City");
					CityID.focus();
					return false;
				}else if(txtLogo.value.length>5)
				{
						if(LogoPositionID.value==-1)
						{
							alert("Please Select the Logo Position");
							LogoPositionID.focus();
							return false;
						}
				}
				ValidateDevelopmentflag.value="true";
		}
	return true;	
}

//Validating Project

function ValidateProject()
{
		with(document.formobject)
		{		
				if (txtProjectName.value=="")
				{
					alert("Please Enter the Project Name");
					txtProjectName.focus();
					return false;
				}else if (BriefDescription.value=="")
				{
					alert("Please Enter the Brief Description");
					BriefDescription.focus();
					return false;
				}else if(ProjectDeveloperID.value==-1)
				{
					alert("Please Select the Project Developer");
					ProjectDeveloperID.focus();
					return false;
				}else if(MasterDevelopmentID.value==-1)
				{
					alert("Please Select the Master Development");
					MasterDevelopmentID.focus();
					return false;
				}else if(txtArea.value=="")
				{
					alert("Please Enter the Area");
					txtArea.focus();
					return false;
				}else if(CityID.value==-1)
				{
					alert("Please Select the City");
					CityID.focus();
					return false;
				}else if(ProjectTypeID.value==-1)
				{
					alert("Please Select the Project Type");
					ProjectTypeID.focus();
					return false;
				}else if(txtPricePerSqFt.value=="")
				{
					alert("Please Enter the Price Per SQ FT");
					txtPricePerSqFt.focus();
					return false;
				}else if(ProjectStatus.value==-1)
				{
					alert("Please Select the Project Status");
					ProjectStatus.focus();
					return false;
				}else if(txtLogo.value.length>5)
				{
						if(LogoPositionID.value==-1)
						{
							alert("Please Select the Logo Position");
							LogoPositionID.focus();
							return false;
						}
				}
				ValidateProjectflag.value="true";
		}
	return true;	
}

//Validating Unit Types

function ValidateUnitPlans()
{		
		with(document.formobject)
		{		
				ValidateUnitPlansflag.value="true";
		}
	return true;		
}

//Validating Unit Types

function ValidateEditUnitType()
{		
		with(document.formobject)
		{		
				ValidateUnitPlansflag.value="true";
		}
	return true;		
}




//Validating Clients

function ValidateClient()
{
		with(document.formobject)
		{		
				if (Category.value==-1)
				{
					alert("Please Select the Clientele Category");
					Category.focus();
					return false;
				}else if (txtFirstName.value=="")
				{
					alert("Please Enter the First Name");
					txtFirstName.focus();
					return false;
				}else if (txtLastName.value=="")
				{
					alert("Please Enter the Last Name");
					txtLastName.focus();
					return false;
				}else if ((txtOfficeNo.value=="") && (txtMobileNo.value==""))
				{
					alert("Please Enter at least one Contact Number");
					txtOfficeNo.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("Please Enter the Email Address");
					txtEmail.focus();
					return false;
				}else if(!(isEmail(txtEmail.value)))
				{
					alert("Please Enter the Email Address(abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if(Nationality.value==-1)
				{
					alert("Please Select the Nationality");
					Nationality.focus();
					return false;
				}
				ValidateClientflag.value="true";
		}
	return true;	
}

//Ajax Function for Getting Client Info

function getUnitInfo()
{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return false;
		}
		UnitType=document.formobject.UnitType.value;	 
		if(UnitType.value==-1)
		{
			return false;	
		}else
		{
				var url='getUnitInfo.php';
				url=url+"?UnitType="+UnitType;		
				url=url+"&sid="+Math.random();
				xmlHttp.onreadystatechange=DisplayUnitInfo;
				xmlHttp.open("GET",url,true);		
				xmlHttp.send(null);
				return false;
		}
}

//Ajax Display Function for Unit Info

function DisplayUnitInfo()
{
		if (xmlHttp.readyState==4)
		{ 	
				var result=xmlHttp.responseText;
				var resultarray=result.split("-----");	
				document.formobject.txtGrossArea.value=resultarray[0];
				document.formobject.txtNetArea.value=resultarray[1];
				document.formobject.Bedrooms.selectedIndex=eval(resultarray[2])-1;
		}
}

//Calculating Total Price

function calculatetotalprice(totalprice)
{
	var otheramount=0;
	var i=0;
	var total=0;
	if((document.formobject.txtGrossArea.value=="") || (document.formobject.txtNetArea.value==""))
	{
		alert("Please Select the Unit Type to load Gross Area and Net Area");
	}else
	{
			//Totaling the Other Prices
			for(i=0;i<document.formobject.Amount.length;i++)
			{
				otheramount=otheramount+parseInt(document.formobject.Amount[i].value);
			}
			if(document.formobject.computeon.value==1)
			{
					
					document.formobject.txtTotalPrice.value=parseInt(totalprice) + parseInt(document.formobject.txtGrossArea.value *  document.formobject.txtPrice.value) + otheramount;
					
			}else if(document.formobject.computeon.value==2)
			{
			document.formobject.txtTotalPrice.value=parseInt(totalprice) + parseInt(document.formobject.txtNetArea.value *  document.formobject.txtPrice.value) + otheramount;
			}
	}
}

//Calculating Equivalent

function calculateequivalent(selectedindex,controlselected)
{
	var count=selectedindex-2;
	if(document.formobject.computeon.value==1)
	{
			var op=0;
			op=parseInt(document.formobject.txtGrossArea.value *  document.formobject.txtPrice.value);
			if(controlselected==1)
			{
					document.formobject.AmountinPer[count].value = (document.formobject.Amount[count].value/op)*document.formobject.AmountinPer[count].value;
			}else if(controlselected==2)
			{
					document.formobject.Amount[count].value = (document.formobject.Amount[AmountinPer].value/100)*op;
			}
	}else if(document.formobject.computeon.value==2)
	{
			var op=0;
			op=parseInt(document.formobject.txtNetArea.value *  document.formobject.txtPrice.value);
			if(controlselected==1)
			{
					document.formobject.AmountinPer[count].value = (document.formobject.Amount[count].value/op)*document.formobject.AmountinPer[count].value;
			}else if(controlselected==2)
			{
					document.formobject.Amount[count].value = (document.formobject.Amount[AmountinPer].value/100)*op;
			}
	}
calculatetotalprice();
}
//Validating Property

function ValidateProperty()
{
		with(document.formobject)
		{		
				if (Purpose.value==-1)
				{
					alert("Please Select the Purpose");
					Purpose.focus();
					return false;
				}else if (txtApartmentNo.value=="")
				{
					alert("Please Enter the Apartment No");
					txtApartmentNo.focus();
					return false;
				}else if (txtProject.value==-1)
				{
					alert("Please Select the Project");
					txtProject.focus();
					return false;
				}else if (Floor.value==-1)
				{
					alert("Please Select the Floor");
					Floor.focus();
					return false;
				}else if (UnitType.value=="")
				{
					alert("Please Select the Unit Type");
					UnitType.focus();
					return false;
				}else if(txtGrossArea.value=="")
				{
					alert("Please Select the Unit Type to Load Gross Area");
					txtGrossArea.focus();
					return false;
				}else if(txtNetArea.value=="")
				{
					alert("Please Select the Unit Type to Load Net Area");
					txtNetArea.focus();
					return false;
				}else if(txtPrice.value=="")
				{
					alert("Please Enter the Price");
					txtPrice.focus();
					return false;
				}else if (txtPropertyType.value==-1)
				{
					alert("Please Select the Property Type");
					txtPropertyType.focus();
					return false;
				}else if(txtPropertyView.value==-1)
				{
					alert("Please Select the Property View");
					txtPropertyView.focus();
					return false;
				}else if(txtAgent.value==-1)
				{
					alert("Please Select the Sales Agent");
					txtAgent.focus();
					return false;
				}else if(txtOwner.value==-1)
				{
					alert("Please Select the Property Owner");
					txtOwner.focus();
					return false;
				}else if(PropertyStatus.value==-1)
				{
					alert("Please Select the Property Status");
					PropertyStatus.focus();
					return false;
				}
				ValidatePropertyflag.value="true";
		}
	return true;	
}

//Validating CMS Data
function validateotherdata()
{
	with(document.formobject)
	{		
				otherdataflag.value="true";
	}
	return true;	
}

//Loading Other CMS Data
function loadcmscontents()
{
	document.formobject.submit();
}

//Validating Website Configuration

function ValidateWebsiteConfiguration()
{
	with(document.formobject)
	{		
				
				if (txtWebsiteTitle.value=="")
				{
					alert("Please Enter the Website Title");
					txtWebsiteTitle.focus();
					return false;
				}else if (txtEnquiryEmail.value=="")
				{
					alert("Please Enter the Enquiry Email Address(es)");
					txtEnquiryEmail.focus();
					return false;
				}else if (txtCareerEmail.value=="")
				{
					alert("Please Enter the Career Email Address(es)");
					txtCareerEmail.focus();
					return false;
				}else if(txtMainHeadline.value=="")
				{
					alert("Please Enter the Head Line Message");
					txtMainHeadline.focus();
					return false;
				}
				ValidateWebsiteConfigurationflag.value="true";
	}
	return true;	
}

//Validating Careers

function ValidateCareers()
{
	with(document.careerform)
	{		
				
				if (txtName.value=="")
				{
					alert("Please Enter your Full Name");
					txtName.focus();
					return false;
				}else if (txtAge.value=="")
				{
					alert("Please Enter your Age");
					txtAge.focus();
					return false;
				}else if (Gender.value==-1)
				{
					alert("Please Select the Gender");
					Gender.focus();
					return false;
				}else if (Country.value==-1)
				{
					alert("Please Select the Country");
					Country.focus();
					return false;
				}else if (txtTelephone.value=="")
				{
					alert("Please enter the Contact Number");
					txtTelephone.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("Please Enter the Email Address");
					txtEmail.focus();
					return false;
				}else if (!(isEmail(txtEmail.value)))
				{
					alert("Please Enter the Email Address(abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if (txtPosition.value=="")
				{
					alert("Please Enter the Position you are applying for");
					txtPosition.focus();
					return false;
				}else if (ResumeFile.value.length<5)
				{
					alert("Please Attach your Resume");
					ResumeFile.focus();
					return false;
				}
				ValidateCareersflag.value="true";
	}
	return true;	
}

function ValidateCareers_fr()
{
	with(document.careerform)
	{		
				
				if (txtName.value=="")
				{
					alert("S'il vous plaît Entrez votre nom complet");
					txtName.focus();
					return false;
				}else if (txtAge.value=="")
				{
					alert("S'il vous plaît indiquer votre âge");
					txtAge.focus();
					return false;
				}else if (Gender.value==-1)
				{
					alert("S'il vous plaît Choisir le sexe");
					Gender.focus();
					return false;
				}else if (Country.value==-1)
				{
					alert("S'il vous plaît Choisir le pays");
					Country.focus();
					return false;
				}else if (txtTelephone.value=="")
				{
					alert("S'il vous plaît entrez le numéro de téléphone");
					txtTelephone.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("S'il vous plaît entrer l'adresse email");
					txtEmail.focus();
					return false;
				}else if (!(isEmail(txtEmail.value)))
				{
					alert("S'il vous plaît entrez l'adresse électronique (abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if (txtPosition.value=="")
				{
					alert("S'il vous plaît Inscrivez le poste que vous postulez pour");
					txtPosition.focus();
					return false;
				}else if (ResumeFile.value.length<5)
				{
					alert("S'il vous plaît Joindre votre CV");
					ResumeFile.focus();
					return false;
				}
				ValidateCareersflag.value="true";
	}
	return true;	
}

//Validating Newsletter

function ValidateNewsletter()
{
	with(document.formobject)
	{		
		if (txtNewsLetterTitle.value=="")
		{
			alert("Please Enter the Newsletter Title");
			txtNewsLetterTitle.focus();
			return false;
		}
		ValidateNewsletterflag.value="true";
	}
	return true;	
}

//Newsletter
function noblurnewslettercontrol(control)
{
	if(control.value=="")
	{
		control.value="Subscribe to Newsletter";
	}
}

//Validating Subscriber

function ValidateSubscriber()
{
	with(document.newsletterform)
	{
		if(txtEmail.value=="")
		{
			alert("Please Enter the Email Address");
			txtEmail.focus();	
			return;
		}else if(!(isEmail(txtEmail.value)))
		{
			alert("Please Enter the Email Address(abc@abc.com)");
			txtEmail.focus();	
			return;
		}
		newsletterflag.value="true";
	}
	document.newsletterform.submit();
}

//Validate Search Form

function ValidateSearchForm()
{
	with(document.searhform)
	{
		PageType.value="property";
		subtype.value="search";
		searhformflag.value="true";
	}
	document.searhform.submit();
}


//Validating Enquiry Form

function ValidateEnquiryForm()
{
		with(document.contactusform)
		{
				if (txtName.value=="")
				{
					alert("Please Enter your Full Name");
					txtName.focus();
					return false;
				}else if (Gender.value==-1)
				{
					alert("Please Select the Gender");
					Gender.focus();
					return false;
				}else if (Country.value==-1)
				{
					alert("Please Select the Country");
					Country.focus();
					return false;
				}else if (txtContactNumber.value=="")
				{
					alert("Please enter the Contact Number");
					txtContactNumber.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("Please Enter the Email Address");
					txtEmail.focus();
					return false;
				}else if (!(isEmail(txtEmail.value)))
				{
					alert("Please Enter the Email Address(abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if (txtSubject.value=="")
				{
					alert("Please Enter the Subject");
					txtSubject.focus();
					return false;
				}else if (txtenquiry.value=="")
				{
					alert("Please Enter your enquiry Details");
					txtenquiry.focus();
					return false;
				}
				ValidateEnquiryFormflag.value="true";
	}
	return true;	
}

function ValidateEnquiryForm_fr()
{
		with(document.contactusform)
		{
				if (txtName.value=="")
				{
					alert("S'il vous plaît Entrez votre nom complet");
					txtName.focus();
					return false;
				}else if (Gender.value==-1)
				{
					alert("S'il vous plaît Choisir le sexe");
					Gender.focus();
					return false;
				}else if (Country.value==-1)
				{
					alert("S'il vous plaît Choisir le pays");
					Country.focus();
					return false;
				}else if (txtContactNumber.value=="")
				{
					alert("S'il vous plaît entrez le numéro de téléphone");
					txtContactNumber.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("S'il vous plaît entrer l'adresse email");
					txtEmail.focus();
					return false;
				}else if (!(isEmail(txtEmail.value)))
				{
					alert("S'il vous plaît entrez l'adresse électronique (abc@abc.com)");
					txtEmail.focus();
					return false;
				}else if (txtSubject.value=="")
				{
					alert("S'il vous plaît entrez le sujet");
					txtSubject.focus();
					return false;
				}else if (txtenquiry.value=="")
				{
					alert("S'il vous plaît entrer vos coordonnées enquête");
					txtenquiry.focus();
					return false;
				}
				ValidateEnquiryFormflag.value="true";
	}
	return true;	
}
//Validating Enquiry Update
function ValidateEnquiryRemarks()
{
		with(document.formobject)
		{
				if (EnquiryStatus.value==2)
				{
					if(ClosedBy.value==-1)
					{
							alert("Please Select the Agent who has closed this Enquiry");
							ClosedBy.focus();
							return false;
					}
				}
				ValidateEnquiryRemarksflag.value="true";
	}
	return true;	
}

//Validating Change Password

function ValidateChangePassword()
{
		with(document.formobject)
		{
					if(txtOldPassword.value=="")
					{
							alert("Please Enter the Old Password");
							txtOldPassword.focus();
							return false;
					}else if(txtNewPassword.value.length<8)
					{
							alert("Please Enter the New Password(Minimum 8 Characters)");
							txtNewPassword.focus();
							return false;
					}else if(txtNewPassword.value!=txtConfirmPassword.value)
					{
							alert("New Password doesnt Match , Please reconfirm");
							txtNewPassword.focus();
							return false;
					}
				
				ValidateChangePasswordflag.value="true";
	}
	return true;	
}

//Validating Banners

function ValidateBanner()
{
		with(document.formobject)
		{
				if (BannerPosition.value==-1)
				{
					alert("Please Select the Banner Position");
					BannerPosition.focus();
					return false;
				}else if (Project.value==-1)
				{
					alert("Please Select the Project");
					Project.focus();
					return false;
				}else if (BannerTarget.value==-1)
				{
					alert("Please Select the Target");
					BannerTarget.focus();
					return false;
				}else if (Sequence.value=="")
				{
					alert("Please Enter the Sequence");
					Sequence.focus();
					return false;
				}else if(flag.value==0)
				{
					if(txtBanners.value.length<5)
					{
						alert("Please Upload the Banner");
						txtBanners.focus();
						return false;
					}
				}
				ValidateBannerflag.value="true";
	}
	return true;	
}

//Loading Banners

function loadbanner(position,count)
{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return false;
		}
		var url='LoadBanner.php';
		url=url+"?position="+position;	
		url=url+"&count="+count;	
		url=url+"&sid="+Math.random();
	if(position==1)
	{
		xmlHttp.onreadystatechange=LoadTopBanner;
		xmlHttp.open("GET",url,true);		
		xmlHttp.send(null);
		return false;
		count=count+1;
		loadbanner(position,count);
	}else if(position==2)
	{	
		xmlHttp.onreadystatechange=LoadBottomBanner;
		xmlHttp.open("GET",url,true);		
		xmlHttp.send(null);
		return false;
		count=count+1;
		loadbanner(position,count);
	}
}

//Loading Top Banner
function LoadTopBanner() 
{ 
		if (xmlHttp.readyState==4)
		{ 	
				document.getElementById("topbanner").innerHTML=xmlHttp.responseText;
		}
}
//Loading Bottom Banner
function LoadBottomBanner() 
{ 
		if (xmlHttp.readyState==4)
		{ 	
				document.getElementById("bottombanner").innerHTML=xmlHttp.responseText;
		}
}

//Validating Personal Profile

function ValidatePersonalProfile()
{
		with(document.formobject)
		{
				if (txtFirstName.value=="")
				{
					alert("Please Enter your First Name");
					txtFirstName.focus();
					return false;
				}else if (txtLastName.value=="")
				{
					alert("Please Enter your Last Name");
					txtLastName.focus();
					return false;
				}else if ((txtTelephone.value=="") && (txtMobile.value==""))
				{
					alert("Please Enter at least one Contact Number (Telephone / Mobile Number)");
					txtTelephone.focus();
					return false;
				}else if (txtEmail.value=="")
				{
					alert("Please Enter the Email Address");
					txtEmail.focus();
					return false;
				}else if (!(isEmail(txtEmail.value)))
				{
					alert("Please Enter the Email Address(abc@abc.com)");
					txtEmail.focus();
					return false;
				}
				ValidatePersonalProfileflag.value="true";
	}
	return true;	
}

//Validating Newsletter

function ValidateSendNewsletter()
{
		with(document.formobject)
		{
				ValidateSendNewsletterflag.value="true";
	}
	return true;	
	
	
}