/* <![CDATA[ */
function openCentered(theURL,winName,winWidth,winHeight,features) {
 var w = (screen.width - winWidth)/2;
 var h = (screen.height - winHeight)/2 - 30;
 features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
 window.open(theURL,winName,features);
}
function checkForm() {
 document.book.name.value=trim(document.book.name.value);
 document.book.comment.value=trim(document.book.comment.value);
 if(document.book.name.value == "") {
   alert("<?=$ErrorPost1;?>");
   document.book.name.focus();
   return false;
 }
 if(document.book.comment.value == "") {
   alert("<?=$ErrorPost2;?>");
   document.book.comment.focus();
   return false;
 }
}
function trim(value) {
 startpos=0;
 while((value.charAt(startpos)==" ")&&(startpos<value.length)) {
   startpos++;
 }
 if(startpos==value.length) {
   value="";
 } else {
   value=value.substring(startpos,value.length);
   endpos=(value.length)-1;
   while(value.charAt(endpos)==" ") {
     endpos--;
   }
   value=value.substring(0,endpos+1);
 }
 return(value);
}
function eingaben_ueberpruefen(){
        if (document.Form.eingabe.value.length != 5){
          alert("Bitte geben Sie den Code ein!");
          document.Form.eingabe.focus();
          return false;
        }
        else
          return true;
      }
      
      function RND(){
        Zufall = Math.round(Math.random()*11+1);
        document.Form.code.value=Zufall;
        return Zufall;
      }
/* ]]> */
