/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */
var footerFix;
(function($){

	$(document).bind('ready', function() {

		// Accordion menu
		$('.menu-sidebar').accordionMenu({ mode:'slide' });

		// Dropdown menu
		$('#menu').dropdownMenu({ mode: 'slide', dropdownSelector: 'div.dropdown'});

		// Smoothscroller
		$('a[href="#page"]').smoothScroller({ duration: 500 });

		// Fix Browser Rounding
		$('.grid-block').matchWidth('.grid-h');

		// Match height of div tags
		var matchHeight = function(){
			$('#top-a .grid-h').matchHeight('.deepest');
			$('#top-b .grid-h').matchHeight('.deepest');
			$('#bottom-a .grid-h').matchHeight('.deepest');
			$('#bottom-b .grid-h').matchHeight('.deepest');
			$('#innertop .grid-h').matchHeight('.deepest');
			$('#innerbottom .grid-h').matchHeight('.deepest');
			$('#maininner, #sidebar-a, #sidebar-b').matchHeight();
			$('#block-main').matchHeight();
			
		};
		
		matchHeight();

		$(window).bind("load", matchHeight);
		
		// $('.accordion h1').click(function(){
		// 	if( $(this).next().is(':hidden') )
		// 	{
		// 		$('.accordion h1').removeClass('active').next().slideUp();		
		// 		$(this).addClass('active').next().slideDown();
		// 	}
		// 	return false;
		// }).next().slideUp();

		footerHide = function(){
			
			$('footer').fadeTo(250, 0);
			return $('footer');
		}


		footerFix = function(){
			
			if ($('footer').height() == 81)
				$('footer').height(80).fadeTo(250, 1);
			else
				$('footer').height(81).fadeTo(250, 1);		
			return $('footer');
		}
		$(window).bind("load", footerFix);

	});
	

})(jQuery);

