window.onload=function(){
	$('#l1').not(this).stop().fadeTo('fast', 0.9);
	$('#l2').not(this).stop().fadeTo('fast', 0.9);
	$('#l3').not(this).stop().fadeTo('fast', 0.9);
}


function opc(quem)	
{

	var divX = document.getElementById(quem);
	
	$(divX).not(this).stop().fadeTo('slow', 1.0);
		
		$(divX).mouseout(function(){
			$(divX).stop().fadeTo('slow', 0.9)
		})
} 

	
	opct=100;
	alpha2=0;
	j=0;
	r=100;
	i=0;
	b=0;
	limit = 1;
		function bannerRotation(x)
		{
		
			r=180;
			var eternal = setInterval(function(){
			if(x<=490){
			x+=2;
			r--;
			if(r>0 && r%2==0){ setTimeout(function(){r--; opct--},600) };
			
			/*document.getElementById('somb_1').setAttribute("style","position:absolute; left:119px; margin-left:-"+Math.abs((r)/2)+"px; bottom:0px ;width:"+r+"px; opacity:"+eval(r)/100+"" );*/
			$('#somb_1').css({"position":"absolute","left":"119px","margin-left":"-"+Math.abs((r)/2)+"px", "bottom":"0px" , "width":+r+"px", "opacity":+eval(r)/100+""});
			document.getElementById('img_1').style.marginTop='-'+x+'px';
			if(x==490)
				{
				b++;
					if(b==1){document.getElementById('img_1').src="imagens/banner_coluna01.jpg";}
					else{document.getElementById('img_1').src="imagens/banner_coluna.jpg";}
					if(b>2){document.getElementById('img_1').src="imagens/banner_coluna01.jpg"; b=0; }
				}
					if(x>=490){ j=x; h=r;}
					
		if(j==x)
		{
		b++;
		clearInterval(eternal);
		var sign = setInterval(function(){
		window.onerror=function(){return true}
		if(j>=0){
		j-=2;
		h++;
		if(h>0 && h%2==0){ setTimeout(function(){h--; opct--},600) };
		document.getElementById('img_1').style.display='inline';
		document.getElementById('img_1').style.marginTop='-'+j+'px';
		$('#somb_1').css({"position":"absolute", "left":"119px", "margin-left":"-"+Math.abs((h)/2)+"px"," bottom":"0px","width":+h+"px","opacity":+eval(h)/100+""});
		if(j==0){ var out=new function(){ setTimeout(function(){clearInterval(sign); bannerRotation(0);  },5000) } }
		}},5);			
					
		}
					  
		} },5);
		
		}
		


// CONTATO --- VALIDAÇÃO
function Validacampos() {	
	var campos = document.forms[0].getElementsByTagName('input');
		var mensag = document.forms[0].getElementsByTagName('div');
			var camposV = 0;
				var validar = setInterval( function() {
		if(camposV<campos.length){
			if(campos[camposV].value==" " || campos[camposV].value==campos[camposV].id) {
				$(mensag[camposV]).fadeIn('slow');
				document.forms[0].getElementsByTagName('div')[camposV].onmouseover=function(){
					$(this).fadeOut('slow');
				}
			} else {
				document.forms[0].submit();
			}
			camposV++;
		} 
	},1)
}

	
	
	function campos() {	
	var t=0;
	var d=document.forms[0].getElementsByTagName('input').length;
		var intervalo = setInterval(function() {
			if(t<d){
				document.forms[0].getElementsByTagName('input','text')[t].onclick=function(){
					if(this.value==this.id){this.value=""};
					document.getElementById(this.id).onblur=function(){if(this.value==""){this.value=this.id}}
				}
				t++;
			}
		},1)
	}
	
	
	// EFEITO ACORDEON  //
	
	
/***********************************************************************************************************************
DOCUMENT: includes/javascript.js
DEVELOPED BY: Ryan Stemkoski
COMPANY: Zipline Interactive
EMAIL: ryan@gozipline.com
PHONE: 509-321-2849
DATE: 3/26/2009
UPDATED: 3/25/2010
DESCRIPTION: This is the JavaScript required to create the accordion style menu.  Requires jQuery library
NOTE: Because of a bug in jQuery with IE8 we had to add an IE stylesheet hack to get the system to work in all browsers. I hate hacks but had no choice :(.
************************************************************************************************************************/
window.onload=(function() {
	 
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.accordionButton').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.accordionButton').removeClass('on');
		  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.accordionContent').slideUp('normal');
   
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			
			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');
			  
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		 } 
		  
	 });
	  
	
	/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	
	//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER 
	$('.accordionButton').mouseover(function() {
		$(this).addClass('over');
		
	//ON MOUSEOUT REMOVE THE OVER CLASS
	}).mouseout(function() {
		$(this).removeClass('over');										
	});
	
	/*** END REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	
	
	/********************************************************************************************************************
	CLOSES ALL S ON PAGE LOAD
	********************************************************************************************************************/	
	$('.accordionContent').hide();

});

