// for div:hover action
(function($){$.fn.biggerlink=function(a){var b={hoverclass:'hover',clickableclass:'hot',follow:true};if(a){$.extend(b,a)}$(this).filter(function(){return $('a',this).length>0}).addClass(b.clickableclass).each(function(i){$(this).attr('title',$('a[title]:first',this).attr('title'));$(this).mouseover(function(){window.status=$('a:first',this).attr('href');$(this).addClass(b.hoverclass)}).mouseout(function(){window.status='';$(this).removeClass(b.hoverclass)}).bind('click',function(){$(this).find('a:first').trigger('click')}).find('a').bind('focus',function(){$(this).parents('.'+b.clickableclass).addClass(b.hoverclass)}).bind('blur',function(){$(this).parents('.'+b.clickableclass).removeClass(b.hoverclass)}).end().find('a:first').bind('click',function(e){if(b.follow==true){window.location=this.href}e.stopPropagation()}).end().find('a',this).not(':first').bind('click',function(){$(this).parents('.'+b.clickableclass).find('a:first').trigger('click');return false})});return this}})(jQuery);


//09.03.21 edited by odda
		  $(document).ready(function() {
			$("#open_all").hover(function(){
				$(this).css("cursor","pointer"); 
				$(this).css("color","#f90"); 
			},function(){
				$(this).css("cursor","default"); 
				$(this).css("color","#464646"); 
				});
			$("div.bldg_container").css("display","none");
			$("div.bldg_cat_container h2").hover(function(){
				$(this).css("cursor","pointer"); 
				$(this).css("background-color","#f90"); 
			},function(){
				$(this).css("cursor","default"); 
				$(this).css("background-color","#eee"); 
				});
			$("div.bldg_cat_container h2").click(function(){
				$(this).next().slideToggle("1000");
				});
			$("#availability").hover(function(){
				$(this).css("cursor","pointer"); 
				$(this).css("color","#f90"); 
			},function(){
				$(this).css("cursor","default"); 
				$(this).css("color","#464646"); 
				});
			$("#availability").toggle(function(){
			$("div.bldg_container").slideDown("1000");
			$("div.bldg_cat_container ul").not(".available").addClass("not_available");
			$(this).text("Display all buildings");
			$("#open_all").text("Hide all the areas").addClass("opened").removeClass("open");
			}, function() {
			$("ul").not(".available").removeClass("not_available");
			$(this).text("Display vacant buildings only");				
			});
			$("#open_all").click(function(){
			if($(this).is(".open")){
			$("ul").not(".available").removeClass("not_available");
			$("div.bldg_container").slideDown("1000");
			$(this).removeClass("open").addClass("opened").text("Hide all the areas");
			}else if($("#open_all").is(".opened")){
			$("div.bldg_container").slideUp("1000");
			$(this).removeClass("opened").addClass("open").text("Display all the areas");
			$("#availability").text("Display vacant buildings only");				
			}
			});
				$('ul.top').biggerlink();
		});
