var sv_post_queue=new ProcessQueue();
function bind(b,a){return function(){a.apply(b,arguments)
}
}function StreetView(a){this.client=a.streetview_client;
this.target_window=a.streetview_id;
this.parent_id=a.parent_id;
this.base_height=a.base_height;
this.streetview_height=a.streetview_height;
this.toggle_link=a.toggle_link|null;
this.pano_visible=false;
this.pano_handler=null;
this.target_balloon=null;
this.sv_data=null;
this.pov={};
this.callback_s=function(){};
this.callback_e=function(){};
this.callback_data={}
}StreetView.prototype.isActive=function(){return this.pano_visible
};
StreetView.prototype.getPanoHandler=function(){if(this.pano_handler==null){var a=document.getElementById(this.getTargetWindowId());
if(a!=null){this.pano_handler=new GStreetviewPanorama(a)
}else{return false
}}return this.pano_handler
};
StreetView.prototype.getPanoHandler=function(){if(this.pano_handler==null){var a=document.getElementById(this.getTargetWindowId());
if(a!=null){this.pano_handler=new GStreetviewPanorama(a)
}else{return false
}}return this.pano_handler
};
StreetView.prototype.getStreetviewHeight=function(){if(this.streetview_height==null){this.streetview_height=280
}return this.streetview_height
};
StreetView.prototype.setStreetviewHeight=function(a){return this.streetview_height=a
};
StreetView.prototype.setBaseHeight=function(a){return this.base_height=a
};
StreetView.prototype.setDynamicBaseHeight=function(a){if(a!=null){this.getBaseHeight=a
}};
StreetView.prototype.getBaseHeight=function(){if(this.base_height==null){this.base_height=280
}return this.base_height
};
StreetView.prototype.setParentId=function(a){this.parent_id=a
};
StreetView.prototype.getParentId=function(){return this.parent_id
};
StreetView.prototype.getParent=function(){return top.document.getElementById(this.getParentId())
};
StreetView.prototype.setClient=function(a){this.client=a
};
StreetView.prototype.getClient=function(){if(this.client==null){this.client=new GStreetViewClient()
}return this.client
};
StreetView.prototype.setTargetBalloon=function(a){this.target_balloon=a
};
StreetView.prototype.getTargetBalloon=function(){return this.target_balloon
};
StreetView.prototype.getTargetBalloonId=function(){return"gmaps_balloon_"+this.target_balloon
};
StreetView.prototype.getToggleButtonId=function(){return"tlf-streetview-link-toggle-"+this.getTargetBalloon()
};
StreetView.prototype.setTargetWindowId=function(a){this.target_window=a
};
StreetView.prototype.getTargetWindowId=function(){return this.target_window
};
StreetView.prototype.setSvData=function(a){this.sv_data=a
};
StreetView.prototype.getSvData=function(){return this.sv_data
};
StreetView.prototype.checkLocation=function(a,b){this.pov=b;
this.getClient().getNearestPanorama(a,bind(this,this.checkResponse))
};
StreetView.prototype.checkResponse=function(a){if(a.code==200){this.setSvData(a);
this.callback_s()
}else{this.callback_e();
return
}};
StreetView.prototype.togglePano=function(){var a=this.getPanoHandler();
var c=document.getElementById(this.getTargetWindowId());
var b=this.getStreetviewHeight();
if(this.isActive()==false){this.showPanorama()
}else{this.hidePanorama()
}};
StreetView.prototype.showPanorama=function(){var e=document.getElementById(this.getTargetWindowId());
var d=this.getParent();
var b=parseInt(this.getBaseHeight())+parseInt(this.getStreetviewHeight());
d.style.height=b+"px";
if(e!=null){var a=this.getPanoHandler();
var c=this.getSvData();
a.setLocationAndPOV(c.location.latlng,this.pov);
GEvent.addListener(a,"error",this.handleNoFlash);
this.pano_visible=true
}};
StreetView.prototype.hidePanorama=function(){var c=this.getParent();
var b=parseInt(this.getBaseHeight());
c.style.height=b+"px";
var a=this.getPanoHandler();
a.hide();
this.pano_visible=false
};
StreetView.prototype.removePanorama=function(){var a=this.getPanoHandler();
a.remove();
this.pano_visible=false
};
StreetView.prototype.updateLocation=function(){this.showPanorama()
};
StreetView.prototype.handleNoFlash=function(a){};
StreetView.prototype.setupResultAction=function(c,a,b){this.callback_s=c||function(){};
this.callback_e=a||function(){};
if(b!=null){this.callback_data=b
}};
