var PropertyImageUrl ='http://media.cbba.com/';var OfficeBaseImageUrl ='http://media.cbba.com/';var AgentBaseImageUrl ='http://media.cbba.com/';var LiveURL ="'";var noImageProperty="../App_Themes/Default/Images/CommonImages/noPropertyPhoto.gif";var noimageagent ="../App_Themes/Default/Images/CommonImages/NoAgentPhotoMid.jpg";var noimageoffice="../App_Themes/Default/Images/CommmonImages/noPhotoSmall.gif";var agenttemppath="http://media.cbba.com/A/";var officetemppath="http://media.cbba.com/O/";var NWMLSimages="http://media.cbba.com/NWMLS/media/";var RMLSimages="http://media.cbba.com/RMLS/media/";var PropertyBasePath="../Pages/PropertyDetail.aspx?ListingID=";var AgentBasePath="../Pages/AgentDetail.aspx?AID=";var TeamBasePath="../Pages/AgentDetail.aspx?TID=";var OfficeBasePath="../Pages/OfficeDetail.aspx?OID=";var PropertyList="../Pages/PropertyList.aspx?VM=VDO&VCID=";var navigateagentcategory="../Pages/AgentVideoByCatergory.aspx?SID=";String.prototype.reverse = function(){splitext = this.split("");revertext = splitext.reverse();reversed = revertext.join("");return reversed;};String.prototype.replaceAll = function(pcFrom, pcTo) {var i = this.indexOf(pcFrom);var c = this;while (i > -1){c = c.replace(pcFrom, pcTo);i = c.indexOf(pcFrom);}return c;};String.prototype.trim = function (s){return this.replace(/^\s+|\s+$/g, ''); };String.prototype.pad = function(l, s, t){return s || (s = " "), (l -= this.length) > 0 ? (s = new Array(Math.ceil(l / s.length)+ 1).join(s)).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2))+ this + s.substr(0, l - t) : this;};function getPropertyImageUrl(MLSListingID,MlsId2){if(MlsId2 == 1){var MLSListingIDPadded = MLSListingID;if(MLSListingID.toString().length <=7) {MLSListingIDPadded =MLSListingID.toString().pad(8,"0",0);}var listingImageUrl = PropertyImageUrl + 'THUMBS/NWMLS/Media/'+ MLSListingIDPadded.toString().substring(0,3) + '/' + MLSListingIDPadded.toString().substring(3,6) + '/' + MLSListingID.toString() + ".jpg" ;}else{var tempMlsListingId = MLSListingID.toString().reverse();var higerNumber = tempMlsListingId.length > 6 ? tempMlsListingId.toString().substring(5,tempMlsListingId.length ):tempMlsListingId.toString().substring(5,tempMlsListingId.length);var higerFolder = (higerNumber.reverse() * 100000).toString().pad(8,"0",0);var imageSubFolder = higerFolder+"/"+tempMlsListingId.toString().substring(4,5).pad(5,"0",1) +"/"+tempMlsListingId.toString().substring(3,4).pad(4,"0",1);var listingImageUrl = PropertyImageUrl + 'THUMBS/RMLS/Media/'+ imageSubFolder+'/' + MLSListingID.toString() + ".jpg" ;}return listingImageUrl;};