$(document).ready(function() {


    $('#slides').cycle({
		 fx:     'fade', 
		next:   'a#rArrow', 
    	prev:   'a#lArrow' ,
    	 timeout:   4500
     
    
    
	}); 
    	
    	
    	
  //every 3rd
	var $main = $("#content");
	//If the container exists
	if($(".folioEntry").length){
		//Loop through each image, including the index of the object(i)
		$(".workBlockWrap", $main).each(function(i){
			//Since 0 based add one, for every 3rd object remainder will equal 0
			var remainder = (i + 1) % 3;
			//Add a class of last when the remainder is 0
			if(remainder === 0){
				$(this).addClass("last");
			}
		});
	}  	
        
        
     $('.workBlock').hover(function() {
			$("img", this).stop().animate({top : "-40px"});
			$("span.workClick", this).stop().fadeTo("normal", 0.7);
     	},function() {
     		 $("img", this).stop().animate({top : "0px"});
     		 $("span.workClick", this).stop().fadeTo("normal", 0);
     	});
     	
	$(function() { 
        $("a[rel]").overlay({
        	expose: '#000', 
        	effect: 'apple',	
        	onBeforeLoad: function() { 
          		this.getOverlay().appendTo('body'); 
      								} 
        	}); 
	});






  
  });




// youtube function

var getList = function(url, gkey){

        var returned = null;

        if (url.indexOf("?") != -1){

          var list = url.split("?")[1].split("&"),
                  gets = [];

          for (var ind in list){
            var kv = list[ind].split("=");
            if (kv.length>0)
                gets[kv[0]] = kv[1];
        }

        returned = gets;

        if (typeof gkey != "undefined")
            if (typeof gets[gkey] != "undefined")
                returned = gets[gkey];

        }
        return returned;
  };
  
  