var config = {    
     over: dropout, // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: dropin // function = onMouseOut callback (REQUIRED)    
};


function dropout() {
	$('ul', this).slideDown('fast');
}

function dropin() {
	$('ul', this).fadeOut('fast');
}

bannerheight = 0;
imgh = 0;

$(document).ready( 
     function(){ 
      
       $('#tab-container-over ul#switch').tabs({ event: 'mouseover', fx: { opacity: 'toggle' }});
       $(".slide").tabs({ fx: { opacity: 'toggle' } }).tabs("rotate", 8000, false);
       
       $("#nav-topical li").hoverIntent(config);

        var lvl3img =  $("#lvl3banner img").attr("src");
       
       $("#lvl3banner img").attr({src: lvl3img + '?random='+ (new Date()).getTime()});
       
       $("#lvl3banner img").load(function() {
    	    
    		imgh = $("#lvl3banner img").height();
    		
    		bannerheight = 200-imgh;
    		
    		if (imgh > 200) {
    			$("#lvl3banner img").animate({top : -50},5000);
    		}
    		
    		
    	});

       

       $("#lvl3banner").click(function() {
			imgh = $("#lvl3banner img").height();
			if (imgh != 200) {
				//alert($("#lvl3banner").height());
				if ($("#lvl3banner").height() != 200) {
					
					$('#lvl3banner').animate({
						height: 200
					}, 2000, function(){
						$("#lvl3banner img").animate({top : -50},1500);
					});
				} else {
					$("#lvl3banner img").animate({top : 0},1500);
					$('#lvl3banner').animate({
						height:imgh
					}, 2000, function(){
						
					});					
				}								
			}				
		});

	$('#img-gallery a').lightBox();
     }  
); 

