function fonte(dive,formatar){
    var padrao = 16;
    var minimo = 10;
    var maximo = 24;
   if (document.getElementById(dive).style.fontSize == "") 
      var tamFonte = padrao;
    else
      var tamFonte = parseInt(document.getElementById(dive).style.fontSize);
    switch (formatar)
    {
      case '+':
        if (tamFonte < maximo)
          document.getElementById(dive).style.fontSize = (tamFonte + 2) + "px";
      break;
      case '-':
        if (tamFonte > minimo)
          document.getElementById(dive).style.fontSize = (tamFonte - 2) + "px";
      break;
    }
}

function exibir(id) {
var div = document.getElementById(id);
if (div.className=='invisivel') {div.className='visivel';}
else {div.className='invisivel';}
}

function envio() {
	var email = document.noticiaemail.email.value;
	var email2 = document.noticiaemail.email2.value;
	var codigo = document.noticiaemail.codigo.value;
	var id = document.noticiaemail.id.value;
	if(email!="" || email2!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/noticias/envio/" + id + "/" + codigo + "/" + email + "/" + email2, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.noticiaemail.email.value="";
	document.noticiaemail.email2.value="";
	document.noticiaemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}
function envio2() {
	var email = document.eventoemail.email.value;
	var email2 = document.eventoemail.email2.value;
	var codigo = document.eventoemail.codigo.value;
	var id = document.eventoemail.id.value;
	if(email!="" || email2!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/agenda/envio/" + id + "/" + codigo + "/" + email + "/" + email2, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.eventoemail.email.value="";
	document.eventoemail.email2.value="";
	document.eventoemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}
function envio3() {
	var email = document.noticiaemail.email.value;
	var email2 = document.noticiaemail.email2.value;
	var codigo = document.noticiaemail.codigo.value;
	var id = document.noticiaemail.id.value;
	if(email!="" || email2!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/coluna/envio/" + id + "/" + codigo + "/" + email + "/" + email2, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.noticiaemail.email.value="";
	document.noticiaemail.email2.value="";
	document.noticiaemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}
function cadastro() {
	var email = document.noticiaemail.email.value;
	var codigo = document.noticiaemail.codigo.value;
	if(email!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/lista/" + codigo + "/" + email, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.noticiaemail.email.value="";
	document.noticiaemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}
function envio4() {
	var email = document.noticiaemail.email.value;
	var email2 = document.noticiaemail.email2.value;
	var codigo = document.noticiaemail.codigo.value;
	var id = document.noticiaemail.id.value;
	if(email!="" || email2!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/coluna/envio/" + id + "/" + codigo + "/" + email + "/" + email2, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.noticiaemail.email.value="";
	document.noticiaemail.email2.value="";
	document.noticiaemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}
function envio5() {
	var email = document.fotoemail.email.value;
	var email2 = document.fotoemail.email2.value;
	var codigo = document.fotoemail.codigo.value;
	var id = document.fotoemail.id.value;
	if(email!="" || email2!="" || codigo!=""){
	var divresultado = document.getElementById("mailr");
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/fotos/envio/" + id + "/" + codigo + "/" + email + "/" + email2, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	document.fotoemail.email.value="";
	document.fotoemail.email2.value="";
	document.fotoemail.codigo.value="";
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
	}
}

function favoritos(){
    var url        = "http://culturatrance.com";
    var title    = "Cultura Trance";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
function criaXMLHttp() {
	if (typeof XMLHttpRequest != "undefined")
	return new XMLHttpRequest();
	else if (window.ActiveXObject){
	var versoes = ["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0",	"MSXML2.XMLHttp", "Microsoft.XMLHttp"];
	}
	for (var i = 0; i < versoes.length; i++){
	try{
	return new ActiveXObject(versoes[i]);
	}catch (e) {}
	}
	throw new Error("Seu browser nao suporta AJAX");
}
function abr(id,pg) {
	var divresultado = document.getElementById("fot");
	divresultado.innerHTML = "carregando...";
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/fotos/exibir/" + id + "/" + pg, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	divresultado.innerHTML = result;
	} 
	else {	divresultado.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
}

function abrir(foto) {
	var fotos = document.getElementById("resultado");
	fotos.innerHTML = "carregando...";
	var XMLHttp = criaXMLHttp();
	XMLHttp.open("get", "http://culturatrance.com/fotos/abrir/" + foto, true);
	XMLHttp.onreadystatechange = function () {
	if (XMLHttp.readyState == 4)
	if (XMLHttp.status == 200){	
	var result = XMLHttp.responseText;
	fotos.innerHTML = result;
	} 
	else { fotos.innerHTML = "Um erro ocorreu" + XMLHttp.statusText;	}	
	};
	XMLHttp.send(null);
}
function ap(el){
var x = document.getElementById(el);
x.style.opacity=1.0;
x.style.filter="alpha(opacity='100')";
}
function dap(e){
var y = document.getElementById(e);
y.style.opacity=0.3;
y.style.filter="alpha(opacity='30')";
}
