<!-- 

function open_window(url,name,features){
	popup=window.open(url,name,features);
	if (window.focus)
		popup.focus();
}

function UnCryptMailto(s, shift) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}
function linkTo_UnCryptMailto(s, shift)	{
	location.href=UnCryptMailto(s, shift);
}
				
function autoComplete(field, select, property, forcematch){
	var found = false;
	for(var i = 0;i < select.options.length;i++){
		if(select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0){
			found=true;break;
		}
	}
	if(found){
		select.selectedIndex = i;
	}
	else{
		select.selectedIndex = -1;
	}
	if(field.createTextRange){
		if(forcematch && !found){
			field.value=field.value.substring(0,field.value.length-1);
			return;
		}
		var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;";
		if(cursorKeys.indexOf(event.keyCode+";") == -1){
			var r1 = field.createTextRange();
			var oldValue = r1.text;
			var newValue = found ? select.options[i][property] : oldValue;
			if(newValue != field.value){
				field.value = newValue;
				var rNew = field.createTextRange();
				rNew.moveStart('character', oldValue.length) ;
				rNew.select();
			}
		}
	}
}

function PadLeft(String,Length,PadChar) {
	String += ""       // Force argument to string.
	Length += ""       // Force argument to string.
	PadChar += ""      // Force argument to string.
	if((PadChar == "") || (!(PadChar.length == 1)))
	 PadChar = " "
	var Count = 0
	var PadLength = 0
	Length = parseInt(0 + Length,10)
	if(Length <= String.length) // No padding necessary.
	 return(String)
	PadLength = Length - String.length
	for(Count = 0; Count < PadLength; Count++)
	 String = PadChar + String
	return(String)
}

function replaceSubstring(inputString, fromString, toString) {
	// Goes through the inputString and replaces every occurrence of fromString with toString
	var temp = inputString;
	if (fromString == "") {
		return inputString;
	}
	if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
	  while (temp.indexOf(fromString) != -1) {
	    var toTheLeft = temp.substring(0, temp.indexOf(fromString));
	    var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
	    temp = toTheLeft + toString + toTheRight;
	  }
	} else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
	  var midStrings = new Array("~", "`", "_", "^", "#");
	  var midStringLen = 1;
	  var midString = "";
	  // Find a string that doesn't exist in the inputString to be used
	  // as an "inbetween" string
	  while (midString == "") {
	  	for (var i=0; i < midStrings.length; i++) {
	      var tempMidString = "";
	      for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
	      if (fromString.indexOf(tempMidString) == -1) {
	      	midString = tempMidString;
	      	i = midStrings.length + 1;
	      }
	   	}
	   } // Keep on going until we build an "inbetween" string that doesn't exist
	   // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
	   while (temp.indexOf(fromString) != -1) {
	     var toTheLeft = temp.substring(0, temp.indexOf(fromString));
	     var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
	     temp = toTheLeft + midString + toTheRight;
	   }
	   // Next, replace the "inbetween" string with the "toString"
	   while (temp.indexOf(midString) != -1) {
	     var toTheLeft = temp.substring(0, temp.indexOf(midString));
	     var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
	     temp = toTheLeft + toString + toTheRight;
	   }
	} // Ends the check to see if the string being replaced is part of the replacement string or not
	return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function

function convert2Time(TimeString) {
	//all validations have been done before, this is a valid Time String;
	var sHour = "0";
	var sMin = "0";
	var sSec = "0";
	
	isplit = TimeString.indexOf(':');
	
	sHour = TimeString.substring(0, isplit);
	iminute = TimeString.indexOf(':', isplit + 1);

	if (iminute == -1 || iminute == TimeString.length)
		sMin = TimeString.substring((sHour.length + 1));
	else
		sMin = TimeString.substring((sHour.length + 1), iminute);

	if (iminute != -1)
		sSec = TimeString.substring(iminute + 1);
	//the month starts at 0 not 1!
	return new Date(70,0,1,sHour,sMin,sSec);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeContent(id,shtml) {
	theObject=MM_findObj(id);
	if (theObject) {   
      if (typeof theObject.innerHTML != "undefined") theObject.innerHTML = shtml;
   }
}



var dayNames = new Array('Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag');

function t4(y) {

// (c) 1999 by Thomas Salvador, Freeware
// http://www.brauchbar.de
//
// Die hier gebrachten Scripts koennen Sie nach Belieben verwenden, solange
// diese Copyright-Meldung vollstaendig und unveraendert enthalten bleibt
// Jegliche Nutzung mit veraenderter oder entferter Melkdung ist untersagt.

  return (y < 1000 ? y+1900 : y);
}

function date2str(dat) {
  var y = t4(dat.getYear());
  var m = dat.getMonth()+1;
  var d = dat.getDate();
  return '' + (d < 10? '0' : '' ) + d
            + (m < 10? '.0' : '.' ) + m + '.'
            + y;
}

function ymd2julian(y, m, d) {
  if (m < 3)
    var f = -1;
  else
    var f = 0;

  return Math.floor((1461*(f+4800+y))/4)
       + Math.floor(((m-2-(f*12))*367)/12)
       - Math.floor(3*Math.floor((y+4900+f)/100)/4)
       + d
       - 32075;
}

function getJulian(t) {
  return ymd2julian(t4(t.getYear()), t.getMonth()+1, t.getDate());
}

function doy(y,m,d) {
  return ymd2julian(y,m,d)-ymd2julian(y,1,1)+1;
}

function getDoy(t) {
  return doy(t4(t.getYear()), t.getMonth()+1, t.getDate());
}

function dow(y,m,d) {
  return ((ymd2julian(y,m,d) % 7) + 1) % 7;
}

function julianDow(j) {
  return ((j % 7) + 1) % 7;
}

var now = new Date();

function getWeek(dat) {
  var y = t4(dat.getYear());

  var julianDat = getJulian(dat);
  var dowDat = julianDow(julianDat);

  var workJulian;

  if (dowDat == 0)
    workJulian = julianDat - 6;
  else
    workJulian = julianDat - dowDat + 1;

  var julianFirst = ymd2julian(y, 1, 1);

  var weeksFromFirst = Math.floor( (workJulian-julianFirst) / 7) + 1;

  var dowFirst = julianDow(julianFirst);
  var week;
  if (dowFirst == 0 || dowFirst > 4) {
    week = 53 + weeksFromFirst;
    if (week > 53)
      week -= 53;
  } else
    week = 1 + weeksFromFirst;

  if (week >= 53) {
    var tempWeek = getWeek(new Date(y+1, 0, 1));
    if (tempWeek == 1)
      week = 1;
  }

  return week;
}

function weekYear(dat, wek) {
  var result = t4(dat.getYear());

  if (wek == 1 && dat.getMonth() == 11)
    result++;
  else
    if (wek > 50 && dat.getMonth() == 0)
      result--;

  return result;
}

function getClientWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return ( myWidth );
}

function getClientHeight() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return ( myHeight );
}
//-->
