function galeria(url,largura,altura)
{	
popup(url,largura,altura);	
//window.open(url,'','top=200,left=150,width=770,height=420,scrollbars=0,status=1,resizable=0')
}

function popup(pagina,largura,altura){
    var esquerda = (screen.width - largura)/2;
    var topo = (screen.height - altura)/2;
    window.open(pagina,'','height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda); 

}

function janela(url){
	window.open(url,'cliente','top=150,left=350,width=550,height=250,scrollbars=1,status=0,resizable=1')
}

function janelaPopExcluir(url)
	{
		if(confirm('Tem certeza que deseja Excluir?')) 
		{
		window.open(url,'cliente','top=200,left=350,width=500,height=270,scrollbars=1,status=1,resizable=0')
		}
	}
	
function visualizar(url){
	window.open(url,'cliente','top=0,left=350,width=605,height=550,scrollbars=1,status=0,resizable=0')
	
	}	

// JavaScript para tv //
var index = 1; var menu_time = 2500; var anterior = 3; var timer = setTimeout('trocaMsg()',menu_time); 
function trocaMsg() { index = index%3 +1; channel(index); tempo(); }          
function tempo() { clearTimeout(timer);	timer = setTimeout("trocaMsg()",menu_time);}  

function channel(id) { index = id; document.getElementById("tvn" + anterior).className= "transp"; document.getElementById("tvn" + id).className = "opac"; document.getElementById('tvshow').innerHTML=document.getElementById('tv' + id).innerHTML;	anterior = id;}

function tvch(id, out) {if (out == 1)	{ clearTimeout(timer);	channel(id);} else { tempo();}}
//channel(1);




// JavaScript para tv-papeis //
var index_p = 1; var menu_time_p = 2800; var anterior_p = 3; var timer_p = setTimeout('trocaMsg_p()',menu_time_p); 
function trocaMsg_p() { index_p = index_p%5 +1; channel_p(index_p); tempo_p(); }          
function tempo_p() { clearTimeout(timer_p);	timer_p = setTimeout("trocaMsg_p()",menu_time_p);}  
function channel_p(idx) { index_p = idx; document.getElementById("tvp" + anterior_p).className= "transp"; document.getElementById("tvp" + idx).className = "opac"; document.getElementById('paptv').innerHTML=document.getElementById('ptv' + idx).innerHTML;	anterior_p = idx;}
function tvch_p(idx, out) {if (out == 1)	{ clearTimeout(timer_p);	channel_p(idx);} else { tempo_p();}}
//channel_p(1);

//Função p/ n Aparecer erro de JS no navegador do Tiozinho
function semerro(){
return true;
}
window.onerror=semerro;


//Selecionar Check boxs		

function marcareg(frm) {



		document.deletar.submit();

		



	}

function valcheck(x){



		for (var i = 0; i < document.forms(0).elements.length; i++) {



			var e = document.forms(0).elements[i];



			if (e.type=="checkbox") {



				e.checked = x;



				CCA(e);



			}



		}



	}

	var checkflag = "false";



function check(field) {

       if (checkflag == "false") {

           for (i = 0; i < field.length; i++) {

               field[i].checked = true;

           }

           checkflag = "true";

           return true;

        }

       else {

            for (i = 0; i < field.length; i++) {

               field[i].checked = false;

            }

           checkflag = "false";

           return true;

        }

}

