
function REIndex()
{
   if(document.getElementById('txtUserName').value=="")
		{
		//get first name value and check is it blank or not if it is blank
		alert("Enter username");
		//display error message to user
		document.getElementById('txtUserName').value="";
		document.getElementById('txtUserName').focus();
		return false;
		}
		/*if(Fname()==false)
		{
		//check first name validations if it is false return false
		return false;
		} */  
		
		
		if(document.getElementById('txtPassword').value=="")
		{
		//get password value and check is it blank or not
		alert("Enter password");
		//if it is blank display error message to user
		document.getElementById('txtPassword').value="";
		//set the password field to blank
	    document.getElementById('txtPassword').focus();
	    //set the cursor position to password field
		return false;
		}
		/*if(Password()==false)
		{
			//check password  validations,if it is false return false 
		   return false;
		}*/

}
//*******************************************************************************************************

function RESearch()
{

                if(document.getElementById('ddlSearchBy').value == -1)
				{
				//get the Country value of input
				alert("please select Search By value");
				//display error message to user
				document.getElementById('ddlSearchBy').focus();
				//set the cursor position to Country field
				return false;
				}
				
				
			/*	if(document.getElementById('txtValue').value == "")
				{
					alert("please enter  value");
					document.getElementById('txtValue').focus();
				//set the cursor position to Charges in Present Location field
					return false;
				} */

}
	
	//Hot Property page function 
	
	function CompareHotProperty()
	{
			var id1=document.getElementById('txtID').value;
			var id2=document.getElementById('txtID2').value;
				
			if(id1==id2)
			{		
			alert("please select different hot property");
			document.getElementById('txtID2').focus();
			return false;
			}
			
			else
			 return true;
		//	window.open('HotProperties.aspx');
			
						
	}

//*******************************************************************************************************

function EnquiryFrm()
{

         /*       if(document.getElementById('ddlWantedto').value == -1)
				{
				//get the Country value of input
				alert("please select wanted to");
				//display error message to user
				document.getElementById('ddlWantedto').focus();
				//set the cursor position to Country field
				return false;
				} */
				
				
				
				if(document.getElementById('txtName').value=="")
				{
				//get first name value and check is it blank or not  blank
				alert("enter Name");
				//display error message to user
				document.getElementById('txtName').value="";
				document.getElementById('txtName').focus();
				return false;
				}
				if(name()==false)
				{
				//check first name validations if it is false return false
				return false;
				}
				
				
				
				if ((document.getElementById('txtEmail').value) == "")
				{
				//get email address value and check is it blank or not
					alert("enter email");
				//if it is blank display error message to user
					document.getElementById('txtEmail').value=""
				//set the email field value to blank
					document.getElementById('txtEmail').focus();
					//set the cursor position to email field
					return false;
				}
				if(Email()==false)
				{
					//check email validations if it is false return false
					return false;

				}
				
				
				if(document.getElementById('txtPhone').value=="")
				{
					//check the user entered any pin no or not ,if it is blank
				alert("enter Phone");
				//if it is blank display error message to user
					document.getElementById('txtPhone').value=""
				//set the email field value to blank
					document.getElementById('txtPhone').focus();
					//set the cursor position to email field
				return false;
				}
				if(Phoneno()==false)
				{
					//check pin validations ,if it is false return false
				return false;
				}
				
				
				
				if(document.getElementById('txtDetails').value == "")
				{
				//get Name of Patient value and check is it blank or not
				alert("enter Details");
				//if it is blank display error message to user
				document.getElementById('txtDetails').value == ""
				//set the Name of Patient input value to blank
				document.getElementById('txtDetails').focus();
				//set the cursor position to Name of Patient field
				return false;
				}
				
				
}

//***********************************Individual Function (EnquiryFrm)********************************************

        function name()
					{
				//	var illegalChars = /^[a-z(\.\)A-Z]*$/;	   
					//allows only letters 	
					var str=document.getElementById('txtName').value;
					// get the user Name of Patient value
				
					if((str.length<5) || (str.length>20))
					{
					//if Name of Patient value length <3 and length >10 then
					alert("name must be atleast 5 characters");
					//displaying error message to user
					document.getElementById('txtName').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtName').focus();
					//set the cursor position to Name of Patient field
					return false;
					}
			/*		if(!illegalChars.test(str))
					{
					//test the user input value allows only letters or not
					alert("invalid Name");
					//dispalying error message to user
					document.getElementById('txtName').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtName').focus();
					//set the cursor position to Name of Patient field
					return false;
					} */
					}

		function Email()
					{
					var reguser=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
					//email format shuold be like this Shirisha_a@yahoo.co.in
					var str=document.getElementById('txtEmail').value;
					if(!str.match(reguser))
					{
					//if email format matches to given input value or not
					alert("invalid email address");
					//if not display error message to user
					document.getElementById('txtEmail').value=""
					//set the email field value to blank
					document.getElementById('txtEmail').focus();
					//set the cursor position to email field
					return false;
					}
					}
		
		function Phoneno()
	                {
					var illegalChars = /^[0-9./]*$/;	
					//allows only Numbers 	
					var str=document.getElementById('txtPhone').value;
					// get the user Phone No value
					if((str.length<1) || (str.length>20))
					{
					//if Phone No value length <1 and length >3 then
					alert("invalid Phone");
					//displaying error message to user
					document.getElementById('txtPhone').value="";
					//set the  Phone No field to blank
					document.getElementById('txtPhone').focus();
					//set the cursor position to Phone No field
					return false;
					}
					if(!illegalChars.test(str))
					{
					//test the user input value allows only letters or not
					alert("invalid Phone");
					//dispalying error message to user
					document.getElementById('txtPhone').value="";
					//set the Phone No field to blank
					document.getElementById('txtPhone').focus();
					//set the cursor position to Phone No field
					return false;
					}
					return true;
				    }

//*******************************************************************************************************

function Category()
{
       /* if(document.getElementById('txtCatId').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Category ID");
		//if it is blank display error message to user
		document.getElementById('txtCatId').value=""
		         //set the user name input value to blank
		document.getElementById('txtCatId').focus();
		        //set the cursor position to username
		return false;
		}*/
	
	    if(document.getElementById('txtCatName').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Category Name");
		//if it is blank display error message to user
		document.getElementById('txtCatName').value=""
		         //set the user name input value to blank
		document.getElementById('txtCatName').focus();
		        //set the cursor position to username
		return false;
		}
		
		if(document.getElementById('txtDesc').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Description");
		//if it is blank display error message to user
		document.getElementById('txtDesc').value=""
		         //set the user name input value to blank
		document.getElementById('txtDesc').focus();
		        //set the cursor position to username
		return false;
		}
}

//*******************************************************************************************************

function Properties()
{

        if(document.getElementById('txtPropId').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Property ID");
		//if it is blank display error message to user
		document.getElementById('txtPropId').value=""
		         //set the user name input value to blank
		document.getElementById('txtPropId').focus();
		        //set the cursor position to username
		return false;
		}
		
		
		if(document.getElementById('txtName').value=="")
		{
		//get first name value and check is it blank or not if it is blank
		alert("enter Name");
		//display error message to user
		document.getElementById('txtName').value="";
		document.getElementById('txtName').focus();
		return false;
		}
		if(Name()==false)
		{
		//check first name validations if it is false return false
		return false;
		}
		
		
		if(document.getElementById('txtDesc').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Description");
		//if it is blank display error message to user
		document.getElementById('txtDesc').value=""
		         //set the user name input value to blank
		document.getElementById('txtDesc').focus();
		        //set the cursor position to username
		return false;
		}
		
		
		if(document.getElementById('txtLoc').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Location");
		//if it is blank display error message to user
		document.getElementById('txtLoc').value=""
		         //set the user name input value to blank
		document.getElementById('txtLoc').focus();
		        //set the cursor position to username
		return false;
		}
		
		if(document.getElementById('txtOwner').value=="")
		{
		//get first name value and check is it blank or not if it is blank
		alert("enter Owner Name");
		//display error message to user
		document.getElementById('txtOwner').value="";
		document.getElementById('txtOwner').focus();
		return false;
		}
		if(OwnerName()==false)
		{
		//check first name validations if it is false return false
		return false;
		}
		
		if(document.getElementById('txtAddress').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Address");
		//if it is blank display error message to user
		document.getElementById('txtAddress').value=""
		         //set the user name input value to blank
		document.getElementById('txtAddress').focus();
		        //set the cursor position to username
		return false;
		}
		
		if(document.getElementById('txtPrice').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Price");
		//if it is blank display error message to user
		document.getElementById('txtPrice').value=""
		         //set the user name input value to blank
		document.getElementById('txtPrice').focus();
		        //set the cursor position to username
		return false;
		}
		
	/*	if(document.getElementById('txtDate').value=="")
		{
		//get user name value and check is it blank or not
		alert("enter Date");
		//if it is blank display error message to user
		document.getElementById('txtDate').value=""
		         //set the user name input value to blank
		document.getElementById('txtDate').focus();
		        //set the cursor position to username
		return false;
		} */
		
		if(document.getElementById('ddlCategoryId').value==-1)
		{
		//get user name value and check is it blank or not
		alert("please select Category ID");
		
		//set the user name input value to blank
		document.getElementById('ddlCategoryId').focus();
		        //set the cursor position to username
		return false;
		} 
		
		
		if(document.getElementById('ddlIsActive').value == -1)
		{
		//get the Country value of input
		alert("please select IsActive(Y/N)");
		//display error message to user
		document.getElementById('ddlIsActive').focus();
		//set the cursor position to Country field
		return false;
		}
		
		if(document.getElementById('ddlIsHot').value == -1)
		{
		//get the Country value of input
		alert("please select IsHot(Y/N)");
		//display error message to user
		document.getElementById('ddlIsHot').focus();
		//set the cursor position to Country field
		return false;
		}
}

//---------------------------Individual Function(Category)-----------------------------------------------

            function Name()
					{
				//	var illegalChars = /^[a-z(\.\)A-Z]*$/;	   
					//allows only letters 	
					var str=document.getElementById('txtName').value;
					// get the user Name of Patient value
				
					if((str.length<4) || (str.length>20))
					{
					//if Name of Patient value length <3 and length >10 then
					alert("name must be atleast 4 characters");
					//displaying error message to user
					document.getElementById('txtName').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtName').focus();
					//set the cursor position to Name of Patient field
					return false;
					}
				/*	if(!illegalChars.test(str))
					{
					//test the user input value allows only letters or not
					alert("invalid Name");
					//dispalying error message to user
					document.getElementById('txtName').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtName').focus();
					//set the cursor position to Name of Patient field
					return false;
					}*/
					}
					
					
			function OwnerName()
					{
				//	var illegalChars = /^[a-z(\.\)A-Z]*$/;	   
					//allows only letters 	
					var str=document.getElementById('txtOwner').value;
					// get the user Name of Patient value
				
					if((str.length<4) || (str.length>20))
					{
					//if Name of Patient value length <3 and length >10 then
					alert("Owner Name must be atleast 4 characters");
					//displaying error message to user
					document.getElementById('txtOwner').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtOwner').focus();
					//set the cursor position to Name of Patient field
					return false;
					}
				/*	if(!illegalChars.test(str))
					{
					//test the user input value allows only letters or not
					alert("invalid Owner Name");
					//dispalying error message to user
					document.getElementById('txtOwner').value = "";
					//set the Name of Patient field to blank
					document.getElementById('txtOwner').focus();
					//set the cursor position to Name of Patient field
					return false;
					} */
					}