/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var ie    =  document.all? 1 : 0;


function countlimit(maxlength,e,placeholder){
  var theform=eval(placeholder);
  var lengthleft=maxlength-theform.value.length;
  var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder);
  
  if (window.event || e.target && e.target == eval(placeholder)) {
    if (lengthleft < 1) {
      var kommentinfo = 'Sehr sch&ouml;n. Dein Link ist jetzt SEO-tauglich, das <strong>nofollow-Tag</strong> wird entfernt.';
    }
    else if (lengthleft == 1) {
      var kommentinfo = 'Achtung! Es fehlt noch <strong>'+lengthleft+'</strong> Zeichen, bis dein Link ohne <strong>nofollow-Tag</strong> erscheint.';
    }
    else {
      var kommentinfo = 'Achtung! Es fehlen noch <strong>'+lengthleft+'</strong> Zeichen, bis dein Link ohne <strong>nofollow-Tag</strong> erscheint.';
    }
  
    placeholderobj.innerHTML=kommentinfo;
  }
}


function displaylimit(theform,thelimit) {
  var limit_text='<span id="'+theform.toString()+'">Dein Link erscheint ohne <strong>nofollow-Tag</strong>, wenn du einen sinnvollen Kommentar mit 140+ Zeichen verfasst!</span>';

    document.write(limit_text);
    

  if (ie) {
    eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform);}
  }
  else {
    document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform); }, true); 
  }
}
