// JavaScript Document #new.n

		function MM_findObj(n, d) { //v4.01
			var p,i,x;  

			if(!d) 
				d=document; 

			if((p=n.indexOf("?"))>0&&parent.frames.length) 
			{
				d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
			}

			if(!(x=d[n])&&d.all) 
				x=d.all[n]; 

			for (i=0;!x&&i<d.forms.length;i++) 
				x=d.forms[i][n];

			for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
				x=MM_findObj(n,d.layers[i].document);

			if(!x && d.getElementById) 
				x=d.getElementById(n); 

			return x;
		}

		function MM_showHideLayers() 
		{ //v6.0
			var i,p,v,obj,args=MM_showHideLayers.arguments;
			for (i=0; i<(args.length-2); i+=3) 
				if ((obj=MM_findObj(args[i]))!=null) 
				{	
					v=args[i+2];

					/*Code to eliminate flicker on images on firefox (Firefox bug)*/
					var objmore = window.document.getElementById('scroll' + obj.id);

					if (obj.style) 
					{ 
						obj=obj.style; 
						v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
					}
					obj.visibility=v; 

					/*Code to eliminate flicker on images on firefox (Firefox bug)*/
					if (objmore != null)
					{
						if (v=='visible')
						{
							objmore.style.overflow = 'auto';
						}
						else
						{
							objmore.style.overflow = '';
						}
					}

				}
		}

		var globalHide = false;
		var objPostCard;
		var cursorPos = {x:0, y:0};
		var iclientCursorPostCardY;

		function delayhide(obj, idelaytime) 
		{
			cursorposition();
		
			if (window.document.getElementById(obj))
			{
				if (objPostCard && objPostCard != obj)
				{
					MM_showHideLayers('iframe' + objPostCard,'','hide');
					MM_showHideLayers(objPostCard,'','hide');
				}
				objPostCard = obj;
				globalHide = true;
				iclientCursorPostCardY = cursorPos.y;

				setTimeout("show_stuff()", idelaytime);
			}
		}

		function show_stuff(obj) 
		{
			if (globalHide == true) 
			{
				MM_showHideLayers(objPostCard,'','show');
				MM_showHideLayers('iframe' + objPostCard,'','show');
			}

				var objauxPostCard = window.document.getElementById(objPostCard);
				var objauxIframe = window.document.getElementById('iframe' + objPostCard);
				
				/*Positioning the box into the screen*/
				var iobjtop = -188;
				var iobjheight = 276;
				var iavailheight = 0;

				if (document.body.clientHeight > document.documentElement.clientHeight)
				{
					iavailheight = document.documentElement.clientHeight;	//IE and FF
				}
				else
				{
					iavailheight = document.body.clientHeight;				//Opera
				}
				
				if (iclientCursorPostCardY == 0)
				{
					iclientCursorPostCardY = cursorPos.y;
				}

				var iclientY = iclientCursorPostCardY;

				var ipartobjdown = iobjheight + iobjtop;
				var ipartobjup = iobjtop * -1;
				var ipartavaildown = iavailheight - iclientY;
				var ipartavailup = iclientY;

				if ((ipartobjdown + 100) > ipartavaildown)
				{
					var inewtop = iobjtop - ipartobjdown + ipartavaildown - 100;
				
					objauxPostCard.style.top = inewtop.toString() + 'px';
					objauxIframe.style.top = inewtop.toString() + 'px';
				}
				else
				{
					objauxPostCard.style.top = iobjtop.toString() + 'px';
					objauxIframe.style.top = iobjtop.toString() + 'px';
				}

				if (ipartobjup > ipartavailup)
				{
					var inewtop = iobjtop + ipartobjup - ipartavailup;
					objauxPostCard.style.top = inewtop.toString() + 'px';
					objauxIframe.style.top = inewtop.toString() + 'px';
				}
		}

		function MM_showHideLayersIframe(obj) 
		{
			globalHide = false;
			MM_showHideLayers(objPostCard,'','hide');
			MM_showHideLayers('iframe' + objPostCard,'','hide');
		}

		function MM_showHideMoreLayersIframe(obj) 
		{
			var objscrollaux = window.document.getElementById('scroll' + obj);
			var objiframeaux = window.document.getElementById('iframe' + obj);
			var objaux = window.document.getElementById(obj);
			
			var arVersion = navigator.appVersion.split("MSIE");
			var version = parseFloat(arVersion[1]);

			if (version < 7.0)
			{
				objscrollaux.style.height = "110px";
				objiframeaux.style.height = "167px";
				objaux.style.height = "167px";
			}

			
		  	// Hide all layers first.
			var divs = document.getElementsByTagName("div");
			var iframes = document.getElementsByTagName("iframe");

			for (var i = 0; i < iframes.length; i++)
			{
				if (iframes[i].id != objiframeaux.id)
				{
    				if (iframes[i].id.indexOf("twistylist_more") >= 0)
    				{
						if (iframes[i].style.visibility == 'visible')
						{
							MM_showHideLayers(iframes[i].id,'','hide');
						}
					}
				}
			}

			for (var i = 0; i < divs.length; i++)
			{
				if (divs[i].id != objaux.id)
				{
    				if (divs[i].id.indexOf("twistylist_more") >= 0)
    				{
						if (divs[i].style.visibility == 'visible')
						{
							MM_showHideLayers(divs[i].id,'','hide');
						}
					}
				}
			}

			MM_showHideLayersTwistyMore(obj);
			MM_showHideLayersTwistyMore('iframe' + obj);
		}

		function MM_showHideLayersTwistyMore(obj) 
		{
			var objaux = window.document.getElementById(obj);

			if (objaux.style.visibility=='visible')
			{
				MM_showHideLayers(objaux.id,'','hide');
			}
			else
			{
				MM_showHideLayers(objaux.id,'','show');

				/*Positioning the box into the screen*/
				var iobjtop = -40;
				var iobjheight = 190;

				var iavailheight = 0;

				if (document.body.clientHeight > document.documentElement.clientHeight)
				{
					iavailheight = document.documentElement.clientHeight;	//IE and FF
				}
				else
				{
					iavailheight = document.body.clientHeight;				//Opera
				}

				var iclientY = cursorPos.y;

				var ipartobjdown = iobjheight + iobjtop;
				var ipartobjup = iobjtop * -1;
				var ipartavaildown = iavailheight - iclientY;
				var ipartavailup = iclientY;

				if ((ipartobjdown) > ipartavaildown)
				{
					var inewtop = iobjtop - ipartobjdown + ipartavaildown;
					objaux.style.top = inewtop.toString() + 'px';
				}
				else
				{
					objaux.style.top = iobjtop.toString() + 'px';
				}

				if ((ipartobjup) > ipartavailup)
				{
					var inewtop = iobjtop + ipartobjup - ipartavailup + 20;
					objaux.style.top = inewtop.toString() + 'px';
				}
			}
		}

		function setvariable() 
		{
			globalHide = false;
		} 

	function eventHandler(e)
	{
		e = e || window.event;
		if (e.pageX || e.pageY) 
		{		
			cursorPos.x = e.pageX - document.documentElement.scrollLeft;
			cursorPos.y = e.pageY - document.documentElement.scrollTop;
		}
		else 
		{
			cursorPos.x = e.clientX;
			cursorPos.y = e.clientY;
		}
	}

	function cursorposition()
	{
		//if (window.Event) 
		//{
		//	document.captureEvents(window.Event.MOUSEMOVE);
		//}
		document.onmousemove = eventHandler;
	}

    function highlightProperty(objname, highlighted)
    {
        var obj = document.getElementById(objname);
        
        if (highlighted)
        {
            obj.style.backgroundColor='#BECBDB';
        }
        else
        {
            obj.style.backgroundColor='#FFFFFF';
        }
    }
    
    function correctBackgroundPNG(element) // correctly handle PNG transparency in Win IE 5.5 & 6.
    {
       var arVersion = navigator.appVersion.split("MSIE");
       var version = parseFloat(arVersion[1]);
       if ((version >= 5.5) && (document.body.filters))
       {
          try
          {
              var imageLocation = "";
              imageLocation = element.style.backgroundImage;
              imageLocation = imageLocation.substring(4, imageLocation.length-1);
              element.style.backgroundImage = "";
              element.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"" + imageLocation + "\")";
          } 
          catch(exc) { } // only reason the try/catch is so that IE doesn't display javascript error. The code works fine though.
       }    
    }
    

//Property Details Menus change color on mouse hover    
function MM_swapImgRestore() 
{ //v3.0
	try
	{
		var i,x,a=document.MM_sr; 
		for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
			x.src=x.oSrc;
	}
	catch(e){}
}

function MM_swapImage() 
{ //v3.0
	try
	{
		var i,j=0,x,a=MM_swapImage.arguments; 
		document.MM_sr=new Array; 
		for(i=0;i<(a.length-2);i+=3)
		{
			if ((x=MM_findObj(a[i]))!=null)
			{
				document.MM_sr[j++]=x;
				if(!x.oSrc) 
					x.oSrc=x.src; 
				x.src=a[i+2];
			}
		}
	}
	catch(e){}
}
