/* ***********************************************************
 * @author izus.com.ar
 */

/*
Cufon.replace('h1.pagetitle', {
	color: '-linear-gradient(#999, #333)',
	fontFamily: 'exeo'
});
*/

Shadowbox.init();

function mycarousel_initCallback(carousel)
{
	// Disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});

	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});

	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};
	
jQuery(document).ready(function(){

	$('#logo').fadeIn('5000', function() {
	   $('#legend').fadeIn('5000');
    });

	jQuery('#collection-list').jcarousel({
			auto: 8,
			start: 3,
			wrap: 'last',
			initCallback: mycarousel_initCallback								 
	});

	//$('#press-items div.span-8').click(function() {		
		//jquery.get($(this).find("a").attr("href"));
//	});
	$('#press-items div.span-8').bind('click', getAnchorId);
	
	function getAnchorId() {
    	var tUrl = $(this).find('a').attr('href');
    	window.location(tUrl);
	}
	
	
	$("#press-items div.span-8").hover(
		function(){$(this).siblings("div.span-8").stop().fadeTo("slow", 0.3);},
		function(){$(this).siblings("div.span-8").stop().fadeTo("slow", 1);}
	);
	$("#collection-list li").hover(
		function(){$(this).siblings("li").find("img").stop().fadeTo("slow", 0.3);},
		function(){$(this).siblings("li").find("img").stop().fadeTo("slow", 1);}
	);	

}); // close document.ready



/* 
funcion para capturar el ctrl + key y mostrar u ocultar la grilla de blueprint  
http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/
*/
jQuery.ctrl = function(key, callback, args) {
    jQuery(document).keydown(function(e) {
        if(!args) args=[]; // IE barks when args is null
        if(e.keyCode == key.charCodeAt(0) && e.ctrlKey) {
            callback.apply(this, args);
            return false;
        }
    });
};
jQuery.ctrl("G", function() { $("#content").toggleClass("showgrid");});
