$(document).ready(function(){
				
$("#quotes-hide").mousemove(function(e){
		/* The scrollable quote container */

		if(!this.hideDiv)
		{
			/* These variables are initialised only the firts time the function is run: */
			
			this.hideDiv = $(this);
			this.scrollDiv = $('#quotes-slide');

			this.pos = this.hideDiv.offset();
			this.pos.top+=20;
			/* Adding a 20px offset, so that the scrolling begins 20px from the top */
			
			
			this.slideHeight = this.scrollDiv.height();
			
			this.height = this.hideDiv.height();
			this.height-=20;
			/* Adding a bottom offset */
						
			this.totScroll = this.slideHeight-this.height;
		}
		
		this.scrollDiv.css({
			/* Remember that this.scrollDiv is a jQuery object, as initilised above */
			
			marginTop:'-'+this.totScroll*(Math.max(e.pageY-this.pos.top,0)/this.height)+'px'
			/* Assigning a negative top margin according to the position of the mouse cursor, passed
			   with e.pageY; It is relative to the page, so we substract the position of the scroll container */
		});
		
	});				
				
				
		$('#fp_plugin').flash({ 
			src: 'scripts/swf/example.swf',
			width: 360,
			height: 215
		},
		{
			version: 8
		});

	var params = $("#yt_video").attr('rel').split(';');
    var s = params[1];
    var w = params[2];
    var h = params[3];	
    var title = params[4];		
    var subtitle = params[5];			
	$('#yt_title').html(title);				
	$('#yt_subtitle').html(subtitle);					
    $('#'+params[0]).flash( 
					{ width: 225, height: 150, allowfullscreen: true },
					{ version: 9 },
					function(htmlOptions) {
						$this = $(this);
						htmlOptions.src = s;
        				htmlOptions.width = w;
        				htmlOptions.height = h;		
						htmlOptions.addThumbs = "true"; 
						htmlOptions.allowfullscreen = "true";						
						this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
						$this.addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
					});				
				
		autoh('1');
});
        
function autoh(pane) 
{
		var h = 0; 
	 	var h = $(".SlidingPane#"+pane).height();	
		$("#SlidingContainer").height(h+20);
}	


$("#yt_video").livequery('click', function(event) 
{
	var params = $(this).attr('rel').split(';');
    var s = params[1];
    var w = params[2];
    var h = params[3];	
    var title = params[4];		
    var subtitle = params[5];			
	$('#yt_title').html(title);				
	$('#yt_subtitle').html(subtitle);
    $('#'+params[0]).flash( 
					{ width: 225, height: 150 },
					{ version: 9 },
					function(htmlOptions) {
						$this = $(this);
						htmlOptions.src = s;
        				htmlOptions.width = w;
        				htmlOptions.height = h;	
						htmlOptions.allowfullscreen = "true";
						this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
						$this.addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
					});
	autoh(3);
}); 

