function getAppVersion() {
 appname= navigator.appName;
 appversion = navigator.appVersion;
 majorver = appversion.substring(0, 1);
 if ( (appname == "Netscape") && ( majorver >= 3 ) ) return 1;
 if ( (appname == "Microsoft Internet Explorer") && (majorver >= 4) ) return 1;
  return 0;
}

function swtch(num, imgname, layername) {
  if (getAppVersion()) {
 	if(document.layers)
		{
			if (layername)
				{ document.layers[layername].document.images[imgname].src = img[num].src; }
			else

				{ document[imgname].src = img[num].src; }	
		}
	else
		{ document[imgname].src = img[num].src; }
  	}
}

function mOver(cell)
{
   if (!cell.contains(event.fromElement))
   {
      cell.style.cursor = 'hand';
      cell.bgColor = '#C1C1C1';
   }
}

function mOut(cell)
{
   if (!cell.contains(event.toElement))
   {
      cell.style.cursor = 'default';
      cell.bgColor = '#005B7F';
   }
}

function mOver2(cell)
{
   if (!cell.contains(event.fromElement))
   {
      cell.style.cursor = 'hand';
      cell.bgColor = '#9D9C9C';
   }
}

function mOut2(cell)
{
   if (!cell.contains(event.toElement))
   {
      cell.style.cursor = 'default';
      cell.bgColor = '#C1C1C1';
   }
}

function mClick(cell)
{
   if(event.srcElement.tagName=='TD')
   {
      cell.children.tags('A')[0].click();
   }
}


function openwindow (datei,rid) {
  F1 = window.open('/cgi-bin/'+datei+'.pl?' + rid, 'Rechnung', 'left=100,top=200');
  F1.focus();
}


var nachrichtenMarkiert = false;

function markAll(form) {
        var i = 0;
        while ( true ) {
              if ( form.elements[i] ) {
                   if ( form.elements[i].type == "checkbox" ) {
                        if ( !nachrichtenMarkiert )
                             form.elements[i].checked = true;
                        else
                             form.elements[i].checked = false;
                   }
              }
              else
                   break;
              i++;
        }
        if ( nachrichtenMarkiert )
             nachrichtenMarkiert = false;
        else
             nachrichtenMarkiert = true;
}
