var className = ' js';
if (window.frameElement) {
    className += ' iframe';
}
document.documentElement.className += className;

jQuery(function($){

    // ie < 7.0 kann kein li:hover
    if ($.browser.msie && +$.browser.version < 7) {
        // if ie6 add hover support to elements
        $('.iehover').live('mouseover', function(e){
            if ($(this).hasClass('iehover')) {
                $(this).addClass('hover');
            }
        }).live('mouseout', function(e){
            if ($(this).hasClass('iehover')) {
                $(this).removeClass('hover');
            }
        });

    }

    $(".search a").click(function(){
        $("#layer").slideToggle("fast");
        return false;
    });

    // close menus whenever you click somewhere else on the page
    // respond to any clicks that happen anywhere
    $(document).click(function(e){
        // your menu root element
        var menu = $('#layer');
        // the element that was clicked
        var target = $(e.target);
        // if the element clicked isn't the menu or inside the menu
        // and if the menu is visible
        if (target.closest('#layer').length == 0 && menu.is(':visible')) {
            // slide the menu up
            menu.slideUp("fast");
        }
    });


	// inputs with default text
	$('input.text').each(function () {
		var input = $(this),data = input.metadata();
		if (!data['default']) {
			return;
		}
		if (!input.val()) {
			input.val(data['default']);
		}
		input.bind('focusin', function (e) {
			if (data['default'] == input.val()) {
				input.val('');
			}
		}).bind('focusout', function (e) {
			if (!input.val()) {
				input.val(data['default']);
			}
		});
	});

	$('a.printJS').click(function(){window.print();})



});
