	
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

ajaxReturnFunction=false

function doRequest(url,f){

	url+=(url.replace(/\?/,"")==url?"?":"&")+Math.random()
	ajaxReturnFunction=f
	xmlhttp.open("GET",url,true)
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4)
			ajaxReturnFunction(xmlhttp.responseText)
	}
	xmlhttp.send(null)

}
	
	// url_encode version 1.0  
function url_encode(str) {  
    var hex_chars = "0123456789ABCDEF";  
    var noEncode = /^([a-zA-Z0-9\_\-\.])$/;  
    var n, strCode, hex1, hex2, strEncode = "";  

    for(n = 0; n < str.length; n++) {  
        if (noEncode.test(str.charAt(n))) {  
            strEncode += str.charAt(n);  
        } else {  
            strCode = str.charCodeAt(n);  
            hex1 = hex_chars.charAt(Math.floor(strCode / 16));  
            hex2 = hex_chars.charAt(strCode % 16);  
            strEncode += "%" + (hex1 + hex2);  
        }  
    }  
    return strEncode;  
}  

// url_decode version 1.0  
function url_decode(str) {  
    var n, strCode, strDecode = "";  

    for (n = 0; n < str.length; n++) {  
        if (str.charAt(n) == "%") {  
            strCode = str.charAt(n + 1) + str.charAt(n + 2);  
            strDecode += String.fromCharCode(parseInt(strCode, 16));  
            n += 2;  
        } else {  
            strDecode += str.charAt(n);  
        }  
    }  
    return strDecode;  
}  
//-->  

function addItem(obj,strText,strText2,Tam)
					 {       
						obj.options.length = obj.options.length+1;
						obj.options[Tam].text = strText;
						obj.options[Tam].value = strText2;            
					 } 
// Data
function Mes(num,Ano)
		{
					var months= new Array();
					months[1] = "Janeiro";
					months[2] = "Fevereiro";
					months[3] = "Março";
					months[4] = "Abril";
					months[5] = "Maio";
					months[6] = "Junho";
					months[7] = "Julho";
					months[8] = "Agosto";
					months[9] = "Setembro";
					months[10] = "Outubro";
					months[11] = "Novembro";
					months[12] = "Dezembro";

					return(months[num]+' / '+ajaxAno);
		}


function Data(){
					days = new Array(7)
					days[1] = "Domingo";
					days[2] = "Segunda-feira";
					days[3] = "Terça-feira";
					days[4] = "Quarta-feira";
					days[5] = "Quinta-feira";
					days[6] = "Sexta-feira";
					days[7] = "Sábado";
					months = new Array(12)
					months[1] = "Janeiro";
					months[2] = "Fevereiro";
					months[3] = "Março";
					months[4] = "Abril";
					months[5] = "Maio";
					months[6] = "Junho";
					months[7] = "Julho";
					months[8] = "Agosto";
					months[9] = "Setembro";
					months[10] = "Outubro";
					months[11] = "Novembro";
					months[12] = "Dezembro";
					today = new Date(); day = days[today.getDay() + 1]
					month = months[today.getMonth() + 1]
					date = today.getDate()
					year=today.getYear();
					if (year < 2000)
					year = year + 1900;
					document.write (" "+ day +
					", " + date + " de " + month + " de " + year + "." + "</font>")
					// -- end hiding
	
}
function Data2(){
					days = new Array(7)
					days[1] = "Domingo";
					days[2] = "Segunda-feira";
					days[3] = "Terça-feira";
					days[4] = "Quarta-feira";
					days[5] = "Quinta-feira";
					days[6] = "Sexta-feira";
					days[7] = "Sábado";
					months = new Array(12)
					months[1] = "Janeiro";
					months[2] = "Fevereiro";
					months[3] = "Março";
					months[4] = "Abril";
					months[5] = "Maio";
					months[6] = "Junho";
					months[7] = "Julho";
					months[8] = "Agosto";
					months[9] = "Setembro";
					months[10] = "Outubro";
					months[11] = "Novembro";
					months[12] = "Dezembro";
					today = new Date(); day = days[today.getDay() + 1]
					month = months[today.getMonth() + 1]
					date = today.getDate()
					year=today.getYear();
					if (year < 2000)
					year = year + 1900;
					document.write (" "+ day +
					", " + date + " de " + month + " de " + year + "." + "</font>")
					// -- end hiding
	
}


var reloadPop;

function centerPop(){
	parent.document.getElementById("pop").style.left=(parent.document.body.clientWidth/2)-(parent.document.getElementById("popup").width/2);
	parent.document.getElementById("pop").style.top=(parent.document.body.clientHeight/2)-(parent.document.getElementById("popup").height/2);
}

function centerPop2(){
	if(parent.parent.parent.document.getElementById("fader").style.visibility != "hidden")
		{	
		setTimeout("centerPop2()",50);	
			window.clearInterval(reloadPop);		
		parent.parent.parent.document.getElementById("pop").style.left=(parent.parent.document.body.scrollLeft+parent.parent.document.body.clientWidth/2)-(parent.parent.parent.document.getElementById("popup").width/2);
		parent.parent.parent.document.getElementById("pop").style.top=(parent.parent.document.body.scrollTop+parent.parent.document.body.clientHeight/2)-(parent.parent.parent.document.getElementById("popup").height/2);
		}
}

function activePop(w,h,tit,loc,cl){  
	parent.parent.document.getElementById("popup").width=w;
	parent.parent.document.getElementById("popup").height=h;  
	parent.parent.document.getElementById("popup").height=h;
	parent.parent.popup.document.getElementById("popTit").innerText=tit;
	parent.parent.popup.document.getElementById("popContent").src=loc;
	parent.parent.document.getElementById("fader").style.visibility="visible";
	if (cl==1){
		parent.parent.popup.document.getElementById("botclose").style.visibility="hidden";
	}else{
		parent.parent.popup.document.getElementById("botclose").style.visibility="visible";
	}
	centerPop2();
}
function activePop02(w,h,tit,loc,cl){  
	parent.parent.parent.document.getElementById("popup").width=w;
	parent.parent.parent.document.getElementById("popup").height=h;  
	parent.parent.parent.document.getElementById("popup").height=h;
	parent.parent.parent.popup.document.getElementById("popTit").innerText=tit;
	parent.parent.parent.popup.document.getElementById("popContent").src=loc;
	parent.parent.parent.document.getElementById("fader").style.visibility="visible";
	if (cl==1){
		parent.parent.parent.popup.document.getElementById("botclose").style.visibility="hidden";
	}else{
		parent.parent.parent.popup.document.getElementById("botclose").style.visibility="visible";
	}
	centerPop2();
}


function closePop(){
	parent.parent.parent.document.getElementById("fader").style.visibility="hidden";
}

function scaleFader(){	
	parent.document.getElementById("fader").style.height=1;	
	parent.parent.parent.document.getElementById("fader").style.height=(document.body.scrollHeight)+160;	
	centerPop();
}

function reScale(){
 if(parent.document.getElementById("content") != undefined && parent.document.getElementById("content") != null)
  {
	parent.document.getElementById("content").height=1;
	scaleFader();
	var htotal=document.body.scrollHeight;
	if(htotal>463){
	parent.document.getElementById("content").height=htotal;
	}else{
		parent.document.getElementById("content").height=463;
	}
  }
}


function init(){

//bt06 - forum
	gif031=new Image();
	gif031.src="../img/bot_forum.gif"
	gif032=new Image();
	gif032.src="../img/bot_forum02.gif"

//bt09 - satisfaçao
	gif019=new Image();
	gif019.src="../img/bot_satisfacao.gif"
	gif020=new Image();
	gif020.src="../img/bot_satisfacao02.gif"

//bt010 - ocorrências
	gif021=new Image();
	gif021.src="../img/bot_ocorrencias.gif"
	gif022=new Image();
	gif022.src="../img/bot_ocorrencias02.gif"

//bt011 - Notas
	gif023=new Image();
	gif023.src="../img/bot_notas.gif"
	gif024=new Image();
	gif024.src="../img/bot_notas02.gif"

//bt012 - Presenças
	gif025=new Image();
	gif025.src="../img/bot_presencas.gif"
	gif026=new Image();
	gif026.src="../img/bot_presencas02.gif"

//bt013 - Dados de Curso
	gif027=new Image();
	gif027.src="../img/bot_dadoscurso.gif"
	gif028=new Image();
	gif028.src="../img/bot_dadoscurso02.gif"

//bt014 - Close Pop
	gif029=new Image();
	gif029.src="../img/bot_close01.gif"
	gif030=new Image();
	gif030.src="../img/bot_close02.gif"


}

//aba01 - Aba Material Apoio
	ab01=new Image();
	ab01.src="../../img/aba_apoio01.gif"
	ab02=new Image();
	ab02.src="../../img/aba_apoio02.gif"
	
	//aba02 - Aba Material Prática
	ab03=new Image();
	ab03.src="../../img/aba_pratica01.gif"
	ab04=new Image();
	ab04.src="../../img/aba_pratica02.gif"
	
	//aba03 - Aba Material Estudo
	ab05=new Image();
	ab05.src="../../img/aba_estudo01.gif"
	ab06=new Image();
	ab06.src="../../img/aba_estudo02.gif"
	
	//aba04 - Aba Hotel
	ab07=new Image();
	ab07.src="../../img/aba_hotel01.gif"
	ab08=new Image();
	ab08.src="../../img/aba_hotel02.gif"
	
	//aba05 - Aba Passagens
	ab09=new Image();
	ab09.src="../../img/aba_passagem01.gif"
	ab010=new Image();
	ab010.src="../../img/aba_passagem02.gif"
	
	//aba06 - Aba Sala
	ab011=new Image();
	ab011.src="../../img/aba_sala01.gif"
	ab012=new Image();
	ab012.src="../../img/aba_sala02.gif"



var argumento1;
function markerMod(arg1){
	argumento1=arg1;
		setTimeout("doPass()",50);
}

function doPass(){
	//Menu Superior
	zeraAbas();
	if(argumento1=='apoio'){
		document.aba01.src=ab02.src;
	}
	if(argumento1=='pratica'){
		document.aba02.src=ab04.src;
	}
	if(argumento1=='estudo'){
		document.aba03.src=ab06.src;
	}
	if(argumento1=='hotel'){
		document.aba04.src=ab08.src;
	}
	if(argumento1=='passagem'){
		document.aba05.src=ab010.src;
	}
	if(argumento1=='sala'){
		document.aba06.src=ab012.src;
	}

}

function zeraAbas(){
	//numero total de abas
	totalabas=7;
	
	for(n=1; n<totalabas; n++){
		nameAba="aba0"+n;
		nameGif="ab0"+((n*2)-1)+".src";
		if(document.getElementById(nameAba)!=null){
			document.getElementById(nameAba).src=eval(nameGif);	
		}
	}
}

