document.write('<link rel="stylesheet" type="text/css" href="http://www.bandwebkit.com/plugins/pirobox/style.css" media="screen" />');

$(document).ready(function() { 
	$("body").prepend('<link rel="stylesheet" type="text/css" href="http://www.bandwebkit.com/ext/css/photos/default.css" media="screen" />');
	
	$.listen('change', '#album_select', function(){
		$(".album").hide();
		$("#div"+$(this).val()).fadeIn();
		
	});
	
	function display_images (photosid) {		
		
		$.getJSON("http://www.bandwebkit.com/ext/photos.php?widget="+photosid+"&jsoncallback=?", function(data){
			widget = data.text;
			height = data.height;
			$("#bwkAlbum").html(widget);
			$(".image_container").height(height);
			$().piroBox({
			  my_speed: 300, //animation speed
			  bg_alpha: 0.5, //background opacity
			  radius: 4, //caption rounded corner
			  scrollImage : false, // true == image follows the page _|_ false == image remains in the same open position
								   // in some cases of very large images or long description could be useful.
			  slideShow : 'true', // true == slideshow on, false == slideshow off
			  slideSpeed : 3, //slideshow duration in seconds(3 to 6 Recommended)
			  pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
			  pirobox_prev : 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
			  close_all : '.piro_close,.piro_overlay' // add class .piro_overlay(with comma)if you want overlay click close piroBox
			});
		});
		
	}
	
	display_images(photosid);

});