//Força da Senha
var shortPass = 'Curta'
var badPass = 'Ruim'
var goodPass = 'Boa'
var strongPass = 'Forte'

if (navigator.appName.indexOf("Microsoft") == -1) {
	user_pref("capability.policy.policynames", "allowclipboard");
	user_pref("capability.policy.allowclipboard.sites", "http://www.mozilla.org");
	user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
	user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
}


function envmail_radio(){
        var idmodulo  = document.getElementById('idmodulo').value;
        var urlmodulo = document.getElementById('urlmodulo').value;
        var modulo    = document.getElementById('modulo').value;
        var musica    = document.getElementById('musica').value;
        var artista   = document.getElementById('artista').value;

        if(!musica){alert('Informe a M\u00FAsica.');return;}
        if(!artista){alert('Informe o Artista.');return;}


        _jsPage("../../envia_musica.php?acao=envmail&modulo=" + modulo + "&urlmodulo=" + urlmodulo + "&idmodulo=" + idmodulo + "&musica=" + musica + "&artista=" + artista,"idsp");

    }

	function envmail_dizae(){
        var idmodulo  = document.getElementById('idmodulo').value;        
        var modulo    = document.getElementById('modulo').value;
        var nome    = document.getElementById('nome').value;
        var email   = document.getElementById('email').value;
        var idade   = document.getElementById('idade').value;
        var colegio   = document.getElementById('colegio').value;
        var twitter   = document.getElementById('twitter').value;
        var mensagem   = document.getElementById('mensagem').value;


        if(!nome){alert('Informe seu Nome.');return;}
        if(!idade){alert('Informe sua Idade.');return;}
        if(!email){alert('Informe seu email.');return;}
        if(!colegio){alert('Informe seu col\u00E9gio.');return;}
        if(!twitter){alert('Informe seu Twitter.');return;}
        if(!mensagem){alert('Mande sua mensagem');return;}        

        _jsPage("../../envia_musica.php?acao=envdizae&modulo=" + modulo + "&idmodulo=" + idmodulo + "&nome=" + nome + "&idade=" + idade + "&email=" + email + "&colegio=" + colegio + "&twitter=" + twitter + "&mensagem=" + mensagem,"idsp");

    }

	
function envmail_promocoes(){
        var idmodulo  = document.getElementById('idmodulo').value;        
        var modulo    = document.getElementById('modulo').value;
        var nome    = document.getElementById('nome').value;
        var email   = document.getElementById('email').value;
        var colegio   = document.getElementById('colegio').value;
        var cidade   = document.getElementById('cidade').value;
        var resposta   = document.getElementById('resposta').value;


        if(!nome){alert('Informe seu Nome.');return;}
        if(!email){alert('Informe seu email.');return;}
        if(!colegio){alert('Informe seu col\u00E9gio.');return;}
        if(!cidade){alert('Informe sua Cidade.');return;}
        if(!resposta){alert('Mande uma resposta');return;}        


        _jsPage("../../envia_musica.php?acao=envmail&modulo=" + modulo + "&idmodulo=" + idmodulo + "&nome=" + nome + "&email=" + email + "&colegio=" + colegio + "&cidade=" + cidade + "&resposta=" + resposta,"idsp");

    }

function cadastrarDados(){

        if(!document.getElementById('nome').value){
                    alert("Informe seu nome.");
                    document.getElementById('nome').focus();
                    return;
                }
                if(!document.getElementById('email').value){
                    alert("Informe seu email.");
                    document.getElementById('email').focus();
                    return;
                }
                if(!document.getElementById('idade').value){
                    alert("Informe sua idade.");
                    document.getElementById('idade').focus();
                    return;
                }
                if(document.getElementById('sexo').selectedIndex == 0){
                    alert("Informe seu genero.");
                    document.getElementById('sexo').focus();
                    return;
                }
                if(!document.getElementById('senha').value){
                    alert("Informe uma senha.");
                    document.getElementById('senha').focus();
                    return;
                }
                if(!document.getElementById('cidade').value){
                    alert("Informe sua cidade.");
                    document.getElementById('cidade').focus();
                    return;
                }
                if(document.getElementById('uf').selectedIndex == 0){
                    alert("Informe seu estado.");
                    document.getElementById('uf').focus();
                    return;
                }

        var nome    = document.getElementById('nome').value;
        var email   = document.getElementById('email').value;
        var idade   = document.getElementById('idade').value;
        var sexo    = document.getElementById('sexo').value;
        var senha   = document.getElementById('senha').value;
        var cidade  = document.getElementById('cidade').value;
        var uf      = document.getElementById('uf').value;
        var modulo  = document.getElementById('modulo').value;
        
        _jsPage("../../envia_musica.php?acao=cadastra_dados&nome=" + nome + "&email=" + email + "&idade=" + idade + "&sexo=" + sexo + "&senha=" + senha + "&cidade=" + cidade + "&uf=" + uf,"idsp");
        setTimeout("_jsPage('../../form_login.php?modulo=" + modulo + "','idsp');",2000);
        
    }

function exec(){
        var em = document.getElementById('email').value;
        var se = document.getElementById('senha').value;
        var md = document.getElementById('modulo').value;
        var imd = document.getElementById('idmodulo').value;

        if(!em){alert('Informe o email.');return;}
        if(!se){alert('Informe a senha.');return;}

        _jsPage("../../form_login.php?acao=logar&email=" + em + "&senha=" + se + "&modulo=" + md + "&idmodulo=" + imd,"idsp");
    }


function abreCadastro(){
    var md = document.getElementById('modulo').value;
    _jsPage("../../cadastro_form.php?modulo=" + md,"idsp");
}

function abreEsqueci(){
    var md = document.getElementById('modulo').value;
    _jsPage("../../esqueci_form.php?modulo=" + md,"idsp");
}

function enviaEsqueci(){
    var email = document.getElementById('email').value;
    var md = document.getElementById('modulo').value;
        
    if(!email){alert('Informe o email.');return;}    
    _jsPage("../../envia_musica.php?acao=envia_esqueci&email=" + email ,"idsp");
    setTimeout("_jsPage('../../form_login.php?modulo=" + md + "','idsp');",2000);
}


function validaDestaquesMenores() {

        var oEditor = FCKeditorAPI.GetInstance('Destaque_Texto') ;

	var oDOM = oEditor.EditorDocument;

	var iLength ;

	if ( document.all )
	{
		iLength = oDOM.body.innerText.length ;
	}
	else
	{
		var r = oDOM.createRange() ;
		r.selectNodeContents( oDOM.body ) ;
		iLength = r.toString().length ;
	}


    	if (document.frm1.Destaque_TituloHome.value == '') {
		alert('O titulo do Destaque deve ser preenchido.');
		document.frm1.Destaque_TituloHome.focus();
		return false;
	}

	if (document.frm1.Destaque_Chamada.value == '') {
		alert('Escreva uma chamada para este Destaque.');
		document.frm1.Destaque_Chamada.focus();
		return false;
	}

        if(!document.frm1.arquivo.value && !document.frm1.arquivo2.value){
            alert('Selecione uma imagem');
            document.frm1.arquivo.focus();
            return false;
        }

        if (document.frm1.Destaque_Link.value == '') {
		alert('Informe um link para este Destaque.');
		document.frm1.Destaque_Link.focus();
		return false;
	}

	if (iLength == 0) {
		alert('O Texto do Destaque deve ser preenchido.');
		document.frm1.Destaque_Texto.focus();
		return false;
	}

}

function validaPainelDestaque(){
/*
		if(!document.frm1.titulo.value){
        alert('Informe o Titulo');
        document.frm1.titulo.focus();
        return false;
    }
    if(!document.frm1.chamada.value){
        alert('Informe a Chamada');
        document.frm1.chamada.focus();
        return false;
    }
*/
    if(!document.frm1.arquivo.value && !document.frm1.arquivo2.value){
        alert('Selecione uma imagem');
        document.frm1.arquivo.focus();
        return false;
    }
    if(!document.frm1.link.value){
        alert('Informe o Link');
        document.frm1.link.focus();
        return false;
    }

    return true;
}


function analisa(file) {
    caminho = document.getElementById(file).value;
    var extensao;
    extensao = caminho.split("/");
    extensao = extensao[ (extensao.length-1) ].split(".")
    extensao = extensao[ (extensao.length-1) ];


    if ( extensao != "jpg" &&
         extensao != "gif" &&
         extensao != "bmp" &&
         extensao != "png" &&
         extensao != "jpeg" &&
         extensao != "JPG" &&
         extensao != "GIF" &&
         extensao != "BMP" &&
         extensao != "PNG" &&
         extensao != "JPEG" &&
         extensao != "swf"
        ) {
        alert('Upload deve ser apenas de imagem ou flash!');
        document.getElementById(file).value="";
    }
}


function passwordStrength(password, username) {
    score = 0

    //password < 4
    if (password.length < 4 ) {return shortPass}

    //password == username
    if (password.toLowerCase()==username.toLowerCase()) return badPass

    //password length
    score += password.length * 4
    score += ( checkRepetition(1,password).length - password.length ) * 1
    score += ( checkRepetition(2,password).length - password.length ) * 1
    score += ( checkRepetition(3,password).length - password.length ) * 1
    score += ( checkRepetition(4,password).length - password.length ) * 1

    //password has 3 numbers
    if (password.match(/(.*[0-9].*[0-9].*[0-9])/))  score += 5

    //password has 2 sybols
    if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5

    //password has Upper and Lower chars
    if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  score += 10

    //password has number and chars
    if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  score += 15
    //
    //password has number and symbol
    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/))  score += 15

    //password has char and symbol
    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/))  score += 15

    //password is just a nubers or chars
    if (password.match(/^w+$/) || password.match(/^d+$/) )  score -= 10

    //verifing 0 < score < 100
    if ( score < 0 )  score = 0
    if ( score > 100 )  score = 100

    if (score < 34 )  return badPass
    if (score < 68 )  return goodPass
    return strongPass
}

function checkRepetition(pLen,str) {
    res = ""
    for ( i=0; i<str.length; i++ ) {
        repeated=true
        for (j=0;j < pLen && (j+i+pLen) < str.length;j++)
            repeated=repeated && (str.charAt(j+i)==str.charAt(j+i+pLen))
        if (j<pLen) repeated=false
        if (repeated) {
            i+=pLen-1
            repeated=false
        }
        else {
            res+=str.charAt(i)
        }
    }
    return res
}

function _jsVerificaSenha(senhaForca) {
	switch(senhaForca) {
		case "Curta":
			document.getElementById("passCurta").style.background = "#d80000";
			document.getElementById("passCurta").style.color = "#FFFFFF";
			
			document.getElementById("passRuim").style.background = "#F7F7F7";
			document.getElementById("passRuim").style.color = "";
			
			document.getElementById("passBoa").style.background = "#F7F7F7";
			document.getElementById("passBoa").style.color = "";
			
			document.getElementById("passForte").style.background = "#F7F7F7";
			document.getElementById("passForte").style.color = "";
			break;
			
		case "Ruim":
			document.getElementById("passCurta").style.background = "#F7F7F7";
			document.getElementById("passCurta").style.color = "";
			
			document.getElementById("passRuim").style.background = "#ee8a31";
			document.getElementById("passRuim").style.color = "#FFFFFF";
			
			document.getElementById("passBoa").style.background = "#F7F7F7";
			document.getElementById("passBoa").style.color = "";
			
			document.getElementById("passForte").style.background = "#F7F7F7";
			document.getElementById("passForte").style.color = "";
			break;
			
		case "Boa":
			document.getElementById("passCurta").style.background = "#F7F7F7";
			document.getElementById("passCurta").style.color = "";
			
			document.getElementById("passRuim").style.background = "#F7F7F7";
			document.getElementById("passRuim").style.color = "";
			
			document.getElementById("passBoa").style.background = "#edef1b";
			document.getElementById("passBoa").style.color = "";
			
			document.getElementById("passForte").style.background = "#F7F7F7";
			document.getElementById("passForte").style.color = "";
			break;

		case "Forte":
			document.getElementById("passCurta").style.background = "#F7F7F7";
			document.getElementById("passCurta").style.color = "";
			
			document.getElementById("passRuim").style.background = "#F7F7F7";
			document.getElementById("passRuim").style.color = "";
			
			document.getElementById("passBoa").style.background = "#F7F7F7";
			document.getElementById("passBoa").style.color = "";
			
			document.getElementById("passForte").style.background = "#52ef1b";
			document.getElementById("passForte").style.color = "";
			break;
	}
}

//Validação de data
function _jsData(pStr) {
	var reDate = /^((0?[1-9]|[12]\d)\/(0?[1-9]|1[0-2])|30\/(0?[13-9]|1[0-2])|31\/(0?[13578]|1[02]))\/(19|20)?\d{2}$/;
	if (reDate.test(pStr)) {
		return true
	} else if (pStr != null && pStr != "") {
		return false
	}
} 

//Coloca as primeiras letras de uma palavra como maiúscula
function ucwords(str) {
    return str.replace(/^(.)|\s(.)/g, function ( $1 ) {return $1.toUpperCase ( );} );
}

//Mascara geral para qualquer tipo de campo
function _jsMascara(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)
	if (texto.substring(0,1) != saida) src.value += texto.substring(0,1);
}

//Validação de CPF
function _jsValidaCPF(s) { 
	var s = s.replace(".","").replace(".","").replace("-","");
	var i;
	var c = s.substr(0,9); 	  
	var dv = s.substr(9,2);	  
	var d1 = 0; 	  
	for (i = 0; i < 9; i++) {  
		d1 += c.charAt(i)*(10-i); 	  
	} 
  
	if (d1 == 0) return false; 	  
	d1 = 11 - (d1 % 11);   
	if (d1 > 9) d1 = 0; 	  
	if (dv.charAt(0) != d1)	return false;   
	d1 *= 2; 
	
	for (i = 0; i < 9; i++) { 
		d1 += c.charAt(i)*(11-i); 
	} 
	  
	d1 = 11 - (d1 % 11); 	  
	if (d1 > 9) d1 = 0; 
	if (dv.charAt(1) != d1) {  
		return false; 
	} 
	return true;   
}

function valida_prom(){
                if(!document.prom1.nome.value){
                    alert("Informe o nome.");
                    document.prom1.nome.focus();
                    return false;
                }

                if(!document.prom1.email.value){
                    alert("Informe o email.");
                    document.prom1.email.focus();
                    return false;
                }

                if(!document.prom1.cidade.value){
                    alert("Informe a cidade.");
                    document.prom1.cidade.focus();
                    return false;
                }

                if(!document.prom1.resposta.value){
                    alert("Informe a resposta.");
                    document.prom1.resposta.focus();
                    return false;
                }
                return true;
}
            

//Ajax
var xmlHttp = new Object();
var idCont = "";

function _jsPage() {
	idCont = _jsPage.arguments[1];
	page = _jsPage.arguments[0];

	if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.onreadystatechange = _jsPageDone
	xmlHttp.open("GET", page, true)
	xmlHttp.send(null)
}

function _jsPageDone() { 
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
		document.getElementById(idCont).innerHTML = xmlHttp.responseText;
		if (document.getElementById("pageCount")) {
			document.getElementById("totalPlace").innerHTML = document.getElementById("recordCount").value;
			document.getElementById("totalPagePlace").innerHTML = document.getElementById("pageCount").value;
			document.getElementById("selectPage").options.length = 0;
		
			for (p=1; p<=document.getElementById("pageCount").value; p++) {
				var opt = document.createElement("option");
				document.getElementById("selectPage").options.add(opt);
				opt.text = p;
				opt.value = p;
			}
			document.getElementById("selectPage").value = document.getElementById("page").value
		}
	} else {
		document.getElementById(idCont).innerHTML = '<table celspacing=\"0\" celpadding=\"0\" width=\"100%\"><tr><td class=\"arial f11\" align=\"center\"><img src=\"../img/imgCarregando.gif\" align=\"absmiddle\">&nbsp;Carregando...</td></tr></table>';
	}
}

function _jsBusca() {
    frmName = _jsBusca.arguments[0]
    urlAction = document[frmName].action;
    q = 1;
    for (i=1;i<=(_jsBusca.arguments.length-2);i++) {
        fieldName = _jsBusca.arguments[i];
        fieldValue = "";
        i++;
        switch (_jsBusca.arguments[i]) {
            case 1: //texto
              	fieldValue = document[frmName][fieldName].value;
                break;
                
	   case 2: //select
             	fieldValue = document[frmName][fieldName][document[frmName][fieldName].selectedIndex].value;
                break;
	
	   case 3: //valor fixo
             	i++;
		fieldValue = _jsBusca.arguments[i]
		break;
			
	   case 4:
	   z = 0;
           for (c=0; c<=(document[frmName][fieldName].length-1); c++) {
               if (document[frmName][fieldName][c].checked) {
						z++;
						if (z == 1) fieldValue = document[frmName][fieldName][c].value;
						else fieldValue += ', '+document[frmName][fieldName][c].value;
					}
				}
				break;
		}
		if (q == 1) urlAction += '?'+fieldName+'='+fieldValue;
		else urlAction += '&'+fieldName+'='+fieldValue;
		q++;
	}

	_jsPage(urlAction,'listPlace');
	document.getElementById("selectPage").onchange = function() {
		_jsPage(urlAction+'&p='+this.value,'listPlace');
	};
}

function _jsEditLeg(obj, imgId) {
	if (obj.readOnly == true) {
		obj.style.background = "#FFF";
		obj.style.border = "1px solid #CCC";
		obj.readOnly = false;
	} else {
		obj.style.background = "#F7F7F7";
		obj.style.border = "none";
		obj.readOnly = true;

                if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
		else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
		xmlHttp.open("GET", "acoes.php?Acao=14&Imagem_Id="+imgId+"&Imagem_Legenda="+obj.value, true)
		xmlHttp.send(null)
	}
}

function _jsCapa(galId, imgId) {
	if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=15&Galeria_Id="+galId+"&Imagem_Id="+imgId, true)
	xmlHttp.send(null)
}

function _jsSelDest(Noticia_Destaque, Noticia_Id, compUrl) {
	if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=36&Noticia_Id="+Noticia_Id+"&Noticia_Destaque="+Noticia_Destaque, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") _jsPage('acoes.php?Acao=20&'+compUrl,'listPlace')
	}
}

function _jsDelImgDest(Noticia_Id, Noticia_ImagemDestaque) {
	if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=37&Noticia_Id="+Noticia_Id+"&Noticia_ImagemDestaque="+Noticia_ImagemDestaque, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgDest").style.display = 'none';
	}
}

function _jsDelImgProp(Propaganda_Id, Propaganda_Imagem) {
	if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=55&Propaganda_Id="+Propaganda_Id+"&Propaganda_Imagem="+Propaganda_Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgProp").style.display = 'none';
	}
}

function _jsDelImgGame(Game_Id, Game_Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=81&Game_Id="+Game_Id+"&Game_Imagem="+Game_Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgGame").style.display = 'none';
	}
}

function _jsDelImgBlog(Blog_Id, Blog_Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=86&Blog_Id="+Blog_Id+"&Blog_Imagem="+Blog_Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgBlog").style.display = 'none';
	}
}

function _jsDelImgBlogueiros(Blog_Id, Blog_Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=97&id="+Blog_Id+"&foto="+Blog_Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgBlog").style.display = 'none';
	}
}

function _jsDelImgRevistas(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=102&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}

function _jsDelImgDownloads(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=117&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}

function _jsDelImgVestibular(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=122&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}

function _jsDelImgModa(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=127&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}

function _jsDelImgGrits(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=132&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}

function _jsDelImgPromocao(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=137&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRev").style.display = 'none';
	}
}


function _jsDelImgRadio(Id, Imagem) {
        if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest()
	else if (window.ActiveXObject) xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "acoes.php?Acao=112&id="+Id+"&foto="+Imagem, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			document.getElementById("divOptImgRadio").style.display = 'none';
	}
}

function executaAcao(acao){
    alert('teste');
    var head = document.getElementsByTagName('head').item(0);
    var eScript = document.createElement("script");
    eScript.setAttribute('src', "teste.php");
    head.appendChild(eScript);    
}
