$(document).ready(function(){
	
	if (ie && !ie6plus) return;
	
	// - - - - - - - - - - - - - - - - - - - - - - -
	// move table images out of the scrolling div 
	
	$('#pane table td img').appendTo(".images");
	
	// - - - - - - - - - - - - - - - - - - - - - - -
	
	content_scroll();
	video_marquee();
	
	// - - - - - - - - - - - - - - - - - - - - - - -
	
	if (marquee) {
		
		marquee.trigger('stop'); 
		
		marquee.mouseover(function () {
			$(this).trigger('start');
		});
	
		marquee.mouseout(function () {
			$(this).trigger('stop');
		});
		
		$('.start').mouseout( function () {
			marquee.trigger('stop'); 
		});
		
		$('#marquee .cover').show();
		
		$('#marquee').mouseenter( function () {
			$('#marquee .cover').fadeOut("fast");
		});
		
		$('#marquee').mouseleave( function () {
			$('#marquee .cover').fadeIn("fast");
		});
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - -
	// show images on link hover 
	
	var timer = null;
	var wait  = 1000;
	
	$("#pane table td a").hover(
		function () {
        	show_image_bg();
        	show_image($(this).attr('rel'));
    	},
    	function () {
      		hide_images()
     		hide_image_bg();
    	}
    );
    	
	// - - - - - - - - - - - - - - - - - - - - - - -
	
	function show_image_bg() {
		
		if(timer) { 
        	clearTimeout(timer); 
        	timer = null;
        } else { 
        	$('.images').fadeIn("fast"); 
        }
	}
	
	function hide_image_bg() {
	
		timer = setTimeout(function(wait) { 
			$('.images').fadeOut("slow"); 
			timer = null; 
		}, wait);
	}
	
	function show_image(id) {
		 $('.images img#'+id).fadeIn("slow");
	}
	
	function hide_images() {
		$('.images img').fadeOut("slow");
	}
	
});
