function fAtribuiEvento(obj, evType, fn){
	if (obj.addEventListener) obj.addEventListener(evType, fn, true)
	if (obj.attachEvent) obj.attachEvent("on"+evType, fn)
}


function fRolagem () {
	if (obj = document.getElementById('botoes')) {
		if (obj.className == "") {
			topAtual = document.documentElement.scrollTop;
			obj.style.top = (topAtual+150)+"px";
		}
	}
}

//fAtribuiEvento(window,'load',fRolagem)
fAtribuiEvento(window,'scroll',fRolagem)

try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
fila=[]
ifila=0

function ajaxExecuta(){
	xmlhttp.open("GET",fila[ifila][1],true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4){
			retorno=xmlhttp.responseText.replace(/\+/g," ")
			retorno=unescape(retorno)
			document.getElementById(fila[ifila][0]).innerHTML=retorno
            ifila++
            if(ifila<fila.length) setTimeout("ajaxExecuta()",20)
        }
    }
    xmlhttp.send(null)
}

function ajax(php,idRetorno,idEsconde){
	x = new String(idEsconde)
	esconder = x.split(",")
	for(i=0;i<esconder.length;i++){
		if(esconder[i] != ''){
			esconde = document.getElementById(esconder[i])
			esconde.innerHTML = ""
		}
	}
	retorno = document.getElementById(idRetorno)
	retorno.innerHTML = '<img src="http://cadeufsc.org.br/blog/wp-content/themes/cadeufsc2007/imgs/ajax-loader.gif" class="loading" alt="Aguarde, carregando..." />'
	fila[fila.length]=[idRetorno,php]
    if((ifila+1)==fila.length)ajaxExecuta()
}