var noHide = 0;
function pageload(hash) {
		var P = new Object;
		if(hash) {
			var h = hash.split('-');
			for(var i=0;i<h.length;i+=2) {
				P[h[i]] = h[i+1];	
			}
		} 
		/////////////////////////////////////////
		// ACCORDEON
		// init
		// go
		if(P.ucBox) {
			$('.ucBox .ucContent').slideUp();
			$('#ucBox-'+(P.ucBox)+' .ucContent').slideDown();
		}
}
	
	
$(document).ready(function() {
  jQuery.fn.media.defaults.mp3Player = 'http://www.arbeitnehmer.bz.it/fileadmin/tpl/js/mediaplayer.swf';
  jQuery('a[href$=mp3],a[href$=wav],a[href$=WAV]').media({ width: 250, height: 20, flashvars: { autostart : false} });

	if ($('.ucBox .ucHead:eq(0)').attr('class') && !noHide) {
		$.historyInit(pageload);
		$('.ucBox').each(function(i, o){
			if ($(this).parent().attr('class') == 'ucPopup') {
				return false;
			}
			if (i) {
				$(this).find('.ucContent').hide();
			}
			$(this).find('.ucHead').click(function(){
				$.historyLoad('ucBox-' + $(this).parent().attr('id').split('-')[1]);
				return false;
			});
		});
	}
	// BLOG SEARCH
	var EmptySearchBlogTxt = 'Stichwortsuche';
	$('.blogSearchSubmit').click(function() {
		var form = $(this).parent().parent();
		form.submit();
		return false;
	});
	if($('.blogSearchInput').val()=='') {
		$('.blogSearchInput').val(EmptySearchBlogTxt);
	}
	$('.blogSearchInput').focus(function() {
							if($(this).val()==EmptySearchBlogTxt) {
								$(this).val('');
							}

						})
						.blur(function() {
							if(!$(this).val()) {
								$(this).val(EmptySearchBlogTxt);
							}
						})
						;
	

	// NAVIGATION 
	$('.main-nav li').hover(function() {
			if ($(this).find('a:eq(0)').hasClass('on') && !$(this).attr('act')) {
				$(this).attr('act','1');
			}
			$(this).find('a:eq(0)').addClass('on');

			$("ul", this).fadeIn("fast");	
		},function() {
			if (!$(this).attr('act')) {
				$(this).find('a:eq(0)').removeClass('on');
			}
			$("ul", this).fadeOut("fast");
		});
});


