// JavaScript Document

$(document).ready(function() {

//	$('#cap_intro').animate({top: "0px"}, 2000);

	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-160px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'-325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagnal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'160px', left:'325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	});
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
	});
	
	$('.blocOcultable').click(function(){
		$(this).next().slideToggle("slow");
	} );

	$(".simbolDreta").animate({ 
		width: "42",
		marginLeft: "0",
	}, 1000 );


	$("#papers").animate({ 
	width: "40",
	}, 1000 );

	$("#prolyte").animate({ 
		width: "40",
	}, 1000 );	

	$("#Clients").animate({ 
    height: 'toggle',
	}, 1000 );


	$('#menu_1.noselect').mouseover(function(){
			var amplada = $(this).width();
			var altura = $(this).height()*0;
			$(this).animate({backgroundPosition:"-"+amplada+"px -"+altura+"px"}, {duration:200})
			// alert(amplada+" x "+altura);
		});
	$('#menu_1.noselect').mouseout(function(){
			$(this).stop().animate({backgroundPosition:"0 0"}, {duration:200, complete:function(){}
		})
	});


	$('#menu_5.noselect').mouseover(function(){
			var amplada = $(this).width();
			var altura = $(this).height()*0;
			$('#menu_5.noselect').animate({backgroundPosition:"-"+amplada+"px -"+altura+"px"}, {duration:200})
			// $(this).hide();
	});
	
/*
	// JQUERY UI: aplica estils de botons
	$(function() {
		$( ".boto_jquery, button").button();
	});
*/

	/* FANCYBOX */
	$(".galeria_fancybox").fancybox({
		'titleShow'     : false
	});

	$("a[rel=galeria_fotos_fancybox]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
	});

	$(".iframe").fancybox({
		'width'				: '75%',
		'height'			: '75%',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

});    

