function Search_OnSave(){
	PropertyCart.RefreshInlineView();
}
var PropertyCart = new EstateWeb_Objects_PropertyCartManager();

var iIndex = null;
var iOl = null;
var iOt = null;
var sref = null;
var ithumbs = 0;
var iCurrentIndex = -1;
var iobject = null;

function Search_Property_OnGalleryLoaded(){
	HttpManager.Document.GetObject("pnlPropertyThumbViewLoadingContainer").style.display = "none";
}

function Search_Property_OnMouseOver(e, o, index, ol, ot, ref){
	if (!e) var e = window.event;
	try{
		iIndex = ( index != null ? index : iIndex );
		iOl = ( ol != null ? ol : iOl );
		iOt = ( ot != null ? ot : iOt );
		sref = ( ref != null ? ref : sref );
		iobject = ( o != null ?  o : this );
		var ocursor = HttpManager.Browser.cursor(e);
		var owindowscroll = HttpManager.Browser.ScrollOffset();
		var owindowdimensions = HttpManager.Browser.ViewableDimensions();
		with ( HttpManager.Document.GetObject("pnlPropertyThumbView") ){
			if (  iCurrentIndex != iIndex ){ 
				HttpManager.Document.GetObject("pnlPropertyThumbViewLoadingContainer").style.display = "block";
				style.visibility = "visible";
				var oiframe = HttpManager.Document.GetObject("pnlPropertyThumbView").getElementsByTagName("iframe")[0];
				oiframe.src = "/gallery.aspx?id="+sref+"&w=388&h=288&stb=0&onfirstphotoloaded=parent.Search_Property_OnGalleryLoaded";
			}
			style.left = ( ( ocursor.x ) + iOl ) + "px";
			//calculate maximum y position
			var y = ( ( ocursor.y ) + iOt );
			if ( ( y + offsetHeight ) > ( owindowscroll[1] + owindowdimensions[1] ) ){
				y = ( owindowscroll[1] + owindowdimensions[1] ) - ( offsetHeight + iOl );
			}
			style.top = y + "px";
		}
		if ( iCurrentIndex != iIndex ){
			iobject.onmousemove = Search_Property_OnMouseOver;
		}
		iCurrentIndex = iIndex;
	}catch(e){
	
	}
}

function Search_Property_OnMouseOut(o, index){
	o.onmouseove = null;
	HttpManager.Document.GetObject("pnlPropertyThumbView").style.visibility = "hidden";
	var oiframe = HttpManager.Document.GetObject("pnlPropertyThumbView").getElementsByTagName("iframe")[0];
	oiframe.src = "about:blank";
	iCurrentIndex = -1;
}
