var $j = jQuery.noConflict();


function mainmenu(){
	$j('#language-selector').click(
		function(){
			$j('#language-choser').toggle();
		}
	);
}

$j(document).ready(function() {
	
	/**
	 * Show/hide #category links
	 */
	$j('#category p.menu-head').click(function()
	{
		var bgImg = 'url(/lib/css/gfx/arrow-down.gif)';
		var wasOpened = false;
		
		try {
			if ($j(this).next('div.menu-body')[0].style.display != 'block') {
				wasOpened = true;
			} else {
				bgImg = 'url(/lib/css/gfx/arrow-right.gif)';
			}
		} catch(ex) {
		}
		
		var skip = false;
		
		// ie fix -- freaks out on slideToggle and slideUp
		/*@cc_on
			skip = true;

			$j(this)
				.css({backgroundImage:bgImg})
				.next('div.menu-body')
				.toggle()
				.siblings('div.menu-body')
				.hide();
		@*/

		if (!skip)
			$j(this)
				.css({'background-image':bgImg})
				.next('div.menu-body')
				.slideToggle(300)
				.siblings('div.menu-body')
				.slideUp('slow');

		$j(this)
			.siblings('p')
			.css({'background-image':'url(/lib/css/gfx/arrow-right.gif)', 'background-repeat': 'no-repeat'});
	});
	
	mainmenu();
	
});
