//++++++++++++++++++++++++++++//
//global javascript functions
//++++++++++++++++++++++++++++//

//Set current Year
function copyright(){
   var jetzt = new Date();
   document.write(jetzt.getFullYear());
}

//++++++++++++++++++++++++++++//
//Printlink
//++++++++++++++++++++++++++++//


function createPrintLink(){
      printLink = document.createElement("a");
      printLink.setAttribute('href',window.location.href+'?print=1');
      printLink.setAttribute('id','printLink');
      printLink.setAttribute('title','Diese Seite ausdrucken');
      printLink.setAttribute('class','printlink');
      var txt = document.createTextNode("SEITE DRUCKEN");
      printLink.appendChild(txt);
      document.getElementById("centerfooter").insertBefore(printLink, document.getElementById("tipafriendfooter")); 
  
      var pos = window.location.search.indexOf("print=1");
  
      if(pos != -1 ){
         var backurl = window.location.href.replace(/\?print=1/g,"");
        
        Check = confirm("Wollen Sie diese Seite ausdrucken?");
        
        if (Check == true){
            window.print();
        }else{
          self.location.href = backurl;
        }
       }
      }



//++++++++++++++++++++++++++++//
//crossbrowser add eventloader
//++++++++++++++++++++++++++++//

function addLoadEvent(func){   
    var oldonload = window.onload;
    if (typeof window.onload != 'function'){
        window.onload = func;
    } else {
        window.onload = function(){
        oldonload();
        func();
        }
    }
}



//+++++++++++++++++++++++++++++++++//
//little helper functions searchform
//+++++++++++++++++++++++++++++++++//

function clear(){
   this.value="";
   }

function initGegenbauer(){
   if(document.getElementById("sword")!= null){
      document.getElementById("sword").value="";
      document.getElementById("sword").onfocus=clear;
   }
   if(document.getElementById("catselectsubmit")!= null){
      document.getElementById("catselectsubmit").style.display="none";
   }
   if(document.getElementById("bundselectsubmit")!= null){
      document.getElementById("bundselectsubmit").style.display="none";
   }
}

//finaly fire up the scripts
addLoadEvent(initGegenbauer);
//addLoadEvent(createPrintLink);



