$(document).ready(function() {

// jobs

$('.jobs').mouseover(function(){$(this).animate({"left": "+=80px","opacity": "1"}, "slow");}).mouseout(function(){$(this).animate({"left": "-=80px","opacity": "0.3"}, "slow");});

$('.jobs').click(function(){
	$.scrollTo( $('#jobs'), {speed:2000} );
	return false;
});

// ceebox

$(".ceebox").ceebox();
$(".ceebox a").hover(function(){
	$(this).addClass("huba").append('<div class="show png"></div>');
  $(".huba .show").show();
},function(){
  $(".huba .show").hide()
  $(this).removeClass("huba");
});


// Slider

if ($('#slides').length != 0) {
$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 8000,
				pause: 8000,
				slideSpeed: 2000,
				slideEasing: 'easeInOutQuad',
				hoverPause: true
			});
};
// Open links in new window
	
	$('.newWin').click( function() { 
		
		url = $(this).attr("href");
		window.open(url);
		
		return false;	
	});
	
	
 // More Projects
 
 $('.extend').hide();
 
 $('.more').click( function(){
								
	$('.extend').animate({
      "height": "toggle", "opacity": "toggle"
    }, { duration: "slow" });

	$('.more').toggleClass("hideItem");

});


	//Hide (Collapse) the toggle containers on load
	$(".job").hide(); 

	//Switch the "Open" and "Close" state per click
	$(".trigger").toggle(function(){
		$(this).addClass("hideItem");
		}, function () {
		$(this).removeClass("hideItem");
	});

	//Slide up and down on click
	$(".trigger").click(function(){
		//$(this).next(".toggle_container").slideToggle("slow");
		$(this).parent().parent().find(".job").slideToggle("slow");
	});


// nospam

	$('a.nospam').nospam({ replaceText: true });
	$('a#nospam2').nospam({ replaceText: false });


});

