function chClass(el, nClass) {
	if(el.id) {
		document.getElementById(el.id).className = nClass;
	}
}

function getURL(url) {
	if(url) {
		window.location = url;
	}
}

function showSbMn(el) {
	document.getElementById(el).style.visibility = 'visible';
	document.getElementById(el).style.display = 'block';	
}

function hideSbMn(el) {
	document.getElementById(el).style.visibility = 'hidden';
	document.getElementById(el).style.display = 'none';	
}

function chLang(lang) {
		
}

function chLang(uri, lang) {
	if(uri!= '' && lang != '') {
		if(uri.indexOf('lang=') != -1) o = uri.replace(/lang=([a-z_]*)/i, "lang=" + lang);
		else o = (uri.indexOf('?') == -1) ? uri + "?lang=" + lang : uri + "&lang=" + lang;
		
		location.href = o;
	}
}

function chDest(CodDestino) {
	if(CodDestino != '') location.href = URL_BASE + '/destino/?CodDestino=' + CodDestino;
}

//######################################
//## GOOGLE MAPS
//######################################
var map = null;
var geocoder = null;

function gMap_initialize() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(-22.907803,-43.206482), 8);
		geocoder = new GClientGeocoder();
		//map.setUIToDefault();
		map.addControl(new GLargeMapControl());

	}
}

function gMap_showAddress(adgoogle) {
	if (geocoder) {
		geocoder.getLatLng(adgoogle, function(point) {
			if (!point) {
				//alert("Não foi possível localizar o endereço " + adgoogle + " no mapa.");
			} else {
				map.setCenter(point, 15);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				//marker.openInfoWindowHtml(adgoogle);
			}
		});
	}
}
