function validateID()
{
    var myID=frmSearchID.id.value;
    if(isNaN(myID) || myID=="" || myID.indexOf(" ") >0)
    {
        alert("Please Enter Numeric Value For ID");        
        return false;
    }
}
function validateMLS()
{
   var myMLS=frmSearchMLS.id.value;
    if(isNaN(myMLS) ||  myMLS=="" || myMLS.indexOf(" ") >0)
    {
        alert("Please Enter Numeric Value For ID");        
        return false;
    }
}
function validateZip()
{
    var myZip=frmSearchZip.zipcode.value;
    if(isNaN(myZip) || myZip.length != 5 || myZip.indexOf(" ")>0)
    {
        alert("Please Valid US Zip Code");        
        return false;
    }
    else
    return true;
}

function validateZipCode(zipcode)
{
    var myZip=zipcode;
    if(isNaN(myZip) || myZip.length != 5 || myZip.indexOf(" ")>0)
        return false;
    else
        return true;
}

function validateState()
{
    if(frmSearchState.location.value=="")
    {
        alert("Please select state..");        
        return false;
    }
}

function ReferToFriend()
{
    var myTop=(window.screen.height/2)-200;
    var myLeft=(window.screen.width/2)-190;
    window.open("refertofriend.asp","mailtofriend","width=350,height=350,scrolbars=no,menubar=no,status=no,resizeable=no,top="+ myTop + ",left="+ myLeft);
}
function FreeEmailFeature()
{
    if(window.confirm("A new browser window will open up allowing you to access the Free Email Updates feature"))
    {
        window.open('http://www.byowner.com/');
        return true;
    }
    else
        return false;
}

function showCRight()
{
    var myTop=(window.screen.height/2)-300;
    var myLeft=(window.screen.width/2)-275;
    window.open("copyright.asp","copyright","width=630,height=600,scrolbars=no,menubar=no,status=no,resizeable=no,top="+ myTop + ",left="+ myLeft);
}

function disclaim()
{
    var myTop=(window.screen.height/2)-300;
    var myLeft=(window.screen.width/2)-275;
    window.open("disclaimer.asp","disclaimer","width=630,height=200,scrolbars=no,menubar=no,status=no,resizeable=no,top="+ myTop + ",left="+ myLeft);
}
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 checkKeyW(ObjFrm)
{
    if (ObjFrm.keyword.value=="Enter Keywords.." || ObjFrm.keyword.value=="")
    {
	    alert(" Please enter Search Keyword!");
	    ObjFrm.keyword.select();
	    ObjFrm.keyword.focus();
	    return false;
    }
    else
    {
	    return true;
    }
}
    
function validateEmailv2(email)
{
    if(email.length <= 0)
	{
	  return false;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}