  function myTest(){
        alert ('sowas');
  }
  
  
  //After import of this js it will instantiate the document and jqueryobject:
  if (!window.Schluessel) Schluessel = {}
  Schluessel.jq = jQuery;
  
  
  
  Schluessel.jq(document).ready(function(){   
  
          
      /*$("a").click(function(){
        alert('Mich gibts noch nicht, Du darfst mich machen :-)');      
         return false;
       });
     */  
     
     //add the showing Event to each Picture in the #content_column
      //$("#content_top_nav").append("<a title='Leichtes Mittagessen im Freien mit einem Sandwich und Salat vom Gasthof zum Schlüssel... JETZT BESTELLEN!' style='position: absolute; border: none; right:-50px; top:-50px;' href='http://www.gasthof-schluessel.ch/sandwich'><img style='border: none; cursor:pointer;' src='http://gasthof-schluessel.ch/docs/images/neu.png'></a>")
      
      //$("#sandwich").prepend("<a title='Leichtes Mittagessen im Freien mit einem Sandwich und Salat vom Gasthof zum Schlüssel... JETZT BESTELLEN!' style='border: none; margin:0; padding:0;' href='http://www.gasthof-schluessel.ch/sandwich'><img align='right' style='border: none;  margin:0; padding:0; cursor:pointer;' src='http://gasthof-schluessel.ch/docs/images/neu.png'></a>")
      /*each(function(i){            
        $(this).mousedown(function(){
            showTip(this.src.replace('-kl', ''),this.title);
            });                 
      });
      
      */
             
      //add the showing Event to each Picture in the #content_column
      $("#content_column img").each(function(i){            
        $(this).mousedown(function(){
            showTip(this.src.replace('-kl', ''),this.title);
            });                 
      });
      
      //add the hiding Event to #large-picture    
      $("#large-picture").mousedown(function(){
        hideTip();
        });   
        
         //add the hiding Event to #large-picture    
      $(".prod_img img").mouseenter(function(){   
            $(this).css('cursor', 'crosshair');            
            this.src = this.src.replace('_th', '');                
        });
        
        $(".prod_img img").mouseout(function(){
            this.src = this.src.replace('.gif', '_th.gif');
            $(this).css('cursor', 'default');          
        });
        
        
        $(".prod_description textarea").focus(function(){   
            $(this).css('height', '10em');            
              
              if($(this).text().indexOf("Bemerkungen/W")>-1){
             $(this).text("");              
             }                               
        });
        
        $(".prod_description textarea").blur(function(){   
            $(this).css('height', '1.25em');                   
        });
        
        
      $(".checkOrderForm  input").each(function(){   
            $(this).attr('readonly','readonly');                                     
        });
        
      $(".checkOrderForm  textarea").each(function(){   
            $(this).attr('readonly','readonly');                                    
        });
        
      $(".checkOrderForm  input.button").each(function(){   
                $(this).attr('disabled','');                          
        });
    
        


        
         
       
  });
        
        //Shows the enlarged pic and hides the content with some jquery code
  function showTip(myImage, myTitel) {       
    myTop = 800;
    myLeft = 150;
    ieVersion =0;
  	myTop=(window.innerHeight/2)-350;
  	myLeft=(window.innerWidth/2)-350;
  	scrollPosition = window.pageYOffset;
    if (navigator.appName.indexOf("Explorer") != -1){
        if(document.documentElement.clientHeight > 1){
        	myTop=(document.documentElement.clientHeight/2)-350;
        	myLeft=(document.documentElement.clientWidth/2)-300;    
        	scrollPosition = document.documentElement.scrollTop;
        	ieVersion = navigator.appVersion.substr((navigator.appVersion.indexOf('MSIE')+5), 1);         	
        }else{
        	myTop=(document.body.clientHeight/2)-400;
        	myLeft=(document.body.clientWidth/2)-350;     
        }
    } 
    
    if(myTop < 0) myTop=5;
    if(myLeft < 0) myLeft=5;
    
                    
    $("#large-picture").hide();
    tip = document.getElementById('large-picture');
    tip.innerHTML =  "<a>"+myTitel+"</a><img src=\'"+myImage+"\'>";
    tip.style.top = myTop+'px'; 
    tip.style.left = myLeft+'px';
    if(ieVersion && ieVersion < 7){tip.style.position = 'absolute';}
    $("#site_content").fadeOut(1500);   
    $("#site_content").slideUp(10);      
    $("#large-picture").slideDown(2500);
  }
  
  //hides th enlaregd Image and bring back the content, aslo scroll down on last position
  function hideTip() {
          $("#large-picture").slideUp(600);                        
          $("#site_content").slideDown(1500);
          $("#site_content").fadeIn(0); 
          window.setTimeout('$("#site_content").fadeIn(0)',1500); 
          window.setTimeout('scrollDownSoft()',500);               
  }
  //scroll to the position where was bevore hiding content
  function scrollDownSoft(){        
    if(window.pageYOffset > 0){
      actualScrollPosition = window.pageYOffset;
    }else{
      actualScrollPosition = document.documentElement.scrollTop;
    }        
    if(actualScrollPosition < scrollPosition ){
        window.setTimeout('scrollDownSoft()',15);
        window.scrollTo(0, actualScrollPosition+50);
      }
  }

function changeVisibility (myToggleLinkId, myDivID,arrOfmyDivID){  
//alert(myToggleLinkId+' '+myDivID+' '+arrOfmyDivID);

    myDiv = document.getElementById(myDivID);
    myToggleLink = document.getElementById(myToggleLinkId);  
   
        if(myDiv.style.display == 'none'){      
            $("#"+myDivID).slideDown(1000);
            myToggleLink.innerHTML  = '&nbsp;'+myToggleLinkId+'&nbsp;<img src=\'imgs/up.png\'>';
            myToggleLink.title = 'Zuklappen';
            
            //myMenuTab.style.background ='#f7f8fd url(images/hover_top.png) top repeat-x';        
            //myMenuTab.style.borderRight ='2px solid #bdbdbd';
            //alert(myDivID,  myToggleLink.innerHTML );      
            
        }else{
            //myDiv.style.display='none';
            $("#"+myDivID).slideUp(500);
            myToggleLink.innerHTML  = '&nbsp;'+myToggleLinkId+'&nbsp;<font style="font-size: 0.85em;">(click me)</font><img src=\'imgs/down.png\'>';
            myToggleLink.title = 'Aufklappen';
            
            //myMenuTab.style.background ='#fff url(images/hover_top.png) bottom repeat-x';
            //myMenuTab.style.borderRight ='none'; 
        }    

}





