// JavaScript Document


window.onload = function(){


	// ATIVA MENU
	var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
	
	// GERANDO CORNERS
	Rico.Corner.round('CornerMenu',{color:'#A7AE71',bgColor:'#C3CF94',corners:"top"});
	Rico.Corner.round('destaques',{color:'#79A22A',bgColor:'#C9CE96'});
	Rico.Corner.round('agenda',{color:'#FDFADE',bgColor:'#C9CE96'});
	Rico.Corner.round('informacoes',{color:'#EBFFD1',bgColor:'#C9CE96'});
	Rico.Corner.round('newsletter',{color:'#D4E8A7',bgColor:'#C9CE96'});
	Rico.Corner.round('noticias',{color:'#FCF6C5',bgColor:'#C9CE96'});
	
	
	
	
	


	
	// GERANDO ALINHAMENTOS	
	alinhaDivs("esquerda","meio");
	
	
	
	// ATIVANDO CONTROLES DE SLIDE SHOWS	
	

	var slideShow1 = new sandecom.SlideShow('animaCabecalho',
										   {
												timeTransition  : 8,
												fade            : 10,
												activeControl   : false,
												
												heightTitle     : 20,
												alphaTitle      : 80,
												bgTitle         : "#FFF",
												padTitle        : 5
												
	
    										});
	

	var slideShow2 = new sandecom.SlideShow('SlideShow1', 
										   {
											   
												timeTransition  : 3,												
												fade            : 10,
												
												
												activeControl   : true,

												heightTitle     : 20,
												alphaTitle      : 80,
												bgTitle         : "#FFF",
												padTitle        : 5,
																										
															
												borderPause     : "none",
												bgPause         : "url(../sandecom/icones/bgPause.gif)",
												colorPause      : "#A63A0D",
												
												borderPlay      : "none",
												bgPlay          : "url(../sandecom/icones/bgPlay.gif)",
												colorPlay       : "#FFF",
						
												borderIndexAct  : "none",
												bgIndexAct      : "url(../sandecom/icones/bgIndexAct.gif)",
												colorIndexAct   : "#666",

												borderIndexInact: "none",
												bgIndexInact    : "url(../sandecom/icones/bgIndexInact.gif)",
												colorIndexInact : "#333"	
    										});
	
	
}



alinhaDivs = function(div1, div2){

	var elem1 = document.getElementById(div1);
	var elem2 = document.getElementById(div2);
	
	var x = elem1.clientHeight;
	var y = elem2.clientHeight;			
		
	var tam = 0;
		
	if(x>=y){
		tam = x;	
	}else{
		tam = y;
	}
		
	elem1.style.height = tam + "px";
	elem2.style.height = tam + "px";
	
}

alinhaTabelaHome = function(div1, div2){

	var elem1 = document.getElementById(div1);
	var elem2 = document.getElementById(div2);
	
	var x = elem1.clientHeight;
	var y = elem2.clientHeight;			
		
	var tam = 0;
	
	
	if(y<x){
		if(x>=y){
			tam = x;	
		}else{
			tam = y;
		}
		
		elem1.style.height = tam + "px";
		elem2.style.height = tam + "px";
	}
}



alinhaPrimeiroPelaSoma = function(div1, div2, div3, div4){

	
	var elem1 = document.getElementById(div1);
	var elem2 = document.getElementById(div2);
	var elem3 = document.getElementById(div3);
	var elem4 = document.getElementById(div4);
	
		
	var x = elem1.clientHeight;
	var y = elem2.clientHeight;			
	
	if(elem3){
		y = y + elem3.clientHeight;
		
		if(elem4){
			y = y + elem4.clientHeight;
		}
	}
		
	var tam = 0;
		
	if(x<y){
		elem1.style.height = y + "px";
	}
	
	
}