function checkLimits(box){



		var prison_left   = document.getElementById("prison").offsetLeft;

		var prison_right  = prison_left + document.getElementById("prison").offsetWidth;

		var prison_top    = document.getElementById("prison").offsetTop;

		var prison_bottom = prison_top + document.getElementById("prison").offsetHeight;

		

		var box_left   = parseInt(box.css("left"));

		var box_right  = box_left + parseInt(box.css("width"));

		var box_top    = parseInt(box.css("top"));

		var box_bottom = box_top + parseInt(box.css("height"));

		

		if(box_left < prison_left){

			box.css("left", prison_left);

		}



		if(box_top < prison_top){

			box.css("top", prison_top);

		}



		if(box_right > prison_right){

			box.css("left", prison_right - parseInt(box.css("width")));

		}



		if(box_bottom > prison_bottom){

			box.css("top", prison_bottom - parseInt(box.css("height")));

		}



	}



	$(function(){

		$(".geek, .faceb, .iexp, .moz").easydrag();

		$(".geek").ondrag(function(e){ checkLimits($(".geek")); });

		$(".faceb").ondrag(function(e){ checkLimits($(".faceb")); });

		$(".iexp").ondrag(function(e){ checkLimits($(".iexp")); });

		$(".moz").ondrag(function(e){ checkLimits($(".moz")); });

		$("#showTitter").click(function(){

			$(".footer_twitter ul").slideToggle("slow");

			$(".footer_twitter").toggleClass("opened"); 

			return false;

		});

		

//		$("li.box_video").mouseenter(

//		  function () {

//				$('<div class="viewVideos"><p><a href="#">watch the typography video</a></p><p><a href="#">watch the animated video</a></p><p><a href="#">watch the making of the concept video</a></p></div>').appendTo('li.box_video');

//		  }).mouseleave(

//		  function () {

//				$('.viewVideos').remove();

//		  });





		$("li.box_video").mouseenter(

			function () {		

				$('.viewVideos').addClass('vizibil');

			}).mouseleave(

			function () {

				$('.viewVideos').removeClass('vizibil');	 

		});

		$("#sidebar_about").addClass("scrollFallow");

		$(function ()
			{
				$( '.scrollFallow' ).scrollFollow();
			}
		);


		$("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});


	});

		


