function debug(sValue,bAlternative){
	if(window.console&&window.console.log){
		window.console.log(sValue);
	}else if(bAlternative){
		alert(sValue);
	}
}

//suckerfish
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover(
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

$(document).ready(function(){
	//Link-Titel an Formulare übergeben
	$("a.Formularbetreff[title!='']").click(function(e){
		e.preventDefault();
		$obj = $(this);
		debug($obj);
		$('<form method="post" action="'+$obj.attr('href')+'" id="virtualpost" style="position:absolute"><input type="hidden" name="betreff" value="'+$obj.attr('title')+'" /></form>').appendTo('body');
		$("#virtualpost").submit();
	});

	//suckerfish
	if(document.all) {
		$("#nav li").hoverClass("sfHover");
	}

	//erscheinen bei klick
	$("a.clickswitch").each(function(){
		$obj = $(this);
		$target = $('#'+$obj.attr('id')+"_target");
		$target.hide();

		$obj.click(function(e){
			e.preventDefault();
			$obj.hide();
			$target.fadeIn();
		});
	});
});

