<!--
function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit) {
        field.value = field.value.substring(0, maxlimit);
    } else {
        countfield.value = maxlimit - field.value.length;
    }
}
//-->


<!--
function tierMenu(TAGID, IMAGEID) {
   var objMenu = document.getElementById(TAGID);
   var objImage = document.getElementById(IMAGEID);
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = ""; 
       objImage.src = "/pix/icons/icon_minus.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "/pix/icons/icon_plus.gif";
   }
}
//-->


<!--
function tierMenuFrage(objMenu,objImage)
{
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = "";
       objImage.src = "../pix/icons/icon_rufzeichen20.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "../pix/icons/icon_fragezeichen20.gif";
   }
}
//-->


<!--
function tierMenuDetailliste(TAGID, IMAGEID) {
   objMenu=document.getElementById(TAGID);
   objImage=document.getElementById(IMAGEID);
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = ""; 
       objImage.src = "../pix/icons/icon_list2_detaillisteminus.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "../pix/icons/icon_list2_detaillisteplus.gif";
   }
}
//-->


<!--
function tierOeffnungszeiten(TAGID, IMAGEID) {
   objMenu=document.getElementById(TAGID);
   objImage=document.getElementById(IMAGEID);
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = ""; 
       objImage.src = "../pix/icons/icon_uhr12_a.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "../pix/icons/icon_uhr12_a.gif";
   }
}
//-->



<!--
function tierMenuInfo(objMenu,objImage)
{
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = "";
       objImage.src = "../pix/icons/icon_info12.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "../pix/icons/icon_info12.gif";
   }
}
//-->


<!--
function tierMenuTermine(objMenu,objImage)
{
   if (objMenu.style.display == "none")
   {
       objMenu.style.display = "";
       objImage.src = "../pix/icons/icon_termine16.gif";
   }
   else
   {
       objMenu.style.display = "none";
       objImage.src = "../pix/icons/icon_termine16.gif";
   }
}
//-->


<!--
function go()
{
	if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none")
	{
	location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value
	}
}
//-->


<!--
function OpenWindow(url, name, width, height)
{
settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=no,"+
"resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}
function OpenWindow_scrollbar(url, name, width, height)
{settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=auto,"+
"resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}



/*
* OpenWindow_email(): open a new window, set reference on global variable emailWindow 
* CloseWindow_email(): close a window previously opened by OpenWindow_email()
*/

emailWindow = null; //global variable for active emailWindow

function OpenWindow_email(url, name, width, height) {
	settings = "locationbar=no,toolbar=no,location=no,directories=no,";
	settings += "locationbar=no,toolbar=no,location=no,directories=no,";
	settings += "status=no,menubar=no,scrollbars=yes,";
	settings += ("resizable=yes,top=200,left=500,width=" + width + ",height=" + height);
	emailWindow = window.open(url, name, settings);
	if (emailWindow != null) {
		emailWindow.focus();
	}
} //OpenWindow_email

function CloseWindow_email() {
	if (emailWindow != null) {	
		emailWindow.close();
		emailWindow = null;
	}
} //CloseWindow_email




function openWindow900x700(url)
{
	popupWin = window.open(url,'new_page','width=900,height=700,scrollbars=yes,toolbars=no,menubar=no,resizable=no')
}
function openWindow2(url)
{
	popupWin = window.open(url,'new_page','width=800,height=700,scrollbars=yes,toolbars=no,menubar=no,resizable=no')
}
function openWindow3(url)
{
	popupWin = window.open(url,'new_page','top=150,left=150,width=500,height=300,scrollbars=yes,toolbars=no,menubar=no,resizable=no')
}
function openWindow_notiz(url)
{
	popupWin = window.open(url,'new_page','top=200,left=200,width=330,height=330,scrollbars=no,toolbars=no,menubar=no,resizable=no')
}
function openWindow_kalender(url)
{
	popupWin = window.open(url,'new_page','top=150,left=150,width=330,height=300,scrollbars=no,toolbars=no,menubar=no,resizable=no')
}
function openWindow_verbindungen(url)
{
	popupWin = window.open(url,'new_page','top=150,left=150,width=700,height=400,scrollbars=yes,toolbars=no,menubar=no,resizable=no')
}
//-->


<!--
function AllMessages()
{
for(var x=0;x<document.MI.elements.length;x++)
{ var y=document.MI.elements[x];
if(y.name!='ALLMSGS') y.checked=document.MI.ALLMSGS.checked;
}
}
//-->


<!-- Begin
function validate_time(field) {
var valid = "0123456789:."
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Keine gültige Zeit!");
field.focus();
field.select();
   }
}
//  End -->



<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function help_msg(menu_id, msg_title, msg_text) {
newwin = window.open('','','top=150,left=150,width=300,height=300');
if (!newwin.opener) newwin.opener = self;
with (newwin.document)
{
open();
write('<html>');
write('<head>');
write('<title>' + msg_title + '</title>');
write('</head>');
write('<body>');
write('<font style="font-family:Tahoma, Verdana, Arial;font-size:11px;">');
write('<b>' + msg_title + '</b><br><br>');
write('' + msg_text + '<br><br>');
write('<a href="javascript:window.close()">Fenster schliessen</a>')
write('</font>');
write('</html>');
close();
   }
}
//  End -->


function nudge(list,direction) {
  var length = list.length;
  var temp = new Object();

  if (direction == 'up') {
    for (var i = 0; i < length; i++) {
      if (list[i].selected) {
        for (var n = 0; n < length; n++) {
          if (n == i) {
            if (n > 0) {
              swapListItems(list,n,(n - 1));
            }
          }
        }
      }
    }
  }
  else {
    for (var i = (length - 1); i > -1; i--) {
      if (list[i].selected) {
        for (var n = 0; n < length; n++) {
          if (n == i) {
            if (n < (length - 1)) {
              swapListItems(list,n,(n + 1));
            }
          }
        }
      }
    }
  }
}



function swapListItems(list,a,b) { // swaps item a and b in the given form
  var temp = new Object;

  temp.value = list[b].value;
  temp.text = list[b].text;  
  temp.selected = list[b].selected;

  list[b].value = list[a].value;
  list[b].text = list[a].text;  
  list[b].selected = list[a].selected;

  list[a].value = temp.value;
  list[a].text = temp.text;  
  list[a].selected = temp.selected;
}


function FormSelectAll(formname,selectname) {
var el_collection=eval("document.forms."+formname+"."+selectname)
  for (i = 0; i < el_collection.length; i++)
      el_collection.options[i].selected = true;
}

/* löscht Default-Werte aus HTML-Elementen */
function deleteDefault(element, defaultStr) {
	if(element.value == defaultStr) {
		element.value = "";
		element.style.color = "#000000";
	}
}

function writelength_textarea(quelle, ziel)	{
	laenge = quelle.value.length;
	document.getElementById(ziel).innerHTML = laenge;
}


function checkAll(eingabe, rufer) {
	var len = document.getElementsByName(eingabe).length;
	for(i=0; i<len; i++) {
		document.getElementsByName(eingabe)[i].checked = true;
	}
	document.getElementById(rufer).onchange = function() {uncheckAll(eingabe, rufer)};
}

function uncheckAll(eingabe, rufer) {
	var len = document.getElementsByName(eingabe).length;
	for(i=0; i<len; i++) {
		document.getElementsByName(eingabe)[i].checked = false;
	}
	document.getElementById(rufer).onchange = function() {checkAll(eingabe, rufer)};
}
function openCalender(inputId, formId) {
	var actual_date = document.getElementById(inputId).value;
	newWindow = window.open("/calendar.asp?formname=" + formId + "&formfieldname=" + inputId + "&datum=" + actual_date + "", "Calendar", "width=300,height=300,left=100,top=100");
 		newWindow.focus();
}
function openColorPicker(remoteUrl, formname, formfieldname, targetId) {
     this_color = document.getElementById(formfieldname).value;
     this_color = this_color.substring(1);
     var openStr = remoteUrl;
     openStr += "?formname=";
     openStr += formname;
     openStr += "&formfieldname=";
     openStr += formfieldname;
     openStr += "&color=";
     openStr += this_color;
     openStr += "&targetId=";
     openStr += targetId;
     var windowStr = "colorWindow";
     var styleStr = "width=450, height=355, left=100, top=200";
     colorWindow = window.open(openStr, windowStr, styleStr);
     colorWindow.focus();
}