
function StripSpacesFromEnds(s)
{	
	while((s.indexOf(' ',0) == 0) && (s.length > 1))
	{
		s = s.substring(1,s.length);
	}
	while((s.lastIndexOf(' ') == (s.length - 1) && (s.length > 1)))
	{
		s = s.substring(0,(s.length - 1));
	}
	if((s.indexOf(' ',0) == 0) && (s.length == 1)) s = '';
	return s;
}
function newwintop(pg)
{
win=window.open(pg,"_blank","toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,width=780,height=575");
				if (win==null)
					{
					alert("Popup blocker is detected in your browser, please temporarily disable it to view this page.");
					return false;
					}
					else
					{
					win.focus();
					return false;
					}
}					

   function validdelhi()

 {
  	var aa = true;
  		
		if (document.srch.search.value == "" )
			{
				alert ("Please Enter Property code ");
				aa = false;
				return false;
			}    
		else {
			propval=StripSpacesFromEnds(document.srch.search.value).substring(0,2);
			propval2=StripSpacesFromEnds(document.srch.search.value);
			if(propval.toLowerCase()=="rm")
			{
				win=window.open("http://www.abodesindia.com/room/viewdetailsroomate.asp?serialnumber="+document.srch.search.value,"_blank","toolbar=yes,location=no,resizable=yes,status=yes,scrollbars=yes,width=380,height=250");
				if (win==null)
					{
					alert("Popup blocker is on, please temporarily disable it to view this page.");
					return false;
					}
					else
					{
					win.focus();
					return false;
					}
			}
			else if(propval.toLowerCase()=="pg")
			{
				win=window.open("http://www.abodesindia.com/room/viewdetails.asp?serialnumber="+document.srch.search.value,"_blank","toolbar=yes,location=no,resizable=yes,status=yes,scrollbars=yes,width=380,height=250");
				if (win==null)
					{
					alert("Popup blocker is on, please temporarily disable it to view this page.");
					return false;
					}
					else
					{
					win.focus();
					return false;
					}
			}
			else if(propval.toLowerCase()=="rs")
			{
			
			win=window.open("http://www.delhi-estate.com/Real-Estate-Property-In-India/residential-property/location-delhi/for-Sale/area-null/"+propval2+".html","_blank","toolbar=yes,location=no,resizable=yes,status=yes,scrollbars=yes,width=780,height=575");			
				if (win==null)
					{
					alert("Popup blocker is on, please temporarily disable it to view this page.");
					return false;
					}
					else
					{					
					win.focus();
					return false;
					}
			}	
			else if(propval.toLowerCase()=="cs")
			{
			
			win=window.open("http://www.delhi-estate.com/Real-Estate-Property-In-India/commertial-property/location-delhi/for-Sale/area-null/"+propval2+".html","_blank","toolbar=yes,location=no,resizable=yes,status=yes,scrollbars=yes,width=780,height=575");			
				if (win==null)
					{
					alert("Popup blocker is on, please temporarily disable it to view this page.");
					return false;
					}
					else
					{					
					win.focus();
					return false;
					}
			}	
			else if(propval.toLowerCase()=="ls")
			{
			
			win=window.open("http://www.delhi-estate.com/Real-Estate-Property-In-India/land-property/location-delhi/for-Sale/area-null/"+propval2+".html","_blank","toolbar=yes,location=no,resizable=yes,status=yes,scrollbars=yes,width=780,height=575");			
				if (win==null)
					{
					alert("Popup blocker is on, please temporarily disable it to view this page.");
					return false;
					}
					else
					{					
					win.focus();
					return false;
					}
			}	
			  aa==true;        
			 // return true;
		}
  }
