////////////////////////////////////////////////////////////////////////////////////////////////
function cursor(){
if (navigator.appName == "Microsoft Internet Explorer"){
a = "hand";
return a;
}
else {
a = "pointer";
return a;
}}

////////////////////////////////////////////////////////////////////////////////////////////////
function f_over(obj){
src=document.getElementById(obj);
a = "../extra/_res/" + obj + "_over.jpg";
return a;
}
function f_out(obj){
src=document.getElementById(obj);
a = "../extra/_res/" + obj + "_out.jpg";
return a;
}
////////////////////////////////////////////////////////////////////////////////////////////////
function intra_over(obj){
a = "../extra/_res/intra_over.jpg";
return a;
}
function intra_out(obj){
a = "../extra/_res/intra_out.jpg";
return a;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
function confirma(confirma){
	if (confirm ("Você deseja realmente realizar esta exclusão?")){
	location.href= confirma;}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
function foto(foto) {
	window.open("../fotos/ver.php?foto="+foto,"","titlebar=0,menubar=0,scrollbars=0,status=0,resizable=0,width=100, height=100");
}
/////////////////////////////////////////////////////////////////////////////////////////////////
 function Validate_insere()
  {     
    var strErro="";
	
	arq = document.form.arq.value;
	arq_part = arq.split(".");
	fileExt = arq_part[arq_part.length-1].toLowerCase();
	
	if (arq.length !=0 && fileExt != "jpg") 
	{	strErro="Você não pode enviar este arquivo porque ele não é uma imagem valida!\n" + strErro;
		document.form.arq.focus();
	}

	if (document.form.arq.value.length==0)
    {    strErro="Selecione uma foto para adicionar!\n" + strErro;
         document.form.arq.focus();
    }

    if (strErro!="")
    {	alert(strErro);
       		return (false);
	}
	   else return (true);
 }
/////////////////////////////////////////////////////////////////////////////////////////////////
//Verifica se é o lixo do IE
var isIE = document.all?true:false;

function showtip(current,e,text)
{        if (document.layers) // Netscape 4.0+
        {        theString="<DIV CLASS='ttip'>"+text+"</DIV>";
                document.tooltip.document.write(theString);
                document.tooltip.document.close();
                document.tooltip.left=window.pageXOffset+e.pageX+10;
                document.tooltip.top=window.pageYOffset+e.pageY;
                document.tooltip.visibility="show";
        }
        else
        {        if(document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+
                    {          elm=document.getElementById("tooltip");
                               elml=current;
                               elm.innerHTML="<img src='../fotos/_res/quad.jpg' style='float:left;margin:4px'>"+text;
                        elm.style.height=elml.style.height;
                        if(isIE)
                        {        elm.style.top=parseInt(document.body.scrollTop+e.clientY);
                                 elm.style.left=parseInt(document.body.scrollLeft+e.clientX+10);
                        }
                        else
                        {        elm.style.top=parseInt(window.pageYOffset+e.clientY);
                                elm.style.left=parseInt(window.pageXOffset+e.clientX+10);
                        }
                               elm.style.visibility = "visible";
                    }
        }
}

function hidetip()
{        if (document.layers)  document.tooltip.visibility="hidden";
           else  elm.style.visibility="hidden";
}

function EventoInfo(celula,evento,info,status)
{        if(status=='in')
        {
                showtip(celula,evento,info);
        }
        else
        {
				hidetip();
        }
        return false;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
 function Validate_fotos()
  {     
    var strErro = "";	
	if (document.form.txt.value.length == 0)
    {    strErro="Adicione a descrição deste evento!\n" + strErro;
         document.form.txt.focus();
    }	
	if (document.form.dt_ev.value.length == 0)
    {    strErro="Adicione a data deste evento!\n" + strErro;
         document.form.dt_ev.focus();
    }	
	if (document.form.tit.value.length == 0)
    {    strErro="Adicione o nome deste evento!\n" + strErro;
         document.form.tit.focus();
    }	
    if (strErro!="")
    {	alert(strErro);
       		return (false);
	}
	   else return (true);
 }
 /////////////////////////////////////////////////////////////////////////////////////////////////
 function ver(id) {
	lerr = window.open('./ver_sec.php?id='+id,"","titlebar=0,menubar=0,scrollbars=yes,status=0,resizable=yes,width=750, height=550,top=10,left=10");
}
 /////////////////////////////////////////////////////////////////////////////////////////////////
 function ver2(id) {
	lerr = window.open('./ver_agen.php?id='+id,"","titlebar=0,menubar=0,scrollbars=yes,status=0,resizable=yes,width=400, height=500,top=10,left=10");
}