// JavaScript Document

/*****************************   Window Open *******************************/
// Used to open a pop up for the property page for each property description //

function Ideal_open(str)
{
	 win=open( "pop.asp?propid="+str,"Ideal","width=500,height=500,scrollbars=yes "/*,resizable=yes"*/);
	 
}
	 
	
/*******************************   Window Close ************************************/
/* This function is used for closing the pop up window */

function Ideal_close()
{
		
	win=close();
		
	}

/**************************** Feedback Form Validation ************************************/


function validateform(frm)

{

	i=frm.elements.length; // get the total number of controls in the form

	for(j=0;j<i;j++)
	{
			if(frm.elements[j].value=="") //check the control has value
		{
						alert("enter value for "+frm.elements[j].name);
			frm.elements[j].focus();
			return false;
			
		}
		
	
	}


	if(!validate_email(frm.email.value)) //call function to validate email
	{
		alert("invalid email");
		frm.email.select(); 
		return false;
	}
	}
	
	function validate_email(email)									
{
	var x = email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) //will test the given x against filter.
	{
	return true;
	}
	else
	{
	return false;
	}
}
	/****************************************  END *********************************************/
