	$(function(){
		
		var imgpost = $('.post p');
		
		/*imgpost.each(function(){
			$img	= $('img', this);
			$imgh	= $img.height();
			$imgw	= $img.width();
			$span	= $('<span id="grid" />').css({'width':$imgw, 'height':$imgh, 'display':'block', 'background':'url(/images/grid.png)', 'position':'absolute', 'top':0, 'left':0, 'cursor':'pointer'});
			$span.appendTo(this);
		});*/
		
		/*$spangrd = $("span#grid");
		$spangrd.hover(function(){
			$(this).stop().animate('opacity',0);
		}, function(){
		
		});*/
		
		var $video_div = $('.black');
		$video_div.css('opacity',0);
		$video_div.hover(function(){
			$(this).stop().fadeTo('normal', 0.7);
		}, function(){
			$(this).stop().fadeTo('normal', 0);
		});
		
		$('#flash_box_link').fancyZoom();
		
		$('#slide-info-img1').show();
		$('#slides').jCarouselLite({
			btnNext: '.arrow-next',
			btnPrev: '.arrow-prev',
			auto: 6800,
			speed: 1000,
			btnGo:	['.button-img1', '.button-img2', '.button-img3'],
			beforeStart: function(a) {
				var slidenum = '.active-' + $(a).attr('id');
				$(slidenum).replaceWith('<a class="button-img' + $(slidenum).html() + '" href="#">' + $(slidenum).html() + '</a>');
			},
			afterEnd: function(a) {
				$('.slide-content').fadeOut();
				var slideshowing = '#slide-info-' + $(a).attr('id');
				var slidenum = '.button-' + $(a).attr('id');
				$(slidenum).replaceWith('<strong class="active-img' + $(slidenum).html() + '">' + $(slidenum).html() + '</strong>');
				$(slideshowing).fadeIn();
			}

		});

		var overlay = function(){
			$div = $("<div id='overlay' />").css({ 'width':'100%', 'height':$(document).height(), 'position':'absolute', 'top':'0', 'left':'0', 'z-index':'9', 'background':'#000000', 'cursor':'pointer', 'display':'none', 'opacity':0.8 });
			$div.appendTo('body').fadeIn(500);
			$div.click(function(){
				$(this).fadeOut({duration:500, complete:function(){$(this).remove();}});
			});
		}
		
		$('.light').click(overlay);
		
		$("#sharebox").sharebox();  
		
	});
	
	
	(function($){
		$.fn.sharebox = function(){
			var element = this;

			var i = 10;
			var j = 0;
			$(element).find("li").each(function(){
				$(this).css("z-index", i)
				if (j>0)
					$(this).css("left", j * 24 + 100 + "px");
				i = i - 1;
				j = j + 1;
			});
		}
	})(jQuery);
