function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { 
  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];}}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function envia1(f)
{
var chosen;
escolhido=f.go1.options[f.go1.selectedIndex].value;
self.location=escolhido;
return false;
}

function envia2(f)
{
var chosen;
escolhido=f.go2.options[f.go2.selectedIndex].value;
self.location=escolhido;
return false;
}

function envia3(f)
{
var chosen;
escolhido=f.go3.options[f.go3.selectedIndex].value;
self.location=escolhido;
return false;
}

function envia4(f)
{
var chosen;
escolhido=f.go4.options[f.go4.selectedIndex].value;
self.location=escolhido;
return false;
}

function envia5(f)
{
var chosen;
escolhido=f.go5.options[f.go5.selectedIndex].value;
self.location=escolhido;
return false;
}

function envia6(f)
{
var chosen;
escolhido=f.go6.options[f.go6.selectedIndex].value;
self.location=escolhido;
return false;
}

function arruma(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);
  }
}

		var tabAtual = 1
 
		mudarTab = function(numeroTab) {
			$("#tab_"+tabAtual).toggle()
			$("#tab_"+numeroTab).toggle()
			tabAtual = numeroTab
		}

function enquete(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=350,height=300, status=no,scrollbars=yes,resize=no,menubars=no");
}

function rolar(aba)
{
    document.getElementById('aba1').style.display = 'none';
   // document.getElementById('aba2').style.display = 'none';
    document.getElementById('aba3').style.display = 'none';
    document.getElementById('aba4').style.display = 'none';
    document.getElementById('aba5').style.display = 'none';
    document.getElementById(aba).style.display = 'block';
}

function rolarNoticia(not)
{
    for(i=1;i<=10;i++)
    {
        document.getElementById('not'+i.toString()).style.display = 'none';
    }
    document.getElementById(not).style.display = 'block';
}


currentMini = 1;

function rolarMini(type)
{
    if(type==2)
    {
        if(currentMini<6)
        {
            for(i=1;i<=10;i++)
            {
                  document.getElementById('mininot'+i).style.display = 'none';
            }
            currentMini+=1;
            for(i=currentMini;i<currentMini+5;i++)
            {
                  document.getElementById('mininot'+i).style.display = 'block';
            }
        }
    }else
    {
        if(currentMini>1)
        {
         for(i=1;i<=10;i++)
            {
                  document.getElementById('mininot'+i).style.display = 'none';
            }
            currentMini-=1;
            for(i=currentMini;i<currentMini+5;i++)
            {
                  document.getElementById('mininot'+i).style.display = 'block';
            }
        }
    }
}

/*Início do ajax para a enquete*/
function ajaxInit()
{
	var req;
	try 
        {
            req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
        {
            try
            {
                req = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(ex)
            {
                try
                    {
                        req = new XMLHttpRequest();
                    }
                    catch(exc)
                    {
                        alert("Esse browser não tem recursos para uso do Ajax");
			req = null;
                    }
		}
	}
	return req;
}

function votar(opcao, cod)
{
	var value='';
        for(i=0;i<opcao.votoEnquete.length;i++)
        {
            if (opcao.votoEnquete[i].checked == true)
            value = opcao.votoEnquete[i].value;
        }
        if(value!='')
        {
            var wmDiv = document.getElementById("r_51");
            ajax = ajaxInit();
            ajax.open("GET", 'enquete/votar?opcao='+value+'&cod='+cod, true);
            ajax.onreadystatechange=function()
            {
                if (ajax.readyState==1)
                {
                    wmDiv.innerHTML = "<p style='text-decoration: blink;'>Carregando...</p>";
                }
                if (ajax.readyState==4)
                {
                    window.alert('Obrigado pela participação.'  );
                    wmDiv.innerHTML = ajax.responseText;
                }
            }
            ajax.send(null);
        }
        else
        {
            window.alert("Marque uma pção para poder votar.");
        }
}
//fim do ajax para a enquete

function formEnquete(mostra)
{
    if(mostra==1)
    {
        document.getElementById('form_enquete').style.display = 'block';
        document.getElementById('parcial').style.display = 'none';
    }
    else
    {
        document.getElementById('form_enquete').style.display = 'none';
        document.getElementById('parcial').style.display = 'block';
    }
}

currentDepo = 1;

function slideDepo(type)
{
        if(type==1)
        {
            if(currentDepo<5)
            {
                currentDepo++;
                for(i=1;i<=5;i++)
                {
                    document.getElementById('depo'+i).style.display = 'none';
                }
                document.getElementById('depo'+currentDepo).style.display = 'block';
            }
        }else
        {
           if(currentDepo>1)
            {
                currentDepo--;
                for(i=1;i<=5;i++)
                {
                    document.getElementById('depo'+i).style.display = 'none';
                }
                document.getElementById('depo'+currentDepo).style.display = 'block';
            }
        }
}


currentGal = 1;
function slideGal(type)
{
        if(type==1)
        {
            if(currentGal<5)
            {
                currentGal++;
                for(i=1;i<=5;i++)
                {
                    document.getElementById('gal'+i).style.display = 'none';
                }
                document.getElementById('gal'+currentGal).style.display = 'block';
            }
        }else
        {
           if(currentGal>1)
            {
                currentGal--;
                for(i=1;i<=5;i++)
                {
                    document.getElementById('gal'+i).style.display = 'none';
                }
                document.getElementById('gal'+currentGal).style.display = 'block';
            }
        }
}


currentNin = 1;
function slideNin(type,tam)
{
        if(type==1)
        {
            if(currentNin<tam)
            {
                currentNin++;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('nin'+i).style.display = 'none';
                }
                document.getElementById('nin'+currentNin).style.display = 'block';
            }
        }else
        {
           if(currentNin>1)
            {
                currentNin--;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('nin'+i).style.display = 'none';
                }
                document.getElementById('nin'+currentNin).style.display = 'block';
            }
        }
}

currentPar = 1;
function rolarParceiro(type,tam)
{
        if(type==1)
        {
            if(currentPar<tam)
            {
                currentPar++;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('par'+i).style.display = 'none';
                }
                document.getElementById('par'+currentPar).style.display = 'block';
            }
        }else
        {
           if(currentPar>1)
            {
                currentPar--;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('par'+i).style.display = 'none';
                }
                document.getElementById('par'+currentPar).style.display = 'block';
            }
        }
}




currentGal = 1;
function rolarGalerias(type,tam)
{
        if(type==1)
        {
            if(currentGal<tam)
            {
                currentGal++;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('fotos'+i).style.display = 'none';
                }
                document.getElementById('fotos'+currentGal).style.display = 'block';
            }
        }else
        {
           if(currentGal>1)
            {
                currentGal--;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('fotos'+i).style.display = 'none';
                }
                document.getElementById('fotos'+currentGal).style.display = 'block';
            }
        }
}

currentV = 1;
function rolarVideos(type,tam)
{
        if(type==1)
        {
            if(currentV<tam)
            {
                currentV++;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('videos'+i).style.display = 'none';
                }
                document.getElementById('videos'+currentV).style.display = 'block';
            }
        }else
        {
           if(currentV>1)
            {
                currentV--;
                for(i=1;i<=tam;i++)
                {
                    document.getElementById('videos'+i).style.display = 'none';
                }
                document.getElementById('videos'+currentV).style.display = 'block';
            }
        }
}

$(document).ready(function(){
$('#rr_24').cycle({fx:'slideX',timeout:5000,pause:true,next:'#bannerProx',prev:'#bannerAnt'});
});
