$(document).ready(function(){
    $("ul.sf-menu").superfish({
        autoArrows: false,
        animation: {opacity:'show'},
        speed: 'fast',
        delay: 20
    });
    $('abbr[title], dfn[title]').cluetip({splitTitle: '|'});
    $('form.callback label').inputPresetByLabel();

    $hc = $("#hidecontent");
    if($hc.length > 0){
      $("#hidecontent_more a").live("click", function(e){
        e.preventDefault();
        $(this).parent().hide();
        $hc.fadeIn('fast');
      });

      $hc.hide().after('<p id="hidecontent_more" style="clear:both"><a href="#">Mehr lesen ...</a></p>');
    }

	formswitch($("#formswitcher"));
	switcheven();

    $("#formswitcher").click(function(){
    	formswitch($(this));
    }).find("input").click(function(){
		switcheven();
    });
});

function formswitch($obj){
  formswitch_bVisible = false;
    $obj.find("input").each(function(){
      if($(this).is(":checked")){
        formswitch_bVisible = true;
        return true;
      }
    });
    if(formswitch_bVisible == true){
      $("#tblcontent:hidden, p.frmhide").fadeIn("normal");
    }else{
      $("#tblcontent:visible, p.frmhide").hide();
    }
}

function switcheven(){
	$("#formswitcher input:checked").each(function(){
          toggleRelated(this, false);
     });
}
