//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_calgary a").mouseover(function(){
		$("#main_logo .calgary").fadeToggle();
		$("#main_logo .edmonton").hide();
		$("#main_logo .montreal").hide();
		$("#main_logo .ottawa").hide();
		$("#main_logo .toronto").hide();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").hide();
		$("#calgaryd").hide();
		
	});
	
	$("#btn_calgary a").mouseout(function(){
		$("#calgaryd").hide();								  
								  
	});
	
	$("#calgaryd").mouseover(function(){
		$(this).show();
		$("#btn_calgary").css({"background-position": "-0px -47px"});
				  
	});
	
	$("#calgaryd").mouseout(function(){
		$(this).hide();
		$("#btn_calgary").css({"background-position": "-0px -0px"});
		
		
	});
	
	$("#cl_2010 a").mouseover(function(){
		$("#calgaryd").css({"background-position":"0px -59px"});						  
		//$("#calgaryd").show();			  
	});
	
	
	$("#cl_2011").mouseover(function(){
		$("#calgaryd").css({"background-position":"0px 0px"});			  
	});
	$("#cl_2011").mouseout(function(){
				  
	});

	$("#btn_edmonton a").mouseover(function(){
		$("#main_logo .calgary").hide();
		$("#main_logo .edmonton").fadeToggle();
		$("#main_logo .montreal").hide();
		$("#main_logo .ottawa").hide();
		$("#main_logo .toronto").hide();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").hide();
		$("#edmontond").show();
	});
	$("#btn_edmonton a").mouseout(function(){
		$("#edmontond").hide();								  
								  
	});
	
	$("#edmontond").mouseover(function(){
		
		$(this).show();
		$("#btn_edmonton").css({"background-position": "-112px -47px"});		  
	});
	
	$("#edmontond").mouseout(function(){
		$(this).hide();
		$("#btn_edmonton").css({"background-position": "-112px -0px"});
		
	});
	
	$("#ed_2010 a").mouseover(function(){
		$("#edmontond").css({"background-position":"0px -59px"});						  
		//$("#edmontond").show();			  
	});
	
	
	$("#ed_2011").mouseover(function(){
		$("#edmontond").css({"background-position":"0px 0px"});			  
	});
	$("#ed_2011").mouseout(function(){
				  
	});
	$("#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();
	});
	
	
	$("#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();
		$("#ottawad").show();
	});
	
	$("#btn_ottawa a").mouseout(function(){
		
		$("#ottawad").hide();
	});
	$("#ottawad").mouseover(function(){
		$(this).show();
		$("#btn_ottawa").css({"background-position": "-253px -47px"});
				  
	});
	
	$("#ottawad").mouseout(function(){
		$(this).hide();
		$("#btn_ottawa").css({"background-position": "-253px 0px"});
		
		
	});
	
	$("#ot_2010 a").mouseover(function(){
		$("#ottawad").css({"background-position":"0px -59px"});						  
		//$("#ottawad").show();			  
	});
	
	
	$("#ot_2011").mouseover(function(){
		$("#ottawad").css({"background-position":"0px 0px"});			  
	});
	$("#ot_2011").mouseout(function(){
				  
	});
	
	
	$("#btn_toronto a").mouseover(function(){
		$("#main_logo .calgary").hide();
		$("#main_logo .edmonton").hide();
		$("#main_logo .montreal").hide();
		$("#main_logo .ottawa").hide();
		$("#main_logo .toronto").fadeToggle();
		$("#main_logo .vancouver").hide();
		$("#main_logo .home").hide();
		$("#torontod").show();
	});
	$("#btn_toronto a").mouseout(function(){
		$("#torontod").hide();								  
								  
	});
	
	$("#torontod").mouseover(function(){
		$(this).show();
		$("#btn_toronto").css({"background-position": "-353px -47px"});	  
	});
	
	$("#torontod").mouseout(function(){
		$(this).hide();
		$("#btn_toronto").css({"background-position": "-353px -0px"});	 
		
		
	});
	
	$("#to_2010 a").mouseover(function(){
		$("#torontod").css({"background-position":"0px -59px"});						  
		//$("#torontod").show();			  
	});
	
	
	$("#to_2011").mouseover(function(){
		$("#torontod").css({"background-position":"0px 0px"});			  
	});
	$("#to_2011").mouseout(function(){
				  
	});
	
	$("#btn_vancouver a").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").fadeToggle();
		$("#main_logo .home").hide();
		$("#vancouverd").show();
	});
	$("#btn_vancouver a").mouseout(function(){
		$("#vancouverd").hide();								  
								  
	});
	
	$("#vancouverd").mouseover(function(){
		$(this).show();
		$("#btn_vancouver").css({"background-position": "-353px -47px"});	  
				  
	});
	
	$("#vancouverd").mouseout(function(){
		$(this).hide();
		$("#btn_vancouver").css({"background-position": "-353px 0px"});
		
		
	});
	
	$("#va_2010 a").mouseover(function(){
		$("#vancouverd").css({"background-position":"0px -59px"});						  
		//$("#vancouverd").show();			  
	});
	
	
	$("#va_2011").mouseover(function(){
		$("#vancouverd").css({"background-position":"0px 0px"});			  
	});
	$("#va_2011").mouseout(function(){
				  
	});
	
	
	
	$("#bottom_area, #left_column, #main_image, #dropdown, #titlebar, #footer_area").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").hide();

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

	$("#droplink, #dropdown_2009").mouseout( function() {
		$("#dropdown_2009").hide();
	});;
	
});
