/**
 * @author Fábio Miranda Costa <fabiomcosta@gmail.com>
 * http://www.meiocodigo.com
 */

$liItems = $$("li.liit");
var itemNumber;
var children = null, children2 = null;
var fontSize;
var enterEffect = new Array();
var leaveEffect = new Array();
var $centro = $('centro');

$liItems.each(function(el,index){
	children = el.getChildren();
	
	if( children.length > 1 ){
		enterEffect[index] = new Fx.Style(children[1],'opacity', { wait:false });
		leaveEffect[index] = new Fx.Style(children[1],'opacity', { wait:false });
	}
	
	el.addEvent("mouseenter",function(){
		children = this.getChildren();
		if( children.length > 1 ){
			enterEffect[index].start(1);
		}
	});
	
	el.addEvent("mouseleave",function(){
		children2 = this.getChildren();
		if( children2.length > 1 ){
			leaveEffect[index].start(0);
		}
	});
	
});

function changeFontSize(i){
	if( (fontSize < 28 && i > 0) || (fontSize >8 && i < 0) ){
		fontSize+=i;
	}
	$centro.setStyle('fontSize',fontSize+"px");
	Cookie.set( 'site_brenobarth_tam_fonte' , fontSize+"px" ,{duration:60*60*24*30,path:"/"});
}
//detects the font size
if( Cookie.get( 'site_brenobarth_tam_fonte' ) ){
	$centro.setStyle('fontSize',Cookie.get( 'site_brenobarth_tam_fonte' ));
	fontSize = parseInt(Cookie.get( 'site_brenobarth_tam_fonte' ));
}
else{
	fontSize = parseInt($('detc_tam_fonte').getStyle('fontSize'));
	Cookie.set( 'site_brenobarth_tam_fonte' , fontSize+"px" , {duration:60*60*24*30,path:"/"});
}