// when the DOM is ready:
$(document).ready(function () {
	$('#page_content').html($('#page_home').html());

	// Options for SuperBGImage
	$.fn.superbgimage.options = {
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		slideshow: 0, // 0-none, 1-autostart slideshow
		slide_interval: 2000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 1000, // animation speed,
		showimage: 1,
		transition: 0,
		onShow : superbgimage_show
	};

	// initialize SuperBGImage
	$('#thumbs').superbgimage().hide();
			
    // select #flowplanes and make it scrollable. use circular and navigator plugins 
    /* var api = $(".scrollable").scrollable({
		size: 1,
		easing: 'swing',
		speed: 1000
		}).circular({api: true});
	*/
	$('.pagelink a').click(function(){
		id = this.id.split('-');
		pageid = this.getAttribute('href').split('#');
		pageid = pageid[1];
		if (!pageid){
			pageid = 'content';
		}
		html = $('#page_'+ pageid).html();
		$('#page_home').html(html);
		if (!id[1]) {
			id[1] = 2;
		}
		t = $.fn.superbgShowImage(id[1],'d');

		return false;	
	}); 

	

	$('.bdrowse').click(function(){
		id = this.id.split('_');
		$('#page_home').html($('#page_'+ id[1]).html());
		//console.log(id);
		return false;	
	}); 

});

	function superbgimage_show(img) {
		$('#superbgimage').css('background', 'none');
			$.fn.superbgimage.options = {
			transition: 1,
			speed: 1000, // animation speed,
			onShow: null
		}
	}


