$(document).ready(function(){
	$(".video").colorbox({returnFocus: false});

	$('div.bookmark').mosaic({
		animation : 'slide'
	});

//	$('.slideshow').cycle({
//		fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
//		delay: Math.ceil(100*Math.random())
//	});

	$('.slideshow').each(
		function() {
			sp = Math.ceil(600*Math.random()+600);
			to = Math.ceil(4000*Math.random()+4000);
			//alert(t);
			$(this).cycle({
				fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, scrollHorz, etc...
				speed: sp,
				timeout: to,
				//delay: 2000
			});
		}
	);

	if (urlparam('show') != '') {
		var post_id = urlparam('show');
		$("#post-id-"+post_id).click();
	}
});

jQuery(document).ready(function(){
	jQuery("img.bookmark").css({opacity: 0}); 	// Initial opacity 0
	jQuery("img.bookmark").fadeTo(900, 0.8);
	jQuery("div.bookmark").hover(function(){
			jQuery(this).find("img.bookmark").fadeTo("fast", 1.0); 	// fade to 1.0
		},function(){
			jQuery(this).find("img.bookmark").fadeTo("fast", 0.8); 	// fade back to 0.8
		});
});

function urlparam(name) {
	var match = new RegExp('[\?&]'+name + "=([^&]+)","i").exec(location.search);
	if (match==null) return null;
	else return decodeURIComponent(match[1]).replace(/\+/g,' ');
}

