/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Mr J | http://www.huntingground.net/ */

scrollStep=4

timerLeft=""
timerRight=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=scrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivRight(id){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=scrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
}


function abrenovo(id){

	if(id == 'menu01'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('menu02').style.display = "none";
				window.document.getElementById('menu03').style.display = "none";
				window.document.getElementById('menu04').style.display = "none";

			}
	}
	
	if(id == 'menu02'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('menu01').style.display = "none";
				window.document.getElementById('menu03').style.display = "none";
				window.document.getElementById('menu04').style.display = "none";

			}
	}
	
	if(id == 'menu03'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('menu01').style.display = "none";
				window.document.getElementById('menu02').style.display = "none";
				window.document.getElementById('menu04').style.display = "none";

			}
	}
	
		if(id == 'menu04'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('menu01').style.display = "none";
				window.document.getElementById('menu02').style.display = "none";
				window.document.getElementById('menu03').style.display = "none";


			}
	}
		
}


function popup(Url, Titulo, Width, Height, Scrollbar) 
{
    window.open(Url, Titulo, 'width='+Width+', height='+Height+', scrollbars='+Scrollbar+', status=no, resizable, top='+((screen.availHeight/2)-(Height/2))+', left='+((screen.availWidth/2)-(Width/2)))
}


function abreimg(id){

	if(id == 'img01'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('img02').style.display = "none";
				window.document.getElementById('img03').style.display = "none";
				window.document.getElementById('img04').style.display = "none";

			}
	}
	
	if(id == 'img02'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('img01').style.display = "none";
				window.document.getElementById('img03').style.display = "none";
				window.document.getElementById('img04').style.display = "none";

			}
	}
	
	if(id == 'img03'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('img01').style.display = "none";
				window.document.getElementById('img02').style.display = "none";
				window.document.getElementById('img04').style.display = "none";

			}
	}
	
		if(id == 'img04'){
	
			if(window.document.getElementById(id).style.display == "")
				window.document.getElementById(id).style.display = "none";
			else{
				window.document.getElementById(id).style.display = "";
				window.document.getElementById('img01').style.display = "none";
				window.document.getElementById('img02').style.display = "none";
				window.document.getElementById('img03').style.display = "none";


			}
	}
		
}

function validaform()

   {
     if (window.document.frmsalvar.ds_nome.value == "")
         
         {
           alert("O campo Nome deve ser preenchido");
	   return false;
         }

	if (window.document.frmsalvar.ds_email.value == "")
         
         {
           alert("O campo E-mail deve ser preenchido");
	   return false;
         }  

	if (window.document.frmsalvar.ds_tel.value == "")
         
         {
           alert("O campo Telefone deve ser preenchido");
	   return false;
         } 

	if (window.document.frmsalvar.ds_msg.value == "")
         
         {
           alert("O campo Mensagem deve ser preenchido");
	   return false;
         }     

   return true;
}
			   
function newsletter(){
	FivecomUtil.loadHtml('#newsletter', 'index.php?id=/includes/paginas/newsletter.php&var_nome='+document.getElementById("news_nome").value+'&var_email='+document.getElementById("news_email").value);
  //FivecomUtil.loadHtml('#newsletter', 'index.php?id=/includes/paginas/newsletter.php&var='+document.getElementById("news_name").value+'&var2='+document.getElementById("news_email").value);
}
