$(document).ready(function() {

	$("ul.gallery li").hover(function() { //On hover...

		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});

});



//On hover...
	
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
			
				$(".example5").colorbox();
				
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#fff", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});

	
// colorbox grupal, agregado por chelo 08072010

$(document).ready(function(){
	$("a[rel='project']").colorbox({onLoad: function() {
		$('#cboxNext').remove();
		$('#cboxPrevious').remove();
	},
		onComplete: function() {
				try{Typekit.load();}catch(e){}; }}); //	},transition:'fade', speed:100});
});

$(document).ready(function(){
	$("a[rel='project2']").colorbox({onLoad: function() {
		$('#cboxNext').remove();
		$('#cboxPrevious').remove();
	},
		onComplete: function() {
				try{Typekit.load();}catch(e){}; }}); //	},transition:'fade', speed:100});
});

// ajax projects call
$("#load_projects").live('click', function() {
var link = $(this);
var counterp = $("#counterp").html();
    $.ajax({ url: link.attr("href")+"?"+counterp, 
            dataType: 'html',
            data: {post_loader: 1},
            success: function(data){
                $(".gallery").html(data).fadeIn();
				$(".gallery li").fadeIn();
				var newrow = "sixprojects"+(parseInt(counterp))+".html";
				$("#load_projects").attr("href", newrow);
				$("#counterp").html(parseInt(counterp) + 1);
				if (counterp == "2")
				{
					$("#counterp").html(1);
				}
	}});
    return false;
});

// colorbox fade
//jQuery.fn.colorbox.settings.transition = "fade";
//jQuery.fn.colorbox.settings.transitionSpeed = 10000;

//
	$(document).ready(function(){
		$('#slider-code').tinycarousel({ axis: 'y'});
	});


