/*
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 = '<strong>Done!!</strong> Now your comment will be a no-follow free comment. :)';
    }
    else if (lengthleft == 1) {
      var kommentinfo = 'It only needs <strong>'+lengthleft+'</strong> more character to make your link a do-follow link! :)';
    }
    else {
      var kommentinfo = 'It needs <strong>'+lengthleft+'</strong> more characters to make your link a do-follow link! :)';
    }
  
    placeholderobj.innerHTML=kommentinfo;
  }
}


function displaylimit(theform,thelimit) {
  var limit_text='<span id="'+theform.toString()+'">It needs <strong>'+thelimit+'</strong> characters until your link is a real backlink without no-follow link! :(</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); 
  }
}
