var sid = 0;

function AbrePagina(perfil, tamx, tamy, yn) {
	lf = Math.floor(screen.width/2) - Math.floor(tamx/2);
	tp = Math.floor(screen.height/2) - Math.floor(tamy/2);
	window.open(perfil,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=" + yn + ",width=" + tamx + ",height=" + tamy + ", left = " + lf + ", top = " + tp)
}

function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente) {
	var obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	if(transparente == true) {
		obj+= '<param name="wmode" value="transparent" />';
	}
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}

function carrega_destaque(pagina) {
	var lv = new LoadVars();
	lv.pagina = pagina;

	lv.onLoad = function () {
		document.getElementById("projetodestaque").innerHTML = lv.content;
		if(document.getElementById("aguarde")) {
			document.getElementById("aguarde").style.display = "none";
		}
	}

	lv.send("ajax.php?modelo=destaque","POST");
	if(document.getElementById("aguarde")) {
		document.getElementById("aguarde").style.display = "block";
	}

}

function carrega_projeto(pagina) {
	var lv = new LoadVars();
	lv.pagina = pagina;
	lv.sid = sid;

	lv.onLoad = function () {
		document.getElementById("listagem").innerHTML = lv.content;
		if(document.getElementById("aguarde")) {
			document.getElementById("aguarde").style.display = "none";
		}
	}

	lv.send("ajax.php?modelo=projeto","POST");
	if(document.getElementById("aguarde")) {
		//document.getElementById("aguarde").innerHTML = "Aguarde!<br />Carregando Mensagens";
		document.getElementById("aguarde").style.display = "block";
	}

}
