jQuery.noConflict();
jQuery(document).ready(function($){


	var id = $("#header_menu");

	 
	/* Menu start (based on jFastMenu)
	--------------------------------------------------------------------- */

	$(id).find('ul').find('li').hover(
		// open menu sub-folder
		function(){  
			clearTimeout(jQuery(this).data('jQueryMenu'));
			$(this).find('ul:first').animate({height:'show'}, 'fast');
		},
		
		// close menu sub-folder
		function(){ 
			var mm = $(this);
			var timer = setTimeout(function(){
				mm.find('ul:first').animate({height:'hide', opacity:'hide'}, 'slow');
			}, 500);
			$(this).data('jQueryMenu', timer);
		}
	),

	// change only in first level
	$("#header_menu li a").not("ul li ul li a").mouseover(function(){ 
		$("img", this).attr("src", "fileadmin/templates/images/header_menu_arrow_hover.gif");
	});

	// change only in first level & if not :hover
	$("#header_menu li a").not("ul li ul li a").not(".active").mouseout(function(){ 
		$("img", this).attr("src", "fileadmin/templates/images/header_menu_arrow.gif");
	});

	
	/* swap the default input value, if the css class "jq_swap_value" is set
	--------------------------------------------------------------------- */
	swapValues = [];
    $(".jq_swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
            }
        });
    });
});	



