// redefine Cycle's updateActivePagerLink function 
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
    $(pager).find('li').removeClass('activeLI') 
        .filter('li:eq('+currSlideIndex+')').addClass('activeLI'); 
}; 

$(function(){
	
$("div#partnership_switcher").show();
$("div#partnership_switcher select").change(function() {
	window.location = $(this).find("option:selected").val();
});

$("#cc_switcher").show();
$("#cc_switcher").change(function() {
	window.location = $(this).find("option:selected").val();
});
	
	
$(".panel-no-js").hide();
$(".slider-wrap").show();
$('#panelContainer').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
	speed: 500,
    timeout: 10000, 
	pagerEvent: 'mouseover',
    pager:  '#nav',
    pauseOnPagerHover: true , 
    pagerAnchorBuilder: function(idx, slide) { 
        return '#nav li:eq(' + idx + ')'; 
    }	
	});	

    $("#nav li").hover(
      function () {
        $(this).addClass("hover");
      }, 
      function () {
        $(this).removeClass("hover");
      }
    );

/*
$('div.main_content a').filter(function() {
    return this.hostname && this.hostname !== location.hostname;
  }).addClass('external_link');
*/

$("div.main_content a[href$='.doc'], div.main_content a[href$='.docx']").each(function() {
	$(this).addClass('word');
});
$("div.main_content a[href$='.ppt'], div.main_content a[href$='.pptx']").each(function() {
	$(this).addClass('ppoint');
});
$("div.main_content a[href$='.xls'], div.main_content a[href$='.xlsx']").each(function() {
	$(this).addClass('excel');
});
$("div.main_content a[href$='.pdf']").each(function() {
	$(this).addClass('pdf');
});

var noUpcoming = $('.partnership_upcoming .upcoming').is(':empty');
if (noUpcoming) {
	$('.partnership_upcoming .upcoming').remove();
}
			
});
