//JavaScript Document
//MENSAGEM DE SESSÃO EXCLUSIVA
function SExclusiva(item) {
	if (confirm('ATENÇÃO : OPÇÃO DESEJADA RESTRITA AOS USUÁRIOS CADASTRADOS ! \n\n Se você já possui cadastro clique em cancelar e faça seu login ! \n\n Se você ainda não se cadastrou clique em ok e cadastre-se gratuitamente !')) {
	window.location.href='http://www.cinetotal.com.br/cadastro.php';
	}
}
//ALTERA MSG DE LINK NO STATUS
function showStatus(sMsg) {
    window.status = sMsg ;
    return true ;
}
//FUNCAO DE SUBIT DE BUSCA ATRAVES DE ENTER
function IEentBusca(myform) {
	if (window.event && window.event.keyCode == 13) {
		var qry_busca = document.all.txt_busca.value;
		var parametro = document.all.sel_tipo.value;
		//document.frmBusca.parametro1.value = frmBusca.txt_busca.value;
		//document.frmBusca.parametro2.value = frmBusca.sel_tipo.value;
		//document.frmBusca.submit();
		window.location.href='busca.php?param='+parametro+'&query='+qry_busca;
	}
}
function NentBusca(event,myform) {
	if (event && event.which == 13) {
		var qry_busca = document.all.txt_busca.value;
		var parametro = document.all.sel_tipo.value;
		//document.frmBusca.parametro1.value = frmBusca.txt_busca.value;
		//document.frmBusca.parametro2.value = frmBusca.sel_tipo.value;
		//document.frmBusca.submit();
		window.location.href='busca.php?param='+parametro+'&query='+qry_busca;
	}
}
function IEentSubmit(myform) {
	if (window.event && window.event.keyCode == 13) {
		if((myform.txt_senha.value != '') && (myform.txt_usuario.value != ''))
		{
			myform.submit();				
		}
		else
		{
			return false;
		}
	}
}
function NentSubmit(event,myform) {
	if (event && event.which == 13) {
		if((myform.txt_senha.value != '') && (myform.txt_usuario.value != ''))
		{
			myform.submit();				
		}
		else
		{
			return false;
		}
	}
}
//FUNCAO DE SUBMIT BUSCA
function EfetuaBusca(item){
	var qry_busca = document.all.txt_busca.value;
	var parametro = document.all.sel_tipo.value;
	//document.frmBusca.parametro1.value = frmBusca.txt_busca.value;
	//document.frmBusca.parametro2.value = frmBusca.sel_tipo.value;
	//document.frmBusca.submit();
	window.location.href='busca.php?param='+parametro+'&query='+qry_busca;
}
function GoMenu(item){
	var qry_busca = item;
	var parametro = 'b_link';
	//document.frmBusca.parametro1.value = item;
	//document.frmBusca.parametro2.value = 'BuscaLink';
	//document.frmBusca.submit();
	window.location.href='busca.php?param='+parametro+'&query='+qry_busca;
}
function SubmitForm(item){
	item.submit();
}
//FUNÇÃO DE RESET EM FORMULARIO
function ResetForm(item){
	item.reset();
}
//FUNCAO DE JUMP MENU
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//FUNÇÕES DE CARACTERES ESPECÍFICOS
function somente_alfa(campo){
	var digits="ABCDEFGHIJLMNOPQRSTUVXZKYWÇÁÉÍÓÚÂÊÎÔÛÃÕÀÈÌÒÙabcdefghijlmnopqrstuvxzkywçáéíóúâêîôûãõàèìòù,.!?+#/\*&$%@ºª°~-_()[]´`'0123456789:=;<>{}"
	var campo_temp 
	for (var i=0;i<campo.value.length;i++){
	  campo_temp=campo.value.substring(i,i+1)	
	  if (digits.indexOf(campo_temp)==-1){
		    campo.value = campo.value.substring(0,i);
		    break;
	   }
	}
}
function somente_alfa2(campo){
	var digits="ABCDEFGHIJLMNOPQRSTUVXZKYWÇÁÉÍÓÚÂÊÎÔÛÃÕÀÈÌÒÙabcdefghijlmnopqrstuvxzkywçáéíóúâêîôûãõàèìòù,.!?+#/\*&$%@ºª°~-_()[]´`'0123456789:=;<>{} "
	var campo_temp 
	for (var i=0;i<campo.value.length;i++){
	  campo_temp=campo.value.substring(i,i+1)	
	  if (digits.indexOf(campo_temp)==-1){
		    campo.value = campo.value.substring(0,i);
		    break;
	   }
	}
}
//VALIDAÇÃO DE COMENTARIO
function ChkComentario(item){
	if (frmComentario.comentarioo.value == ''){
		alert("AVISO : Comentário não preenchido !\n Digite sua opnião sobre a legenda e tente novamente !");
		frmComentario.comentarioo.focus();
	}
	else {
		frmComentario.submit();
	}
}
//EFEITO ESPECIAL NAS IMAGENS
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}
//SCRIPT DE NOVO POP-UP
/*
windowopen.js
V 1.0
copyright Andrew Holt 
This script is free to use provided this notice remains.
Full instructions can be found @ http://www.webdevtips.com/webdevtips/js/openwindow.shtml
*/

function Open_PopUp(what_link,the_x,the_y,toolbar,addressbar,directories,statusbar,menubar,scrollbar,resize,history,pos,wname){ 
	var the_url = what_link;
	the_x -= 0;
	the_y -= 0;
	var how_wide = screen.availWidth;
	var how_high = screen.availHeight;
	if(toolbar == "0"){var the_toolbar = "no";}else{var the_toolbar = "yes";}
	if(addressbar == "0"){var the_addressbar = "no";}else{var the_addressbar = "yes";}
	if(directories == "0"){var the_directories = "no";}else{var the_directories = "yes";}
	if(statusbar == "0"){var the_statusbar = "no";}else{var the_statusbar = "yes";}
	if(menubar == "0"){var the_menubar = "no";}else{var the_menubar = "yes";}
	if(scrollbar == "0"){var the_scrollbars = "no";}else{var the_scrollbars = "yes";}
	if(resize == "0"){var the_do_resize =  "no";}else{var the_do_resize = "yes";}
	if(history == "0"){var the_copy_history = "no";}else{var the_copy_history = "yes";}
	if(pos == 1){top_pos=0;left_pos=0;}
	if(pos == 2){top_pos = 0;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 3){top_pos = 0;left_pos = how_wide - the_x;}
	if(pos == 4){top_pos = (how_high/2) -  (the_y/2);left_pos = 0;}
	if(pos == 5){top_pos = (how_high/2) -  (the_y/2);left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 6){top_pos = (how_high/2) -  (the_y/2);left_pos = how_wide - the_x;}
	if(pos == 7){top_pos = how_high - the_y;left_pos = 0;}
	if(pos == 8){top_pos = how_high - the_y;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 9){top_pos = how_high - the_y;left_pos = how_wide - the_x;}
	if (window.outerWidth ){
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
		wname=window.open(the_url, wname, option);
		wname.focus();
	}
	else
	{
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
		if (!wname.closed && wname.location){
			wname.location.href=the_url;
		}
		else
		{
			wname=window.open(the_url, wname, option);
			//wname.resizeTo(the_x,the_y);
			wname.focus();
			wname.location.href=the_url;
		}
	}
}
function Open_DialogFire(what_link,the_x,the_y,toolbar,addressbar,directories,statusbar,menubar,scrollbar,resize,history,pos,wname){ 
	var the_url = what_link;
	the_x -= 0;
	the_y -= 0;
	var how_wide = screen.availWidth;
	var how_high = screen.availHeight;
	if(toolbar == "0"){var the_toolbar = "no";}else{var the_toolbar = "yes";}
	if(addressbar == "0"){var the_addressbar = "no";}else{var the_addressbar = "yes";}
	if(directories == "0"){var the_directories = "no";}else{var the_directories = "yes";}
	if(statusbar == "0"){var the_statusbar = "no";}else{var the_statusbar = "yes";}
	if(menubar == "0"){var the_menubar = "no";}else{var the_menubar = "yes";}
	if(scrollbar == "0"){var the_scrollbars = "no";}else{var the_scrollbars = "yes";}
	if(resize == "0"){var the_do_resize =  "no";}else{var the_do_resize = "yes";}
	if(history == "0"){var the_copy_history = "no";}else{var the_copy_history = "yes";}
	if(pos == 1){top_pos=0;left_pos=0;}
	if(pos == 2){top_pos = 0;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 3){top_pos = 0;left_pos = how_wide - the_x;}
	if(pos == 4){top_pos = (how_high/2) -  (the_y/2);left_pos = 0;}
	if(pos == 5){top_pos = (how_high/2) -  (the_y/2);left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 6){top_pos = (how_high/2) -  (the_y/2);left_pos = how_wide - the_x;}
	if(pos == 7){top_pos = how_high - the_y;left_pos = 0;}
	if(pos == 8){top_pos = how_high - the_y;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 9){top_pos = how_high - the_y;left_pos = how_wide - the_x;}
	if (window.outerWidth ){
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos+",dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes";
		wname=window.open(the_url, wname, option);
		wname.focus();
	}
	else
	{
		var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos+",dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes";
		if (!wname.closed && wname.location){
			wname.location.href=the_url;
		}
		else
		{
			wname=window.open(the_url, wname, option);
			//wname.resizeTo(the_x,the_y);
			wname.focus();
			wname.location.href=the_url;
		}
	}
}
function Open_DialogIE(dUrl,dWidth,dHeight,dlCenter,dlHelp,dlResizable,dlStatus){

	if(dlCenter == 0){ dCenter = 'No'; }else{ dCenter = 'Yes'}
	if(dlHelp == 0){ dHelp = 'No'; }else{ dHelp = 'Yes'}
	if(dlResizable == 0){ dResizable = 'No'; }else{ dResizable = 'Yes'}
	if(dlStatus == 0){ dStatus = 'No'; }else{ dStatus = 'Yes'}

	window.showModalDialog(dUrl,'Dialogue','dialogWidth: '+dWidth+'px; dialogHeight: '+dHeight+'px; center: '+dCenter+'; help: '+dHelp+'; resizable: '+dResizable+'; status: '+dStatus+';');
}