var novasib_events={
setOptions:function(options){
this.options=options;
},
init:function(){
this.onWindowResize('',Window.getDimensions());
this.wro=new Window.ResizeObserver(window.document.body,0.25,this.onWindowResize.bind(this));
var mapElement=$('map');
this.map=false;
if(typeof(GMap2)!='undefined'){
this.map=new Cs3000.MapWrapper.GoogleMap(mapElement);
this.map.setCenter(50.971887,10.960912,9);
}
else if(typeof(VEMap)!='undefined'){
this.map=new Cs3000.MapWrapper.VirtualEarthMap(mapElement);
this.map.setCenter(50.971887,10.960912,9);
this.map.setScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
this.map.setMapStyle(VEMapStyle.Shaded);
}
if(this.map){
this.eventsLoader=new Cs3000.Novasib.EventsLoader(this.map,this.options,this.refr);
}
},
destroy:function(){
if(typeof(GMap2)!='undefined'){
this.map.destroy();
}
else if(typeof(VEMap)!='undefined'){
this.map=null;
}
},
onWindowResize:function(element,dimensions){
var xy=$('map').cumulativeOffset();
var minHeight=xy[1]+150;
var height=Math.max(minHeight,dimensions.height-xy[1]-175);
[$('map'),$('eventform')].invoke('setStyle',{
height:height+'px'}
);
[$('eventform')].invoke('setStyle',{
height:(height+107)+'px'}
);
}
}
Event.observe(window,'load',novasib_events.init.bind(novasib_events));
Event.observe(window,'unload',novasib_events.destroy.bind(novasib_events));
