  /*  webScenery Funktion; Der Code darf ausschließlich für nicht kommerzielle Zwecke genutzt werden. */

  /*  Statusleistenausgabe
       onmouseover="los('Informationen zum Angebot &quot;Werbefläche&quot;'); hinweis(8,50); return true"
       onmouseout="end(); hideit(); return true;"
       oder onmouseover="window.status='Werbung'; return true" onmouseout="window.status='&nbsp;'; return true"
   */
       m=0; letter='';
      function los(message){
       if (m!=message.length){
        window.status=letter;
        letter+=message.charAt(m++);
        SleepFXTimer=setTimeout("los('" + message + "')",10);
        }
       if (m==message.length){
        letter+=message.charAt(m);
        window.status=letter;
       clearTimeout(SleepFXTimer);
        m=0; letter='';
        }
       }
      function end(){
       clearTimeout(SleepFXTimer); m=0; letter='';
       window.status="";
      }

  /*  Boxen ein und ausblenden */

function boxblend(who)
{
 var tmp;
 if (document.images['b_' + who].src.indexOf('_on') == -1)
 {
  tmp = document.images['b_' + who].src.replace('_off', '_on');
  document.getElementById('box_' + who).style.display = 'none';
  document.images['b_' + who].src = tmp;
 } else {
  tmp = document.images['b_' + who].src.replace('_on', '_off');
  document.getElementById('box_' + who).style.display = 'block';
  document.images['b_' + who].src = tmp;
 }
}
  /*  Boxen ein und ausblenden */

function boxblendcopyright(dertext)
{
var tmp;
if (document.images['b_' + dertext].src.indexOf('_on') == -1)
{
 tmp = document.images['b_' + dertext].src.replace('_off', '_on');
 document.getElementById('box_' + dertext).style.display = 'none';
 document.images['b_' + dertext].src = tmp;
} else {
 tmp = document.images['b_' + dertext].src.replace('_on', '_off');
 document.getElementById('box_' + dertext).style.display = 'block';
 document.images['b_' + dertext].src = tmp;
}
}

  /*  Rechtliches Boxen ein und ausblenden */

function boxblendrecht(recht)
{
var tmp;
if (document.images['b_' + recht].src.indexOf('_on') == -1)
{
 tmp = document.images['b_' + recht].src.replace('_off', '_on');
 document.getElementById('box_' + recht).style.display = 'none';
 document.images['b_' + recht].src = tmp;
} else {
 tmp = document.images['b_' + recht].src.replace('_on', '_off');
 document.getElementById('box_' + recht).style.display = 'block';
 document.images['b_' + recht].src = tmp;
}
}
  /*  unicode verschlüsseln


   */

function toUnicode()
{
  var str=document.myForm.myInput.value
  document.myForm.unicode.value = ""
  strLen = str.length;
  if (str!="")
  {
   for(i=0;i < strLen;i++)
   {
    unicode=str.charCodeAt(i)
    unicode = "&#"+unicode+";"
    document.myForm.unicode.value += unicode
   }
  }
}



function Go(x)
{
  if (x == "nix")
  {
    document.forms[0].reset();
    return;
  } else {
    location.href = "./" + x;
  }
}

      function springe(x)
      {
       if(x == "nix")
               {
               document.forms[0].reset();
               document.forms[0].elements[0].blur();
               return;
               }
       else
               {
               window.location.href = x;
               }
       }
function formHandler()
         {
         var URL = document.form.site.options[document.form.site.selectedIndex].value;
         window.location.href = URL;
         }

function newWindow(htmldatei,fenstername,toolbar,breite,hoehe,scrollbars)
         {
          window.open(htmldatei,fenstername,"toolbar="+toolbar+",copyhistory=no,location=no,width="+breite+",height="+hoehe+",directories=no,status=no,scrollbars="+scrollbars+",resize=no,menubar=no")
          newWindow.focus();
      }
/* <a class=\"top\" href=\"JavaScript:newWindow('".home."mitglieder.htm','mtgl','no',780,530,'yes')\" onmouseover=\"stm(Text[1],Style[0]),los('Online-Gemeinde'); return true;\" onmouseout=\"htm();end(); return true;\">&nbsp;Online-Gemeinde&nbsp;</a> */

function link(htmldatei,fenstername,breite,hoehe)
         {
          window.open(htmldatei,fenstername,"toolbar=yes,copyhistory=yes,location=yes,width="+breite+",height="+hoehe+",directories=yes,status=yes,scrollbars=yes,resize=yes,menubar=yes")
      }

function boerse()
        {
        msgWindow=window.open("http://217.7.85.108/cgi-bin/khl/kontaktboerse/khlboerse.pl?id=khlboerse","displayWindow","toolbar=no,copyhistory=no,location=no,width=750,height=500,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
      }
function board()
        {
        msgWindow=window.open("http://www.kinderherzliga.de/kommunikation/board/board.html","displayWindow","toolbar=no,copyhistory=no,location=no,width=750,height=600,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
      }
function gb()
        {
        msgWindow=window.open("http://www.kinderherzliga.de/cgi-bin/guestbook/khlgb4u.pl?id=khl","displayWindow","toolbar=no,copyhistory=no,location=no,width=750,height=500,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
      }
function karten()
        {
        msgWindow=window.open("karten/index.html","displayWindow","toolbar=no,copyhistory=no,location=no,width=750,height=600,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
      }

window.defaultStatus = "Kinderherzliga INTERAKTIV";

/*
------------------------------------------
	Flipbox written by CrappoMan
	simonpatterson@dsl.pipex.com
------------------------------------------
*/
function flipBox(who) {
	var tmp;
	if (document.images['b_' + who].src.indexOf('_on') == -1) {
		tmp = document.images['b_' + who].src.replace('_off', '_on');
		document.getElementById('box_' + who).style.display = 'none';
		document.images['b_' + who].src = tmp;
	} else {
		tmp = document.images['b_' + who].src.replace('_on', '_off');
		document.getElementById('box_' + who).style.display = 'block';
		document.images['b_' + who].src = tmp;
	}
}

  /*  textarea1  */
function addText(elname, wrap1, wrap2) {
	if (document.selection) { // for IE
		var str = document.selection.createRange().text;
		document.forms['inputform'].elements[elname].focus();
		var sel = document.selection.createRange();
		sel.text = wrap1 + str + wrap2;
		return;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var txtarea = document.forms['inputform'].elements[elname];
		var selLength = txtarea.textLength;
		var selStart = txtarea.selectionStart;
		var selEnd = txtarea.selectionEnd;
		var oldScrollTop = txtarea.scrollTop;
		//if (selEnd == 1 || selEnd == 2)
		//selEnd = selLength;
		var s1 = (txtarea.value).substring(0,selStart);
		var s2 = (txtarea.value).substring(selStart, selEnd)
		var s3 = (txtarea.value).substring(selEnd, selLength);
		txtarea.value = s1 + wrap1 + s2 + wrap2 + s3;
		txtarea.selectionStart = s1.length;
		txtarea.selectionEnd = s1.length + s2.length + wrap1.length + wrap2.length;
		txtarea.scrollTop = oldScrollTop;
		txtarea.focus();
		return;
	} else {
		insertText(elname, wrap1 + wrap2);
	}
}

  /*  textarea2  */
function insertText(elname, what) {
	if (document.forms['inputform'].elements[elname].createTextRange) {
		document.forms['inputform'].elements[elname].focus();
		document.selection.createRange().duplicate().text = what;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var tarea = document.forms['inputform'].elements[elname];
		var selEnd = tarea.selectionEnd;
		var txtLen = tarea.value.length;
		var txtbefore = tarea.value.substring(0,selEnd);
		var txtafter =  tarea.value.substring(selEnd, txtLen);
		var oldScrollTop = tarea.scrollTop;
		tarea.value = txtbefore + what + txtafter;
		tarea.selectionStart = txtbefore.length + what.length;
		tarea.selectionEnd = txtbefore.length + what.length;
		tarea.scrollTop = oldScrollTop;
		tarea.focus();
	} else {
		document.forms['inputform'].elements[elname].value += what;
		document.forms['inputform'].elements[elname].focus();
	}
}
  /*  private nachrichten  */
function show_hide(msg_id) {
	msg_id.style.display = msg_id.style.display == 'none' ? 'block' : 'none';
}

  /*  Uhrzeit im Text */
var clockid=new Array()
var clockidoutside=new Array()
var i_clock=-1
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
var thistime = hours+":"+minutes+":"+seconds

function writeclock() {
        i_clock++
        if (document.all || document.getElementById || document.layers) {
                clockid[i_clock]="clock"+i_clock
                document.write("<span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span>")
        }
}

function clockon() {
        thistime= new Date()
        hours=thistime.getHours()
        minutes=thistime.getMinutes()
        seconds=thistime.getSeconds()
        if (eval(hours) <10) {hours="0"+hours}
        if (eval(minutes) < 10) {minutes="0"+minutes}
        if (seconds < 10) {seconds="0"+seconds}
        thistime = hours+":"+minutes+":"+seconds

        if (document.all) {
                for (i=0;i<=clockid.length-1;i++) {
                        var thisclock=eval(clockid[i])
                        thisclock.innerHTML=thistime
                }
        }

        if (document.getElementById) {
                for (i=0;i<=clockid.length-1;i++) {
                        document.getElementById(clockid[i]).innerHTML=thistime
                }
        }
        var timer=setTimeout("clockon()",1000)
}
window.onload=clockon

