function _BM(A){this._MM(A);this.FieldDisplayNames=new Array("","","","","","","","","","","","Year Built","Website","Description","","","");this.ApartmentObjects=undefined}copyPrototype(_BM,_MM);_BM.prototype.bldgname=function(){return this.FullArray[4]};_BM.prototype.streetnum=function(){return this.FullArray[5]};_BM.prototype.streetdir=function(){return this.FullArray[6]};_BM.prototype.streetname=function(){return this.FullArray[7]};_BM.prototype.City=function(){return this.FullArray[8]};_BM.prototype.Zipcode=function(){return this.FullArray[9]};_BM.prototype.Floors=function(){return this.FullArray[10]};_BM.prototype.YearBuilt=function(){return this.FullArray[11]};_BM.prototype.Website=function(){return this.FullArray[12]};_BM.prototype.Description=function(){return this.FullArray[13]};_BM.prototype.PictureBase=function(){return this.FullArray[15]};_BM.prototype.BID=function(){return this.FullArray[15]};_BM.prototype.KeyParam=function(){return this.FullArray[16]};_BM.prototype.StreetAddress=function(){return this.streetnum()+" "+this.streetdir()+" "+this.streetname()};_BM.prototype.FullAddress=function(){return this.streetnum()+" "+this.streetdir()+" "+this.streetname()+"<br/>"+this.City()+",HI,"+this.Zipcode()};_BM.prototype.FavoriteLabel=function(){return this.bldgname()+", "+this.StreetAddress()};_BM.prototype.UnselectedMarkerImage=function(){return"BIMAGE/blue-dot.png"};_BM.prototype.ToLinkHTML=function(){var A='<A  id="link'+this.MarkerId()+'" HREF="javascript:mmc.AddTabByMarkerId('+this.MarkerId()+')"  onmouseover="mmc.MarkerFocusIn('+this.MarkerId()+')" onmouseout="mmc.MarkerFocusOut('+this.MarkerId()+')">'+this.bldgname()+"</A><br/>";return A};_BM.prototype.ToTableRowHTML=function(){var A="";if(SuperSearchType==-1){A=this.KeyParam();if(A=="1"){A+=" unit"}else{A+=" units"}}else{A=FormatSecondCol4SuperSearch(this.KeyParam())}return"<tr><td>"+this.ToLinkHTML()+"</td><td>"+A+"</td></tr>"};_BM.prototype.ToPopupHTML=function(){return this.bldgname()+"<br/>"+this.StreetAddress()};_BM.prototype.GetImage=function(A){if(A=="0"){return"BIMAGE/"+this.PictureBase()+".jpg"}else{return"BIMAGE/"+this.PictureBase()+"-"+A+".jpg"}};_BM.prototype.GetDashboardImagesHtml=function(){var C=new Array();for(var B=0;B<9;B++){C.push(this.GetImage(B.toString()))}var A=GetImagesTable(C,3,false,bimage.src);A+="<input type='checkbox' onclick='javascript:SwitchFrame(this.checked, \"frame"+this.MarkerId()+'", 100, "Pages_FileUpload_Frame.aspx?bid='+this.BID()+"\")'>Add more pictures"+OutputFrame(this.MarkerId(),"",0);return A};_BM.prototype.ToTabName=function(){return this.bldgname()};_BM.prototype.ToDetails=function(E,D){var A=_MM.prototype.ToDetails.call(this,E,D);if(E){A+="<form id='frmMarker"+this.MarkerId+"'><table border=0 cellspacing=1 cellpadding=0>";for(var B=0;B<this.Names.length;B++){if(B<5){A+=GetHidden(this.Names[B],this.FullArray[B])}else{if(this.Names[B]=="Description"){A+=GetFieldAndTextareaRow(this.Names[B],this.Names[B],this.FullArray[B])}else{A+=GetFieldAndTextboxRow(this.Names[B],this.Names[B],this.FullArray[B])}}}A+=GetLoginAndPasswordRow();A+="</table>";A+="<input type='button' value='save' onclick='javascript:this.value=\"Please, wait...\";this.disabled=\"disabled\";mmc.SaveMarker("+this.MarkerId+")'><form>"}else{A+=GetCondoGoogleAd();var C=this.FullAddress();A+=this.ToStaticDetail(this.bldgname(),C,D);A+="<div id='Apts"+this.MarkerId()+"'>";if(this.ApartmentObjects==undefined){A+="...if MLS has any properties for sale at this location, they will appear here in a few seconds..."}else{A+=GetAptsDiv(this.MarkerId(),9)}A+="</div>";if(this.ApartmentObjects==undefined){this.LoadApartments()}}return A};function ShowAllImagesAtOnce(H){var C=mmc.MasterMarkerFromId(H);var B=C.ApartmentObjects;var G=B.length;for(var D=0;D<G;D++){var E=B[D];var A=E.MlsNumber();OpenAllMlsImages(A,8);var F=document.getElementById("mlsAptForm"+A);F.innerHTML=GetEmailForm(A,false)}}_BM.prototype.LoadApartments=function(){var A="Pages_GetApartments.aspx?marker_id="+this.MarkerId()+"&bid="+this.BID();GDownloadUrl(A,this.ApartmentLoaded)};_BM.prototype.ApartmentLoaded=function(H){lines=H.split("<br/>");var B;var D;var A;var G=new Array();for(var F=0;F<lines.length;F++){if(lines[F].length>1){A=lines[F].split("|");if(B==undefined){B=A[0];D=A[1]}G.push(new Apartment(A))}}if(B!=undefined){var C=mmc.MasterMarkerFromId(B);if(C!=""){C.ApartmentObjects=G;var E="Apts"+B;FillDiv(E,C)}}};function FillDiv2(B,C){if(document.getElementById(B)==undefined){return }else{var A=mmc.MasterMarkerFromId(C);FillDiv(B,A)}}function FillDiv(B,A){if(A==""){return }if(document.getElementById(B)==undefined){var C="FillDiv2( '"+B+"',"+A.MarkerId()+")";setTimeout(C,5000)}else{PopulateAptsDiv(A.MarkerId(),9)}}function SwitchFrame(C,D,A,B){var E=document.getElementById(D);E.height=C?A:0;if(C){E.src=B}}var maxWidth=100;var maxHeight=100;var fileTypes=["jpg"];var outImage="previewField";var defaultPic="";function preview(D){var C=D.value;var B=C.substring(C.lastIndexOf(".")+1,C.length).toLowerCase();for(var A=0;A<fileTypes.length;A++){if(fileTypes[A]==B){break}}globalPic=new Image();if(A<fileTypes.length){globalPic.src=C}else{globalPic.src=defaultPic;alert("THAT IS NOT A VALID IMAGE\nPlease load an image with an extention:\n\n"+fileTypes.join(", "))}setTimeout("applyChanges()",200)}var globalPic;function applyChanges(){var B=document.getElementById(outImage);var A=parseInt(globalPic.width);var C=parseInt(globalPic.height);if(A>maxWidth){C*=maxWidth/A;A=maxWidth}if(C>maxHeight){A*=maxHeight/C;C=maxHeight}B.style.display=(A<1||C<1)?"none":"";B.src=globalPic.src;B.width=A;B.height=C};