function ajax(id,url,figura){
objetoHTML=document.getElementById(id);
objetoHTML.innerHTML='<br /><br /><p align=\"center\"><img src=\"http://www.flogvip.net/img/load' + figura + '.gif\" alt=\"Carregando...\" border=\"0\" /></p>';
try{ xmlhttp = new XMLHttpRequest(); }
	catch(ee){
		try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(E){
			xmlhttp = false;
			}
		}
	}

xmlhttp.open("GET",url);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4){
		retorno=unescape(xmlhttp.responseText.replace(/\+/g," "));
		objetoHTML.innerHTML=retorno;
		}
	}
xmlhttp.send(null);
};

function ajax1(id,url){ ajax(id,url,'1'); };
function ajax2(id,url){ ajax(id,url,'2'); };

var segundos = 1;

function verificalogin(){
var login = document.getElementById("login_cadastro").value;
ajax1('boxdispo','http://www.flogvip.net/cadastro_verifica.php?login=' + login + ''); segundos=segundos+1;
}

function ajaxatual(){ ajax1('a-atual','http://www.flogvip.net/ajax.php?ajax=atual&tmp=' + segundos + ''); segundos=segundos+1;}
function ajaxvisit(){ ajax2('a-visit','http://www.flogvip.net/ajax.php?ajax=visit&tmp=' + segundos + ''); segundos=segundos+1;}
function ajaxceleb(){ ajax1('a-celeb','http://www.flogvip.net/ajax.php?ajax=celeb&tmp=' + segundos + ''); segundos=segundos+1;}

function cmt_exibir(login,foto){ ajax('loc-cmt','http://www.flogvip.net/flog_cmt_exibir.php?login=' + login + '&foto=' + foto + '&tmp=' + segundos + '','0'); segundos=segundos+1;}
function cmt_excluir(login,foto,excluir){ ajax('loc-cmt','http://www.flogvip.net/flog_cmt_exibir.php?login=' + login + '&foto=' + foto + '&cmt_deleta=' + excluir + '&tmp=' + segundos + '','0'); segundos=segundos+1;}

function cmt_postar() {
var texto = document.getElementById("cmt-texto").value;
texto = texto.replace(/[\r\n]+/g, "{QBL}");
texto = escape(texto);
var login = document.getElementById("cmt-login").value;
var foto = document.getElementById("cmt-foto").value;
var quem = document.getElementById("cmt-quem").value;
quem = escape(quem);
ajax('loc-cmtin','http://www.flogvip.net/flog_cmt_inserir.php?login=' + login + '&foto=' + foto + '&quem=' + quem + '&texto=' + texto + '&enviado=1&tmp=' + segundos + '','0');
segundos=segundos+1;
document.getElementById("cmt-texto").value = "";
document.cmtform.cmtbutao.focus();
}

function postlg (evt) {
    if (evt.keyCode == 13) {
      document.logarvip.submit();
    }
}

function favorita(URL) {
window.open('http://www.flogvip.net/flog_fav_adicionar.php?flog='+URL+'','favo', 'width=550, outerWidth=550, height=200, top=20, left=20, scrollbars=1, status=0, toolbar=0, location=0, directories=0, menubar=0, resizable=0, fullscreen=0');
}

function emoction(URL) {
window.open('http://www.flogvip.net/flog_emoctions.php','emoc', 'width=480, outerWidth=480, height=350, top=20, left=20, scrollbars=1, status=0, toolbar=0, location=0, directories=0, menubar=0, resizable=1, fullscreen=1');
}

