var resizeImgs=function(){
	
	var ss_w=$('#fullSlideShow').width();
	var ss_h=$('#fullSlideShow').height();
	var ss_ratio=ss_w/ss_h;
	$('#fullSlideShow .imgSlide ').each(function(){
		var my_w=$(this).width();
		var my_h=$(this).height();
		var my_ratio=my_w/my_h;
		
		if( $(this).hasClass('img100'))
			if(my_ratio>ss_ratio)
			{
				my_h=ss_h;
				my_w=ss_h*my_ratio;
			}
			else 
			{
				my_w=ss_w;
				my_h=ss_w/my_ratio;
	
			}
		$(this).height(my_h);
		$(this).width(my_w);
		var my_l=(ss_w-my_w)/2;
		var my_t=(ss_h-my_h)/2;
		$(this).css({ 'width':my_w+'px', 'height':my_h+'px','position':'absolute', 'top':my_t+'px', 'left':my_l+'px'});
		
	});
	
	
	/*$('.mdl').each(function(){
		$(this).css('margin-top',-$(this).height()/2+'px')
	});*/
	
	

}


$(document).ready(function() {
	$(window).bind('resize', function( ) {
		resizeImgs();
	});
	
	
	$(window).trigger('resize');
	$('#focus_navigator').bind('click',function(){
		if($(this).hasClass('page2'))
			$('.focus_container ul').stop(true,false).animate({left: '0px'}, 200);
		else 
			$('.focus_container ul').stop(true,false).animate({left: '-720px'}, 200);
		
		
		
		$(this).toggleClass('page2');
	});
	
	
	//alert($(".events:first  div").length);
	if($(".events:first  div").length>2)
	{
		setTimeout(function() {
	      var ww=240;
	      $('.events:first  div:first').animate({'margin-left':-ww+'px'},200,function(){$(this).hide(0).css('margin-left',0); $('.events:first').append($('.events:first  div:first')); $(this).show(0)});
		}, 2000);
	}
	else{$('.events').css({'width':'auto'})}
	if($("#fullSlideShow ul li").length >1)
	{
	$('#fullSlideShow ul').cycle({
		fx: 'fade', 	
		
		speed:500,
		sync:   1,
		timeout: 8000, 
		random:        true,
				
		before:function(curr, next, opts)
				{
					//$('#displayLabel').hide(300);
					$('#displayLabel').html($(this).find('.hiddenLabel:first').html());
				},
		after:function(curr, next, opts)
				{
					//$(this).css('display','none');
					
					//alert($(this).find('#diplayLabel').html());
					//$(this).css('display','block');
					//$(this).css('display','block');
					//$('#displayLabel').show(300);
				}
	});	
	}
	else{$('#displayLabel').html($('#fullSlideShow ul li:first').find('.hiddenLabel:first').html());}
});
	

