function task_load(task,id)
{
 document.form1.task.value=task;
 document.form1.id.value=id;
 document.form1.submit();    
}




function id_del(question,id_del,task,id)
{
 if (id_del==id)
   {
    var agree=confirm(question);
    if (agree)
      {
       document.form1.task.value=task;
       document.form1.id.value=id;     
       document.form1.submit();     
      }	   
    }
 else
    {
     document.form1.task.value=task;
     document.form1.id.value=id;     
     document.form1.submit();     
    }     
}




function action_del(question,task_del,task,id)
{
 if (task_del==task)
   {
    var agree=confirm(question);
    if (agree)
      {
       document.form1.task.value=task;
       document.form1.id.value=id;     
       document.form1.submit();     
      }	   
    }
 else
    {
     document.form1.task.value=task;
     document.form1.id.value=id;     
     document.form1.submit();     
    }     
}


function ord(string)
{
 return string.charCodeAt(0);
}

function insert(input,aTag, eTag) {
  input.focus();
  
  /* fr Internet Explorer */
  if(typeof document.selection != 'undefined') {
    /* Einfgen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + (insText) + eTag;
    /* Anpassen der Cursorposition */
    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -eTag.length);
    } else {
      range.moveStart('character', aTag.length + insText.length + eTag.length);      
    }
    range.select();
  }
  /* fr neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Einfgen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + replase1(insText) + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0) {
      pos = start + aTag.length;
    } else {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* fr die brigen Browser */
  else
  {
    /* Abfrage der Einfgeposition */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Einfgen an Position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }
    /* Einfgen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");
    input.value = input.value.substr(0, pos) + aTag + replase1(insText) + eTag + input.value.substr(pos);
  }
}


function replase(input)
 {
  var b="", c="" , n=0

  for(n = 0; n < input.length; n++)
   {
    //c=input.charAt(n);
    c="&#"+ord(input.charAt(n));
    /* 
    if(c == "@"){c="&#64;"}
    if(c == "a"){c="&#97;"}
    if(c == "b"){c="&#98;"}
    if(c == "c"){c="&#99;"}
    if(c == "d"){c="&#100;"}
    if(c == "e"){c="&#101;"}
    if(c == "f"){c="&#102;"}
    if(c == "g"){c="&#103;"}
    if(c == "h"){c="&#104;"}
    if(c == "i"){c="&#105;"}
    if(c == "j"){c="&#106;"}
    if(c == "k"){c="&#107;"}
    if(c == "l"){c="&#108;"}
    if(c == "m"){c="&#109;"}
    if(c == "n"){c="&#110;"}
    if(c == "o"){c="&#111;"}
    if(c == "p"){c="&#112;"}
    if(c == "q"){c="&#113;"}
    if(c == "r"){c="&#114;"}
    if(c == "s"){c="&#115;"}
    if(c == "t"){c="&#116;"}
    if(c == "u"){c="&#117;"}
    if(c == "v"){c="&#118;"}
    if(c == "w"){c="&#119;"}
    if(c == "x"){c="&#120;"}
    if(c == "y"){c="&#121;"}
    if(c == "z"){c="&#122;"}
    */
    b=b+c; 
    
   }
  var e = '<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;' + b + '">';
  return (e);
 }
 
 
 function replase1(input)
 {
  var b="", c="" , n=0

  for(n = 0; n < input.length; n++)
   {
    c="&#"+ord(input.charAt(n));
    /*
    if(c == "@"){c="&#64;"}
    if(c == "a"){c="&#97;"}
    if(c == "b"){c="&#98;"}
    if(c == "c"){c="&#99;"}
    if(c == "d"){c="&#100;"}
    if(c == "e"){c="&#101;"}
    if(c == "f"){c="&#102;"}
    if(c == "g"){c="&#103;"}
    if(c == "h"){c="&#104;"}
    if(c == "i"){c="&#105;"}
    if(c == "j"){c="&#106;"}
    if(c == "k"){c="&#107;"}
    if(c == "l"){c="&#108;"}
    if(c == "m"){c="&#109;"}
    if(c == "n"){c="&#110;"}
    if(c == "o"){c="&#111;"}
    if(c == "p"){c="&#112;"}
    if(c == "q"){c="&#113;"}
    if(c == "r"){c="&#114;"}
    if(c == "s"){c="&#115;"}
    if(c == "t"){c="&#116;"}
    if(c == "u"){c="&#117;"}
    if(c == "v"){c="&#118;"}
    if(c == "w"){c="&#119;"}
    if(c == "x"){c="&#120;"}
    if(c == "y"){c="&#121;"}
    if(c == "z"){c="&#122;"}
    */
    b=b+c; 
   }
  //var e = '<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;' + b + '">';
  //return (e);
  return (b);
 }



