//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);
};


$(document).ready(function(){
//disjointed rollover function starting point
	
	$("#main_logo .calgary").hide();
	$("#main_logo .edmonton").hide();
	$("#main_logo .montreal").hide();
	$("#main_logo .ottawa").hide();
	$("#main_logo .toronto").hide();
	$("#main_logo .vancouver").hide();
		
	$("#btn_montreal a").mouseover(function(){
		$("#main_logo .calgary").hide();
		$("#main_logo .edmonton").hide();
		$("#main_logo .montreal").fadeToggle();
		$("#main_logo .ottawa").hide();
		$("#main_logo .toronto").hide();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").hide();
		$(this).css({"background-position":"0px -251px"});
		$("#btn_montreal11_over a").css({"background-position":"-116px 7px"});
	});
	
	$("#btn_montreal a").mouseout(function(){
		$(this).css({"background-position":"0px 0px"});	
		$("#btn_montreal11_over a").css({"background-position":"-78px 7px"});
	});
	
	
	
	
	$("#btn_montreal10_over a").mouseover(function(){
		$(this).css({"background-position":"-38px 7px"});
		
		$("#btn_montreal a").css({"background-position":"0px -251px"});
	})
	$("#btn_montreal10_over a").mouseout(function(){
		$(this).css({"background-position":"0px 7px"});										  
	})
	
	$("#btn_montreal11_over a").mouseover(function(){
		$(this).css({"background-position":"-116px 7px"});
		$("#btn_montreal a").css({"background-position":"0px -251px"});	
	});
	
	
	$("#btn_ottawa a").mouseover(function(){
		$("#main_logo .calgary").hide();
		$("#main_logo .edmonton").hide();
		$("#main_logo .montreal").hide();
		$("#main_logo .ottawa").fadeToggle();
		$("#main_logo .toronto").hide();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").hide();
		
		$(this).css({"background-position":"0px -248px"});
		$("#btn_ottawa11_over a").css({"background-position":"-116px 7px"});
	});
	
	$("#btn_ottawa a").mouseout(function(){
		$(this).css({"background-position":"0px 0px"});	
		$("#btn_ottawa11_over a").css({"background-position":"-78px 7px"});
	});
	
	
	$("#btn_ottawa11_over a").mouseover(function(){
		$(this).css({"background-position":"-116px 7px"});
		$("#btn_ottawa a").css({"background-position":"0px -248px"});	
	});
	
	
	
	
	
	$("#btn_ottawa10_over a").mouseover(function(){
		$(this).css({"background-position":"-38px 7px"});
		$("#btn_ottawa a").css({"background-position":"0px -248px"});
	})
	$("#btn_ottawa10_over a").mouseout(function(){
		$(this).css({"background-position":"0px 7px"});
		
	})

	$("#main_logo, #bottom_area, #right_column, #left_border, #btn_other").mouseover(function(){
		$("#main_logo .calgary").hide();
		$("#main_logo .edmonton").hide();
		$("#main_logo .montreal").hide();
		$("#main_logo .ottawa").hide();
		$("#main_logo .toronto").hide();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").fadeIn();
	});
	
	$("ul#dropdown_2009, ul#dropdown_other").hide();

	$("#droplink, #dropdown_2009").mouseover( function() {
		$("#dropdown_2009").show();
	});

	$("#droplink, #dropdown_2009").mouseout( function() {
		$("#dropdown_2009").hide();
	});;
	
	$("#btn_other, #dropdown_other").mouseover( function() {
		$("#dropdown_other").show();
	});

	$("#btn_other, #dropdown_other").mouseout( function() {
		$("#dropdown_other").hide();
	});;
	
});
