var IPXCurrent=new Array();var IPXCollection=new Array();var Static=typeof AbsoluteWebRoot=='undefined'?'/':AbsoluteWebRoot;function GetReloadFailImages(name){this.ReloadingImg=Static+"images/loading_80x60_reloadem.gif";this.FailureImg=Static+"images/no_photo_80x60.png";if(name.toLowerCase()=='ipx_detailsmain'){this.ReloadingImg=Static+"images/loading_130x98_reloadem.gif";this.FailureImg=Static+"images/no_photo_152x110.gif";}else if(name.toLowerCase()=='ipx_detailcarousel'){this.ReloadingImg=Static+"images/loading_60x80_reloadem.gif";this.FailureImg=Static+"images/no_photo_60x80.gif";}else if(name.toLowerCase()=='ipx_openhomes'){this.ReloadingImg=Static+"images/loading_114x85_reloadem.gif";this.FailureImg=Static+"images/no_photo_114x85.gif";}else if(name.toLowerCase()=='ipx_openhouses'){this.ReloadingImg=Static+"images/loading_100x75_reloadem.gif";this.FailureImg=Static+"images/no_photo_100x75.gif";}else if(name.toLowerCase()=='ipx_miniresult'){this.ReloadingImg=Static+"images/loading_130x98_reloadem.gif";this.FailureImg=Static+"images/no_photo_130x98.gif";}else if(name.toLowerCase()=='ipx_listview'){this.ReloadingImg=Static+"images/loading_16x16.gif";this.FailureImg=Static+"images/no_photo_32x46.gif";}else if(name.toLowerCase()=='ipx_activelistings'){this.ReloadingImg=Static+"images/loading_80x60_reloadem.gif";this.FailureImg=Static+"images/no_photo_80x60.png";}}function LoadListingImage(img_ref,img_type_name,img_src,isCarouselImg,ix,isError){$(img_ref).removeAttr('onload');$(img_ref).removeAttr('onerror');var local_proxy_src=GetLocalProxySrc(img_src);var ReloadFailImg=new GetReloadFailImages(img_type_name);var img=new Image();CopyAttributes(img_ref,img);$(img).load(function(){$(this).unbind('load');$(this).unbind('error');if(!isError)HandleSpan(img_ref,this,isCarouselImg,ix,'server');else HandleSpan(img_ref,this,isCarouselImg,ix,'local');}).error(function(){$(this).unbind('error');$(this).unbind('load');$(img_ref).attr('src',ReloadFailImg.ReloadingImg);if(isError){$(this).attr('src',ReloadFailImg.FailureImg);HandleSpan(img_ref,this,isCarouselImg,ix,'server_local_err');}else LoadListingImage(img_ref,img_type_name,local_proxy_src,isCarouselImg,ix,true);})
$(function(){var span=$(img_ref).prev("span");$(span).html('').append(img);$(img).attr('src',img_src);},100);}function GetLocalProxySrc(img_src){var LocalProxyPath=Static+"LocalImageReader.aspx";var ProxyPath="http://gimagesr.gabriels.net/ImageReader.aspx";if(img_src.toLowerCase().substring(0,ProxyPath.length)==ProxyPath.toLowerCase()){return LocalProxyPath+img_src.substring(ProxyPath.length);}else{return img_src;}}function CopyAttributes(img_ref,new_img){if(img_ref.attributes){$(img_ref.attributes).each(function(index){if(this.name!='onerror'&&this.name!='onload'&&this.name!='src'&&this.valueOf!=null){$(new_img).attr(this.name,this.value);}});new_img.setAttribute('id',$(img_ref).attr('id'));$(new_img).attr('class',$(img_ref).attr('class'));}}function HandleSpan(img_ref,new_img,isCarouselImg,ix,status){$(img_ref).hide();$(img_ref).attr('id',$(img_ref).attr('id')+'_disabled');var $spnImgContainer=$(img_ref).prev('span');$spnImgContainer.html('');$spnImgContainer.append(new_img);$spnImgContainer.show();$(new_img).attr('stats',status);$(new_img).show();}
