﻿//google.load("maps",2);
var map;

function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} function posRight() {return posLeft()+pageWidth();} function posBottom() {return posTop()+pageHeight();}
function rsCover(x,y,z) {$('#cover').show(); $('#mapcover').show();  
	with(bID('maptbl').style) { left=parseInt(pageWidth()/2-325)+'px'; top=parseInt(pageHeight()/2-195)+'px'; } 
	with(bID('maptblcl').style) { left=parseInt(pageWidth()/2-50)+'px'; top=parseInt(pageHeight()/2-215)+'px'; }
	loadMap(x,y,z); 
}
function clCover() {$('#cover').hide(); $('#mapcover').hide(); }


function loadMap(x,y,z) {
if (GBrowserIsCompatible()) {
	var ic = new GIcon();
	ic.image            = '/img/l_marker_hotel.png';
	ic.shadow           = '/img/l_marker_hotel_sh.png';
	ic.iconSize         = new GSize(26,26);
	ic.shadowSize       = new GSize(40,27);
	ic.iconAnchor       = new GPoint(13,27);
	ic.infoWindowAnchor = new GPoint(13,1);

	map = new GMap2(bID('map'));	
	map.addControl(new GLargeMapControl());
	map.addControl(new GScaleControl());
	map.addControl(new GMenuMapTypeControl());

        map.setCenter(new GLatLng(x,y),z);
	map.enableContinuousZoom();
	map.enableDoubleClickZoom();
	map.addOverlay(new GMarker(new GLatLng(x,y), {draggable: false, icon: ic}));
}
}