/*Copyright 2007 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl

Free for non-commercial use
*/

function initMenu() {

$('.cat').addClass('inactive');  
$('#nav ul').hide();

$.each($('ul#nav'), function(){
var cookie = $.cookie(this.id);
if(cookie === null || String(cookie).length < 1) {
$('#' + this.id + '.expandfirst ul:first').show();
}
else {
$('#' + this.id + ' .' + cookie).next().show();
}
});

$('#nav li a').hover(
function() {
var checkElement = $(this).next();
if((checkElement.is('ul')) && (checkElement.is(':visible')))
{

return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#nav ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
}
);
}

$(document).ready(function() {initMenu();});

$(document).ready(function() {
//create scroller for each element with "horizontal_scroller" class...
$('.horizontal_scroller').SetScroller({	velocity: 	 60,
										direction: 	 'horizontal',
										startfrom: 	 'right',
										loop:		 'infinite',
										movetype: 	 'linear',
										onmouseover: 'pause',
										onmouseout:  'play',
										onstartup: 	 'play',
										cursor: 	 'pointer'
									});
$('#no_mouse_events').ResetScroller({	onmouseover: 'play', onmouseout: 'play'   });
$('#scrollercontrol').ResetScroller({	velocity: 85, startfrom: 'left'   });
});
