
function tabs(name){
	tab=new Array("news","media","tempo","loc");
	for(i=0;i<4;i++){
		if (document.getElementById((tab[i]))!=null) {
			document.getElementById(tab[i]).className=(tab[i]==name?'active':'');
			document.getElementById('tab_'+tab[i]).className=(tab[i]==name?'active':'');
		}
	}
	set_hash("t="+name);//definir #
	tabTracker._trackPageview('/tab/'+name);
	return false;
}

function set_hash(hash){
	window.location.hash=''+hash;
	return false;
}

function get_hash(name,value){
	hash=window.location.hash.substring(1);
	keys=hash.split("&");
	for(var i=0; i < keys.length; i++) {
		tag=keys[i].split("=")[0];
		if (tag==name) {
			return keys[i].split("=")[1];
		}
	}
	return value;
}


function select_tab(){
	tab=get_hash("t",'');
	if (tab!='') {
		tabs(tab);
	}
}

function min_tabs(id){
	for(i=0;i<28;i++){
		if (document.getElementById('tab_min_'+i)!=null) {
			document.getElementById('tab_min_'+i).className=(i==id?'active':'');
			document.getElementById('tab_min_content_'+i).className='tab_'+(i==id?'in':'out');
		}
	}
	return false;
}

function open_map(lat, lng, zoom){
	win=classbox_page();
	width=win[2]-140;
	height=win[3]-120;
	html='<iframe src="http://www.brasilocal.com/mapa.php?lat='+lat+'&lng='+lng+'&zoom='+zoom+'" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
	classbox_open('BrasiLocal - Mapa', html, width, height);
	tabTracker._trackPageview('/outros/mapa');
	return false;
}

function open_foto(titulo, image, url, width, height, owner, owner_url){
	html='<a href="'+url+'" title="'+titulo+'"><img src="'+image+'"  width="'+width+'" height="'+height+'"/></a><a href="http://www.panoramio.com/">'+
		'<img src="http://www.brasilocal.com/design/panoramio.gif" align="left"></a>'+
		'<br /><p class="desc">Foto fornecida pelo <a href="http://www.panoramio.com/">Panoramio</a> e está protegida sob copyright do '+
		'proprietário <a href="'+owner_url+'">'+owner+'</a></p>';
	classbox_open(titulo, html, width, height+35);
	tabTracker._trackPageview('/outros/foto');
	return false;
}

function open_video(titulo, flash){
	html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
	'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="460" height="400">' +
	'<param name="movie" value="'+flash+'&amp;color1=0x0A3161&amp;color2=0x4672A9&amp;border=1&amp;autoplay=1"/><param name="allowFullScreen" value="true"><param name="quality" value="high"/>' +
	'<param name="wmode" value="transparent"/>' +
	'<embed src="'+flash+'&amp;color1=0x0A3161&amp;color2=0x4672A9&amp;border=1&amp;autoplay=1" quality="high" wmode="transparent" width="460" height="400" type="application/x-shockwave-flash"' +
	' allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
	classbox_open(titulo,html,460,400);
	tabTracker._trackPageview('/outros/video');
	return false;
}