// JavaScript Document

//------------------------- FROM CVBookmarks.js -----------------------------

// ============================================================================
// ========= Classified Ventures, 2000 ========================================
// ========= Written 7/27/2000 by Mike Kapelson ===========================
// ============================================================================
//
// ============================================================================
var PartnerValue;

function  SaveFavoritesLink(){}
SaveToFavorites=
{
   init:function(st,p,n,pg,geo){
    this.saveToFavLink = this.getSaveFavoritesLink('SaveToFavLink');
    this.site = st; //APTS[0] or RHP[1];
    this.PropertyId = p;
    this.PropertyName = n;
    this.pageName = pg;
    this.BMIndex = this.FindBookMark(this.PropertyId);
    this.BMCount = this.getBMCount();
    this.ProperyNameSplit = this.PropertyName.split("<br>")[0];
    this.bookmark = this.BookMark(); 
	this.MonthsStored = 1;
	this.MaxCookies = 10;
    },
   
   initResults:function(st,divID,p,n,pg,geo)
   {
    this.site = st; //APTS[0] or RHP[1];
    this.saveToFavLink = document.getElementById(divID);
    
    this.PropertyId = p;
    this.PropertyName = n;
    this.pageName = pg;
    this.BMIndex = this.FindBookMark(this.PropertyId);
    this.BMCount = this.getBMCount();
    this.ProperyNameSplit = this.PropertyName.split("<br>")[0];
    this.bookmark = this.BookMark(); 
	this.MonthsStored = 1;
	this.MaxCookies = 10;
	
    },
    getSaveFavoritesLink: function(abc)
    {
     var Link = "";

         if(document.getElementById(abc))
            {
            Link = document.getElementById(abc);
            }
    
       // alert(Link);
          return Link;
    },
    BookMark: function()
	{

		if ( this.BMIndex < 0 )
		{
			if (this.BMCount == this.MaxCookies)
			{
				alert("YOU HAVE NO MORE BOOKMARKS LEFT !");
			}
			else
			{
				Cookie.PackedSave("bookmark","p" + this.BMCount, this.PropertyId, this.MonthsStored);
				Cookie.PackedSave("bookmark","pn" + this.BMCount, this.ProperyNameSplit, this.MonthsStored);
				Cookie.PackedSave("bookmark","v" + this.BMCount, this.pageName, this.MonthsStored);
			}
		}
		else
		{
			this.DeleteBookMark();
		}
		 this.ToggleFavoritesLink();
	},
    
  ViewFavorites: function()
    {
        if(this.site == 1){
            window.open('/ViewBookMark.aspx','book',"height=400,width=440, scrollbars=1");
        }else{
            window.open('/ViewBookMark.aspx','book',"height=400,width=440,scrollbars=1");
        }
    },

	////////////////////////////////////////////////////////////////////	
 DeleteBookMark: function(a)
	{
	this.MonthsStored = 1;
	this.MaxCookies = 10;
		var ind, NextP, NextPN, NextV;
		ind = a;
	    if(this.BMIndex){ind = this.BMIndex;}

		for (var i=ind; i<this.MaxCookies; i++)
		{
			if (i == this.MaxCookies-1)
			{	
				NextP = "";
				NextPN = "";
				NextV = "";
				
			}
			else
			{
				NextP = Cookie.PackedRetrieve("bookmark","p"+(i+1));
				NextPN = Cookie.PackedRetrieve("bookmark","pn"+(i+1));
				NextV = Cookie.PackedRetrieve("bookmark","v"+(i+1));
			}
			Cookie.PackedSave("bookmark","p"+i,NextP,this.MonthsStored);
			Cookie.PackedSave("bookmark","pn"+i,NextPN,	this.MonthsStored);
			Cookie.PackedSave("bookmark","v"+i,NextV,this.MonthsStored);
			if (NextP == "")
				break;
			Cookie.PackedSave("bookmark","p"+(i+1),"",this.MonthsStored);
			Cookie.PackedSave("bookmark","pn"+(i+1),"",this.MonthsStored);
			Cookie.PackedSave("bookmark","v"+(i+1),"",this.MonthsStored);
		}
		
	},
	FindBookMark: function(pid) 
	{
		
		BMCount = this.getBMCount();
	
		for (var i=0; i<=BMCount; i++)
		{
			if (Cookie.PackedRetrieve("bookmark","p" + i) == pid)
			{
				return i;
				
			} 

		}
		
		return -1;
	},
	
	getBMCount: function()
	{
		var i=0;
	
		for (i; i<this.MaxCookies; i++)
		{
			if (Cookie.PackedRetrieve("bookmark","p" + i) == "")
			{
				break;
			}
		}
	
		return i;
	},
   setSavedFavorite: function()
    {
        //this.saveToFavLink = this.getSaveFavoritesLink();
        if(this.saveToFavLink)
        {
            if ((PartnerValue == "terra") || (PartnerValue == "univision"))
			{
				this.saveToFavLink.innerHTML = "Guardar en Favoritos";
			}
			else 
			{
				this.saveToFavLink.innerHTML = "Save to Favorites";
			}
            //this.saveToFavLink.href = "javascript:SaveToFavorites.ViewFavorites()";
        }
    },
   setViewFavorite: function()
    {
        
        //this.saveToFavLink = this.getSaveFavoritesLink();
       
        if(this.saveToFavLink)
        {
            if ((PartnerValue == "terra") || (PartnerValue == "univision"))
			{
				this.saveToFavLink.innerHTML = "Ver favoritos";
			}
			else
			{
				this.saveToFavLink.innerHTML = "View Favorites";
			}
				
            this.saveToFavLink.href = "javascript:SaveToFavorites.ViewFavorites();refreshAds();_OMNLink('17',this,'ViewFavLnk','View Favorites','34');";
   
        }
    },
   ToggleFavoritesLink: function(a,b,c,d,e)
    {
  
     if(b)
        {
      this.saveToFavLink = this.getSaveFavoritesLink('SaveToFavLink');
    this.site = a; //APTS[0] or RHP[1];
    this.PropertyId = b;
    this.PropertyName = c;
    this.pageName = d;

    this.BMCount = this.getBMCount();
    this.ProperyNameSplit = this.PropertyName.split("<br>")[0];
  
	this.MonthsStored = 1;
	this.MaxCookies = 10;
	
        if (this.BMCount == this.MaxCookies)
            {
                    this.setViewFavorite();
            }else{
              if ( this.FindBookMark(this.PropertyId) < 0 ) 
                {   
            
                    this.setSavedFavorite();
                }else {
                    this.setViewFavorite();
                }
		    }
        }else if(this.PropertyId)
        {
            if (this.BMCount == this.MaxCookies)
            {
              this.setViewFavorite();
            }else{
                if ( this.FindBookMark(this.PropertyId) < 0 ) 
                {
                this.setSavedFavorite();

                }else {
                this.setViewFavorite();
                }
		    }
        }
    }

}
	// Cookie Factory
	 
Cookie= {	

	        PackedSave: function( pack, name, cookievalue, months )
		        {
			        var oldPack = this.Retrieve(pack);
			        var newPack = this.Pack(oldPack, name, cookievalue);
			        this.Create(pack, newPack, months);
		        },
	        PackedRetrieve: function( pack, name )
		        {
			        var ret;
			        ret = this.Retrieve(pack);
			        return this.Unpack(ret, name);
		        },
	        Retrieve: function( name )
		        {
			        var cookiestring = new String();
			        var allcookies = document.cookie;
			        var idx = allcookies.indexOf( name + '=' );
        			
			        if( idx != -1 )
			        {
				        var start, end;
				        start = idx + name.length + 1;
				        end = allcookies.indexOf( ";", start );
				        if( end == -1 ) end = allcookies.length;
				        cookiestring = unescape( allcookies.substring( start, end ) );
			        }
			        return cookiestring;
		        },
	        Create: function(name, cookievalue, months )
		        {
			        var timestamp = new Date();
			        timestamp.setMonth(timestamp.getMonth()+months);
			        document.cookie = name + "=" + escape( cookievalue ) + ";expires=" + timestamp.toGMTString() + ";path=/";
		        },
	        Pack: function(oldPack, name, value)
		        {
			        var i, pair;
			        var newPair = escape(name) + '=' + escape(value);
			        var packArray = oldPack.split('&');

			        for(i=0; i < packArray.length; ++i)
			        {
				        pair = packArray[i];
				        if(pair.length > 0)
				        {
					        pair=pair.split('=');
					        if(name == unescape(pair[0]))
					        {
						        break;
					        }
				        }
			        }
			        if(i < packArray.length)
			        {
				        packArray[i] = newPair;
			        }
			        else
			        {
				        packArray = packArray.concat(newPair);
			        }
			        // repack
			        oldPack = "";
			        for(i=0; i < packArray.length; ++i)
			        {
				        pair = packArray[i];
				        if(pair.length > 0)
				        {
					        pair=pair.split('=');
					        if(pair.length>1)
					        {
						        if(pair[1].length>0)
						        {
							        if(oldPack.length>0) oldPack += "&";
							        oldPack += packArray[i];
						        }
					        }
				        }
				        }
				        return oldPack;		
		        },
	        Unpack: function(oldPack, name)
		        {
			        var i, pair, flag;
			        var value = "";
			        var packArray = oldPack.split('&');

			        flag = false;
				        for(i=0; i < packArray.length; ++i)
				        {
					        pair = packArray[i];
					        if(pair.length > 0)
					        {
						        pair=pair.split('=');
						        if(name == unescape(pair[0]))
						        {
							        value = unescape(pair[1]);
							        break;
						        }
					        }
				        }
        		
				        return value;
		        }
	}
function _hbLink(){}

function PCLOmniture(g,a,i)
{
//            //g = unique guid based on session;
//            //a = activity name;
//            //I = object_name_in_flash;
//
//alert("guid: "+g+" activity: "+a+" object: "+i);
            var events;
            var evar;
            //call to omniture tags from our templates.
            //this will propagate the appropriate event tagging for omniture.
            //We will handle from out javascript.

            var s_clven = s_gi(s_account);
            s_clven.eVar34  = a;
  			s_clven.events="event17";
			s_clven.linkTrackVars="eVar34,events";
			s_clven.linkTrackEvents=events;
            s_clven.tl(this,'o',"video");
}


function FlashOmniture(v,k,a,d)
{
//alert("Key : "+k+ " Activity : "+a+" Description : "+d);
var events;
var evar;
if(a == "PlayerLoad" || a == "MediaLoad" || a == "MediaStop" || a == "25per" || a == "50per" || a == "75per")
{

    if(a)
    {
        switch(a)
        {
            case "PlayerLoad":
               events = "event21";
            break;
            case "MediaLoad":
            events = "event18";
            break;
            case "MediaStop":
                events = "event19";
            break;
			case "25per":
                events = "event20";
				evar = "25";
            break;
			case "50per":
                events = "event20";
				evar = "50";
            break;
			case "75per":
                events = "event20";
				evar = "75";
            break;
            default:
            break;
         }
    }
  var s_clven =s_gi(s_account);
   	s_clven.prop35 = v;
   	s_clven.eVar32 = v;
 	s_clven.eVar35 = evar;
   	s_clven.events=events;

s_clven.linkTrackVars="prop35,eVar32,eVar35,events";
s_clven.linkTrackEvents=events;

var lt=this.href!=null?s_clven.lt(this.href):"";
    if (lt=="") { s_clven.tl(this,'o', "Video"); }


}

    
}

function _OMNPhoto(ptype,obj,trackname){
var s_clven =s_gi(s_account);

s_clven.eVar28=ptype;
s_clven.events="event16";
s_clven.prop46=ptype;

s_clven.linkTrackVars="eVar28,events,prop46";
s_clven.linkTrackEvents="event16";

var lt=obj.href!=null?s_clven.lt(obj.href):"";
    if (lt=="") { s_clven.tl(obj,'o', trackname); }

}
function _OMNLink(evTrack,obj,name,eVar,eVNum){
/*
evTrack: event number
obj: this
name: link name
eVar: eVar variable value
eVNum: eVar Number
*/
var evAll;

events = evTrack.split('|');
eventVar = eVar.split('|');
  if(events.length > 1)
    {
        for(i=0; i < events.length;i++)
        {
            evAll = "event"+events[i]+"," +evAll ;
        }
           
        evAll=evAll.replace(/,undefined$/,"")
 
       
    }
    else
    {
         evAll = 'event'+events;
    }

var s_clven =s_gi(s_account);
if(eVNum == "17"){
	s_clven.eVar17=eventVar;
	var evarvalue ="eVar17,prop45,events";
}else if(eVNum=="34"){
	s_clven.eVar34=eventVar;
	var evarvalue ="eVar34,prop45,events";
}else{
	var evarvalue ="events,prop45";
}

if(s_clven.eVar17)
s_clven.prop45=s_clven.eVar17;

s_clven.events=evAll;

s_clven.linkTrackVars=evarvalue;

s_clven.linkTrackEvents=evAll;

var lt=obj.href!=null?s_clven.lt(obj.href):"";
    if (lt=="") { s_clven.tl(obj,'o', name); }

}

function showCaption(whatever,popCation){
	
	var propCaption = document.getElementById(whatever);
		propCaption.className="showDiv pointer";
		}
function hideCaption(whatever)
{
	var propCaption = document.getElementById(whatever);
		propCaption.className="hideDiv";
}

var nMonths = 1;
var nMaxCookie = 10;

function bookMark(property, propertyName, pageName, siteType)
{
	BMIndex = findBM(property.split("=")[1]);
	if ( BMIndex < 0 )
	{
		var BMCount;

		BMCount = getBMCount();
		if (BMCount == nMaxCookie)
		{
			isViewFavorite(siteType);
			alert("YOU HAVE NO MORE BOOKMARKS LEFT !");
			
		}
		else
		{
			CVCookiePackedSave("bookmark","p" + BMCount, property.split("=")[1], nMonths);
			CVCookiePackedSave("bookmark","pn" + BMCount, propertyName.split("<br>")[0], nMonths);
			CVCookiePackedSave("bookmark","v" + BMCount, pageName, nMonths);
		}
	}
	else
	{
		deleteBM(BMIndex);
	}
    ChoiceBMImage(property, siteType);
}

function deleteBM(BMIndex)
{
	var NextP, NextPN, NextV;

	for (var i=BMIndex; i<nMaxCookie; i++)
	{
		if (i == nMaxCookie-1)
		{
			NextP = "";
			NextPN = "";
			NextV = "";
		}
		else
		{
			NextP = CVCookiePackedRetrieve("bookmark","p"+(i+1));
			NextPN = CVCookiePackedRetrieve("bookmark","pn"+(i+1));
			NextV = CVCookiePackedRetrieve("bookmark","v"+(i+1));
		}
		CVCookiePackedSave("bookmark","p"+i,NextP,nMonths);
		CVCookiePackedSave("bookmark","pn"+i,NextPN,nMonths);
		CVCookiePackedSave("bookmark","v"+i,NextV,nMonths);
		if (NextP == "")
			break;
		CVCookiePackedSave("bookmark","p"+(i+1),"",nMonths);
		CVCookiePackedSave("bookmark","pn"+(i+1),"",nMonths);
		CVCookiePackedSave("bookmark","v"+(i+1),"",nMonths);
	}
	
}

function getBMCount()
{
	var i=0;

	for (i; i<nMaxCookie; i++)
	{
		if (CVCookiePackedRetrieve("bookmark","p" + i) == "")
		{
			break;
		}
	}

	return i;
}

function findBM(propNum)
{

	var BMCount;

	BMCount = getBMCount();

	for (var i=0; i<BMCount; i++)
	{
		if (CVCookiePackedRetrieve("bookmark","p" + i) == propNum)
		{
			return i;
		}
	}

	return -1;
}

function SetupBMImges(SetImg, DelImg) 
{
	BMImgSet = new Image();
	BMImgSet.src = SetImg;
	BMImgDel = new Image();
	BMImgDel.src = DelImg;
}
function isSavedFavorite(resDivId){
	if(document.getElementById('BMLink')){
			newBMtxt = document.getElementById('BMLink');
			newBMtxt.innerHTML = "<img src=\"/images/aptImg/buttons/btnFavorites.gif\" height=\"11\" class=\"padLeftRight\" width=\"11\" border=\"0\" alt=\"Save to Favorites\"/>Save to Favorites";
			newBMlink = document.getElementById('bmLinkAnch');
			newBMlink.href = "javascript:MakeBM()";
			}
}
function isViewFavorite(siteType,resDivId){
		if(document.getElementById('BMLink')){
			newBMtxt = document.getElementById('BMLink');
			newBMtxt.innerHTML = "<img src=\"/images/aptImg/buttons/btnFavorites.gif\" height=\"11\" class=\"padLeftRight\" width=\"11\" border=\"0\" alt=\"Save to Favorites\"/>View Favorites";
			newBMlink = document.getElementById('bmLinkAnch');
			//alert(siteType);
			if(siteType == 1){
			newBMlink.href = "javascript:openViewRHP();refreshAds();";
			}else{
			newBMlink.href = "javascript:openView();refreshAds();";
			}
			}else if(resDivId)
			{
				newBMtxt = document.getElementById(resDivId);
				newBMtxt.innerHTML = "View Favorites";
				var links = resDivId+"LinkAnch";
				newBMlink = document.getElementById(links);
				//alert(siteType);
				if(siteType == 1){
				newBMlink.href = "javascript:openViewRHP();refreshAds();";
				}else{
				newBMlink.href = "javascript:openView('/view_bookmark.asp');refreshAds();";
				}
			}
}
function ChoiceBMImage(property,siteType)
{
  var obj;

 if(property){
		var BMCount;

		BMCount = getBMCount();
		if (BMCount == nMaxCookie)
		{
			isViewFavorite(siteType);
		}else{
		if ( findBM(property.split("=")[1]) < 0 ) 
		{
		isSavedFavorite();
		
		}else {
		isViewFavorite(siteType);
		}
		}
  }
	if (document.images["BMImg"]) 
	{
		if(property){
		if ( findBM(property.split("=")[1]) < 0 ) 
		{
			if(document.images["BMImg"]){
			document.images["BMImg"].src = BMImgSet.src;
			
            bmtext = document.getElementById("BMtext");
            if (bmtext != 'undefined' && bmtext.innerHTML != "Save To Favorites")
            {
			  bmtext.innerHTML = "Save To Favorites";
			  
              obj = document.getElementById("BMImg");
			  
              if (obj != undefined)
              {
                obj.style.verticalAlign = "middle";
              }
			}
			}
		}
		else 
		{
			if(document.images["BMImg"]){
			document.images["BMImg"].src = BMImgDel.src;
			
            bmtext = document.getElementById("BMtext");
            if (bmtext != 'undefined' && bmtext.innerHTML != "Remove From Favorites")
            {
              bmtext.innerHTML = "Remove From Favorites";
             isViewFavorite(siteType)
				 obj = document.getElementById("BMImg");
              if (obj != undefined)
              {
                obj.style.verticalAlign = "middle";
              }
  			}
			}
		}
		}
	}
}

function ChoiceBMtext(property,siteType,resDivId)
{
	if ( findBM(property.split("=")[1]) < 0 ) 
		{
			isSavedFavorite(resDivId)
		}
		else 
		{	
			isViewFavorite(siteType,resDivId)
		}
	if (document.images) 
	{
		if ( findBM(property.split("=")[1]) < 0 ) 
		{
            bmtext = document.getElementById("rtext");
            if(bmtext){
            if (bmtext != 'undefined' && bmtext.innerHTML != "Save To Favorites")
            {
			  bmtext.innerHTML = "Save To Favorites";             
			}
			}
		}
		else 
		{
            bmtext = document.getElementById("rtext");
            if(bmtext){
            if (bmtext != 'undefined' && bmtext.innerHTML != "Remove From Favorites")
            {
              bmtext.innerHTML = "Remove From Favorites";              
  			}
  			}
			
		}
	}
}

function GetPartnerName()
{
	return GetURLParam('partner');
}

function GetPageName()
{
	return GetURLParam('page');
}


function GetURLParam(param)
{
	var name_length;
	var name_index;
	var end_index;
	var name = "";
	var params;

	name_index = document.URL.indexOf('?' + param + '=', 0);
	if (name_index == -1)
	{
		name_index = document.URL.indexOf('&' + param + '=', 0);
	}
	if (name_index != -1)
	{
		name_index = name_index + param.length + 2;
		name_end = document.URL.indexOf('&', name_index);
		if (name_end == -1)
		{
			name_length = document.URL.length - name_index;
		}
		else
		{
			name_length = name_end - name_index;
		}
		name = document.URL.substr(name_index, name_length);
	}
	return name;
}

// ============================================================================
// ============================================================================


// END CVBookmarks.js

// ---------------------------FROM CVCookies.js--------------------------------


<!--
// ============================================================================
// ========= Classified Ventures, 2000 ========================================
// ========= Written 5/23/2000 by Lenny Shleymovich ===========================
// ============================================================================
//
// ============================================================================
function CVCookieSave( name, cookievalue, months )
{
	var timestamp = new Date();
	timestamp.setMonth(timestamp.getMonth()+months);
	document.cookie = name + "=" + escape( cookievalue ) +
					";expires=" + timestamp.toGMTString() + ";path=/";
}

function CVCookieRetrieve( name )
{
	var cookiestring = new String();
	var allcookies = document.cookie;
	var idx = allcookies.indexOf( name + '=' );
	
	if( idx != -1 )
	{
		var start, end;
		start = idx + name.length + 1;
		end = allcookies.indexOf( ";", start );
		if( end == -1 ) end = allcookies.length;
		cookiestring = unescape( allcookies.substring( start, end ) );
	}
	return cookiestring;
}

function CVCookiePack(oldPack, name, value)
{
	var i, pair;
	var newPair = escape(name) + '=' + escape(value);
	var packArray = oldPack.split('&');

	for(i=0; i < packArray.length; ++i)
	{
		pair = packArray[i];
		if(pair.length > 0)
		{
			pair=pair.split('=');
			if(name == unescape(pair[0]))
			{
				break;
			}
		}
	}
	if(i < packArray.length)
	{
		packArray[i] = newPair;
	}
	else
	{
		packArray = packArray.concat(newPair);
	}
	// repack
	oldPack = "";
	for(i=0; i < packArray.length; ++i)
	{
		pair = packArray[i];
		if(pair.length > 0)
		{
			pair=pair.split('=');
			if(pair.length>1)
			{
				if(pair[1].length>0)
				{
					if(oldPack.length>0) oldPack += "&";
					oldPack += packArray[i];
				}
			}
		}
	}
	return oldPack;
}

//<%
function CVCookieUnpack(oldPack, name)
{
	var i, pair, flag;
	var value = "";
	var packArray = oldPack.split('&');

	flag = false;
	for(i=0; i < packArray.length; ++i)
	{
		pair = packArray[i];
		if(pair.length > 0)
		{
			pair=pair.split('=');
			if(name == unescape(pair[0]))
			{
				value = unescape(pair[1]);
				break;
			}
		}
	}

	return value;
}
//%>

function CVCookiePackedSave( pack, name, cookievalue, months )
{
	var oldPack = CVCookieRetrieve(pack);
	var newPack = CVCookiePack(oldPack, name, cookievalue);
	CVCookieSave(pack, newPack, months);
}

function CVCookiePackedRetrieve( pack, name )
{
	var ret;
	ret = CVCookieRetrieve(pack);
	return CVCookieUnpack(ret, name);
}

//-->


// END CV Cookies.js

//------------------------- From index_ws.aspx------------------------------
test = new Date()
month = test.getMonth()
month = (month * 1) + 1
day = test.getDate()
year = test.getFullYear()

function openCheck()
{
window.open('http://www.movingcenter.com/mc.dll?page=home&file=movingchecklist_popup.htm&partner=apts',"check","height=340,width=160");
}

function openView()
{
	window.open('/view_bookmark.asp','book',"height=400,width=440,scrollbars=1");
}
function openViewRHP()
{
	window.open('/view_RHPbookmark.asp','book',"height=400,width=440, scrollbars=1");
}
function newsletter()
{
var newWin;
newWin= window.open(url, 'smart', size);
}

		function loadWebID()
		{
			var ID = window.document.WebIDSearch.webID.value;
			//alert ("number you enterd is: " + ID);
			var tracknum = window.document.WebIDSearch.webID.value.substr(0,6);
			var propnum = window.document.WebIDSearch.webID.value.substr(6,8);
			var IDsearch = "results.aspx?page=results&stype=lookup&mode=18&lookup=" + tracknum + "." + propnum + "&partner=magazine";
			//alert ("IDsearch is " + IDsearch);			
			var status;
					
		for (i=0; i<ID.length; i++)
		{
			if (ID.charAt(i) != 0){
			if (ID.charAt(i) != 1){
			if (ID.charAt(i) != 2){
			if (ID.charAt(i) != 3){
			if (ID.charAt(i) != 4){
			if (ID.charAt(i) != 5){
			if (ID.charAt(i) != 6){
			if (ID.charAt(i) != 7){
			if (ID.charAt(i) != 8){
			if (ID.charAt(i) != 9){
			alert ('Web # must be a 9-digit value, please enter the correct Web #.');
			status="bad";
			return false;
			}}}}}}}}}}
        }

		
			
			if (ID=="")
			{
				alert ('Web # must be a 9-digit value, please enter the correct Web #.');
				return false;
			}	
			if (window.document.WebIDSearch.webID.value.length<9)
			{
			alert ('Web # must be a 9-digit value, please enter the correct Web #.');
			return false;
			}
			if (status=="bad")
			{
			alert ('Web # must be a 9-digit value, please enter the correct Web #.');
			return false;
			}
		
			else
			{
				//alert ('sending URL');
				window.document.location = IDsearch
			}

			
		}

function cleartext()
{
		if(document.WebSearch.txtZipCode.value == "Enter Zip")
		{
			document.WebSearch.txtZipCode.value = "";
		}
}
//end index_ws.aspx

//from pp.js


if (document.cookie == "") {
//alert ('empty cookie')
} 
else {
	var the_cookie = document.cookie;
	the_cookie = unescape(the_cookie);
	var x = getCookie('userId');
	//alert(x);
	if (x != null && x.length > 29)
	{
		deleteCookie('userId');	
	}
}

function setCookie(name, value, expires)
{
    if(!expires)
    {
	expires = new Date();
	expires.setTime(expires.getTime() + 60 * 60 * 1000);
    }
    document.cookie = name + "=" + escape(value) +"; expires=" + expires.toGMTString() + "; path=/";
    
}

function getCookie(name)
{
    var dcookie = document.cookie; 
    var cname = name + "=";
    var clen = dcookie.length;
    var cbegin = 0;
    while (cbegin < clen) {
        var vbegin = cbegin + cname.length;
	if (dcookie.substring(cbegin, vbegin) == cname) { 
            var vend = dcookie.indexOf (";", vbegin);
	    if (vend == -1) vend = clen;
            return unescape(dcookie.substring(vbegin, vend));
	}
        cbegin = dcookie.indexOf(" ", cbegin) + 1;
	if (cbegin == 0) break;
    }
    return null;
}

function deleteCookie(name)
{
    //alert("del");
    var today = new Date();
    var expired = new Date(today.getTime() - 48 * 60 * 60 * 1000); // less 2 days	
    
    document.cookie=name + "=null; expires=" + expired.toGMTString() + "; path=/";
}

/*
function deleteCookie(name)
{
    document.cookie = name + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}
*/

function cookiesAreEnabled() 
{
    setCookie("test", "accept");
    if(getCookie("test") == null)
    {
        return 0;
    }
    else
    {
	deleteCookie("test");
	return 1;
    }
}

if(cookiesAreEnabled())
{
	if(getCookie("userId"))
	{    
		// cookie is available hence nothing is to be done
	}
	else
	{    
		// if cookie is not available set it    
		var now = new Date();    
		var thirtyYears = 30 * 365 * 24 * 60 * 60 * 1000;    
		now.setTime(now.getTime() + thirtyYears);       
		var d = new Date();
		var ppjs_time = d.getTime();
		// generate random value between 1 and 99
		// based on the formulae" "Math.floor(Math.random() * (1 + high - low) + low);"
		// generate add one random number generated as above to the start and end of 
		// time value obtained using Date.getTime() java script function.
		
		var rand_num = Math.floor(Math.random() * (1 + 99 - 1) + 1);
		var ppjs_userid = rand_num.toString() + ppjs_time.toString();
		rand_num = Math.floor(Math.random() * (1 + 99 - 1) + 1);
		
		ppjs_userid = ppjs_userid + rand_num.toString();
		
		// set the 17 digit user id to the cookie
		setCookie("userId", ppjs_userid , now);
	}
}

function ValidatePostAListing(szBtnName, objForm)
{ 
	var ZipTxt = objForm.elements["txtZipCode"].value;
	var PropType = objForm.elements["ddPropType"].value;
	 sProductID = document.getElementById('cbPackage').value;
	
	if(ZipTxt.length == 5 && PropType.length >0 && sProductID != "")
	{
		_hbLink(szBtnName);
		
		// Now execute the code similar to the one generated by framework in __doPostBack
		// Since __doPostBack is generated only if there is a control with autopost back
		// and since we do not have any autopost back control at this point of time
		// this custom version of __doPostBack is used.
		AptsCustomPostBack("ContinueButton","", objForm);
		////////////////////////////////////////////////////
	}
	
	 else if(sProductID == "")
	{
	
	alert("Please Select a Package");
		return false;
		
	}
	
	
	else if(PropType == "")
	{
	
	alert("Please Select a Property Type");
		return false;
		
	}
	
	else if(ZipTxt.length < 5 || ZipTxt == "Enter Zip")
	{
		alert("Please Enter a valid ZIP");
		return false;
	}
	
		else 
	{
	
	alert("Please Select a Package, Property Type and Enter valid Zip");
		return false;
		
	}
	
		
}


function AptsCustomPostBack(eventTarget, eventArgument, objForm) 
{
	objForm.__EVENTTARGET.value = eventTarget.split("$").join(":");
	objForm.__EVENTARGUMENT.value = eventArgument;
	objForm.submit();
}
// END pp.js

//--------------------FROM homepage.js------------------------------------

<!--
// ============================================================================
// ======================= Classified Ventures, 2000 ==========================
// ============================================================================
	
function CookieCheck()
{
var strWelcome;
	if (CVCookiePackedRetrieve("bookmark","p0") != "")
		{
strWelcome = "<font size=4 color=#336699 face=arial><strong>Welcome Back.</strong></font>  <br><font size=3 color=#336699 face=arial> To view your bookmarked properties, <a href=javascript:openDemo('search/view_bookmark.asp','height=400,width=350,status=no,menu=no,scrollbars=no,address=no')> click here</a>";
document.write(strWelcome);
		}
}
	   
function openDemo(url,size) 
{
var newWin;
newWin= window.open(url, 'child', size);
}

function openSpecialAd(url)
{
    anotherWin = window.open(url,'another',"height=550,width=320,status=no,menu=no,scrollbars=no,address=no");
}

// Determine whether to do a zipcode search or city/state
//     zipcode overrides city/state
function deterLoad()
{

theCity = window.document.qs.city.value;
theState =
window.document.qs.state.options[window.document.qs.state.selectedIndex].value;
theZip = window.document.qs.zip.value;
theZip = escape(theZip);



  if (theZip.length > 0)
  {  
       return loadZS();
  }
  else if ( theState != "")
  {

       return loadQS();
  }
  else
  {
    alert("Please enter a \"city and state\" or \"zipcode\".");
    return false;
  }
}


function loadQS(w)
{
var theCity;
var theState;
var radius;
var bool;
var partner = GetPartnerName();

theCity = window.document.qs.city.value;
theState = window.document.qs.state.options[window.document.qs.state.selectedIndex].value;
radius = window.document.qs.rad.options[window.document.qs.rad.selectedIndex].value;
	if(radius == '5' || radius == '10' || radius == '20') {
		if(theCity == ""){
		alert("Please enter a City");
		document.qs.city.focus();
		return false;
		}
	}
bool = validateForm(theState);
if (bool == "n")
{
  return false;
}
else
{

theCity = escape(theCity);

  var qString;
  if(document.qs.rad.value == '5' || document.qs.rad.value == '10' || document.qs.rad.value == '20'){
	qString = "Rent.aspx?page=rent&stype=city&city=" + theCity + "&state=" + theState + "&rad=" + radius;
	}
  else{
	qString = "Rent.aspx?stype=city&city=" + theCity + "&state=" + theState;
	}
		if(partner!='')
      {
        qString += "&partner=" + partner
    }
	window.document.location = qString;
  return false;
}

}

function PutTime()
{
	var astr;

	var aDate = new Date()
	var aNum = aDate.getTime()
	var n = new Number(aNum);
	astr  = "<a href=\"http://ad.doubleclick.net/jump/apartments/home;sz=1x1;page=home;ord=";
	astr += n.toString();	
	astr += "\" target=\"\_top\">";
	astr += "<img src=\"http://ad.doubleclick.net/ad/apartments/home;sz=1x1;page=home;ord=";
	astr += n.toString();
	astr += "\"";
	astr += " width=\"1\" height=\"1\" border=\"0\"></a>";

	document.write(astr);
}

function validateForm(st)
{
var daState = st;

if (daState == "")
{
	alert("Please Select a State from the menu")
	return("n");
}

else
{
return("y");
}
}
//NxB
function loadZS()
{
	var theZip;
	var bool;
	var partner = GetPartnerName();

	theZip = document.qs.zip.value;
	
	theZip = escape(theZip);

	if(theZip.length < 5)
	{
		alert("Please enter one/multiple 5 digit zip code/s seperated by commas");
		return false;
	}
	
	var qString;
	if(document.qs.rad.value == '5' || document.qs.rad.value == '10' || document.qs.rad.value == '20'){
      qString  = "Rent.aspx?page=rent&stype=zip&zip=" + theZip + "&rad=" + document.qs.rad.value;
	}
	else{
	  qString = "rent.aspx?page=rent&stype=zip&zip=" + theZip ;
	  }
		  if(partner!='') {
          qString += "&partner=" + partner
        }
  
	window.document.location = qString;
	return false;
}

function loadNS()
{

var theCity;
var theState;
var theName;
var partner = GetPartnerName();

var bool;

theCity = window.document.WebSearch.city.value;
theName = window.document.WebSearch.propName.value;
theState = window.document.WebSearch.state.options[window.document.WebSearch.state.selectedIndex].value;

if(theName == "")
{
   alert("Please enter a valid Property Name");

   return false;
}


theName = escape(theName);

var qString;

qString = "Results.aspx?page=results&mfcisapicommand=quicksearch&QSearchType=1&propname=" + theName;

if(partner!='')
{
    qString += '&partner=' + partner;
}

if (theCity != "")
{
      theCity = escape(theCity);
      qString  += "&city=" + theCity;
}

if (theState != "")
{
      qString  += "&state=" + theState;
}


  window.document.location = qString;

  return false;
}


function ValidateZip(WebSearchFrm)
{
   if(WebSearchFrm.txtZipCode.value == "") 
   { 
      alert('Missing ZIP information. Please enter a ZIP code to post a listing') 
      WebSearchFrm.txtZipCode.focus(); 
      return false; 
   } 
 
 
   if (!IsNumeric(WebSearchFrm.txtZipCode.value)) 
   { 
      alert('Please enter only numbers in the Zip Code') 
      WebSearchFrm.txtZipCode.focus(); 
      return false; 
      } 
 
 return true;
}
function Form_Validation(WebSearchFrm)
 {
 	 if (WebSearchFrm.txtContactEmail.value == "")
  {
    alert("Please enter a value for the Email field.");
    WebSearchFrm.txtContactEmail.focus();
    return (false);
  }

  var checkOK = "_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@. \t\r\n\f";
  var checkStr = WebSearchFrm.txtContactEmail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \"@.\" characters in the Contact Email field.");
    WebSearchFrm.txtContactEmail.focus();
    return (false);
  }

  if (!(IsEmailValid(WebSearchFrm.txtContactEmail)))
  		return(false);

	

return true;
 
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
function IsEmailValid(ElemName)
{
var EmailOk  = true;
var Temp     = ElemName;
var AtSym    = Temp.value.indexOf('@');
var Period   = Temp.value.lastIndexOf('.');
var Space    = Temp.value.indexOf(' ');
var Length   = Temp.value.length - 1;   // Array is from 0 to length-1
if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      EmailOk = false;
      alert('Please enter a valid e-mail address!');
      Temp.focus();
   }
return EmailOk;
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); }


//~NxB
//-->
// END homepage.js

// FROM ---------------sHome.aspx prior to FMemailalert form------------------------
                                    function clearemail(){
                                    if(document.FMemailalert.Alertmail.value == "Enter your email")
                                    {document.FMemailalert.Alertmail.value = "";}}
                                    function SetEmail(c_name,expiredays){
                                    clearemail()
                                    var strEmail=document.FMemailalert.Alertmail.value
                                    var filter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
                                    if (strEmail=='')
                                    {window.location = 'rentalalerttool.aspx'
                                    return true;
                                    }
                                    if(filter.test(strEmail)){
                                    var exdate=new Date()
                                    exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000))
                                    document.cookie=c_name+ "=" +escape(strEmail)+ ((expiredays==null) ? "" : "; expires="+exdate) + ";path=/";
                                    window.location = 'rentalalerttool.aspx'
                                    //alert (document.cookie);
                                    return true;}
                                    else
                                    {alert('E-Mail is in wrong format.\n     Example:\n     name@domain.com');
                                    return false;}
                                    }		
                             
// END sHome.aspx prior to FMemailalert form

//clkonce function
	
		var count = 0
		function clkonce(num)
		{
		count ++
			if (count > 1)
			{
			alert ('The form has alread been submitted please wait')
			return false;
			}
		}
		
// END clkonce function
//------------------------- FROM Rent.aspx-------------------------------
function validatemaxminrent()
{
	//alert('Hey I am called');
    var iMin=document.form2.RentMinTextBox.value;
    var iMax=document.form2.RentMaxTextBox.value;
    var bReturn=true;        
    
           
    
    if( iMin.length == 0 || iMax.length == 0)
    {
      alert ('Rent fields cannot be empty');
      document.form2.RentMinTextBox.focus(); 
       bReturn=false;
    }
    else if( (isNaN(iMin)) )
    {
	   alert ('Rent fields should have numeric values only');	   
       document.form2.RentMinTextBox.focus(); 
       document.form2.RentMinTextBox.value=0;
       bReturn=false;
       return false;
    }
    else if( (isNaN(iMax)) )
    {
	   alert ('Rent fields should have numeric values only');	   
       document.form2.RentMaxTextBox.focus(); 
       document.form2.RentMaxTextBox.value=99999;
       
       bReturn=false;
       return false;
    }
    else if(parseFloat(iMin) < 0 )
    {
      alert ('Rent fields cannot have negative values');
      document.form2.RentMinTextBox.focus();
      bReturn=false;
    }
    else if( parseFloat(iMax) <0)
    {
      alert ('Rent fields cannot have negative values');
      document.form2.RentMaxTextBox.focus();
      bReturn=false;
    }
    else if(parseFloat(iMin) > parseFloat(iMax))
    {
      alert ('Minimum rent cannot exceed maximum rent');
      document.form2.RentMaxTextBox.focus();
      bReturn=false;
    }   
    else if( parseFloat(iMin) == 0 && parseFloat(iMax) == 0)
    {
      alert ('Both Rent fields cannot be zero');
      document.form2.RentMinTextBox.focus(); 
       bReturn=false;
    }
    return bReturn;
}

function OpenWindowAfterSort()
{
	window.location = document.Form1.SortOptions.value;
}

// END Rent.aspx

//------------------ FROM Results.aspx------------------------>

var nonotif = "";
var chkvalcnt = 1;
var chkvalobj = new Object();

function doNotif(mode)
{
  if (nonotif=="")
  {
    nonotif = CVCookieRetrieve( "bm_nonotif" );
  //alert(nonotif);
	window.open("/resultsBookmark.asp?mode="+mode,"notif","height=200,width=400,scrollbars=1");
	
    }
 
}
function resultBookMark(property, propertyName, pageName, siteType,divid)
{
	//alert(property);
	BMIndex = findBM(property.split("=")[1]);
	
	if ( BMIndex < 0 )
	{
		var BMCount;

		BMCount = getBMCount();
		if (BMCount == nMaxCookie)
		{
			isViewFavorite(siteType,divid);
			alert("YOU HAVE NO MORE BOOKMARKS LEFT !");
			
		}
		else
		{
			
			CVCookiePackedSave("bookmark","p" + BMCount, property.split("=")[1], nMonths);
			CVCookiePackedSave("bookmark","pn" + BMCount, propertyName.split("<br>")[0], nMonths);
			CVCookiePackedSave("bookmark","v" + BMCount, pageName, nMonths);
		}
	}
	else
	{
		isViewFavorite(siteType,divid);
		deleteBM(BMIndex);
	}
	
	 ChoiceBMtext(property,siteType,divid);


}
function MakeResultsBM( prop, propertyName, pageName, siteType,divid)
{
	resultBookMark(prop,stringUnFix(propertyName),pageName,siteType,divid);
	
	if ( findBM(prop.split("=")[1]) >= 0 )
	{
	  return doNotif("");
	} else {
	  //alert(findBM(prop.split("=")[1]));
	  return doNotif("d");
	}

	
}

function MakeBM( prop, propertyName, pageName, siteType)
{
	resBookMark(prop,stringUnFix(propertyName),pageName,siteType);
	
	if ( findBM(prop.split("=")[1]) >= 0 )
	{
	  return doNotif("");
	} else {
	  //alert(findBM(prop.split("=")[1]));
	  return doNotif("d");
	}

	
}
function setChecked()
{
   var inputs = document.getElementsByTagName('input');
   //alert(inputs.length);
   for (var i = 0; i < inputs.length; i++) {
     if (inputs[i].type == 'checkbox' && inputs[i].name == 'checkbox') {
         chkval = inputs[i].id;
         //alert(chkval);
         myexists = findBM(chkval.split("=")[1]);
         //alert(myexists);
         if (myexists>=0)
         {
            //alert(inputs[i].onclick);
            inputs[i].checked = true;
            
         } else {
            inputs[i].checked = false;
         }
     }
   }
}

function stringUnFix(sin)
{
  //alert(sin);
  s = new String(sin);
  s.replace("\'","'");

  return s;
}

function stringFix(sin)
{
  //alert(sin);
  s = new String(sin);
  s.replace("'","\'");

  return s;
}

function findresBM(propNum)
{
	var BMCount;
	BMCount = getBMCount();
	for (var i=0; i<BMCount; i++)
	{
		if (CVCookiePackedRetrieve("bookmark","p" + i) == propNum)
		{
			return i;
		}
	}
	return -1;
}
function resBookMark(property, propertyName, pageName, siteType)
{
	BMIndex = findBM(property.split("=")[1]);
	if ( BMIndex < 0 )
	{
		var BMCount;

		BMCount = getBMCount();
		if (BMCount == nMaxCookie)
		{
			isViewFavorite(siteType);
			alert("YOU HAVE NO MORE BOOKMARKS LEFT !");
			
		}
		else
		{
			CVCookiePackedSave("bookmark","p" + BMCount, property.split("=")[1], nMonths);
			CVCookiePackedSave("bookmark","pn" + BMCount, propertyName.split("<br>")[0], nMonths);
			CVCookiePackedSave("bookmark","v" + BMCount, pageName, nMonths);
		}
	}
	else
	{
		deleteBM(BMIndex);
	}
	
	 ChoiceBMtext(property);


}
function PopInfo(arg)
{
  var ptypes = new Array();
  ptypes["managed"] = "sourcekey.aspx";	
	ptypes["private"] = "sourcekey.aspx";
	ptypes["newspaper"] = "sourcekey.aspx";

  
  var argin = new String(arg);
  argin = argin.toLowerCase();
 
  //alert(argin);
  
  if (ptypes[argin] != "undefined")
  {  
     window.open(ptypes[argin],"sourcekeynfo","height=210,width=275,scrollbars=0");  }
}
//-- TEXT RESULT SCROLLING AD - NETSCAPE FIX --
function OpenWindowAfterSort(i)
{
	
	if(i==1)
	{	 
		if(document.SortForm1.SortOptions1.options[document.SortForm1.SortOptions1.selectedIndex].value != "select")
		{			
			window.location=document.SortForm1.SortOptions1.options[document.SortForm1.SortOptions1.selectedIndex].value;
		}
	}
	else if(i==2)
	{	
		if(document.SortForm2.SortOptions2.options[document.SortForm2.SortOptions2.selectedIndex].value != "select")
		{		
			window.location=document.SortForm2.SortOptions2.options[document.SortForm2.SortOptions2.selectedIndex].value;
		}
	}
	else if(i==3)
	{	   
		if(document.SortForm3.SortOptions3.options[document.SortForm3.SortOptions3.selectedIndex].value != "select")
		{		
			window.location=document.SortForm3.SortOptions3.options[document.SortForm3.SortOptions3.selectedIndex].value;
		}	
	}
	
}
function scrollit()
{}
function regenerate()
{
window.location.reload()
}

//--POPUP ON DOMAIN CODE-->
// http://www.apartments.com)  
function openpopup()
	{ 
	///////* configure "bye.htm and the window dimensions as desired
	window.open("popup.htm","","width=300,height=338") 
	} 
	
function get_cookie(Name)
{ 
	var search = Name + "=";
	var returnvalue = ""; 
	if (document.cookie.length > 0) 
	{ 
		offset=document.cookie.indexOf(search);
		if (offset != -1) 
		{ 
		//	if cookie exists 
		offset += search.length 
		// set index of beginning of value 
		end = document.cookie.indexOf(";", offset); 
		// set index of end of cookie value 
		
			if (end == -1) 
			end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset,end)) 
		} 
	} 
return returnvalue; 
}
function openme(p_listingID) {
		listings_rentals_photo = window.open("", "listings_rentals_photo", "height=200,width=250,left=50,top=50,status=no,menu=no,scrollbars=no,address=no");
		listings_rentals_photo.location.href = "http://www.renttech.com/web/apt_photo.ixe?listingID=" + p_listingID;
		}
// END results.aspx
//This function is designed to work with the asp.net ajax library 2.0
//It does a partial postback of whatever form theObjectID belongs to,
//while canceling the page/form's default full postback behavior.
//onkeypress="javascript:SubmitOnEnterKey('<%# sometextbox.UniqueID.Replace("$", "_") %>',event)"/>
function SubmitOnEnterKey(theObjectID,e){
	 var eventObject = (window.event) ? window.event : e;
	 var keyCodeObject = (eventObject.which) ? eventObject.which : eventObject.keyCode;
	 if(keyCodeObject == 13)
	 {
		 if(eventObject.preventDefault)
		 {
			eventObject.preventDefault();
		 }
		 else
		 {
			eventObject.returnValue = false;
		 }
		 __doPostBack(theObjectID, '');
	 }
}

var spathchecked=false;
//check all box on RHP searchpath
function Checkall (frm1) {
	var check="Check all";
	var clear="Clear all";
	var clink = document.getElementById('checklink').innerHTML;
	var aa= document.getElementById('Form1');
	 if (spathchecked == false)
          {
           spathchecked = true
          }
        else
          {
          spathchecked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
		 if (aa.elements[i].disabled==false)
		 {
		 aa.elements[i].checked = spathchecked;
			if (clink == check){ document.getElementById('checklink').innerHTML = clear;}
			else if (clink == clear) { document.getElementById('checklink').innerHTML = check;}
		 }
	}
}

//===================Word filter for lead forms=====================================



<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Enter the words to be filtered in the line below:
var swear_words_arr=new Array("ass","myass","yourass","kissmyass","getyourheadoutofyourass","assbag","assbanger","asscock","assfuck","asshead","asshole","assmuncher","assshole","asswipe","bastard","bitch","beaner","blowjob","blow job","boob","boner","bullshit","buttfucker","carpetmuncher","chink","clit","cock","cockface","cocksucker","coon","cooter","cracker","cum","cumtart","cunt","crap","cunthole","damn","dickhead","dicks","dildo","dipshit","douche","douchebag","dumb ass","dumbass","dyke","fag","faggot","fuck","fucker","fucked","fuckface","fuckhead","fuckin","fucking","fucks","fudgepacker","gaywad","goddamn","gook","gringo","hardon","hard on","homo","humping","jackass","jerk off","jizz","lesbian","lesbo","mothafucka","motherfucker","motherfucking","muff","negro","nigga","nigger","niglet","nutsack","pecker","penis","piss","pissed off","prick","pussy","puto","puta","queer","rimjob","sandnigger","schlong","shit","shitface","shithead","shittiest","shitty","skank","skeet","slut","snatch","spic","tard","tit","titfuck","tits","twat","twats","vagina","wank","wetback","whore");

var swear_alert_count=0;

function reset_alert_count()
{
 swear_alert_count=0;
}
function validate_user_text(fieldid)
{
 reset_alert_count();
 var compare_text=fieldid.value;

 for(var i=0; i<swear_words_arr.length; i++)
 {
   if(swear_words_arr[i]==compare_text.toLowerCase())
   {
    swear_alert_count++;
   }
 }
 if(swear_alert_count>0)
 {
  var fid=fieldid.id;	 
  alert("Please refrain from using inappropriate language.");
  document.getElementById(fid).focus();
  document.getElementById(fid).select();
  fieldid.value="";
  reset_alert_count();
  //return false;	
 }
 //else
// {
//	return true;
// }
}

//  End -->

function trackMediaLinks(name, linkposition){ 
var linkname = name;
var lposition = linkposition;
var pg=  page;
var medlinkchk = pg+"_"+lposition+"_"+linkname; 
_OMNLink("17",this, linkname, medlinkchk,"34");
//alert (medlinkchk);
}



//===================email filter for lead forms=====================================


function checkemail2(fieldid) {
var aptCheck = document.getElementById('ctl00_body_PropDetailHdr1_InlineLeadForm1_EmailATB').value;
var wordSwear = false;
var badLang = new Array(/myass/i,/assbag/i,/yourass/i,/kissmyass/i,/getyourheadoutofyourass/i,/asscock/i,/assfuck/i,/asshead/i,/asshole/i,/assmuncher/i,/assshole/i,/asswipe/i,/bastard/i,/bitch/i,/beaner/i,/lowjob/i,/blowjob/i,/boob/i, /boner/i,/bullshit/i,/buttfuck/i,/buttfucker/i,/carptermuncher/i,/chink/i,/clit/i,/cock/i,/cockface/i,/cocksucker/i,/coon/i,/cooter/i, /cooter/i,/cracker/i,/crap/i,/dickheads/i,/fuck/i,/fucker/i,/fucked/i,/fucking/i,/fucks/i,/fudgepacker/i,/gaywad/i,/goddamn/i,/goddammnn/i,/gook/i,/gringo/i,/hardon/i,/hardon/i,/homo/i,/humping/i,/mothafucka/i,/motherfucker/i,/muff/i,/negro/i,/nigga/i,/nigger/i,/niglet/i,/nutsack/i,/pecker/i,/penis/i,/piss/i,/pissedoff/i,/prick/i,/pussy/i,/puto/i,/puta/i,/queer/i,/rimjob/i,/sandnigger/i,/schlong/i,/shit/i,/shithead/i,/shittiest/i,/shitty/i,/skank/i,/skeet/i,/slut/i,/snatch/i,/spic/i,/tard/i,/titfuck/i,/tits/i,/twat/i,/twats/i,/vagina/i,/wank/i,/wetback/i,/whore/i);

for(i=0; i<badLang.length; i++) {
if(badLang[i].test(aptCheck)){
wordSwear = true;
}
}
if(wordSwear){
alert("Please refrain from using inappropriate language.");
var fid=fieldid.id;
document.getElementById(fid).focus();
document.getElementById(fid).select();
fieldid.value="";
}
//else{ alert("pass"); }
};

//===================Contact the Property - email filter for lead forms=====================================


function checkemail(fieldid) {
var aptCheck = document.getElementById('ctl00_body_InlineLeadForm2_EmailATB').value;
var wordSwear = false;
var badLang = new Array(/myass/i,/assbag/i,/yourass/i,/kissmyass/i,/getyourheadoutofyourass/i,/asscock/i,/assfuck/i,/asshead/i,/asshole/i,/assmuncher/i,/assshole/i,/asswipe/i,/bastard/i,/bitch/i,/beaner/i,/lowjob/i,/blowjob/i,/boob/i, /boner/i,/bullshit/i,/buttfuck/i,/buttfucker/i,/carptermuncher/i,/chink/i,/clit/i,/cock/i,/cockface/i,/cocksucker/i,/coon/i,/cooter/i, /cooter/i,/cracker/i,/crap/i,/dickheads/i,/fuck/i,/fucker/i,/fucked/i,/fucking/i,/fucks/i,/fudgepacker/i,/gaywad/i,/goddamn/i,/goddammnn/i,/gook/i,/gringo/i,/hardon/i,/hardon/i,/homo/i,/humping/i,/mothafucka/i,/motherfucker/i,/muff/i,/negro/i,/nigga/i,/nigger/i,/niglet/i,/nutsack/i,/pecker/i,/penis/i,/piss/i,/pissedoff/i,/prick/i,/pussy/i,/puto/i,/puta/i,/queer/i,/rimjob/i,/sandnigger/i,/schlong/i,/shit/i,/shithead/i,/shittiest/i,/shitty/i,/skank/i,/skeet/i,/slut/i,/snatch/i,/spic/i,/tard/i,/titfuck/i,/tits/i,/twat/i,/twats/i,/vagina/i,/wank/i,/wetback/i,/whore/i);

for(i=0; i<badLang.length; i++) {
if(badLang[i].test(aptCheck)){
wordSwear = true;
}
}
if(wordSwear){
alert("Please refrain from using inappropriate language.");
var fid=fieldid.id;
document.getElementById(fid).focus();
document.getElementById(fid).select();
fieldid.value="";
}
//else{ alert("pass"); }
};



//===================comment filter for lead forms=====================================
// Word Filter
// (c) 2002 Premshree Pillai
// Created : 23 June 2002
// http://www.qiksearch.com
// http://javascript.qik.cjb.net
// E-mail : qiksearch@rediffmail.com


var swear_words_arr=new Array("ass","myass","yourass","kissmyass","getyourheadoutofyourass","ass hole","assbag","assbanger","asscock","assfuck","asshead","asshole","assmuncher","assshole","asswipe","bastard","bitch","bitchs","beaner","blowjob","blow job","boob","boner","bullshit","buttfucker","carpetmuncher","chink","clit","cock","cockface","cocksucker","coon","cooter","cracker","cum","crap","cumtart","cunt","cunthole","damn","dickhead","dicks","dildo","dipshit","douche","douchebag","dumb ass","dumbass","dyke","fag","faggot","fuck","fucker","fucked","fuckface","fuckhead","fuckin","fucking","fucks","fudgepacker","gaywad","goddamn","gook","gringo","hardon","hard on","hell","homo","humping","jackass","jerk off","jizz","lesbian","lesbo","mothafucka","motherfucker","motherfucking","muff","negro","nigga","nigger","niglet","nutsack","pecker","penis","piss","pissed off","prick","pussy","puto","puta","queer","rimjob","sandnigger","schlong","shit","shitface","shithead","shittiest","shitty","skank","skeet","slut","snatch","spic","tard","tit","titfuck","tits","twat","twats","vagina","wank","wetback","whore");


var swear_alert_arr=new Array;
var swear_alert_count=0;

function reset_alert_count()
{
 swear_alert_count=0;
}

function swearword_user_text(fieldid)
{
 reset_alert_count();
 var compare_text=fieldid.value;
 for(var i=0; i<swear_words_arr.length; i++)
 {
  for(var j=0; j<(compare_text.length); j++)
  {
   if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase())
   {
    swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
    swear_alert_count++;
   }
  }
 }
 var alert_text="";
 for(var s=1; s<=swear_alert_count; s++)
 {
  alert_text+="\n" + "(" + s + ")  " + swear_alert_arr[s-1];
 }
 if(swear_alert_count>0)
 {
  var fid=fieldid.id;
  alert("Please refrain from using inappropriate language.");
  document.getElementById(fid).focus();
  document.getElementById(fid).select();
  fieldid.value="";
  reset_alert_count();

 }
 else
 {
  document.getElementById(fid).submit();
 }
}

function select_area()
{
 document.getElementById(fid).user_text.select();
}

window.onload=reset_alert_count;


//===================Contact the Property - email filter for lead forms=====================================


function LeadComments2(fieldid) {
var aptCheck = document.getElementById('ctl00_body_PropDetailHdr1_InlineLeadForm1_CommentsATB').value;
var wordSwear = false;
var badLang = new Array(/myass/i,/assbag/i,/yourass/i,/kissmyass/i,/getyourheadoutofyourass/i,/asscock/i,/assfuck/i,/asshead/i,/asshole/i,/assmuncher/i,/assshole/i,/asswipe/i,/bastard/i,/bitch/i,/beaner/i,/lowjob/i,/blowjob/i,/boob/i, /boner/i,/bullshit/i,/buttfuck/i,/buttfucker/i,/carptermuncher/i,/chink/i,/clit/i,/cock/i,/cockface/i,/cocksucker/i,/coon/i,/cooter/i, /cooter/i,/cracker/i,/crap/i,/dickheads/i,/fuck/i,/fucker/i,/fucked/i,/fucking/i,/fucks/i,/fudgepacker/i,/gaywad/i,/goddamn/i,/goddammnn/i,/gook/i,/gringo/i,/hardon/i,/hardon/i,/homo/i,/humping/i,/mothafucka/i,/motherfucker/i,/muff/i,/negro/i,/nigga/i,/nigger/i,/niglet/i,/nutsack/i,/pecker/i,/penis/i,/piss/i,/pissedoff/i,/prick/i,/pussy/i,/puto/i,/puta/i,/queer/i,/rimjob/i,/sandnigger/i,/schlong/i,/shit/i,/shithead/i,/shittiest/i,/shitty/i,/skank/i,/skeet/i,/slut/i,/snatch/i,/spic/i,/tard/i,/titfuck/i,/tits/i,/twat/i,/twats/i,/vagina/i,/wank/i,/wetback/i,/whore/i);

for(i=0; i<badLang.length; i++) {
if(badLang[i].test(aptCheck)){
wordSwear = true;
}
}
if(wordSwear){
alert("Please refrain from using inappropriate language.");
var fid=fieldid.id;
document.getElementById(fid).focus();
document.getElementById(fid).select();
fieldid.value="";
}
//else{ alert("pass"); }
};


//===================Contact the Property - email filter for lead forms=====================================


function LeadComments(fieldid) {
var aptCheck = document.getElementById('ctl00_body_InlineLeadForm2_CommentsATB').value;
var wordSwear = false;
var badLang = new Array(/myass/i,/assbag/i,/yourass/i,/kissmyass/i,/getyourheadoutofyourass/i,/asscock/i,/assfuck/i,/asshead/i,/asshole/i,/assmuncher/i,/assshole/i,/asswipe/i,/bastard/i,/bitch/i,/beaner/i,/lowjob/i,/blowjob/i,/boob/i, /boner/i,/bullshit/i,/buttfuck/i,/buttfucker/i,/carptermuncher/i,/chink/i,/clit/i,/cock/i,/cockface/i,/cocksucker/i,/coon/i,/cooter/i, /cooter/i,/cracker/i,/crap/i,/dickheads/i,/fuck/i,/fucker/i,/fucked/i,/fucking/i,/fucks/i,/fudgepacker/i,/gaywad/i,/goddamn/i,/goddammnn/i,/gook/i,/gringo/i,/hardon/i,/hardon/i,/homo/i,/humping/i,/mothafucka/i,/motherfucker/i,/muff/i,/negro/i,/nigga/i,/nigger/i,/niglet/i,/nutsack/i,/pecker/i,/penis/i,/piss/i,/pissedoff/i,/prick/i,/pussy/i,/puto/i,/puta/i,/queer/i,/rimjob/i,/sandnigger/i,/schlong/i,/shit/i,/shithead/i,/shittiest/i,/shitty/i,/skank/i,/skeet/i,/slut/i,/snatch/i,/spic/i,/tard/i,/titfuck/i,/tits/i,/twat/i,/twats/i,/vagina/i,/wank/i,/wetback/i,/whore/i);

for(i=0; i<badLang.length; i++) {
if(badLang[i].test(aptCheck)){
wordSwear = true;
}
}
if(wordSwear){
alert("Please refrain from using inappropriate language.");
var fid=fieldid.id;
document.getElementById(fid).focus();
document.getElementById(fid).select();
fieldid.value="";
}
//else{ alert("pass"); }
};