/* Copyright (C) 2007 - 2010 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

var WarpTemplate = {
		
	start: function() {

		/* Accordion menu */
		new Warp.AccordionMenu('div#middle ul.menu li.toggler', 'ul.accordion', { accordion: 'default' }); /*efilip easycomtech 21.12.2010 changed from 'slide' in order to close one tab when another item (tab) is clicked at the left menu*/

		/* Dropdown menu */
		var dropdown = new Warp.Menu('menu', { mode: 'height', duration: 300, dropdownSelector: 'div.dropdown', transition: Fx.Transitions.Expo.easeOut, fancy:{mode: 'fade', transition: Fx.Transitions.Back.easeOut, duration: 300} });
		//dropdown.matchHeight();
		
		/* set hover color */
		switch (Warp.Settings.color) {
			case 'plainflowers':
				var submenuEnter = '#F4F4F3';
				var submenuLeave = '#F9F9F8';
				break;
			default:
				var submenuEnter = '#EDEDEE';
				var submenuLeave = '#F7F7F8';
		}

		/* Morph: sub menu - level1 (bg) */
		var submenuEnter = { 'background-color': submenuEnter };
		var submenuLeave = { 'background-color': submenuLeave };

		new Warp.Morph('div.mod-shadowbox ul.menu li.level1', submenuEnter, submenuLeave,
			{ transition: Fx.Transitions.linear, duration: 0 },
			{ transition: Fx.Transitions.sineIn, duration: 300 });

		/* Smoothscroll */
		new SmoothScroll({ duration: 500, transition: Fx.Transitions.Expo.easeOut });

		/* Match height of div tags */
		Warp.Base.matchHeight('div.headerbox div.deepest', 20);
		Warp.Base.matchHeight('div.topbox div.deepest', 20);
		Warp.Base.matchHeight('#bottom div.bottombox div.deepest', 20);
		Warp.Base.matchHeight('#bottom2 div.bottombox div.deepest', 20);
		Warp.Base.matchHeight('div.maintopbox div.deepest', 20);
		Warp.Base.matchHeight('div.mainbottombox div.deepest', 20);
		Warp.Base.matchHeight('div.contenttopbox div.deepest', 20);
		Warp.Base.matchHeight('div.contentbottombox div.deepest', 20);
		Warp.Base.matchHeight('#left, #right, div.right-3, div.left-3', 20);
	}

};

/* Add functions on window load */
window.addEvent('domready', WarpTemplate.start);

