// JavaScript Document

/*
	// on resize window setWidth right container
	$(window).resize(function() {
		setWidthUL();
	});
*/

	$(document).ready(function() {	

			$("#id12_banner a.close_banner").click(function () {
				$("#id12_banner").fadeOut();
				return false;

			});
			
			
			
			$("#people_wanted a").click(function () {
				$("#people_wanted").fadeOut();
				return false;

			});
			
			
		
	
			
			
	$(".clicker h2").click(function () {
    // $('#people_wanted').animate({ top: '610px' });

   });
   
  	   $(function() {

	//$( ".push h2" ).toggle(
	
	
 		
 	//	function() {$( "#people_wanted" ).animate({top: '650px'}, 1000 );},
 	//	function() {$( "#people_wanted" ).animate({top: '200px'}, 1000 );}
 		
 	//	);
	});
   



	// give id's to li items
  	$.each( $("ul#work li"), function(i, n){
			var $wim = "id-"+(i+1);
			$("ul#work li:eq("+i+")").attr("data-id",$wim);
 		});	
	
	// bind filterlists in the form
	var $filterType = $('#filter li');
	var $filterClient = $('#clientlist li');
	
	// get the first collection
	var $applications = $('#work');
	
	// clone applications to get a second collection
	var $data = $applications.clone();

	// attempt to call Quicksand on every form change
	$filterType.click(function(e) {
		var $id = $(this).attr("id");
							   
		$('li.checked').removeClass('checked');
		$(this).addClass('checked');
		
		if ($id == 'all') {
			var $filteredData = $data.find('li');
		} else {
			var $filteredData = $data.find('li[data-type=' + $id + ']');				
		}
				 
		
	 // finally, call quicksand
	  $applications.quicksand($filteredData, {
		duration: 800,
		easing: 'easeInOutQuad'
		}, function captionPJ (){
			$("a[rel^='prettyPhoto']").prettyPhoto();	//prettyPhoto callback
			$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
					$(this).css("cursor", "pointer");
			}, function() {
					$(".cover", this).stop().animate({top:'150px'},{queue:false,duration:160});					
			});	
		});	
	  
	  });
	
	$filterClient.click(function(e) {
		var $id = $(this).attr("id");
							   
		$('li.checked').removeClass('checked');
		$(this).addClass('checked');
		
		
		if ($id == 'all-clients') {
			var $filteredData = $data.find('li');			
		} else {				
			var $filteredData = $data.find('li[data-client=' + $id + ']');
		}		
		
		// finally, call quicksand
	  $applications.quicksand($filteredData, {
		duration: 800,
		easing: 'easeInOutQuad'},  function captionPJ (){	
			$("a[rel^='prettyPhoto']").prettyPhoto();	//prettyPhoto callback
			$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
					$(this).css("cursor", "pointer");
				}, function() {
					$(".cover", this).stop().animate({top:'150px'},{queue:false,duration:160});					
				});	
			});	 
		});
		
		
		// initiating twitterfeed
		getTwitters('twitterfeed', { 	id: 'prophetsAntwerp', count: 3, ignoreReplies: true, template: '<p>%text%<br /><span class="minitext"><a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a></span></p>'});
		
		/*
		// initiating superbox
		$.superbox();
		
		// open link in superbox if referred from other page
		if (location.search.length > 0){
			var $loc = unescape(location.search.substring(1));
			$("a[href$='"+$loc+".html']:first").trigger('click');	
		}
		*/
		
  });  

	/*
	//popup gallery
	$(function() {				
		$('#2').hide();
	  $('#3').hide();
	});

	$(function(){

	  $('ul a#thumb_01').click(function() {										   		
			$('.current').fadeOut(300);
			$('#1').fadeIn(300);
			$('#1').addClass('current');
		});

		$('ul a#thumb_02').click(function() {										   		
			$('.current').fadeOut(300);
			$('#2').fadeIn(300);
			$('#2').addClass('current');
		});

		$('ul a#thumb_03').click(function() {										   		
			$('.current').fadeOut(300);
			$('#3').fadeIn(300);
			$('#3').addClass('current');
		});

	});
	*/
