var ocontainer;
var ocontent;
var spaceToScroll;
var running = false;
var currentBD = 1;
var nbBD = 7;
$(document).ready(init);

function init() 
{
	
	slideUp("#main_content", "900px", "32px", 3500);
	slideUp("#content_txt", "900px", "0px", 3500);
	slideUp(".indicator", "900px", "0px", 3500);
	
	
	ocontainer = $('div.container');
	ocontent = $('div.content');
	
	containerSize = jQuery.iUtil.getSize(ocontainer.get(0));
	containerPosition = jQuery.iUtil.getPosition(ocontainer.get(0));
	containerInner = jQuery.iUtil.getClient(ocontainer.get(0));
	
	contentSize = jQuery.iUtil.getSize(ocontent.get(0));
	
	$('div.slider1')
		.css('top', '32px')
		.css('float', 'left')
		.css('height', containerSize.hb + 'px');
	
	spaceToScroll = contentSize.hb - containerInner.h;
	
	//$('div.indicator').css('height', containerInner.h * containerSize.hb / contentSize.hb + 'px');
	
	$('.slider1').Slider(
		{
			accept : '.indicator',
			onSlide : function( cordx, cordy, x , y)
			{
				ocontent.css('top',  '-'+Math.abs(spaceToScroll * cordy / 100) + 'px');
			}
		}
	);
	
	$(".indicator").css("top", "0px");
}

function slideUp(jQueryElement, posFrom, posTo, slideDuration)
{
	/*********************************/
	/* Slide up the main_content div */
	/*   Created by Claire Dolecki   */
	/*********************************/
	// Set the position to the bottom
	$(jQueryElement).css("top", posFrom);
	// Launch the slide up function
	$(jQueryElement).animate({ top :posTo}, {queue:false, duration:parseInt(slideDuration), easing: 'easeInOutBack'});
	/*********************************/
}


