// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){
	$('#menu-item-28,#menu-item-444,#menu-item-445,#menu-item-446').addClass("resource-menu-item");
	$('.resource-menu-item').hover(function(){
		$('.resource-menu-item').addClass("hovering");
	}, function(){
		$('.resource-menu-item').removeClass("hovering");
	});
	$('#menu-item-28 ul li.menu-item-2243').hover(function(){
		$('#menu-item-28 ul li.resource-menu-item').removeClass("hovering");
	});
	$('a.enlarge').fancybox({
		'overlayColor'          :       '#444',
		'overlayOpacity'        :       0.6
	});
	$('a.connect-with-us').fancybox({
		'width'                 :       320,
		'height'                :       660,
		'overlayColor'          :       '#444',
		'overlayOpacity'        :       0.6,
		'type'                  : 'iframe'
	});
	$('#partner a').fancybox({
		'width'                 :       570,
		'height'                :       660,
		'overlayColor'          :       '#444',
		'overlayOpacity'        :       0.6,
		'type'                  : 'iframe'
	});
	if ( $('body#home').is('*') ) {
		$('#cards').jshowoff({effect:'slideLeft', speed:8000, controls:false, hoverPause:false});
	}
});


$(window).load(function() {
	$('a.youtube').click(function(){
		var $destination = $(this).attr("href");
		$.fancybox({
			'href'              :       $destination,
			'width'				:		853,
			'height'			:		668,
			'overlayColor'      :       '#000',
			'overlayOpacity'    :       1.0,
			'type'              : 'swf'
		});
		return false;
	});
	$("#homepage-callouts div").hover(function(){
		$(this).css('cursor','pointer');
	}, function() {
		$(this).css('cursor','auto');
	});
	$("#callout-1,#callout-2").click(function(){
		window.location=$(this).find("a").attr("href");
		return false;
	});
	$('#callout-3').click(function(){
		var $destination = $(this).find("a").attr("href");
		$.fancybox({
			'href'              :       $destination,
			'width'				:		853,
			'height'			:		668,
			'overlayColor'      :       '#000',
			'overlayOpacity'    :       1.0,
			'type'              : 'swf'
		});
		return false;
	});
	$("ul.downloads li").hover(function(){
		$(this).css('cursor','pointer');
	}, function() {
		$(this).css('cursor','auto');
	});
	$("ul.downloads li.pdf").click(function(){
		window.open($(this).find("a").attr("href"), "download");
		return false;
	});
	$('ul.downloads li.mobile').click(function(){
		var $destination = $(this).find("a").attr("href");
		$.fancybox({
			'href'              :       $destination,
			'overlayColor'      :       '#444',
			'overlayOpacity'    :       0.6,
			'type'              : 'swf'
		});
	});
});

/* $(window).resize(function() {
	
}); */


