Cufon.replace('h1, #top_a, #top_b, #top_c, #menu, #en, #busctit, #buscador label, #buscador a, #suc strong, #suc span', {fontFamily: 'fq', hover:true});

$(function(){
	var option = {
		resizeLgImages: true,
		displayNav: true,
		handleUnsupported : 'remove',
		keysClose: ['c', 27], 
		players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
	};
	Shadowbox.init(option);
	
	if($('#slider').length) {
	var s=$('#slider').children('div').children('div');
	var itm=$(s).children('a');
	var w=0;
	for(var i=0;i<itm.length;i++) w+=parseInt($(itm[i]).outerWidth(1));
	$(s).css('width',w+10);
	
	$('#slider .l').click(function() {
		var pos=parseInt($('#slider').children('div').children('div').css('left'));
		pos+=$('#slider').children('div').children('div').children('a:eq(0)').outerWidth(1);
		
		var slw=parseInt($('#slider').children('div').children('div').innerWidth());
		var slcw=parseInt($('#slider').children('div').innerWidth());
		var mx=-1*(slw-slcw);
		
		if(pos>0) pos=mx;
		
		$('#slider').children('div').children('div').stop().animate({left:pos+'px'},500,'swing');
		return false;
	});
	
	$('#slider .r').click(function() {
		var pos=parseInt($('#slider').children('div').children('div').css('left'));
		pos-=$('#slider').children('div').children('div').children('a:eq(0)').outerWidth(1);
		
		var slw=parseInt($('#slider').children('div').children('div').innerWidth());
		var slcw=parseInt($('#slider').children('div').innerWidth());
		var mrg=parseInt($('#slider').children('div').children('div').children('a:eq(0)').css('margin-right'));
		var mx=-1*((slw-slcw)-mrg);
		
		if(pos<mx) pos=0;

		$('#slider').children('div').children('div').stop().animate({left:pos+'px'},500,'swing');
		return false;
	});
	}
});

