var fatdoorImage=function(){
};
fatdoorImage.prototype={initialize:function(_1,_2,_3,_4,_5,_6,_7,_8){
this.containerID=_1;
this.currentProfileImage=_2;
this.profileID=_3;
this.profileType=_4;
this.profileName=_5;
this.profileLocation=_6;
this.profileWebsite=_7;
this.imageCallback=_8;
if(this.currentProfileImage==""||this.currentProfileImage==null||this.currentProfileImage==this.defaultImage()){
$(this.containerID).src=rootPath+"images/spinny.gif";
}else{
$(this.containerID).src=_2;
return;
}
function LocalImageSearchControl(_9,_a,_b){
this.callBack=_9;
this.containerID=_a;
this.imageCallback=_8;
this.resultsHandback=null;
this.searcher=new GimageSearch();
this.searcher.setNoHtmlGeneration();
this.searcher.setResultSetSize(GSearch.LARGE_RESULTSET);
this.searcher.setSearchCompleteCallback(this,LocalImageSearchControl.prototype.searchComplete,[this.searcher]);
}
LocalImageSearchControl.prototype.search=function(q,_d){
this.resultsHandback=_d;
this.searcher.execute(q);
return false;
};
LocalImageSearchControl.prototype.searchComplete=function(_e){
if(_e!=null&&_e.results!=null&&_e.results[0]!=null){
var _f="width";
if(_e.results[0].height>_e.results[0].width){
_f="height";
}
this.callBack(_e.results[0]);
}else{
$(this.containerID).src=new fatdoorImage().defaultImage();
}
};
var _10=new LocalImageSearchControl(this.setImage,this.containerID,this.imageCallback);
var _11=this.profileName+", "+this.profileLocation;
if(this.profileWebsite!=null&&this.profileWebsite!=""){
_11=_11+" site:"+this.profileWebsite;
}else{
$(this.containerID).src=this.defaultImage();
}
_10.search(_11);
},setImage:function(_12){
var _13=unescape(_12.url);
if(_13){
if(_13!=""){
if(_12.height>_12.width){
var _14=_12.width/_12.height;
$(this.containerID).height=150;
$(this.containerID).width=Math.floor(150*_14);
}else{
var _14=_12.height/_12.width;
$(this.containerID).width=150;
$(this.containerID).height=Math.floor(150*_14);
var _15=$(this.containerID);
var _16=0;
}
$(this.containerID).src=_13;
}else{
$(this.containerID).src=this.defaultImage();
}
}else{
$(this.containerID).src=this.defaultImage();
}
if(this.imageCallback){
this.imageCallback(_13);
}
},defaultImage:function(){
switch(this.profileType){
case "p":
return rootPath+"images/person.png";
case "b":
return rootPath+"images/places-70.gif";
default:
return rootPath+"images/places-70.gif";
}
}};

