function BusinessProfileManager(){
__bpm=this;
this.onFavoriteOptionsClick=null;
this.GetAutoFormattedBio=function(_1){
return "This is a stub; please add more information.";
if(_1){
return "<p>"+_1.title+" has been serving this neighborhood for a long time.</p>";
}else{
return "";
}
};
this.GetFormattedBio=function(_2){
if(!_2){
return "";
}
if(_2.description==""||_2.description==null){
return this.GetAutoFormattedBio(_2);
}
return _2.description.replace(/%0D%0A/gi,"");
};
this.GetFormattedKeywords=function(_3,_4,_5){
if(!_3||_3==""){
return "";
}
_3=unescape(_3);
var _6=_3.split(",");
var _7=_6.length;
var _8="";
for(var i=0;i<_7;i++){
if(_6[i]==" "){
continue;
}
var _a=new String(_6[i]).escapeHTML();
_8=_8+"<a href=\""+rootPath+"business/?cat="+escape(_a)+"&lat="+_4+"&lon="+_5+"\">"+_a+"</a>"+" ";
}
return _8;
};
this.ToString=function(_b,_c){
if(_b){
var _d=_b.title;
if(!_b.f.image){
if(!_b.f.icon){
_b.f.image=rootPath+"images/thumbnails/noImage.png";
}else{
_b.f.image=_b.icon;
}
}
_b.f.image=_b.f.image.replace(/standard/gi,"thumbnail");
_b.f.image=_b.f.image.replace(/business.png/gi,"business.gif");
if(productionMode=="True"){
_b.f.image=_b.f.image.replace(/fatdoortest./gi,"fatdoor.");
}
var _e="";
if(_b.f.p){
_e=_b.f.p;
}
var _f="";
if(_b.f.c){
_f=_b.f.c;
}
if(_c==null){
var str="<div style='border:solid 1px #c6c6c6;padding:3px;width:83px;height:83px;float:left;margin:3px;cursor:hand;'><div style='background-image:url("+unescape(_b.f.image)+");background-repeat:no-repeat;background-position:center center;height:80px;width:80px;overflow:hidden;'><a style='height:80px;width:80px;display:block' href='"+rootPath+"business/profile/?id="+_b.guid+"'></a></div></div><div class=profileName><a href='"+rootPath+"business/profile/?id="+_b.guid+"'>"+_d+"</a></div><div class=profileAddress><a href='"+rootPath+"explore/?l="+_f+","+_b.f.s+","+_e+"'>"+_f+", "+_b.f.s+"</a></div>";
if(this.onFavoriteOptionsClick!=null){
str=str+"<div style='clear:both;'>"+this.GetFavoriteOptions(_b.guid)+"</div>";
}else{
str=str+"<div style='clear:both;'></div>";
}
return str;
}else{
if(_c=="Explore"){
var str="";
str=str+"<div style='font-size:110%;font-weight:bold;' align = left><a href='"+rootPath+"business/profile/?id="+_b.guid+"'>"+_d+"</a></div><div style='padding-left:3px;padding-bottom:3px;' align = left>"+_f+", "+_b.f.s+"</div>";
if(this.onFavoriteOptionsClick!=null){
str=str+"<div style='clear:both;'>"+this.GetFavoriteOptions(_b.guid)+"</div>";
}else{
str=str+"<div style='clear:both;'></div>";
}
return str;
}else{
if(_c=="Thumbnail"){
return "<div style='width:83px;height:120px;float:left;margin:3px;cursor:hand;'><div style='background-image:url("+unescape(_b.f.image)+");background-repeat:no-repeat;background-position:center center;height:80px;width:80px;overflow:hidden;border:solid 1px #c6c6c6;padding:1px;'><a style='height:80px;width:80px;display:block' href='"+rootPath+"business/profile/?id="+_b.guid+"'></a></div><div id='ProfileName' style='font-size:80%;text-align:center;'><a href='"+rootPath+"business/profile/?id="+_b.guid+"'>"+_d+"</a></div></div>";
}else{
if(_c=="Tiny"){
return "<div style='width:55px;height:95px;float:left;margin:3px;cursor:hand;overflow:hidden;'><div style='background-image:url("+unescape(_b.f.image)+");background-repeat:no-repeat;background-position:0 0;height:45px;width:45px;overflow:hidden;border:solid 1px #c6c6c6;padding:1px;'><a style='height:80px;width:80px;display:block' href='"+rootPath+"business/profile/?id="+_b.guid+"'></a></div><div id='ProfileName' style='font-size:80%;text-align:center;'><a href='"+rootPath+"business/profile/?id="+_b.guid+"'>"+_d+"</a></div></div>";
}
}
}
}
}else{
return "";
}
};
this.UpdateField=function(obj,_12,_13){
if(obj==null||_12==null){
return false;
}
try{
var val=eval("obj."+_12);
if(val==undefined||val==null){
return false;
}
if(_13!=null||_13!="undefined"){
_13=unescape(_13).replace(/'/gi,"'");
if(_12=="CategoryKeywords"&&val!=""){
_13=val+","+_13;
}
}
eval("obj."+_12+"='"+escape(_13)+"';");
if(!obj.PendingChanges){
obj.PendingChanges=0;
}
obj.PendingChanges=obj.PendingChanges+1;
return true;
}
catch(everything){
return false;
}
};
this.GetFavoriteOptions=function(id){
return "<a class=linkButton id='"+id+"_favHref' href='javascript:void(0);' onclick='__bpm.__onPFavoriteOptionsClick(\""+id+"\");'>"+"<img src='"+rootPath+"images/options_1.png' align=middle>"+" Add to my places"+"</a>";
};
this.GetIconUrl=function(obj){
if(!obj){
return "";
}
var _17=obj.CategoryKeywords;
if(!_17){
return rootPath+"images/ico/24/places.png";
}else{
if(_17.indexOf("Grocers-Retail")>=0){
return rootPath+"images/ico/24/shopping.png";
}else{
if((_17.indexOf("Coffee")>=0)){
return rootPath+"images/ico/24/restaurant.png";
}else{
if((_17.indexOf("Restaurants")>=0)||(_17.indexOf("Diners-Restaurants")>=0)){
return rootPath+"images/ico/24/restaurant.png";
}else{
if((_17.indexOf("Dentists")>=0)||(_17.indexOf("Clinics")>=0)){
return rootPath+"images/ico/24/medical.png";
}else{
if((_17.indexOf("Cinemas")>=0)||(_17.indexOf("Theatres-Movie")>=0)){
return rootPath+"images/ico/24/theater.png";
}else{
if(_17.indexOf("Nature Parks")>=0){
return rootPath+"images/ico/24/parks.png";
}else{
if((_17.indexOf("Golf")>=0)||(_17.indexOf("Golf Courses")>=0)){
return rootPath+"images/maps/icons/golfer.gif";
}else{
if((_17.indexOf("Banks-Commercial")>=0)){
return rootPath+"images/maps/icons/bank.gif";
}else{
if((_17.indexOf("Pharmacies-Specialty")>=0)){
return rootPath+"images/maps/icons/pharmacy.gif";
}else{
if((_17.indexOf("Limousine-Rentals")>=0)){
return rootPath+"images/maps/icons/cabs.gif";
}else{
if((_17.indexOf("Railroads-Passenger")>=0)){
return rootPath+"images/maps/icons/rail.gif";
}else{
if((_17.indexOf("Bus Lines")>=0)){
return rootPath+"images/maps/icons/bus.gif";
}else{
if((_17.indexOf("Government-Post Offices")>=0)){
return rootPath+"images/maps/icons/mail.gif";
}else{
if((_17.indexOf("Parking")>=0)){
return rootPath+"images/maps/icons/parking.gif";
}else{
if((_17.indexOf("Church")>=0)){
return rootPath+"images/maps/icons/religion.gif";
}else{
if((_17.indexOf("Clubs-Health")>=0)){
return rootPath+"images/maps/icons/healthclub.gif";
}else{
if(_17.indexOf("Library")>=0){
return rootPath+"images/maps/icons/housing.gif";
}else{
if((_17.indexOf("Museums")>=0)||(_17.indexOf("Galleries")>=0)){
return rootPath+"images/maps/icons/arts.gif";
}else{
if(_17.indexOf("Schools")>=0){
return rootPath+"images/maps/icons/school.gif";
}else{
if(_17.indexOf("Lodging")>=0){
return rootPath+"images/maps/icons/lodging.gif";
}else{
if((_17.indexOf("Drinking Places-Alcoholic")>=0)||(_17.indexOf("Bars")>=0)){
return rootPath+"images/maps/icons/bar.gif";
}else{
return rootPath+"images/ico/24/places.png";
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
};
this.__onPFavoriteOptionsClick=function(id){
if(this.onFavoriteOptionsClick){
this.onFavoriteOptionsClick(id);
}
};
}

