//minified
function hostelsClubMap(latitude,longitude,name){this.map=null;if(this.api){if((latitude)&&(longitude)&&(name)){this.buildPropertyMap(latitude,longitude,name);}else{this.all_markers=new Array();this.buildCityMap();}}}
hostelsClubMap.prototype.api=MAP_API_PUBLIC;hostelsClubMap.prototype.mapElement='map';hostelsClubMap.prototype.markerIcon='images/mm_hclub.png';hostelsClubMap.prototype.markerShadow='images/mm_shadow.png';hostelsClubMap.prototype.markerIconBig='images/mm_hclub_big.png';hostelsClubMap.prototype.markerShadowBig='images/mm_shadow_big.png';hostelsClubMap.prototype.ratingIcons=['images/mm_hclub1.png','images/mm_hclub2.png','images/mm_hclub3.png','images/mm_hclub4.png','images/mm_hclub5.png'];hostelsClubMap.prototype.buildPropertyMap=function(latitude,longitude,name){var point=new LatLonPoint(latitude,longitude);this.map=new Mapstraction(this.mapElement,this.api);this.map.addSmallControls();this.map.addMapTypeControls();this.map.setCenterAndZoom(point,14);this.map.setMapType(Mapstraction.ROAD);var marker=new Marker(point);marker.setLabel(name);marker.setIcon(this.markerIconBig,new Array(24,30),new Array(6,20));marker.setShadowIcon(this.markerShadowBig,new Array(34,30));this.map.addMarker(marker);}
hostelsClubMap.prototype.buildCityMap=function(){var self=this;$(".show_map").click(function(){$("object").css({visibility:"hidden"});$("#searchleft").css({visibility:"hidden"});$("#fade_map").fadeIn("normal");$("#popup").slideDown("slow");self.loadMap();return false;});$("#hide_map").click(function(){$("#popup").slideUp("slow");$("#fade_map").fadeOut("normal");$("object").css({visibility:"visible"});$("#searchleft").css({visibility:"visible"});return false;});}
hostelsClubMap.prototype.loadMap=function(){if(!this.map){if(this.all_markers.length>0){this.map=new Mapstraction(this.mapElement,this.api);this.map.addSmallControls();this.map.addMapTypeControls();this.map.setCenterAndZoom(new LatLonPoint(0,0),0);this.map.setMapType(Mapstraction.ROAD);for(var j=0;j<this.all_markers.length;j++){var marker=new Marker(new LatLonPoint(this.all_markers[j][0],this.all_markers[j][1]));marker.setLabel(this.all_markers[j][2]);marker.setInfoBubble(this.all_markers[j][3]);if(this.all_markers[j][4]<0){marker.setIcon(this.markerIcon,new Array(15,20),new Array(6,20));}else{marker.setIcon(this.getIcon(this.all_markers[j][4]),new Array(18,22),new Array(6,20));}
marker.setShadowIcon(this.markerShadow,new Array(27,20));this.map.addMarker(marker);}}}
this.map.autoCenterAndZoom();if(this.map.getZoom()>15){this.map.setZoom(15);}}
hostelsClubMap.prototype.addMarker=function(latitude,longitude,label,info,rating){this.all_markers[this.all_markers.length]=new Array(latitude,longitude,label,info,rating);}
hostelsClubMap.prototype.getIcon=function(rating){if(rating<21){return this.ratingIcons[0];}else if(rating<41){return this.ratingIcons[1];}else if(rating<61){return this.ratingIcons[2];}else if(rating<80){return this.ratingIcons[3];}else{return this.ratingIcons[4];}}
