//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT
// jQuery fadeToggle plugin
jQuery.fn.fadeToggle = function(s, fn){
	return (this.is(":visible"))
		? this.fadeOut(s, fn)
		: this.fadeIn(s, fn);
};


jQuery(function($){
	
    

    


	var labelHide = 'Click to hide content!';
	var labelShow = 'Click to show content!';
	$(".toggler").text(labelHide);
	$(".toggler").click(function(){
		var copy = $(".content").is(":visible") ?  labelShow : labelHide;
		$(".content").fadeToggle();
		$(this).text(copy);
	});
});


$(document).ready(function(){
						   
// hide years

		$("#alberta_2011 a").hide();
		$("#alberta_2010 a").hide();
		$("#alberta_btn").hide();
		$("#bc_2011 a").hide();
		$("#bc_2010 a").hide();
		$("#bc_btn").hide();
		$("#ontario_2011 a").hide();
		$("#ontario_2010 a").hide();
		$("#ontario_btn").hide();
		$("#quebec_2011 a").hide();
		$("#quebec_2010 a").hide();
		$("#quebec_btn").hide();
//disjointed rollover function starting point
	$(".menu .alberta").mouseover(function(){
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").fadeIn();
		$("#alberta_2011 a").show();
		$("#alberta_2010 a").show();
		$("#alberta_btn").show();
			$("#bc_2011 a").hide();
		$("#bc_2010 a").hide();
		$("#bc_btn").hide();
		$("#ontario_2011 a").hide();
		$("#ontario_2010 a").hide();
		$("#ontario_btn").hide();
		$("#quebec_2011 a").hide();
		$("#quebec_2010 a").hide();
		$("#quebec_btn").hide();
		$("#alberta_2011 a").css({"background-position": "0px -42px"});
		$(".alberta a").css({"background-position":"-195px -14px"});	
	});
	
	$(".menu .alberta").mouseout(function(){
			$("#alberta_2011 a").css({"background-position": "0px 0px"});	
			$(".alberta a").css({"background-position":"-16px -14px"});
	 });
											
										  
	$("#alberta_2011 a").mouseover(function(){
		$(".alberta a").css({"background-position":"-195px -14px"});					
		$(this).css({"background-position": "0px -42px"})
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").fadeIn();
	});
	
	$("#alberta_2011 a").mouseout(function(){
		$(this).css({"background-position": "0px 0px"});	
		$(".alberta a").css({"background-position":"-16px -14px"});
	});
	$("#alberta_2010 a").mouseover(function(){
			
		$(this).css({"background-position": "-64px -21px"});
		$(".alberta a").css({"background-position":"-195px -14px"});
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").fadeIn();
	});
	
	$("#alberta_2010 a").mouseout(function(){
		$(this).css({"background-position": "-64px 0px"});	
		$(".alberta a").css({"background-position":"-16px -14px"});
			});
	
	$(".menu .bc").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").fadeIn();
		$(".bc a").css({"background-position":"-194px -45px"});
		$("#bc_2011 a").css({"background-position":"0px -42px"});
		$("#alberta_2011 a").hide();
		$("#alberta_2010 a").hide();
		$("#alberta_btn").hide();
		$("#bc_2011 a").show();
		$("#bc_2010 a").show();
		$("#bc_btn").show();
		$("#ontario_2011 a").hide();
		$("#ontario_2010 a").hide();
		$("#ontario_btn").hide();
		$("#quebec_2011 a").hide();
		$("#quebec_2010 a").hide();
		$("#quebec_btn").hide();
	});
	
	$(".menu .bc").mouseout(function(){
		$("#bc_2011 a").css({"background-position": "0px 0px"});	
			$(".bc a").css({"background-position":"-16px -44px"});		
		});	
	$("#bc_2011 a").mouseover(function(){
		$(".bc a").css({"background-position":"-194px -45px"});					
		$(this).css({"background-position": "0px -42px"})
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").show();});
		
	$("#bc_2011 a").mouseout(function(){
		$(this).css({"background-position": "0px 0px"});	
		$(".bc a").css({"background-position":"-16px -44px"});
		});
	$("#bc_2010 a").mouseover(function(){
			
		$(this).css({"background-position": "-64px -21px"});
		$(".bc a").css({"background-position":"-194px -45px"});
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").show();
	});
	
	$("#bc_2010 a").mouseout(function(){
		$(this).css({"background-position": "-64px 0px"});	
		$(".bc a").css({"background-position":"-16px -44px"});
			});
	$(".menu .ontario").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").fadeIn();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		
		$("#ontario_2011 a").css({"background-position": "0px -42px"});
		$(".ontario a").css({"background-position":"-195px -75px"});
		$("#alberta_2011 a").hide();
		$("#alberta_2010 a").hide();
		$("#alberta_btn").hide();
		$("#bc_2011 a").hide();
		$("#bc_2010 a").hide();
		$("#bc_btn").hide();
		$("#ontario_2011 a").show();
		$("#ontario_2010 a").show();
		$("#ontario_btn").show();
		$("#quebec_2011 a").hide();
		$("#quebec_2010 a").hide();
		$("#quebec_btn").hide();
	});
	
	$(".menu .ontario").mouseout(function(){
			$("#ontario_2011 a").css({"background-position": "0px 0px"});	
			$(".ontario a").css({"background-position":"-16px -75px"});
	 });
											
										  
	$("#ontario_2011 a").mouseover(function(){
		$(".ontario a").css({"background-position":"-195px -75px"});					
		$(this).css({"background-position": "0px -42px"})
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").   				        hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").				        fadeIn();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
	});
	
	$("#ontario_2011 a").mouseout(function(){
		$(this).css({"background-position": "0px 0px"});	
		$(".ontario a").css({"background-position":"-16px -75px"});
										   
										   });
	$("#ontario_2010 a").mouseover(function(){
			
		$(this).css({"background-position": "-64px -21px"});
		$(".ontario a").css({"background-position":"-195px -75px"});
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").   				        hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").				        fadeIn();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
	});
	$("#ontario_2010 a").mouseout(function(){
		$(this).css({"background-position": "-64px 0px"});	
		$(".ontario a").css({"background-position":"-16px -75px"});
			});
	
	
	
	$(".menu .quebec").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").fadeIn();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$(".quebec a").css({"background-position":"-195px -105px"});
		$("#quebec_2011 a").css({"background-position":"0px -42px"});
		//$("#quebec_2010 a").css({"background-position":"-64px -21px"});
		$("#alberta_2011 a").hide();
		$("#alberta_2010 a").hide();
		$("#alberta_btn").hide();
		$("#bc_2011 a").hide();
		$("#bc_2010 a").hide();
		$("#bc_btn").hide();
		$("#ontario_2011 a").hide();
		$("#ontario_2010 a").hide();
		$("#ontario_btn").hide();
		$("#quebec_2011 a").show();
		$("#quebec_2010 a").show();
		$("#quebec_btn").show();
		
		
	});
	
	
	$(".menu .quebec").mouseout(function(){
										 
			$(".quebec a").css({"background-position":"-16px -105px"});	
			$("#quebec_2011 a").css({"background-position":"0px 0px"});
	});
	
	$("#quebec_2011 a").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").fadeIn();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$(".quebec a").css({"background-position":"-195px -105px"});
		$(this).css({"background-position":"0px -42px"}); });
									   
										   
	$("#quebec_2011 a").mouseout(function(){	
			$(".quebec a").css({"background-position":"-16px -105px"});	
			$(this).css({"background-position": "0px 0px"});							   
	});
	$("#quebec_2010 a").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").fadeIn();
		$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$(".quebec a").css({"background-position":"-195px -105px"});
		$(this).css({"background-position": "-64px -21px"}); });
	$("#quebec_2010 a").mouseout(function(){	
			$(".quebec a").css({"background-position":"-16px -105px"});	
			$(this).css({"background-position": "-64px 0px"});							   
	});
	
	$("#logo_main, #logo_sponsors, #bottom_container, #menu_2009, #nav_right").mouseover(function(){
		$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		$("#logo_main .bc, #logo_sponsors .bc, #bottom_container .bc").hide();
		$("#logo_main .ontario, #logo_sponsors .ontario, #bottom_container .ontario").hide();
		$("#logo_main .quebec, #logo_sponsors .quebec, #bottom_container .quebec").hide();
		//$("#logo_main .alberta, #logo_sponsors .alberta, #bottom_container .alberta").hide();
		//$("#logo_main .home, #logo_sponsors .home, #bottom_container .home").fadeIn();
		$("#ontario_2011 a").hide();
		$("#ontario_2010 a").hide();
		$("#ontario_btn").hide();
		$("#quebec_2011 a").hide();
		$("#quebec_2010 a").hide();
		$("#quebec_btn").hide();
		$("#bc_2011 a").hide();
		$("#bc_2010 a").hide();
		$("#bc_btn").hide();
		$("#alberta_2011 a").hide();
		$("#alberta_2010 a").hide();
		$("#alberta_btn").hide();
	});

	$("ul#dropdown_2009").hide();

	$(".quebec_2009, .alberta_2009, .ontario_2009, .bc_2009").mouseover( function() {
		$("ul#dropdown_2009").show();
	});
	
	$(".quebec_2009, .alberta_2009, .ontario_2009, .bc_2009").mouseout( function() {
		$("ul#dropdown_2009").hide();
	});
	
	$(".other_2009").mouseover( function() {
		$("ul#dropdown_2009").toggle();
	});
	
	$(".other_2009").mouseout( function() {
		$("ul#dropdown_2009").toggle();
	});
});
