
//Code to set the domain name to avoide the "https" problem
// Added by Synapse
// Author: Pawan Kamboj  
// Date: 28-March-2007
/***************************/
 var sPK_DomainName=document.domain;
	if(sPK_DomainName==null || sPK_DomainName=="")
		sPK_DomainName="";
	else
		sPK_DomainName="http://" + sPK_DomainName;
/***************************/

function clearIT(obj,str,flag)
{
	if (flag==0)
	{
		if (obj.value==str || obj.value=="")
		{
			obj.value=str
		}
	}
	if (flag==1)
	{
		if (obj.value==str)
		{
			obj.value=""
		}
	}

}
function GetAreaCode(objc)
{
	if (objc[objc.selectedIndex].value!="0")
	{
		window.location.href="/property_Listing.asp?areacode="+objc[objc.selectedIndex].value +"&fromp=AC";
	}
}
function getout2(obj) 
{

	if(obj[obj.selectedIndex].value!="0")
	{
		var URL ="/state.asp?location=" + obj[obj.selectedIndex].value;
		window.location.href = URL;
	}

}

function advanced_search() 
{
	var wasabi=window.open('/advSearch.asp',"stories",'height=300,width=400,scrollbars=yes,resizable=0,status=no,menubar=no');
}
function contpop(url) 
{

var bop=window.open(url,"contpop",'width=350,height=435,status=no,scrollbars=yes,resizable=0=menubar=no');

}
function ValidAdId(Obj)
{
		var isValid
		var chr
		var strid
		isValid=true
		strid=Obj.aid.value
		if (strid.length==0 || strid==" ")
		{
				alert("Please put the AD ID#.")
				return false
		}
		else
		{
			for (i=0;i<strid.length;i++)
			{
				chr=strid.charAt(i);
				if (chr<'0' || chr>'9')
				{
					isValid=false;
					break;
				}
			}
			if (isValid==false)
			{
				Obj.aid.value=""
				alert("Ad ID# can be only Numeric")
				return false
			}
			else
			{
					Obj.id.value=Obj.aid.value;
					Obj.action= sPK_DomainName + "/chk_tv.asp?id="+strid+"&navsearch=navsearch"
					return true;
			}
		}

}

function ValidAdId22(Obj)
{
		var isValid
		var chr
		var strid
		isValid=true
		strid=Obj.aid.value
		if (strid.length==0 || strid==" ")
		{
				alert("Please put the AD ID.")
				Obj.aid.focus()
				return false
		}
		else
		{
			for (i=0;i<strid.length;i++)
			{
				chr=strid.charAt(i);
				if (chr<'0' || chr>'9')
				{
					isValid=false;
					break;
				}
			}
			if (isValid==false)
			{
				Obj.aid.value=""
				alert("Ad ID can be only Numeric")
				Obj.aid.focus()
				return false
			}
			else
			{
					Obj.id.value=Obj.aid.value;
					Obj.action=sPK_DomainName + "/chk_tv.asp?id="+strid+"&navsearch=navsearch"
					return true;
			}
		}
}

function checkIt()
			{
				isValid=true
				strZip=document.frmList.Zip.value
				if (strZip.length==0 || strZip.length>5 || strZip==" ")
				{
						alert("Please put the valid Zip code.")
						document.frmList.Zip.value="Enter ZIP CODE"
						document.frmList.Zip.focus();
						return false;
				}
				else
				{
					for (i=0;i<strZip.length;i++)
					{
						chr=strZip.charAt(i);
						if (chr<'0' || chr>'9')
						{
							isValid=false;
							break;
						}
					}
					if (isValid==false)
					{
						alert("Please put only Numeric Values")
						document.frmList.Zip.select();
						document.frmList.Zip.focus();
						return false;
					}
					else
					{
							
							return true;
					}
				}
			}


function CheckZipCode(Obj)
{
	var isValid
	var chr
	isValid	=true
	var strZip
	strZip=Obj.Zip.value
	if (strZip.length==0 || strZip==" ")
	{
			alert("Please put the Zip code.")
			return false;
	}
	else
	{
		for (i=0;i<strZip.length;i++)
		{
			chr=strZip.charAt(i);
			if (chr<'0' || chr>'9')
			{
				isValid=false;
				break;
			}
		}
		if (isValid==false)
		{
			Obj.Zip.value=""
			alert("Please put only Numeric Values")
			return false;
		}
		else
		{
				
				return true;
		}
	}
}

function doSortListing(Objc,objFrm)
{
	if (Objc.selectedIndex!=0)
	{
		window.location.href=Objc[Objc.selectedIndex].value;
	}
}
