var loadingHtml='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';loadingHtml+='<html xmlns="http://www.w3.org/1999/xhtml" ><head>';loadingHtml+="<title> Red Bell Real Estate</title>";loadingHtml+='<link rel="SHORTCUT ICON" href="/ave/App_Themes/CurrentTheme/images/RedBell_favicon.ico" />';loadingHtml+="</head><body><form>";loadingHtml+='<div id="divPageLoading" style="display: block; position: absolute; top: 45%; left: 50%; width: 197px; height: 38px;';loadingHtml+=" padding: 120px 0 0 0; margin: -80px 0 0 -98px; background-image: url(/ave/App_Themes/CurrentTheme/images/integration/floating_loader_bg.jpg);";loadingHtml+=' background-position: top center;">';loadingHtml+='<img src="/ave/App_Themes/CurrentTheme/images/integration/floating_loader_animation.gif" alt="Loading..." />';loadingHtml+="</div></form></body></html>";var base="directories=0,location=0,menubar=0,toolbar=0,top=0,scrollbars=1,resizable=1,",baseNoScroll="directories=0,location=0,menubar=0,toolbar=0,top=0,scrollbars=0,resizable=0,",aveWinParams=base+"width="+(screen.availWidth-25)+",height="+(screen.availHeight-50),disclosureParams=base+"width="+(screen.availWidth-125)+",height="+(screen.availHeight-100),vowWinParams=base+"width=1030,height=900",vowSubWinParams=base+"width=1000,height=870",tutorialParams=base+"width=1080,height=680",aboutWinParams=base+"width=1070,height=870",contactWinParams=base+"width=620,height=470",copyrightWinParams=base+"width=620,height=670",resetParams=baseNoScroll+"width=620,height=670",websupportParams=baseNoScroll+"width=670,height=590",reportOptionParams=base+"status = 1, width = 1130, height = 650",xlWinParams=base+"status = 1, width = 1030, height = 960",doclWinParams=base+"width = 820, height = 470",valReconProdParams=base+"width=1120,height=900",reviewFormParams=base+"width=1400,height=900",moveWindow=true,reqObj=null,serverURL="/ave/ajaxhandler.aspx?ajax=true&",childWindows=[];function GetReqObject(){try{reqObj=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{reqObj=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){reqObj=null}}if(!reqObj&&typeof XMLHttpRequest!="undefined")reqObj=new XMLHttpRequest}function getInternetExplorerVersion(){var a=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent,b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(b.exec(c)!=null)a=parseFloat(RegExp.$1)}return a}function Ajax_Error(){alert("Your session is expired. Please login again by closing and re-opening your browser. \r\n If the problem still continues, please contact System Adminstrator.")}function OpenPopup(d,b,c){var a={};a=open(d,"_blank",b,0);a!=undefined&&a!=null&&a.focus();c&&a!=undefined&&a!=null&&a.moveTo(0,0);childWindows[childWindows.length]=a}function ResponseRedirect(a){window.location=a}function OpenPopupWithLoadingAnimationReturn(c,a,b){OpenPopupWithLoadingAnimation(c,a,b);return false}function OpenPopupWithLoadingAnimation(d,b,c){var a={};a=open("","_blank",b,0);a.document.write(loadingHtml);a.focus();c&&a.moveTo(0,0);a.location=d;childWindows[childWindows.length]=a}function TryPageUnload(){TryUnloadGoogleMap();TryUnloadChildren()}function TryUnloadGoogleMap(){document.getElementById("divGmap")!=null&&GUnload()}function TryUnloadChildren(){if(childWindows)for(var a=0;a<childWindows.length;a++)childWindows[a].closed==false&&childWindows[a].close()}function ShowPDF(b){var a="directories = 0, location = 0, menubar = 0, toolbar = 0, top = 0, scrollbars = 1, resizable = 1, status = 1, width = "+document.body.clientWidth+", height = "+(document.body.clientHeight-18),c=OpenPopupWithLoadingAnimation(b,a,true)}function ChecknumberofCharacters(b,a){var c=b.value;if(a!=0&&c.length>a){alert("Exceeded maximum allowed characters. ");b.value=c.substr(0,a)}}function replaceSubstring(j,b,i){var a=j;if(b=="")return j;if(i.indexOf(b)==-1)while(a.indexOf(b)!=-1){var h=a.substring(0,a.indexOf(b)),g=a.substring(a.indexOf(b)+b.length,a.length);a=h+i+g}else{var f=["~","`","_","^","#"],l=1,c="";while(c=="")for(var d=0;d<f.length;d++){for(var e="",k=0;k<l;k++)e+=f[d];if(b.indexOf(e)==-1){c=e;d=f.length+1}}while(a.indexOf(b)!=-1){var h=a.substring(0,a.indexOf(b)),g=a.substring(a.indexOf(b)+b.length,a.length);a=h+c+g}while(a.indexOf(c)!=-1){var h=a.substring(0,a.indexOf(c)),g=a.substring(a.indexOf(c)+c.length,a.length);a=h+i+g}}return a}function formatDec(b,a,d){if(!d){a=replaceSubstring(a,"$","");a=replaceSubstring(a,"%","");var c=/(\)|\(|,|\s)/g;a=a.toString().replace(c,"");if(a!=""){var e=new RegExp(/^\d*$|^\d*\.\d*$|^\.\d*$|^\d*\.\d*$/),f=e.exec(a);if(!f){alert("This field must contain a decimal value.");b.focus();b.select()}else b.value=a}else b.value="";a=0}return false}function getPageSize(){var c,d;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;d=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;d=document.body.scrollHeight}else{c=document.body.offsetWidth;d=document.body.offsetHeight}var b,a;if(self.innerHeight){b=self.innerWidth;a=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else if(document.body){b=document.body.clientWidth;a=document.body.clientHeight}if(d<a)pageHeight=a;else pageHeight=d;if(c<b)pageWidth=b;else pageWidth=c;var e=[pageWidth,pageHeight,b,a];return e}function getPageScroll(){var a,b;if(self.pageYOffset){a=self.pageXOffset;b=self.pageYOffset}else if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}else if(document.body){a=document.body.scrollLeft;b=document.body.scrollTop}arrayPageScroll=[a,b];return arrayPageScroll}function isInteger(b,a,d){var g=0,f=5e4;a=replaceSubstring(a," ","");if(a!=""){var e=new RegExp(/\D/),c=e.test(a);if(!c)if(a>=0&&a<=5e4)b.value=a;else{alert("Value should be less than 50,000");b.value=""}else{alert("This field must contain an INTEGER value. Value should be less than 50,000");b.value=""}}else!d&&alert("This field cannot be blank.")}function isYearInRange(b,a,f){var d=new Date,c=d.getFullYear();a=replaceSubstring(a," ","");if(a!=""){var g=new RegExp(/\D/),e=g.test(a);if(!e)if(a>=1700&&a<=c)b.value=a;else{alert("Year should not be less than 1700 (OR) it should not be greater than current year");b.value=""}else{alert("Year must be a valid number");b.value=""}}else!f&&alert("This field cannot be blank.")}function GetToday(f,e,d){var c=new Date,a=c.getDate();a=a<10?"0"+a:a;var b=c.getMonth()+1;b=b<10?"0"+b:b;var g=c.getFullYear();document.getElementById(f).value=b;document.getElementById(e).value=a;document.getElementById(d).value=g}function IsValidMonth(c,d,m,e,i,h,j){OnKeyUp(c,c,d,e);var b=document.getElementById(c),a=b.value;if(a==""||a.length!=e)return;var k=new RegExp(/\d{2}/),l=k.exec(a);if(l){if(!(a>0&&a<13)){alert(" Month out of range. ");b.value="";b.focus();return}}else{alert("This field must contain an INTEGER value. Month less than 10 should have leading ZERO. Ex: 01");b.value="";b.focus();return}var f=document.getElementById(d).value,g=document.getElementById(m).value;event.keyCode!=16&&event.keyCode!=9&&f!=""&&g!=""&&VerifyDate(a,f,g,d,c,false,i,h,j)}function IsValidDay(f,c,d,e,j,i,k){OnKeyUp(c,f,d,e);var b=document.getElementById(c),a=b.value;if(a==""||a.length!=e)return;var m=new RegExp(/\d{2}/),l=m.exec(a);if(l){if(!(a>0&&a<32)){alert(" Day out of range. ");b.value="";b.focus();return}}else{alert("This field must contain an INTEGER value. Day less than 10 should have leading ZERO. Ex: 01");b.value="";b.focus();return}var g=document.getElementById(f).value,h=document.getElementById(d).value;event.keyCode!=16&&event.keyCode!=9&&g!=""&&h!=""&&VerifyDate(g,a,h,c,c,false,j,i,k)}function IsValidYear(m,d,c,e,i,h,j){OnKeyUp(c,d,c,e);var a=document.getElementById(c),b=a.value;if(b==""||b.length!=e)return;var l=new RegExp(/\d{4}/),k=l.exec(b);if(k){if(!(b>1950)){alert(" Year should not be less than 1950 ");a.value="";a.focus();return}}else{alert("This field must contain an INTEGER value.");a.value="";a.focus();return}var g=document.getElementById(m).value,f=document.getElementById(d).value;event.keyCode!=16&&event.keyCode!=9&&g!=""&&f!=""&&VerifyDate(g,f,b,c,d,true,i,h,j)}function VerifyDate(a,f,e,b,i,l,k,j,h){var d=false;if(a==2&&f>daysInFebruary(e)){d=true;alert("The February of "+e+" has only"+daysInFebruary(e)+" days");document.getElementById(b).value="";document.getElementById(b).focus()}if((a==4||a==6||a==9||a==11)&&f>30){var c;if(a==4)c=" April ";else if(a==6)c=" June ";else if(a==9)c=" September ";else if(a==11)c=" November ";d=true;alert(c+"has only 30 days.");if(l){document.getElementById(i).value="";document.getElementById(i).focus()}else{document.getElementById(b).value="";document.getElementById(b).focus()}}else{if(!j){var m=new Date,g=new Date;g.setFullYear(e,a-1,f);if(g>m){d=true;alert("Date cannot be in the future");document.getElementById(b).value="";document.getElementById(b).focus();return}}!d&&k&&h!=""&&callBackForValidYear(h)}}function OnKeyUp(b,e,d,f){if(event.keyCode==8&&document.getElementById(b).value.length==0){var c=document.getElementById(e),a=c.createTextRange();a.collapse(false);a.select()}else event.keyCode!=16&&event.keyCode!=9&&document.getElementById(b).value.length==f&&document.getElementById(d).focus()}function daysInFebruary(a){return a%4==0&&(!(a%100==0)||a%400==0)?29:28}function FormatInputAsCurrency(a,b,c){if(!c)if(b!=""){var d=new RegExp(/^-?\d*$|^-?\d*\.\d{2}$|^-?\.\d{1}$|^-?\d*\.\d{1}$|^-?\.\d{1}$/),e=d.exec(b);if(!e){alert("This field must contain a numeric value.");a.focus();a.select()}else a.value="$"+formatCurrency(b)}else a.value=""}function FormatCurrencyInput(a,b,c){if(!c){if(b!="")a.value=unformatCurrency(b);a.focus();a.select()}}function formatCurrency(a){var c=/(\$|\,|\s)/g;a=a.toString().replace(c,"");if(isNaN(a))a="";sign=a==(a=Math.abs(a));a=Math.floor(a*100+.50000000001);a=Math.floor(a/100).toString();for(var b=0;b<Math.floor((a.length-(1+b))/3);b++)a=a.substring(0,a.length-(4*b+3))+","+a.substring(a.length-(4*b+3));return sign?a:"-"+a}function unformatCurrency(d){var b="",c="",e=0,f=0;d+="";if(d=="")return 0;for(i=0;i<=d.length;i++){var a=d.substring(i,i+1);if(a=="."){e=1;b=b+a}if(a!="-"&&a<"0"||a>"9"){if(a!="$"&&a!="."&&a!=","&&a!=" "&&a!="")f=1}else{c=c+a;b=b+a}if(a=="$"||a=="."||a==",")c=c+a}return e?parseFloat(b):b.length>0?parseFloat(b):0}function FormatInputAsCurrencyDecimal(a,b,c){if(!c)if(b!=""){var d=new RegExp(/^-?\d*$|^-?\d*\.\d{2}$|^-?\.\d{1}$|^-?\d*\.\d{1}$|^-?\.\d{1}$/),e=d.exec(b);if(!e){alert("This field must contain a numeric value.");a.focus();a.select()}else a.value="$"+formatDecimalCurrency(b)}else a.value=""}function FormatCurrencyInputDecimal(a,b,c){if(!c){if(b!="")a.value=unformatDecimalCurrency(b);a.focus();a.select()}}function formatDecimalCurrency(a){var f=/(\$|\,|\s)/g;a=a.toString().replace(f,"");if(isNaN(a))a="";var c=false,d="",e=a.indexOf(".");if(e>0){c=true;d=a.substr(e,3)}sign=a==(a=Math.abs(a));a=Math.floor(a*100+.50000000001);a=Math.floor(a/100).toString();for(var b=0;b<Math.floor((a.length-(1+b))/3);b++)a=a.substring(0,a.length-(4*b+3))+","+a.substring(a.length-(4*b+3));return sign?c?a+d:a:c?a+d:"-"+a}function unformatDecimalCurrency(d){var b="",c="",e=0,f=0;d+="";if(d=="")return 0;for(i=0;i<=d.length;i++){var a=d.substring(i,i+1);if(a=="."){e=1;b=b+a}if(a!="-"&&a<"0"||a>"9"){if(a!="$"&&a!="."&&a!=","&&a!=" "&&a!="")f=1}else{c=c+a;b=b+a}if(a=="$"||a=="."||a==",")c=c+a}return e?parseFloat(b).toFixed(2):b.length>0?parseFloat(b).toFixed(2):0}function FormatInputAsPercent(b,a,d){if(!d){var c=/(\)|\(|,|\s)/g;a=a.toString().replace(c,"");if(a!=""){var e=new RegExp(/^\d*$|^\d*\.\d*$|^\.\d*$|^\d*\.\d*$/),f=e.exec(a);if(!f){alert("This field must contain a percent value.");b.focus();b.select()}else b.value=a+" %"}else b.value="";a=0}return false}function FormatPercentInput(a,b,c){if(!c&&b!="")a.value=replaceSubstring(b,"%","");a.focus();a.select()}function isValidData(c,a,e,g,b){if(a!=""){var f=new RegExp(g),d=f.test(a);if(d)c.value=a;else{if(b=="")alert("Data is invalid.");else alert(b);c.value=""}}else!e&&alert("This field cannot be blank.")}var DragInfo={};DragInfo.zIndex=10;function Div_beginDrag(c,b,a){DragInfo.element=c;DragInfo.beginCursorX=a.pageX+document.documentElement.scrollLeft+document.body.scrollLeft;DragInfo.beginCursorY=a.pageY+document.documentElement.scrollTop+document.body.scrollTop;DragInfo.beginElementLeft=parseInt(DragInfo.element.css("left"),10);DragInfo.beginElementTop=parseInt(DragInfo.element.css("top"),10);DragInfo.element.css("zIndex",++DragInfo.zIndex);b.mousemove(function(a){Div_dragging(a)});b.mouseup(function(){Div_endDrag(b)});a.stopPropagation();a.returnValue=false}function Div_dragging(a){var b=a.pageX+document.documentElement.scrollLeft+document.body.scrollLeft,d=DragInfo.beginElementLeft-DragInfo.beginCursorX+b;DragInfo.element.css("left",d+"px");var c=a.pageY+document.documentElement.scrollTop+document.body.scrollTop,e=DragInfo.beginElementTop-DragInfo.beginCursorY+c;DragInfo.element.css("top",e+"px");a.stopPropagation();a.returnValue=false}function Div_endDrag(a){a.unbind("mousemove");a.unbind("mouseup")}function GetRelativeWidth(a){return parseInt(a*screen.width/1680)}function GetRelativeHeight(a){return parseInt(a*screen.height/1050)}function RedirectToSearchScreen(a){location.href="main.aspx?tabid="+a+"&amp;ControlId="+a+"3";return false}function DisplayShadowImage(b){if(b==""){var a='<div id="image_notfound" style="font-size: 14px; margin: auto; width: 300px; height: 150px; color: Red;">';a+='<table><tr><td nowrap="nowrap">Image not found. Sorry for the inconvenience</td></tr></table></div>';Shadowbox.open({player:"html",content:a})}else Shadowbox.open({player:"img",content:b})}function DisplayinShadowBox(c,b,a){Shadowbox.open({player:"iframe",content:c,width:b,height:a})}function UploadFile(a){var b="directories = 0, location = 0, menubar = 0, toolbar = 0, top = "+(event.clientY+10)+", scrollbars = 0, resizable = 0, status = 1, width = 450, height = 290";OpenPopup(a,b,false);return false}function RefreshParentWindow(){var a=this.opener;if(a!=null){a.document.write(loadingHtml);a.location.reload()}else alert("Error refreshing results screen!")};
