function f_check() {
 if(document.f.message.value.length > limit) {
  alert('Zu viele Zeichen eingegeben!');
  document.f.message.focus();
  return false;
 }
 else
   return true;
}

function  f_update() {
 var old = document.f.counter.value;
 document.f.counter.value=document.f.message.value.length;
 if(document.f.counter.value > limit && old <= limit) {
  alert('Bitte maximal '+limit+' Zeichen eingeben!');
  if(document.styleSheets) {
   document.f.counter.style.fontWeight = 'bold';
   document.f.counter.style.color = '#ff0000'; } }
  else if(document.f.counter.value <= limit && old > limit && document.styleSheets ) {
   document.f.counter.style.fontWeight = 'normal';
   document.f.counter.style.color = '#ffffff'; } 
  }

function  f_update2() {
 var old = document.f.counter.value.split("/")[0];
 document.f.counter.value=''+document.f.message.value.length+'/'+limit;
 if(document.f.counter.value.split("/")[0] > limit && old <= limit) {
  alert('Bitte maximal '+limit+' Zeichen eingeben!');
  if(document.styleSheets) {
   document.f.counter.style.fontWeight = 'bold';
   document.f.counter.style.color = '#ff0000'; } }
  else if(document.f.counter.value.split("/")[0] <= limit && old > limit && document.styleSheets ) {
   document.f.counter.style.fontWeight = 'normal';
   document.f.counter.style.color = '#ffffff'; } 
  }

var ar = new Array();

function preload() {
  if (document.images){
    var arguments = preload.arguments;
    for (var i = 0; i < arguments.length; i++) {
      ar[i] = new Image();
      ar[i].src = "images/" + arguments[i];
    }
  }
}




function popup( URL, w, h, scrollbars ) {
 var l = screen.width/2 - w/2;
 var t = screen.height/2 - h/2;
 var windowprops = "width="+ w +",height="+ h +",scrollbars="+scrollbars+",top="+ t +",left="+ l;
 newwindow = window.open( URL, '', windowprops);
 if (window.focus) { newwindow.focus() }
}

