// JavaScript Document

var is=new function (){ 	
	this.VER=navigator.appVersion
	this.AGENT=navigator.userAgent
	this.DOM=document.getElementById?1:0
	this.IE=(document.all && !this.DOM)?1:0;
	this.MAC=this.AGENT.indexOf("Mac")>-1
	this.NS6=document.getElementById&&!document.all?1:0
	this.NS4=(document.layers && !this.DOM)?1:0;
	this.OPERA=this.AGENT.indexOf('Opera')>-1
	return this
}

function getElement(id){
	if (is.DOM)	return document.getElementById(id)
	else
	if (is.IE) return eval("document.all."+id)
	else
	if (is.NS) return eval("document."+id)
}

function showhide(id) {
obj = getElement(id);
viz =  obj.style.display;
    if (viz == 'block' ) {
    obj.style.display = "none";
    } else {
	obj.style.display = "block";
    }   
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function encode(pValue){
	pValue = escape(pValue);
	pValue = pValue.replace(/%u20AC/g, "%80"); 
	pValue = pValue.replace(/%u201A/g, "%82"); 
	pValue = pValue.replace(/%u0192/g, "%83"); 
	pValue = pValue.replace(/%u201E/g, "%84"); 
	pValue = pValue.replace(/%u2026/g, "%85"); 
	pValue = pValue.replace(/%u2020/g, "%86"); 
	pValue = pValue.replace(/%u2021/g, "%87"); 
	pValue = pValue.replace(/%u02C6/g, "%88"); 
	pValue = pValue.replace(/%u2030/g, "%89"); 
	pValue = pValue.replace(/%u0160/g, "%8A"); 
	pValue = pValue.replace(/%u2039/g, "%8B"); 
	pValue = pValue.replace(/%u0152/g, "%8C"); 
	pValue = pValue.replace(/%u017D/g, "%8E"); 
	pValue = pValue.replace(/%u2018/g, "%91"); 
	pValue = pValue.replace(/%u2019/g, "%92"); 
	pValue = pValue.replace(/%u201C/g, "%93"); 
	pValue = pValue.replace(/%u201D/g, "%94"); 
	pValue = pValue.replace(/%u2022/g, "%95"); 
	pValue = pValue.replace(/%u2013/g, "%96"); 
	pValue = pValue.replace(/%u2014/g, "%97"); 
	pValue = pValue.replace(/%u02DC/g, "%98"); 
	pValue = pValue.replace(/%u2122/g, "%99"); 
	pValue = pValue.replace(/%u0161/g, "%9A"); 
	pValue = pValue.replace(/%u203A/g, "%9B"); 
	pValue = pValue.replace(/%u0153/g, "%9C"); 
	pValue = pValue.replace(/%u017E/g, "%9E"); 
	pValue = pValue.replace(/%u0178/g, "%9F"); 
	pValue = pValue.replace(/%20/g, "+"); 
	return pValue;
}

// AJAX functions
var ajaxObjects = new Array();
var ajaxObjectsDelayProtect = new Array();

function getContent(url,divobj,fnc_completo,params){
	try {
	pageTracker._trackPageview(url);
	} catch(err) {}
	var ajaxIndex = ajaxObjects.length;
	ajaxObjectsDelayProtect[url] = ajaxIndex;
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = url;
	ajaxObjects[ajaxIndex].encodeURIString = false;
	ajaxObjects[ajaxIndex].onCompletion = function() {showContent(divobj,ajaxIndex,url,fnc_completo);};
	ajaxObjects[ajaxIndex].runAJAX(params);
	showWaitMessage(divobj);
} 

function showWaitMessage(divobj){
	divobj.innerHTML = '<img src="images/ajax-loader.gif" alt="A carregar dados..." />';
}

function showContent(divobj,index,url,fnc_completo){
	if (ajaxObjectsDelayProtect[url] == index){divobj.innerHTML = ajaxObjects[index].response;	}
	if (fnc_completo)eval(fnc_completo);
}

// show divs associacoes
function show_div1(){
	document.getElementById('div1').style.display='block';
	document.getElementById('div2').style.display='none';
	document.getElementById('div3').style.display='none';
	document.getElementById('div4').style.display='none';
	document.getElementById('div5').style.display='none';
	document.getElementById('div6').style.display='none';
	document.getElementById('tab1').style.backgroundColor='#DEDEDE';
	document.getElementById('tab2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab6').style.backgroundColor='#EEEEEE';
}

function show_div2(){
	document.getElementById('div1').style.display='none';
	document.getElementById('div2').style.display='block';
	document.getElementById('div3').style.display='none';
	document.getElementById('div4').style.display='none';
	document.getElementById('div5').style.display='none';
	document.getElementById('div6').style.display='none';
	document.getElementById('tab1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab2').style.backgroundColor='#DEDEDE';
	document.getElementById('tab3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab6').style.backgroundColor='#EEEEEE';
}

function show_div3(){
	document.getElementById('div1').style.display='none';
	document.getElementById('div2').style.display='none';
	document.getElementById('div3').style.display='block';
	document.getElementById('div4').style.display='none';
	document.getElementById('div5').style.display='none';
	document.getElementById('div6').style.display='none';
	document.getElementById('tab1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab3').style.backgroundColor='#DEDEDE';
	document.getElementById('tab4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab6').style.backgroundColor='#EEEEEE';
}

function show_div4(){
	document.getElementById('div1').style.display='none';
	document.getElementById('div2').style.display='none';
	document.getElementById('div3').style.display='none';
	document.getElementById('div4').style.display='block';
	document.getElementById('div5').style.display='none';
	document.getElementById('div6').style.display='none';
	document.getElementById('tab1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab4').style.backgroundColor='#DEDEDE';
	document.getElementById('tab5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab6').style.backgroundColor='#EEEEEE';
}

function show_div5(){
	document.getElementById('div1').style.display='none';
	document.getElementById('div2').style.display='none';
	document.getElementById('div3').style.display='none';
	document.getElementById('div4').style.display='none';
	document.getElementById('div5').style.display='block';
	document.getElementById('div6').style.display='none';
	document.getElementById('tab1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab5').style.backgroundColor='#DEDEDE';
	document.getElementById('tab6').style.backgroundColor='#EEEEEE';
}

function show_div6(){
	document.getElementById('div1').style.display='none';
	document.getElementById('div2').style.display='none';
	document.getElementById('div3').style.display='none';
	document.getElementById('div4').style.display='none';
	document.getElementById('div5').style.display='none';
	document.getElementById('div6').style.display='block';
	document.getElementById('tab1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab6').style.backgroundColor='#DEDEDE';
}

// show divs camping
function show_div_camping1(){
	document.getElementById('div_camping1').style.display='block';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';
}

function show_div_camping2(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='block';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';}

function show_div_camping3(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='block';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';}

function show_div_camping4(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='block';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';}

function show_div_camping5(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='block';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';}

function show_div_camping6(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='block';
	document.getElementById('div_camping7').style.display='none';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#DEDEDE';
	document.getElementById('tab_camping7').style.backgroundColor='#EEEEEE';}

function show_div_camping7(){
	document.getElementById('div_camping1').style.display='none';
	document.getElementById('div_camping2').style.display='none';
	document.getElementById('div_camping3').style.display='none';
	document.getElementById('div_camping4').style.display='none';
	document.getElementById('div_camping5').style.display='none';
	document.getElementById('div_camping6').style.display='none';
	document.getElementById('div_camping7').style.display='block';
	document.getElementById('tab_camping1').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping2').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping3').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping4').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping5').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping6').style.backgroundColor='#EEEEEE';
	document.getElementById('tab_camping7').style.backgroundColor='#DEDEDE';}