$(document).ready(function() { 
	
	fix_flash();   
	
    var options = {
        buildNavigation: false, 
        delay: 8000
    };

	$('#nav > li:odd').addClass('stripe');

    // Only set this option if the body has this class
    if ($('body').hasClass('partnerCharitiesDetail')) {
        options.autoPlay = false
    };

    $('#slideshow').show();
    $('#slider1').anythingSlider(options);

		
	$('div.slideshowImageText').show().css({ opacity: 0 });
	$('div.slideshowImage').hover(function() {
		$('div.slideshowImageText').stop(true).animate({ opacity: 1 }, 500);
		}, function() {
		    $('div.slideshowImageText').animate({ opacity: 0 }, 500);
		});
	
	var url = window.location.toString();
	
	$('#partnerCharities #slider1 li.panel .slideshowInfo a').each(function(index){
	   var myHref= $(this).attr('href');
	   if( url == myHref) {
	        $(this).closest("li").addClass('hello')
	        if(index==0){
	            $(this).closest("li").insertAfter("#partnerCharities #slider1 li:nth-child(2)");
	        }else{
	            $(this).closest("li").insertAfter("#partnerCharities #slider1 li:nth-child(1)");
	        }
	        return false;
	   }
	});
});
