// JavaScript Document
$(function(){
		   
// Main menu Tabs: ---------------------------------------------	
		var tabsContainer = $('div#banner-main-menu-wrapper > div > div');
		tabsContainer.hide().css('display','none').filter(':first').show().css('display','block');
		$('banner-main-menu-wrapper ul li a').filter(":first").addClass("selected");
		
		// Mouse Hover Event..........................................................
		$('#banner-main-menu-wrapper ul li a').mouseover(function(){
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#main-menu-tab-1')
					 {
						 $(this).css('background-position','-500px -30px');
					 }
					 
					 else if(this.hash == '#main-menu-tab-2')
					 {
						 $(this).css('background-position','-375px -30px');
					 }
					 
					 
					 else if(this.hash == '#main-menu-tab-3')
					 {
						 $(this).css('background-position','-250px -30px');						 
					 }
					 
					  else if(this.hash == '#main-menu-tab-4')
					 {
						 $(this).css('background-position','-125px -30px');						
					 }
					 
					  else if(this.hash == '#main-menu-tab-5')
					 {
						 $(this).css('background-position','0 -30px');						 
					 }
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Out Event----------------------------------------------------------------------------
		$('#banner-main-menu-wrapper ul li a').mouseout(function(){
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#main-menu-tab-1')
					 {
						 $(this).css('background-position','-500px 0');
					 }
					 
					 else if(this.hash == '#main-menu-tab-2')
					 {
						 $(this).css('background-position','-375px 0');
					 }
					 
					 
					 else if(this.hash == '#main-menu-tab-3')
					 {
						 $(this).css('background-position','-250px 0');						 
					 }
					 
					  else if(this.hash == '#main-menu-tab-4')
					 {
						 $(this).css('background-position','-125px 0');						
					 }
					 
					  else if(this.hash == '#main-menu-tab-5')
					 {
						 $(this).css('background-position','0 0');						 
					 }
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Click Event----------------------------------------------------------------------------
		$('#banner-main-menu-wrapper ul li a').click(function(){
			 if($(this).hasClass('selected')){
				return false;
			 }
			 else
			 {
			 $('#banner-main-menu-wrapper ul li a').removeClass('selected');		 
				 
				tabsContainer.hide();		 
			 	tabsContainer.filter(this.hash).fadeIn(200);
			 
			 if(this.hash =='#main-menu-tab-1')
			 {
				 $(this).addClass('selected');
				 $('#banner-main-menu-wrapper ul li a#menu1').css('background-position','-500px -60px');
				 $('#banner-main-menu-wrapper ul li a#menu2').css('background-position','-375px 0');
				 $('#banner-main-menu-wrapper ul li a#menu3').css('background-position','-250px 0');
				 $('#banner-main-menu-wrapper ul li a#menu4').css('background-position','-125px 0');
				 $('#banner-main-menu-wrapper ul li a#menu5').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#main-menu-tab-2')
			 {
				 $(this).addClass('selected');
			 	 $('#banner-main-menu-wrapper ul li a#menu1').css('background-position','-500px 0');
				 $('#banner-main-menu-wrapper ul li a#menu2').css('background-position','-375px -60px');
				 $('#banner-main-menu-wrapper ul li a#menu3').css('background-position','-250px 0');
				 $('#banner-main-menu-wrapper ul li a#menu4').css('background-position','-125px 0');
				 $('#banner-main-menu-wrapper ul li a#menu5').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#main-menu-tab-3')
			 {
				 $(this).addClass('selected');
				 $('#banner-main-menu-wrapper ul li a#menu1').css('background-position','-500px 0');
				 $('#banner-main-menu-wrapper ul li a#menu2').css('background-position','-375px 0');
				 $('#banner-main-menu-wrapper ul li a#menu3').css('background-position','-250px -60px');
				 $('#banner-main-menu-wrapper ul li a#menu4').css('background-position','-125px 0');
				 $('#banner-main-menu-wrapper ul li a#menu5').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#main-menu-tab-4')
			 {
				 $(this).addClass('selected');
				 $('#banner-main-menu-wrapper ul li a#menu1').css('background-position','-500px 0');
				 $('#banner-main-menu-wrapper ul li a#menu2').css('background-position','-375px 0');
				 $('#banner-main-menu-wrapper ul li a#menu3').css('background-position','-250px 0');
				 $('#banner-main-menu-wrapper ul li a#menu4').css('background-position','-125px -60px');
				 $('#banner-main-menu-wrapper ul li a#menu5').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#main-menu-tab-5')
			 {
				 $(this).addClass('selected');
				 $('#banner-main-menu-wrapper ul li a#menu1').css('background-position','-500px 0');
				 $('#banner-main-menu-wrapper ul li a#menu2').css('background-position','-375px 0');
				 $('#banner-main-menu-wrapper ul li a#menu3').css('background-position','-250px 0');
				 $('#banner-main-menu-wrapper ul li a#menu4').css('background-position','-125px 0');
				 $('#banner-main-menu-wrapper ul li a#menu5').css('background-position','0 -60px');
			 }
			 
			 return false;
			 
			 }
			 
		});
		//----------------------------------------------------------------------------
// Main menu Tabs: ---------------------------------------------




// Flahs News Tabs: ---------------------------------------------	
		var newsTabsContainer = $('div#news-center-lvl-1-main > div');		
		newsTabsContainer.hide().filter(':first').show();
		$('#news-center-lvl-1-bottom-closer ul li a').filter(":first").addClass("selected");
		
		// Mouse Hover Event..........................................................
		$('#news-center-lvl-1-bottom-closer ul li a').mouseover(function(){																		
				
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#flash-news-1')
					 {
						 $(this).css('background-position','-210px -15px');
					 }
					 
					 else if(this.hash == '#flash-news-2')
					 {
						
						 $(this).css('background-position','-180px -15px');
					 }
					 
					 
					 else if(this.hash == '#flash-news-3')
					 {
						 $(this).css('background-position','-150px -15px');						 
					 }
					 
					  else if(this.hash == '#flash-news-4')
					 {
						 $(this).css('background-position','-120px -15px');						
					 }
					 
					  else if(this.hash == '#flash-news-5')
					 {
						 $(this).css('background-position','-90px -15px');						 
					 }
					 
					 else if(this.hash == '#flash-news-6')
					 {
						 $(this).css('background-position','-60px -15px');						 
					 }
					 
					 else if(this.hash == '#flash-news-7')
					 {
						 $(this).css('background-position','-30px -15px');						 
					 }
					 
					 else if(this.hash == '#flash-news-8')
					 {
						 $(this).css('background-position','0px -15px');						 
					 }
					 
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Out Event----------------------------------------------------------------------------
		$('#news-center-lvl-1-bottom-closer ul li a').mouseout(function(){
				
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#flash-news-1')
					 {
						 $(this).css('background-position','-210px 0px');
					 }
					 
					 else if(this.hash == '#flash-news-2')
					 {
						
						 $(this).css('background-position','-180px 0px');
					 }
					 
					 
					 else if(this.hash == '#flash-news-3')
					 {
						 $(this).css('background-position','-150px 0px');						 
					 }
					 
					  else if(this.hash == '#flash-news-4')
					 {
						 $(this).css('background-position','-120px 0px');						
					 }
					 
					  else if(this.hash == '#flash-news-5')
					 {
						 $(this).css('background-position','-90px 0px');						 
					 }
					 
					 else if(this.hash == '#flash-news-6')
					 {
						 $(this).css('background-position','-60px 0px');						 
					 }
					 
					 else if(this.hash == '#flash-news-7')
					 {
						 $(this).css('background-position','-30px 0px');						 
					 }
					 
					 else if(this.hash == '#flash-news-8')
					 {
						 $(this).css('background-position','0px 0px');						 
					 }
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Click Event----------------------------------------------------------------------------
		$('#news-center-lvl-1-bottom-closer ul li a').click(function(){			
			 if($(this).hasClass('selected')){				
				return false;				
			 }
			 
			 
			 else
			 {

			 $('#news-center-lvl-1-bottom-closer ul li a').removeClass('selected');		 
				 
				newsTabsContainer.hide();		 
			 	newsTabsContainer.filter(this.hash).fadeIn(800);
			 
			 if(this.hash =='#flash-news-1')
			 {				
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
				 
			 }
			 
			 else if(this.hash == '#flash-news-2')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#flash-news-3')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#flash-news-4')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#flash-news-5')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#flash-news-6')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#flash-news-7')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px -30px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0px 0px');
			 }
			 
			  else if(this.hash == '#flash-news-8')
			 {
				 $(this).addClass('selected');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-1').css('background-position','-210px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-2').css('background-position','-180px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-3').css('background-position','-150px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-4').css('background-position','-120px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-5').css('background-position','-90px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-6').css('background-position','-60px 0px');
				 $('#news-center-lvl-1-bottom-closer ul li a#news-7').css('background-position','-30px 0px');				 
				 $('#news-center-lvl-1-bottom-closer ul li a#news-8').css('background-position','0px -30px');
			 }	
			 
			 return false;
			 
			 }
			 
		});
		//----------------------------------------------------------------------------
		
// Latest-Old news Tabs Tabs: ---------------------------------------------
/*var 	latestOldNewsContainer = $("div#news-center-main > div ");		
		latestOldNewsContainer.hide().filter(":first").show();*/
		
		$("#news-tabs").tabs("div#news-center-main > div",  { effect: 'fade' });
		$('#news-center-tabs ul li a').filter(":first").addClass("selected");
		 //Mouse Click Event----------------------------------------------------------------------------
		$('#news-center-tabs ul li a').click(function(){				 
			 if($(this).hasClass('selected')){
				return false;
			 }
			 else
			 {
			 $('#news-center-tabs ul li a').removeClass('selected');
				/*latestOldNewsContainer.hide();		 
			 	latestOldNewsContainer.filter(this.hash).show();*/
			 
			 if(this.hash =='#latest-news')
			 {				
				 $(this).addClass('selected');
				 $('#news-center-tabs ul li a.latest-news').css('background-position','-155px 0px');
				 $('#news-center-tabs ul li a.old-news').css('background-position','0 0');					 
			 }
			 
			 else if(this.hash == '#old-news')
			 {
				 $(this).addClass('selected');
				 $('#news-center-tabs ul li a.latest-news').css('background-position','-155px -20px');
				 $('#news-center-tabs ul li a.old-news').css('background-position','0 -20px');				 
			 }
			 
			 return false;			 
			 }
			 
		});
		//----------------------------------------------------------------------------
// Latest-Old news Tabs: ---------------------------------------------

// Articles---------------------------------------
$( "#articles" ).accessNews({	        
	        speed : "normal",
			slideBy : 2
	        });		 

// Tooltips

$("#top-news-controls li a").each(function(){	
				if( this.hash == "#flash-news-8" ){
					return false;
				}
				/*if($(this).hasClass('selected')){ return false; }*/
				else{										 
				$(this).simpletip({ showEffect: 'slide', hideEffect: 'slide', position: [0,-80], offset: [0,20], content: $(this).next(".tooltip-content")});
				}
});

// The Gallery Code ---------------------------------------
	$('#imgs-thumbs li').each(function(idx) {
        $(this).data('index', (++idx));
    });   
    
    function initCallbackFunction(carousel) {
        $('#img-display').bind('image-loaded',function() {
            var idx =  $('#imgs-thumbs li.active').data('index') - 2; 
            return false;
        });
    };

    // load and fade-in thumbnails
    $('#imgs-thumbs li img').css('opacity', 0).each(function() {    
        if (this.complete || this.readyState == 'complete') { $(this).animate({'opacity': 1}, 300) } 
        else { $(this).load(function() { $(this).animate({'opacity': 1}, 300) }); }
    });

    
    $('#imgs-thumbs').galleria({
        // #img is the empty div which holds full size images
        insert: '#img-display',
        
        // enable history plugin
        history: true,
        
        // function fired when the image is displayed
        onImage: function(image, caption, thumb) {        
            // fade in the image 
            image.hide().fadeIn(500);
            
            // animate active thumbnail's opacity to 1, other list elements to 0.6
            thumb.parent().fadeTo(200, 1).siblings().fadeTo(200, 0.6)
            
            // $('#img').data('currentIndex', $li.data('index')).trigger('image-loaded')
            
            $('#img-display')
                .trigger('image-loaded')
                .hover(
                    function(){ $('#img-display .caption').stop().animate({height: 25}, 250) },
                    function(){ 
                        if (!$('#show-caption').is(':checked')) {
                            $('#img-display .caption').stop().animate({height: 0}, 250) 
                        }
                    }
                );
        },
        
        // function similar to onImage, but fired when thumbnail is displayed
        onThumb: function(thumb) {
            var $li = thumb.parent(),
                opacity = $li.is('.active') ? 1 : 0.6;
            
            // hover effects for list elements
            $li.hover(
                function() { $li.fadeTo(200, 1); },
                function() { $li.not('.active').fadeTo(200, opacity); }
            )
        }        
    }).find('li:first').addClass('active') // display first image when Galleria is loaded
    
// Even More News Tabs **********************************************************************************************
	$("#even-more-news-tabs").tabs("#even-more-news-tabs-container > div");
	
		
		// Mouse Hover Event..........................................................
		$('#even-more-news-tabs li a').mouseover(function(){
				
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#even-more-news-1')
					 {
						 $(this).css('background-position','-400px -35px');
					 }
					 
					 else if(this.hash == '#even-more-news-2')
					 {
						 $(this).css('background-position','-300px -35px');
					 }
					 
					 
					 else if(this.hash == '#even-more-news-3')
					 {
						 $(this).css('background-position','-200px -35px');						 
					 }
					 
					  else if(this.hash == '#even-more-news-4')
					 {
						 $(this).css('background-position','-100px -35px');						
					 }
					 
					 else if(this.hash == '#even-more-news-5')
					 {
						 $(this).css('background-position','0 -35px');						
					 }
					 
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Out Event----------------------------------------------------------------------------
		$('#even-more-news-tabs li a').mouseout(function(){
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#even-more-news-1')
					 {
						 $(this).css('background-position','-400px 0');
					 }
					 
					 else if(this.hash == '#even-more-news-2')
					 {
						 $(this).css('background-position','-300px 0');
					 }
					 
					 
					 else if(this.hash == '#even-more-news-3')
					 {
						 $(this).css('background-position','-200px 0');						 
					 }
					 
					  else if(this.hash == '#even-more-news-4')
					 {
						 $(this).css('background-position','-100px 0');						
					 }	
					 
					 else if(this.hash == '#even-more-news-5')
					 {
						 $(this).css('background-position','0 0');						
					 }				 
					 
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Click Event----------------------------------------------------------------------------
		$('#even-more-news-tabs li a').click(function(){
			 if($(this).hasClass('selected')){
				return false;
			 }
			 else
			 {
			 $('#even-more-news-tabs li a').removeClass('selected')
			 
			 if(this.hash =='#even-more-news-1')
			 {
				 $(this).addClass('selected');
				 $('#even-more-news-tabs li a#more-news-1').css('background-position','-400px -70px');
				 $('#even-more-news-tabs li a#more-news-2').css('background-position','-300px 0');
				 $('#even-more-news-tabs li a#more-news-3').css('background-position','-200px 0');
				 $('#even-more-news-tabs li a#more-news-4').css('background-position','-100px 0');
				 $('#even-more-news-tabs li a#more-news-5').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#even-more-news-2')
			 {
				 $(this).addClass('selected');
			 	 $('#even-more-news-tabs li a#more-news-1').css('background-position','-400px 0');
				 $('#even-more-news-tabs li a#more-news-2').css('background-position','-300px -70px');
				 $('#even-more-news-tabs li a#more-news-3').css('background-position','-200px 0');
				 $('#even-more-news-tabs li a#more-news-4').css('background-position','-100px 0');
				 $('#even-more-news-tabs li a#more-news-5').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#even-more-news-3')
			 {
				 $(this).addClass('selected');
				 $('#even-more-news-tabs li a#more-news-1').css('background-position','-400px 0');
				 $('#even-more-news-tabs li a#more-news-2').css('background-position','-300px 0');
				 $('#even-more-news-tabs li a#more-news-3').css('background-position','-200px -70px');
				 $('#even-more-news-tabs li a#more-news-4').css('background-position','-100px 0');
				 $('#even-more-news-tabs li a#more-news-5').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#even-more-news-4')
			 {
				 $(this).addClass('selected');
				 $('#even-more-news-tabs li a#more-news-1').css('background-position','-400px 0');
				 $('#even-more-news-tabs li a#more-news-2').css('background-position','-300px 0');
				 $('#even-more-news-tabs li a#more-news-3').css('background-position','-200px 0');
				 $('#even-more-news-tabs li a#more-news-4').css('background-position','-100px -70px');
				 $('#even-more-news-tabs li a#more-news-5').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#even-more-news-5')
			 {
				 $(this).addClass('selected');
				 $('#even-more-news-tabs li a#more-news-1').css('background-position','-400px 0');
				 $('#even-more-news-tabs li a#more-news-2').css('background-position','-300px 0');
				 $('#even-more-news-tabs li a#more-news-3').css('background-position','-200px 0');
				 $('#even-more-news-tabs li a#more-news-4').css('background-position','-100px 0');
				 $('#even-more-news-tabs li a#more-news-5').css('background-position','0 -70px');
			 }
			 
			 return false;
			 
			 }
			
		});
		
// Other News Tabs **********************************************************************************************
	$("#other-news-tabs").tabs("#other-news-tabs-container > div");
	
		
		// Mouse Hover Event..........................................................
		$('#other-news-tabs li a').mouseover(function(){
				
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#other-news-1')
					 {
						 $(this).css('background-position','-300px -35px');
					 }
					 
					 else if(this.hash == '#other-news-2')
					 {
						 $(this).css('background-position','-200px -35px');
					 }
					 
					 
					 else if(this.hash == '#other-news-3')
					 {
						 $(this).css('background-position','-100px -35px');						 
					 }
					 
					  else if(this.hash == '#other-news-4')
					 {
						 $(this).css('background-position','0px -35px');						
					 }
					 
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Out Event----------------------------------------------------------------------------
		$('#other-news-tabs li a').mouseout(function(){
				if($(this).hasClass('selected') == false)
				{				
					
					if(this.hash =='#other-news-1')
					 {
						 $(this).css('background-position','-300px 0');
					 }
					 
					 else if(this.hash == '#other-news-2')
					 {
						 $(this).css('background-position','-200px 0');
					 }
					 
					 
					 else if(this.hash == '#other-news-3')
					 {
						 $(this).css('background-position','-100px 0');						 
					 }
					 
					  else if(this.hash == '#other-news-4')
					 {
						 $(this).css('background-position','-0 0');						
					 }					 
					 
					 return false;
				}
		});
		//----------------------------------------------------------------------------
		
		// Mouse Click Event----------------------------------------------------------------------------
		$('#other-news-tabs li a').click(function(){
			 if($(this).hasClass('selected')){
				return false;
			 }
			 else
			 {
			 $('#other-news-tabs li a').removeClass('selected')
			 
			 if(this.hash =='#other-news-1')
			 {
				 $(this).addClass('selected');
				 $('#other-news-tabs li a#other-news-1').css('background-position','-300px -70px');
				 $('#other-news-tabs li a#other-news-2').css('background-position','-200px 0');
				 $('#other-news-tabs li a#other-news-3').css('background-position','-100px 0');
				 $('#other-news-tabs li a#other-news-4').css('background-position','0 0');
				 
			 }
			 
			 else if(this.hash == '#other-news-2')
			 {
				 $(this).addClass('selected');
			 	 $('#other-news-tabs li a#other-news-1').css('background-position','-300px 0');
				 $('#other-news-tabs li a#other-news-2').css('background-position','-200px -70px');
				 $('#other-news-tabs li a#other-news-3').css('background-position','-100px 0');
				 $('#other-news-tabs li a#other-news-4').css('background-position','0 0');
			 }
			 
			 else if(this.hash == '#other-news-3')
			 {
				 $(this).addClass('selected');
				 $('#other-news-tabs li a#other-news-1').css('background-position','-300px 0');
				 $('#other-news-tabs li a#other-news-2').css('background-position','-200px 0');
				 $('#other-news-tabs li a#other-news-3').css('background-position','-100px -70px');
				 $('#other-news-tabs li a#other-news-4').css('background-position','0 0');
			 }
			 
			  else if(this.hash == '#other-news-4')
			 {
				 $(this).addClass('selected');
				 $('#other-news-tabs li a#other-news-1').css('background-position','-300px 0');
				 $('#other-news-tabs li a#other-news-2').css('background-position','-200px 0');
				 $('#other-news-tabs li a#other-news-3').css('background-position','-100px 0');
				 $('#other-news-tabs li a#other-news-4').css('background-position','0 -70px');
			 }
			 
			 return false;
			 
			 }
			
		});
		
// Editions page -------------------------------------------------------------------------------

	/* $("div#editions").scrollable({ 
             
        // items are auto-scrolled in 2 secnod interval 
        interval: 5000, 
         
        // when last item is encountered go back to first item 
        loop: true,  
         
        // make animation a little slower than the default 
        speed: 500, 
		
		vertical:true,
		
        size: 1,
         
        // when seek starts make items little transparent 
        onBeforeSeek: function() { 
            this.getItems().fadeTo(500, 0.5);         
        }, 
         
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(500, 1); 
        }
    });*/
	
/* ------------------------------------------------------------------------
	s3Slider
	
	Developped By: Boban Kariik -> http://www.serie3.info/
        CSS Help: Mészáros Róbert -> http://www.perspectived.com/
	Version: 1.0
	
	Copyright: Feel free to redistribute the script/modify it, as
			   long as you leave my infos at the top.
------------------------------------------------------------------------- */


(function($){  

    $.fn.sSlider = function(vars) {       
        
        var element     = this;
        var timeOut     = (vars.timeOut != undefined) ? vars.timeOut : 8000;
        var current     = null;
        var timeOutFn   = null;
        var faderStat   = true;
        var mOver       = false;
        var items       = $("#" + element[0].id + "Content ." + element[0].id + "Image");
        var itemsSpan   = $("#" + element[0].id + "Content ." + element[0].id + "Image span");
            
        items.each(function(i) {
    
            $(items[i]).mouseover(function() {
               mOver = true;
            });
            
            $(items[i]).mouseout(function() {
                mOver   = false;
                fadeElement(true);
            });
            
        });
        
        var fadeElement = function(isMouseOut) {
            var thisTimeOut = (isMouseOut) ? (timeOut/2) : timeOut;
            thisTimeOut = (faderStat) ? 10 : thisTimeOut;
            if(items.length > 0) {
                timeOutFn = setTimeout(makeSlider, thisTimeOut);
            } else {
                console.log("Poof..");
            }
        }
        
        var makeSlider = function() {
            current = (current != null) ? current : items[(items.length-1)];
            var currNo      = jQuery.inArray(current, items) + 1
            currNo = (currNo == items.length) ? 0 : (currNo - 1);
            var newMargin   = $(element).width() * currNo;
            if(faderStat == true) {
                if(!mOver) {
                    $(items[currNo]).fadeIn((timeOut/6), function() {
                        if($(itemsSpan[currNo]).css('bottom') == 0) {
                            $(itemsSpan[currNo]).fadeIn((timeOut/6), function() {
                                faderStat = false;
                                current = items[currNo];
                                if(!mOver) {
                                    fadeElement(false);
                                }
                            });
                        } else {
                            $(itemsSpan[currNo]).fadeIn((timeOut/6), function() {
                                faderStat = false;
                                current = items[currNo];
                                if(!mOver) {
                                    fadeElement(false);
                                }
                            });
                        }
                    });
                }
            } else {
                if(!mOver) {
                    if($(itemsSpan[currNo]).css('bottom') == 0) {
                        $(itemsSpan[currNo]).fadeOut((timeOut/6), function() {
                            $(items[currNo]).fadeOut((timeOut/6), function() {
                                faderStat = true;
                                current = items[(currNo+1)];
                                if(!mOver) {
                                    fadeElement(false);
                                }
                            });
                        });
                    } else {
                        $(itemsSpan[currNo]).fadeIn((timeOut/6), function() {
                        $(items[currNo]).fadeOut((timeOut/6), function() {
                                faderStat = true;
                                current = items[(currNo+1)];
                                if(!mOver) {
                                    fadeElement(false);
                                }
                            });
                        });
                    }
                }
            }
        }
        
        makeSlider();

    };  

})(jQuery);
	
	
/*	
$(document).ready(function() {
        $('#slider').sSlider({
            timeOut: 5000
        });
});	
*/
	
	
	 
// Poll results.....................................................
$("#poll-form #poll-submit").click(function(){
	alert("Form has been submitted!");
	return false;
});

//ie6 note **************************************************

$("#ie6-note .ie6-colse-btn").click(function(){
			$(this).parent().remove();			
		});	

//----------------------------------------------------------------------- Font Resizer
	$('#font-control a').click(function(){
		var currFontSize = $('#master-mid-column').css('font-size');
		var finalNum = parseFloat(currFontSize, 10);
        var stringEnding = currFontSize.slice(-2);
		if(this.id =='maximize-font'){				
				finalNum *= 1.2;
		}
		else if(this.id =='minimize-font'){
			finalNum /=1.2;
		}
		$('#master-mid-column').css('fontSize', finalNum + stringEnding);
		return false;
	});


//----------------------------------------------------------------------- Add comment btn
$('#add-comment').click(function(){	
	$('#add-comment-form').toggle();
	return false;

});


});


/*

///////////////////////// Comment ////////////////////////////
$(function(){
		   
	$('#commentAdd').click(function(){
		$('#pollFormSendComment').toggle(1000);
		$('#commentCancel').toggle();
		$('#commentAdd').toggle();
	});
	$('#commentCancel').click(function(){
		$('#pollFormSendComment').toggle(1000);
		$('#commentAdd').toggle();
		$('#commentCancel').toggle();
	});
	
});





///////////////////////// Tahni ////////////////////////////
$(function(){
		   
	$('#commentAdd4').click(function(){
		$('#guestFormSendComment4').toggle(1000);
		$('#commentCancel4').toggle();
		$('#commentAdd4').toggle();
	});
	$('#commentCancel4').click(function(){
		$('#guestFormSendComment4').toggle(1000);
		$('#commentAdd4').toggle();
		$('#commentCancel4').toggle();
	});
	
});

///////////////////////// Comment ////////////////////////////
$(function(){
		   
	$('#commentAdd').click(function(){
		$('#pollFormSendComment').toggle(1000);
		$('#commentCancel').toggle();
		$('#commentAdd').toggle();
	});
	$('#commentCancel').click(function(){
		$('#pollFormSendComment').toggle(1000);
		$('#commentAdd').toggle();
		$('#commentCancel').toggle();
	});
	
});




///////////////////////// GuestComment ////////////////////////////
$(function(){
		   
	$('#commentAdd2').click(function(){
		$('#guestFormSendComment').toggle(1000);
		$('#commentCancel2').toggle();
		$('#commentAdd2').toggle();
	});
	$('#commentCancel2').click(function(){
		$('#guestFormSendComment').toggle(1000);
		$('#commentAdd2').toggle();
		$('#commentCancel2').toggle();
	});
	
});


*/




///////////////////////// Social ////////////////////////////

function showTab(id){
	document.getElementById("tab_1").style.display = "none";
	document.getElementById("tab_2").style.display = "none";
	document.getElementById("tab_" + id).style.display = "block";
}

function changeImg(tab){
	switch (tab)
	{
		case "tab_1":
		document.getElementById("tab_1_inactive").style.display = "none";
		document.getElementById("tab_1_active").style.display = "block";
		document.getElementById("tab_2_inactive").style.display = "block";
		document.getElementById("tab_2_active").style.display = "none";
		break;
		case "tab_2":
		document.getElementById("tab_1_inactive").style.display = "block";
		document.getElementById("tab_1_active").style.display = "none";
		document.getElementById("tab_2_inactive").style.display = "none";
		document.getElementById("tab_2_active").style.display = "block";
		break;
		
	}
}