var 
	posi;
	posi=1;

function ShowDiv (div_id,imagem) {
	var element = document.getElementById(div_id);
     
     if (element.style.display == 'none') {
     
         element.style.display = 'block';
document.getElementById('equipamentos').innerHTML="<img src='/img/equipamentos/"+imagem+".jpg'>";
         document.getElementById('equipamentos').top=(window.event.clientY);
         document.getElementById('equipamentos').left=window.event.clientX
     	 document.getElementById('equipamentos').innerHTML="<img src='/img/equipamentos/"+imagem+".jpg'>";
     }
     else {
         element.style.display = 'none';
     }
     
     return false;
    
}



function FechaDiv (div_id) {
	var element = document.getElementById(div_id);
         
         element.style.display = 'none';
     	 return false;
    
}
function mascaraData(DATA_INICIO, nome){ 
              var mydata = ''; 
              mydata = mydata + DATA_INICIO; 
              if (mydata.length == 2){ 
                  mydata = mydata + '/'; 
                  document.getElementById(nome).value=mydata; 
              } 
              if (mydata.length == 5){ 
                  mydata = mydata + '/'; 
                  document.getElementById(nome).value=mydata;  
              } 
            
          } 
function confirmar(end)
{
	

if (window.confirm("Tem certeza que deseja excluir?")){
window.location = end; 
}else
window.alert("Exclusão cancelada");

	
	
}

function aumentaGal(id,titulo,image,contador){
	
	posi=posi+1;
	id=id.split("^");
	titulo=titulo.split("^");
	image=image.split("^");
	if (posi<=contador){
		imgMuda.innerHTML = "<img src='http://www.fckarate.com.br/newSite/IMG_UP/p_"+image[posi]+ "'  style='border-color:#ffffff; border-style:double;'>";
		titulomuda.innerHTML = titulo[posi];

	
		
	}else{
		posi=posi-1;
		window.alert('Você encerrou a listagem de galerias!');
	}
	
	
	
	
}

function diminuiGal(id,titulo,image,contador){
	
	posi=posi-1;
	id=id.split("^");
	titulo=titulo.split("^");
	image=image.split("^");
	if (posi>0){
		imgMuda.innerHTML = "<img src='http://www.fckarate.com.br/newSite/IMG_UP/p_"+image[posi]+ "' style='border-color:#ffffff; border-style:double;'>";
		titulomuda.innerHTML = titulo[posi];
		
		
	}else{
		posi=posi+1;
		window.alert('Você encerrou a listagem de galerias!');
		
	}
	
	
	
	
}


function abrirGal(val){
	val=val.split("^");
	urlgal="http://www.fckarate.com.br/newSite/galeriaFotos/galeriaFotos.php?conte="+ val[posi];
	window.open(urlgal,'Blank','width=660, height=497','location=no');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


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);
}
}
if(document.images) {
var offimg = new Array()
offimg["cool"] = new Image(120,50)
offimg["cool"].src = "[INSERT]"
function imageOn(imgName) {
if (document.images) {
document.images[imgName].src = onimg[imgName].src
}
}
function imageOff(imgName) {
if (document.images) {
document.images[imgName].src = offimg[imgName].src
}
}
function setMsg(msg) {
window.status = msg
return true
}
function playIt() {
}
}

function validaFormulario(idForm, idInput, action){	
	var input = idInput.split(",");
	
	i = 1;
	j = 0;
	
	do{
		if (document.getElementById(input[j]).value == ''){
			var erro = 1;
		}else{
			var erro = 0;
		}
			
		if (document.getElementById(input[j]).value == ''){			
			alert("Preencha os campos obrigatórios!");
			break;			
		}
		
		i = i + 1;
		j = j + 1;
	}while(i <= input.length);
	
	if (erro == 0){
		document.getElementById(idForm).action = action;
		document.getElementById(idForm).target = '_parent';
		document.getElementById(idForm).submit();
	}
}