$(window).load(function() {    
		
			var theWindow = $(window),
            $div = $("#dynHeight"),
            $vmiddle = $("#vmiddle"),
            
            newSize = (theWindow.height() - 183);
        

        function resizeMain() {
        	var theWindow = $(window),
            $div = $("#dynHeight"),
            $vmiddle = $("#vmiddle"),
            newSize = (theWindow.height() - 183),
            newMargin = $vmiddle.height() / 2;
            
			$div.css({'min-height': newSize + 'px'});
			//$vmiddle.css({'margin-top': '-' + newMargin + 'px'});
        }

        theWindow.resize(function() {
                resizeMain();
        }).trigger("resize");

	});
	
	
	
	$(function(){
	/*
	$('#up').click(function(){
			var $news = $('#news'),
				position = $news.css('top'),
				newPosition = parseInt(position);
			if (position != '0px'){
				$news.animate({'top': '+=24'});
				return false;
				}else{
				return false;
				} 
		});
		
		$('#down').click(function(){
			var $news = $('#news'),
				newsHeight = $news.height(),
				position = $news.css('top'),
				newPosition = parseInt(position),
				difference = Math.abs(newPosition) + 48;
				
				
				if (difference <= newsHeight){
				$news.animate({'top': '-=24'});
				return false;
				} else {
				return false;
				}
		});
		
		
*/
		
		$(".scrollable").scrollable({ vertical: true, circular: true }).autoscroll({ interval: 6000});
		
// VIDEO

	/*
$("a.video").fancybox({
         'scrolling': false,
         'titleShow': false,

 'onStart' : function() {
             $.fn.supersized.options = {  
				slideshow: 0
			};
			$('#supersized').supersized();
         },
         'onClosed' : function() {
             $.fn.supersized.options = {  
				startwidth: 640,  
				startheight: 480,
				vertical_center: 1,
				slideshow: 1,
				navigation: 0,
				thumbnail_navigation: 0,
				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
				pause_hover: 1,
				slide_counter: 0,
				slide_captions: 0,
				slide_interval: 10000,
				slides : [
					{image : 'images/hp1.jpg'},
					{image : 'images/hp2.jpg'},
					{image : 'images/hp3.jpg'},
					{image : 'images/hp4.jpg'},
					{image : 'images/hp5.jpg'}
					
					]
			};
			$('#supersized').supersized();
         },

         'padding' : 0
        
         }
     );
     */
 	
 $("a#play-flv-video").fancybox({
         'scrolling': false,
         'titleShow': false,
         'padding' : 0,
         'onStart' : function() {
         	
             $("#player").show();
             $f("player",
                     "http://silverleaf.redolive.net/swfs/flowplayer-3.2.7.swf",
                     "http://silverleaf.redolive.net/Silverleaf_profile_feb2012.flv");
         },
         'onClosed' : function() {
         	 
             $("#player").hide();
             $f().unload();
         }
     });
     
 
	});

