    var time = 0;
  
   /** Ticker ausblenden wenn nicht benötigt */
   $(document).ready(function() {
	   $("div#ticker").css("overflow", "hidden");
	   if ($("div#ticker > h5").size() < 1)
	     $("div#ticker").hide();
	});
  
  /**
   * Dynamischer TOC 
   * Workaround mangelnde hover Unterstützung IE6 dafür dann (alle Browser) animiert 
   */
   $(document).ready(function() {
	    /** Reset der CSS Vorbelegung */
	    $("div.content").css("height", "auto");
	    $("div.content").css("z-index", "11");
	    $("div.content").css("width", "100%");
	    $("div.content").css("left", "0");
	    $("div.content").css("visibility", "visible");
	    $("div.content").css("display","block");
	    $("div.content").hide(); /* JavaScript basiertes yschließen*/
	    
      
	    $("div.controlBox").hoverIntent(function() {
            $("div.content", this).show("fast");
	    }, function() {
            $("div.content", this).hide("normal");
	    });
              
        
        $("body").click(function() {
	        $("div.content", this).hide("normal");
        });
     });
     
     function sleep(ms) {
      var t = new Date().getTime() + ms;
      while (new Date().getTime() < t) {
      // wait
      }
     }
     

    /************************************************************************************/
    
    /**
     *   Dialogbox mit Eigenschaften für die Notebooksuche
     */
    /*$(document).ready(function() {
	    $("a#CB_NotebookSearch").attr({href: "#"});
	    $("div#first").append("<div id=\"CB_NotebookSearch_Content\"><a class=\"close\" href=\"#\">[x]</a><form action=\"input_file.htm\" method=\"post\" enctype=\"multipart/form-data\"><p>TestFormular<br /><input name=\"Datei\" type=\"text\" size=\"50\" maxlength=\"100000\" accept=\"text\" /></p></form></div>");
	    $("div#CB_NotebookSearch_Content").css("z-index", "11");
	    $("div#CB_NotebookSearch_Content").css("position", "absolute");
	    $("div#CB_NotebookSearch_Content").css("top", $("div#first").height()+"px");
	    $("div#CB_NotebookSearch_Content").css("left", "20.5%");
	    $("div#CB_NotebookSearch_Content").css("width", $("div#search").width()+"px");
	    $("div#CB_NotebookSearch_Content").css("background-color", "#fff");
	    $("div#CB_NotebookSearch_Content").css("border", "2px outset #003090");
	    $("div#CB_NotebookSearch_Content").css("padding", "0.5em");
	    $("div#CB_NotebookSearch_Content > a.close").css("float", "right");
	    $("div#CB_NotebookSearch_Content").hide();
	    var openState = false;
	    $("div#CB_NotebookSearch_Content > a.close").click(function() {    
	        $("div#CB_NotebookSearch_Content").hide("normal");
	        openState = false;
	    });
	    $("a#CB_NotebookSearch").click(function() { 
	      if (!openState)
	      {
	       $("div#CB_NotebookSearch_Content").show("normal");
	       openState = true;
	      }
	      else
	      {
	        $("div#CB_NotebookSearch_Content").hide("normal");
	        openState = false;
	      }
	    });
  	});*/  
    
  	
  	/*$(window).resize(function () {
    	$("div#CB_NotebookSearch_Content").css("top", $("div#first").height()+"px");
    	$("div#CB_NotebookSearch_Content").css("width", $("div#search").width()+"px");
  	});*/
  	/************************************************************************************/
    
    /**
     *  Label für Direktbestellung ins im Eingabefeld einblenden
     */
    $(document).ready(function() {
        $("input[name='basket.directOrder.add_code']").val("Art-Nr.");
     
        $("input[name='basket.directOrder.add_code']").focus(function() {
          if ($(this).val() == "Art-Nr.") {
            $(this).val("");
          }
        });
        $("input[name='basket.directOrder.add_code']").blur(function() {
          if ($(this).val() == "") {
              $(this).val("Art-Nr.");
          }
        });
        
        $("input[name='basket.directOrder.add_quantity']").val("Menge");
     
        $("input[name='basket.directOrder.add_quantity']").focus(function() {
          if ($(this).val() == "Menge") {
            $(this).val("");
          }
        });
        $("input[name='basket.directOrder.add_quantity']").blur(function() {
          if ($(this).val() == "") {
              $(this).val("Menge");
          }
        });
    }); 
    /************************************************************************************/
    
    
    /** Crunching von tabellen **/
    
      
    $(document).ready(function() {
      $("table.crunched").each(function(index, elem) {
        $("tbody", elem).hide();
        $("thead > tr > th", elem).prepend("<span style='cursor: pointer'><img src='/ai/lib/images/pfeilrechts4bgblue.gif' alt='toggle'></span> ")
        $("thead > tr > th", elem).css("cursor", "pointer");
        $("thead > tr > th", elem).css("border", "2px solid #8cb0d2");
        $("thead > tr > th", elem).css("border-right-color", "#00366a");
        $("thead > tr > th", elem).css("border-bottom-color", "#00366a");
        if ($(elem).hasClass("open")) {
          $("tbody", elem).show();
          $("thead > tr > th > span > img", elem).attr("src","/ai/lib/images/pfeilrunter.gif");
          $("thead > tr > th", this).css("border", "none");        
        }
        $("thead > tr > th", elem).toggle(function() {
          $("tbody", elem).show();
          $("img", this).attr("src","/ai/lib/images/pfeilrunter.gif");
          $(this).css("border", "none");          
        },
        function() {
          $("tbody", elem).hide();
          $("img", this).attr("src","/ai/lib/images/pfeilrechts4bgblue.gif");
          $(this).css("border", "2px solid #8cb0d2");
          $(this).css("border-right-color", "#00366a");
          $(this).css("border-bottom-color", "#00366a");
        });
                  
      });
    });
     