/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 1a={19:6(Y,D){3 9=0;3 p=[];3 z=Y.1g(" ");3 V=z.1f();3 u=\'\';z.f(6(8,i){u+=\'.t("\'+8+\'")\'});$1c(V).f(6(k,i){1e(\'p.1d(k\'+u+\');\')});p.f(6(4,i){7(!$r(4))J;3 b,g;7(4.U){b=4.U;g=0;g+=4.m(\'10-Z\').n();g+=4.m(\'10-G\').n();b-=g;l=0;l+=4.m(\'14-Z-P\').n();l+=4.m(\'14-G-P\').n();b-=l}v 7(4.N.L){b=4.N.L}9=16.K(9,b)});7(D!=1b){9=16.K(9,D)}p.f(6(4,i){7(!$r(4))J;7(1l.1w){4.I(\'M\',9+\'O\')}v{4.I(\'1v-M\',9+\'O\')}})}};3 11=a 18({17:6(k,H,13,y,15,q){c.o({A:1u,Q:s.12.1y,T:S,C:\'\'},y);3 5=c.5;$$(k).f(6(8,i){3 E=8;7(q&&8.t(q)){E=8.t(q)}3 d=a s.1B(E,5);7(!($r(5.C)&&8.1A(5.C))){8.R(\'1h\',6(e){d.o(5,y).x(H)});8.R(\'1z\',6(e){d.o(5,15).x(13)})}})}});11.W(a F);3 X=a 18({17:6(5){c.o({Q:s.12.1x,A:1s,T:S,h:[\'#1t\',\'#1k\']},5);3 B=a 1j(1i.B);3 d=B.1m(c.5);3 j=0;3 h=c.5.h;3 1n=w.1r(c.5.A*2);w();6 w(){d.x({\'1q-1p\':h[j]});7(j+1>=h.1o){j=0}v{j++}}}});X.W(a F);',62,100,'|||var|div|options|function|if|el|maxHeight|new|divHeight|this|fx||each|divPadding|colors||index|element|divBorder|getStyle|toInt|setOptions|matchDivs|elementFx|chk|Fx|getElement|script|else|animate|start|enterFx|selectors|duration|body|ignoreClass|minWidth|elfx|Options|bottom|enter|setStyle|return|max|pixelHeight|height|style|px|width|transition|addEvent|false|wait|offsetHeight|elements|implement|YOOBackgroundFx|selector|top|padding|YOOMorph|Transitions|leave|border|leaveFx|Math|initialize|Class|matchDivHeight|YOOBase|undefined|ES|push|eval|shift|split|mouseenter|document|Element|999999|window|effects|timer|length|color|background|periodical|9000|FFFFFF|500|min|ie6|linear|expoOut|mouseleave|hasClass|Styles'.split('|'),0,{}))
/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 t=6 v({w:4(q,p,2){0.x({r:\'m\'},2);0.7=q;0.9=p;y(0.2.r){A\'z\':0.j();C;m:0.g()}},g:4(){5 2={};e(!$n(0.2.8)&&!$n(0.2.c)){2={c:-1}}$k(0.7).l(4(3,i){e(3.o(\'s\'))2={c:i}}.u(0));5 B=6 d.Q(0.7,0.9,$N(0.2,2))},j:4(){$k(0.7).l(4(3,i){5 a=3.h(\'a\');5 f=3.h(0.9);5 b=6 d.M(f,{D:d.P.R,L:K});e(!(3.o(\'s\')||0.2.8==\'F\'||0.2.8==i)){b.E()}a.G(\'H\',4(){b.J()})}.u(0))}});t.I(6 O);',54,54,'this||options|tog|function|var|new|togs|display|elms|span|fx|show|Fx|if|ul|createDefault|getElement||createSlide|ES|each|default|defined|hasClass|elements|togglers|accordion|active|YOOAccordionMenu|bind|Class|initialize|setOptions|switch|slide|case|accordionMenu|break|transition|hide|all|addEvent|click|implement|toggle|250|duration|Slide|extend|Options|Transitions|Accordion|linear'.split('|'),0,{}))
/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h 16=d R({1g:8(e,7){4.N({1e:1l.1s.1p,I:1n,1o:F,10:R.1q,f:1,g:\'n\',18:1t,W:[\'1j\',\'1f\',\'1d\',\'1k\',\'1i\',\'1h\',\'1m\',\'1v\'],U:\'6.1B\',T:\'6.V\'},7);4.e=$(e),4.c=4.e.Q(4.7.T);4.6=[];4.a=[];4.e.1C(4.7.U).Z(8(5,i){4.X(5,i);5.w(\'1E\',8(E){4.1b(E,5)}.k(4));5.w(\'1u\',8(){4.1c(5,i)}.k(4));b(4.7.g==\'n\'){5.w(\'S\',8(){4.G(4.c,i)}.k(4))}B{5.w(\'S\',8(){4.G(5,i)}.k(4))}}.k(4));b(4.7.g==\'n\'){b(4.c){4.r(4.c)}B{h s=4.e.Q(\'6\');s.Y(\'V\');s.Y(\'c\');4.r(s)}}},X:8(5,i){b(4.7.g==\'n\'&&i!=0)14;h K=\'u \'+\'P\'+(i+1);4.7.W.Z(8(H,i){b(5.1w(H)){K+=\' P-\'+H}});4.a[i]=d o(\'a\',{\'A\':\'u-1\'}).M(d o(\'a\',{\'A\':\'u-2\'}).M(d o(\'a\',{\'A\':\'u-3\'})));4.a[i].9=4.a[i].17(4.7);4.6[i]=d o(\'6\',{\'A\':K}).M(4.a[i]).1D(4.e);4.6[i].9=4.6[i].17(4.7)},r:8(5){4.6[0].1A({\'y\':5.j,\'z\':5.m,\'1z\':\'1F\',\'f\':4.7.f});4.c=5},1b:8(E,5){b(!4.c)4.r(5);4.c=5;4.7.10(d 1x(E),5)},1c:8(5,i){13(4.7.g){q\'12\':4.O(5,i,19);v;q\'1a\':4.J(5,i,19);v;11:4.L(5,0)}},G:8(5,i){13(4.7.g){q\'12\':4.O(5,i,F);v;q\'1a\':4.J(5,i,F);v;11:4.L(5,0)}},L:8(5,i){b(!4.c)14;4.6[i].9.l({\'y\':[4.6[i].j,5.j],\'z\':[4.6[i].m,5.m]})},O:8(5,i,D){b(D){4.6[i].9.N(4.7);4.6[i].9.C({\'y\':5.j,\'z\':5.m});4.6[i].9.l({\'f\':[0,1]})}B{h 15=4.7.I*2;4.6[i].9.N({I:15});4.6[i].9.l({\'f\':[1,0]})}},J:8(5,i,D){h x=4.7.18;b(D){4.6[i].9.C({\'f\':1,\'y\':5.j,\'z\':5.m});4.a[i].9.C({\'t-p\':x});4.a[i].9.l({\'t-p\':[x,0]})}B{4.a[i].9.C({\'t-p\':0});4.a[i].9.l({\'t-p\':[0,x]})}}});16.1r(d 1y);',62,104,'||||this|item|li|options|function|fx|div|if|current|new|menu|opacity|mode|var||offsetLeft|bind|custom|offsetWidth|move|Element|top|case|setCurrent|first|margin|fancy|break|addEvent|offset|left|width|class|else|set|show|event|false|mouseleaveItem|col|duration|slideFx|css|moveFx|adopt|setOptions|fadeFx|bg|getElement|Class|mouseleave|activeSelector|itemSelector|active|colorSelector|createBackground|addClass|each|onClick|default|fade|switch|return|dur|YOOFancyMenu|effects|slideOffset|true|slide|clickItem|mouseenterItem|blue|transition|pink|initialize|yellow|orange|red|green|Fx|lilac|500|wait|sineInOut|empty|implement|Transitions|30|mouseenter|turquoise|hasClass|Event|Options|visibility|setStyles|level1|getElements|injectInside|click|visible'.split('|'),0,{}))
/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('2 g=f q({u:6(e,7){9.x({i:\'w\',y:s,B:h.v.A,z:r},7);2 3={\'8\':0,\'a\':0,\'b\':0};t(9.7.i){j\'8\':3={\'8\':0,\'b\':0};m;j\'a\':3={\'a\':0,\'b\':0};m}$$(e).M(6(4){2 1=4.L(\'1\');k(1){2 5=f h.N(1,9.7);2 n=1.O(\'8\',\'a\',\'b\');1.l(3);4.Q({C:6(){2 c=4.K();k(c.J(\'d\')==\'p\')c.o(\'d\',\'E\');5.e.o(\'d\',\'p\');5.D(n)},F:6(){5.G();1.l(3)}})}}.I(9))}});g.H(f P);',53,53,'|ul|var|reset|li|fx|function|options|width|this|height|opacity|parent|overflow|element|new|YOODropdownMenu|Fx|mode|case|if|setStyles|break|styles|setStyle|hidden|Class|false|600|switch|initialize|Transitions|default|setOptions|duration|wait|linear|transition|mouseenter|start|visible|mouseleave|stop|implement|bind|getStyle|getParent|getElement|each|Styles|getStyles|Options|addEvents'.split('|'),0,{}))
/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

var YOOTools = {
		
	start: function() {
		
		/* Match height of div tags */
		YOOTools.setDivHeight();

		/* Accordion menu */
		new YOOAccordionMenu('div#middle ul.menu li.toggler', 'ul.accordion', { accordion: 'slide' });

		/* Fancy menu */
		//new YOOFancyMenu($E('ul', 'menu'), { mode: 'fade', transition: Fx.Transitions.linear, duration: 500 });

		/* Dropdown menu */
		new YOODropdownMenu('div#menu li.parent', { mode: 'height', transition: Fx.Transitions.Expo.easeOut });

		/* Morph: color settings */
		var page = $('page');
		
		var enterColor = '#B45046';
		if (page.hasClass('green'))     enterColor = '#97AF82';
		if (page.hasClass('pink'))      enterColor = '#B995B1';
		if (page.hasClass('orange'))    enterColor = '#D1934E';
		if (page.hasClass('blue'))      enterColor = '#639FB7';
		if (page.hasClass('yellow'))    enterColor = '#AEAC57';
		if (page.hasClass('lilac'))     enterColor = '#87829D';
		if (page.hasClass('turquoise')) enterColor = '#789696';
		if (page.hasClass('black'))     enterColor = '#3C372D';
		
		/* Morph: main menu - level1 (background) */
		var menuEnter = { 'background-color': enterColor };
		var menuLeave = { 'background-color': '#E6E6D2' };
		
		new YOOMorph('div#menu li.level1', menuEnter, menuLeave,
			{ transition: Fx.Transitions.linear, duration: 100, ignoreClass: 'active'},
			{ transition: Fx.Transitions.sineIn, duration: 300 }, '.level1');

		/* Morph: main menu - level2 and deeper (background) */
		menuEnter = { 'margin-left': 0, 'margin-right': 0, 'text-indent': 20 };
		menuLeave = { 'margin-left': 5, 'margin-right': 5, 'text-indent': 15 };
		
		var selector = 'div#menu li.level2 a, div#menu li.level2 span.separator';
		/* fix for Opera because Mootools 1.1 is not compatible with latest Opera version */
		if (window.opera) { selector = 'div#menu li.item1 li.level2 a, div#menu li.item1 li.level2 span.separator, div#menu li.item2 li.level2 a, div#menu li.item2 li.level2 span.separator, div#menu li.item3 li.level2 a, div#menu li.item3 li.level2 span.separator, div#menu li.item4 li.level2 a, div#menu li.item4 li.level2 span.separator, div#menu li.item5 li.level2 a, div#menu li.item5 li.level2 span.separator, div#menu li.item6 li.level2 a, div#menu li.item6 li.level2 span.separator, div#menu li.item7 li.level2 a, div#menu li.item7 li.level2 span.separator'; }
		
		new YOOMorph(selector, menuEnter, menuLeave,
			{ transition: Fx.Transitions.expoOut, duration: 0},
			{ transition: Fx.Transitions.sineIn, duration: 200 });
		
		/* Morph: main menu - level1 (color) */
		menuEnter = { 'color': '#ffffff' };
		menuLeave = { 'color': '#323232' };
		
		new YOOMorph('div#menu li.level1', menuEnter, menuLeave,
			{ transition: Fx.Transitions.linear, duration: 0, ignoreClass: 'active'},
			{ transition: Fx.Transitions.sineIn, duration: 200 }, '.level1');

		/* Morph: main menu - level1 subline (color) */
		menuEnter = { 'color': '#ffffff' };
		menuLeave = { 'color': '#646464' };
		
		new YOOMorph('div#menu li.level1', menuEnter, menuLeave,
			{ transition: Fx.Transitions.linear, duration: 0, ignoreClass: 'active'},
			{ transition: Fx.Transitions.sineIn, duration: 200 }, 'span.sub');

		/* Morph: sub menu (left/right) */
		submenuEnter = { 'margin-left': 0, 'margin-right': 0, 'padding-left': 5 };
		submenuLeave = { 'margin-left': 5, 'margin-right': 5, 'padding-left': 0 };

		new YOOMorph('div#middle ul.menu a, div#middle ul.menu span.separator', submenuEnter, submenuLeave,
			{ transition: Fx.Transitions.expoOut, duration: 0 },
			{ transition: Fx.Transitions.sineIn, duration: 200 });

		/* Morph: module (hover) */
		var moduleEnter = { 'background-color': '#F5F5E6'};
		var moduleLeave = { 'background-color': '#ffffff'};

		new YOOMorph('div.mod-hover div.box-2', moduleEnter, moduleLeave,
			{ transition: Fx.Transitions.expoOut, duration: 100 },
			{ transition: Fx.Transitions.sineIn, duration: 300 });

		/* Smoothscroll */
		new SmoothScroll({ duration: 500, transition: Fx.Transitions.Expo.easeOut });
	},

	/* Include script */
	include: function(library) {
		$ES('script').each(function(s, i){
			var src  = s.getProperty('src');
			var path = '';
			if (src && src.match(/yoo_tools\.js(\?.*)?$/)) path = src.replace(/yoo_tools\.js(\?.*)?$/,'');
			if (src && src.match(/template\.js\.php(\?.*)?$/)) path = src.replace(/template\.js\.php(\?.*)?$/,'');
			if (path != '') document.write('<script language="javascript" src="' + path + library + '" type="text/javascript"></script>');
		});
	},

	/* Match height of div tags */
	setDivHeight: function() {
		YOOBase.matchDivHeight('div.topbox div.deepest', 40);
		YOOBase.matchDivHeight('div.bottombox div.deepest', 40);
		YOOBase.matchDivHeight('div.maintopbox div.deepest', 40);
		YOOBase.matchDivHeight('div.mainbottombox div.deepest', 40);
		YOOBase.matchDivHeight('div.contenttopbox div.deepest', 40);
		YOOBase.matchDivHeight('div.contentbottombox div.deepest', 40);
	}

};

/* Add functions on window load */
window.addEvent('domready', YOOTools.start);

/* Load IE6 fix */
if (window.ie6) {
	YOOTools.include('addons/ie6fix.js');
	YOOTools.include('addons/ie6png.js');
	YOOTools.include('yoo_ie6fix.js');
}
