<!-- saved from url=(0022)http://internet.e-mail -->
/* This is Script file for front-end */

//---------checking mailid is valid or not----------------
	function echeck(str)
	{
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1)
		{
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
		    alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1)
	     {
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		 {
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1)
		 {
		    alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1)
		 {
		    alert("Invalid E-mail ID");
		    return false;
		 }
		return true;				
	}

	//delete white-space from textbox 
	function white_space(field)
	{
		field.value = (field.value).replace(/^\s*|\s*$/g,'');
		//field.value = (field.value).replace(' ','_');		 
	}

	//  this function checks the email format is correct or not and return true or false accordingly.
	function is_email(email)
	{
		if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			return false;
		return true;
	}
	/*************** Phone number validation **************/

		// Declaring required variables
		var digits = "0123456789";
		// non-digit characters which are allowed in phone numbers
		var phoneNumberDelimiters = "()- ";
		// characters which are allowed in international phone numbers
		// (a leading + is OK)
		var validWorldPhoneChars = phoneNumberDelimiters + "+";
		// Minimum no of digits in an international phone no.
		var minDigitsInIPhoneNumber = 10;

		function isInteger(s)
		{   var i;
			for (i = 0; i < s.length; i++)
			{   
				// Check that current character is number.
				var c = s.charAt(i);
				if (((c < "0") || (c > "9"))) return false;
			}
			// All characters are numbers.
			return true;
		}

		function stripCharsInBag(s, bag)
		{   
			var i;
			var returnString = "";
			// Search through string's characters one by one.
			// If character is not in bag, append to returnString.
			for (i = 0; i < s.length; i++)
			{   
				// Check that current character isn't whitespace.
				var c = s.charAt(i);
				if (bag.indexOf(c) == -1) returnString += c;
			}
			return returnString;
		}

		function checkInternationalPhone(strPhone)
		{
			s=stripCharsInBag(strPhone,validWorldPhoneChars);
			return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
		}

	function hIDe()
	{
		document.all.tr1.style.display='block';
		document.all.tr2.style.display='none';
	}
	function unhIDe()
	{
		document.all.tr1.style.display='none';
		document.all.tr2.style.display='block';
	}


	function showfield(checked, id)
	{    
		document.getElementById(id).style.display = checked ? 'block' : 'none';
	}

	function showimage(checked, id)
	{    
		document.getElementById(id).style.display = checked ? 'block' : 'none';
	}









//----------------update special property form ----------------
function update_splpropertyForm()
{

//alert();
	if(window.document.post_property.property_type.value=="")
	{
		alert("Select Property Type");
		window.document.post_property.property_type.focus();
		return false;
	}
		
		if(window.document.post_property.city.value=="")
		{
			alert("Please Select City Name");
			window.document.post_property.city.focus();
			return false;
		} 
	

	/*if(window.document.post_property.add1.value=="")
	{
		alert("Enter Address");
		window.document.post_property.add1.focus();
		return false;
	}*/
	if(window.document.post_property.furnished.value=="")
	{
		alert("Select Furnishing");
		window.document.post_property.furnished.focus();
		return false;
	}
	if(window.document.post_property.totalfloor.value=="")
	{
		alert("Enter Total Floors");
		window.document.post_property.totalfloor.focus();
		return false;
	}
	if(window.document.post_property.area.value=="")
	{
		alert("Enter Area Of Property");
		window.document.post_property.area.focus();
		return false;
	}
	if(window.document.post_property.unit.value=="")
	{
		alert("Select Area Unit");
		window.document.post_property.unit.focus();
		return false;
	}
	if(window.document.post_property.desc.value=="")
	{
		alert("Enter Property Description");
		window.document.post_property.desc.focus();
		return false;
	}
	if(window.document.post_property.prop_cat[0].checked==true)
	{
		if(window.document.post_property.tenant.value=="")
		{
			alert("Select Tenant Type");
			window.document.post_property.tenant.focus();
			return false;
		}
		/*acording to onrequest*/
		if(window.document.post_property.ON_VR[0].checked==true){
			if(window.document.post_property.lakh1.value=="0" && window.document.post_property.thousand.value=="0" && window.document.post_property.hundred.value=="0" ){
				alert("Please Enter Property Rent");
				window.document.post_property.thousand.focus();
				return false;
			}
		}
	}else{
		if(window.document.post_property.ON_VR1[0].checked==true){
			if(window.document.post_property.crores.value=="0" && window.document.post_property.lakh.value=="0" && window.document.post_property.thousand1.value=="0" ){
				alert("Please Enter Property Cost");
				window.document.post_property.lakh.focus();
				return false;
			}
			if(window.document.post_property.crores.value==""){
				alert("Enter Crores");
				window.document.post_property.crores.focus();
				return false;
			}
			if(window.document.post_property.lakh.value==""){
				alert("Enter Lakhs");
				window.document.post_property.lakh.focus();
				return false;
			}
			if(window.document.post_property.thousand1.value==""){
				alert("Enter Thousand");
				window.document.post_property.thousand1.focus();
				return false;
			}
		}
	}
		
	if(window.document.post_property.name.value=="")
	{
		alert("Enter Name");
		window.document.post_property.name.focus();
		return false;
	}
	if(window.document.post_property.contactno.value=="")
	{
		alert("Enter Contact No");
		window.document.post_property.contactno.focus();
		return false;
	}
	if(window.document.post_property.email.value=="")
	{
		alert("Enter EmailID");
		window.document.post_property.email.focus();
		return false;
	}
	else if(! is_email(window.document.post_property.email.value))
	{
		alert("EmailID should be in valid format !");
		window.document.post_property.email.value="";
		window.document.post_property.email.focus();
		return false;
	}
	if(window.document.post_property.stime.value=="")
	{
		alert("Select Suitable Time To Call");
		window.document.post_property.stime.focus();
		return false;
	}
	
	return true;
}
//end update spl property validation


//-------------- testimonial form -------------------

function testiForm()
{
	if(window.document.testimonial.heading.value=="")
	{
		alert("Please Enter Heading For your testimonial");
		window.document.testimonial.heading.focus();
		return false;
	} 
	if(window.document.testimonial.detail.value=="")
	{
		alert("Please Enter Description of testimonial");
		window.document.testimonial.detail.focus();
		return false;
	} 
	if(document.testimonial.name.value=="")
	{
		alert("Please Enter your Name");
		document.testimonial.name.focus();
		return false;
	}
	if(document.testimonial.email.value=="")
	{
		alert("Please Enter your Email Address");
		document.testimonial.email.focus();
		return false;
	}
	else if(!echeck(document.testimonial.email.value) && (!is_email(document.testimonial.email.value)))
	{
		document.testimonial.email.value="";
		document.testimonial.email.focus();
		return false;
	}
	if(document.testimonial.phone.value=="")
	{
		alert("Please Enter your Contact Number");
		document.testimonial.phone.focus();
		return false;
	}
	if(document.testimonial.country.value=="")
	{
		alert("Please Enter your Country Name");
		document.testimonial.country.focus();
		return false;
	}
	if(document.testimonial.occupation.value=="")
	{
		alert("Please Enter your Occupation");
		document.testimonial.occupation.focus();
		return false;
	}
}




	
//------------------registerForm -------------------



function registerForm()
{
	username1=whi
