/*
$Id: func.js,v 1.10 2008/11/06 16:53:56 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*/

//if ($.browser.msie) {
//  $.event.add(
//	  window,
//  	'load',
//	  function() {
//      $('ul.fancycat-icons-level-0 li').hover(fcIconsLIOver, fcIconsLIOut);
//  	}
//  );
//}

function fcIconsLIExpand() {

	this.className += " show_menu";

	$root_link=jQuery(this).next();
	if (jQuery(this).parent().parent().parent().hasClass("fancycat-explorer-level-0")) {
		$root_link.css("color","#00A5E7");
	}
    $root_item=jQuery(this).parent().parent().parent();
    $root_item.addClass("expanded");

	$sub_menu=jQuery(this).parent().parent().next();
    $sub_menu.show();
}

function fcIconsLICollapse() {
	
	this.className = this.className.replace(/ show_menu/, "");

    $root_item=jQuery(this).parent().parent().parent();
    $root_item.removeClass("expanded");

	$root_link=jQuery(this).next();
	if (jQuery(this).parent().parent().parent().hasClass("fancycat-explorer-level-0")) {
		$root_link.css("color","");
	}
	$sub_menu=jQuery(this).parent().parent().next();
    $sub_menu.hide();
}
jQuery.noConflict();

jQuery.event.add(
  window,
'load',
	function() {
		jQuery('ul.fancycat-explorer-level-0 li').each(function(){
				if (!jQuery(this).hasClass("expanded")) {
					if (jQuery("#"+this.id+" > ul").length > 0) {
						jQuery("#"+this.id+" > ul").hide();
						jQuery("#"+this.id+" > div a span.im").toggle(fcIconsLIExpand, fcIconsLICollapse);
					}
				} else {
					if (jQuery("#"+this.id+" > ul").length > 0) {
						jQuery("#"+this.id+" > div a span.im").addClass("show_menu");
						jQuery("#"+this.id+" > div a span.im").toggle(fcIconsLICollapse, fcIconsLIExpand);
					}
				}
			}
		);
	}
);

