$(document).ready(function() {

			$('#slider').delay(800).css({"left": "640px", "z-index" : 3}).animate({left: "0"}, 800);
			$('#slider').orbit({
				animation: 'horizontal-push',
				advanceSpeed: 6000, 
				bullets: true,
				bulletThumbs: true,
				bulletThumbLocation: ''
			});
			$('ul.orbit-bullets,div.timer').hide();
			$('.orbit-bullets').slideUp('500');
			$(".orbit-wrapper").hoverIntent({over: function() {
        			$('.orbit-bullets').slideDown('600');
        			$('div.slider-nav span.right').animate({right: "0"}, 600 );
        			$('div.slider-nav span.left').animate({left: "0"}, 600 );
      			}, timeout: 600, out: function() {
					$('.orbit-bullets').slideUp('600');
	        		$('div.slider-nav span.right').animate({right: "-78px"}, 600 );
        			$('div.slider-nav span.left').animate({left: "-78px"}, 600 );
      			}});
			$('.timer').delay(1000).fadeIn('100');
						

// Children menu function

var site = function() {
	this.linkLi = $('#header ul li').children('ul').hide().end();
	this.init();
};

site.prototype = {
 	
 	init : function() {
 		this.setMenu();
 	},
 	
 	// Enables the slidedown menu, and adds support for IE6
 	
 	setMenu : function() {
 
 	
 		this.linkLi.hoverIntent({over: function() {
 			// mouseover
			$(this).find('> ul').stop(true, true).fadeIn( 600, 'linear');
 		}, timeout: 200, out: function() {
 			// mouseout
 			$(this).find('> ul').stop(true, true).fadeOut( 400, 'linear'); 		
		}});
 		
 	}
 
}

new site();

// Fancybox
$("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({
			'padding': 0,
			'cyclic': true,
			'titleShow': false,
			'overlayColor': '#000',
			'overlayOpacity': 0.5,
			'centerOnScroll': true,
			'hideOnOverlayClick': true,
});

$("a.inline-team").fancybox({
			'padding': 15,
			'cyclic': true,
			'titleShow': false,
			'overlayColor': '#000',
			'overlayOpacity': 0.5,
			'centerOnScroll': true,
			'hideOnOverlayClick': true,
});

$("a.podcastOnline[title!='Not Available']").click(function() {
		$.fancybox({
			'padding': 0,
			'cyclic': true,
			'titleShow': false,
			'overlayColor': '#000',
			'overlayOpacity': 0.5,
			'centerOnScroll': true,
			'hideOnOverlayClick': true,
			'width': 640,
			'height': 360,
			'href': this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?title=0&amp;byline=0&amp;portrait=0&amp;color=fc000d&amp;fullscreen=1&amp;autoplay=1&amp;clip_id=$1'),
			'type': 'swf',
			'swf': {wmode: 'transparent', allowscriptaccess: 'always', allowfullscreen: 'true'}
		});

	return false;
});
	
// Page styling

$('#podcast:first').css("borderTop","none");
$('.search-res:odd').css("background","#f4f4f4");

$("#loc-links img").not(".actived").hoverIntent({over: function() {
 	var newSrc = $(this).attr("src").replace("inactive", "active");
  	$(this).attr("src", newSrc);
}, timeout: 100, out: function() {
    var newSrc = $(this).attr("src").replace("active", "inactive");
  	$(this).attr("src", newSrc);
}});

	
});
