/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_rowColor = new Array;
var marked_row = new Array;
var marked_rowobject = new Array;
var marked_rowcell= new Array;
var marked_rowNum= new Array;



/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   integer  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    if (marked_rowNum.length == 0)
    {
    var lastNum  = theRowNum
   }
    else {
    var lastNum  = marked_rowNum [1];
   }
    marked_rowobject [theRowNum] = theRow;
    marked_rowNum [1] = theRowNum;
	if (theAction='click') {
    marked_rowNum [2] = theRowNum;
	}
	else {
	    marked_rowNum [2] = 0;
		}
	

    var theCells = null;
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
        marked_rowcell [theRowNum] = theCells;
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
        marked_rowcell [theRowNum] = theCells;
    }
    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var defaultColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        //currentColor = theCells[0].getAttribute('bgcolor');
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3
    if (currentColor == 'rgb(255, 255, 255)'){
        currentColor = '';
    }
    if (currentColor == 'rgb(242, 242, 242)'){
        currentColor = '';
    }
    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
            defaultColor           = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            defaultColor           = theDefaultColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
            defaultColor           = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            defaultColor           = theDefaultColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            defaultColor           = theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
            defaultColor           = theDefaultColor;
        }
    } // end 4
    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (theRowNum) {        
            for (c = 0; c < rowCellsCnt; c++) {
                if (lastNum == theRowNum) 
                {
                }
                else {
                //marked_rowcell[lastNum][c].setAttribute('bgcolor', defaultColor, 0);
				 if (marked_rowNum [2] == theRowNum)
                {
				marked_rowcell[lastNum][c].style.backgroundColor = defaultColor;
                }
                }
                //theCells[c].setAttribute('bgcolor', newColor, 0);
                theCells[c].style.backgroundColor = newColor;
            } // end for
        }
        // 5.2 ... with other browsers
        else {
        var c = null;
            for (c = 0; c < rowCellsCnt; c++) {
                if (lastNum == theRowNum)
                {
                }
                else {
                //marked_rowcell[lastNum][c].setAttribute('bgcolor', defaultColor, 0);
				if (marked_rowNum [2] == !theRowNum) 
                {
				marked_rowcell[lastNum][c].style.backgroundColor = defaultColor;
                }
				
                }
               // theCells[c].setAttribute('bgcolor', newColor, 0);
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5
    return true;
} // end of the 'setPointer()' function


var task_id; 
var y = 1; 
var scrolling=false; 

function scrollDown() {
parent.frame06.scroll(0, y)
y = y + 10;
task_id=window.setTimeout("scrollDown()",50); 
return;
} 

function StartScroll () { 
window.clearTimeout(task_id); 
scrollDown(); 
scrolling=true; 
return;
} 

function scrollUp() {
parent.frame06.scroll(0, y)
y = y - 10;
task_id=window.setTimeout("scrollUp()",50); 
return;
} 

function StartScrollUp () { 
window.clearTimeout(task_id); 
scrollUp(); 
scrolling=true; 
return;
} 


function StopScroll () { 
if (scrolling) {window.clearTimeout(task_id); scrolling=false;} 
return;
} 


function setColor(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor) {
if(typeof(marked_rowColor[1])=='undefined'){
marked_rowColor[1]=theRow
}
theOldRow = marked_rowColor[1]
theOldRow.style.backgroundColor = theDefaultColor;
theRow.style.backgroundColor = theMarkColor;
marked_rowColor[1] = theRow
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

	function des_List(obj, objimg){
		var j;
		var bSelected = false;
		
		//pruefen ob ein item selected ist
		for(j=0;j<obj.options.length;j++) 
			{if(obj.options[j].selected==true) {bSelected=true;break;}}
		
		//wenn kein item selected => tue nichts
		if(bSelected)
		{
			//wenn dummy gewaehlt => tue nichts
			if(obj.options[obj.selectedIndex].value!=0) 
			{
					for (j=obj.length-1;j>=0;j--) {
						if(obj.options[j].selected==true&&obj.options[j].value!=0) {
							obj.options[j] = null;
					}}
			}
		}
		if(obj.length==1) 	{objimg.src="/img/button_loeschen_lo.gif";}

	}
		function Add_List() // neue Funktion fuer Auswahlliste mit Mehrfachauswahl...AL 25.10.2002
	{
		var x;
		var j;
		var dummy = "                                  "
		
		if (document.webSave.source)
		{
			for (j=0;j<document.webSave.source.length;j++)
			{
				if(document.webSave.source.options[j].selected == true)
				{
					x = document.webSave.source.options[j].text;
					document.webSave.aim.options[document.webSave.aim.options.length]=new Option(dummy,0);
					document.webSave.aim.options[document.webSave.aim.options.length-2]=new Option(x,x);
				}
			}
			document.webSave.source_loeschen.src="/img/button_loeschen_lo.gif";
		}
	}
	
	function Set_Selected() 
	{
	for (j=0;j<document.webSave.aim.length;j++)
		{
		document.webSave.aim.options[j].selected = true
		}
	}
var ns4,ns6,ie4,ie5;
var caldiv = null;
var today,wrkdate,wrkdate2, today2;
function getBrowser() {
	// Decide browser version
	ns4 = (document.layers)? true:false;
	ns6 = (document.getElementById)? true:false;
	ie4 = (document.all)? true:false;
	ie5 = false;
	if (ie4) {
		if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) {
			ie5 = true;}
		if (ns6) {ns6 = false;}
	}
	/* alert('ns4 = '+ns4+'\nns6 = '+ns6+'\nie4 = '+ie4+'\nie5 = '+ie5);*/
	if (ns4) caldiv = self.document.cal;
	if (ie4) caldiv = self.cal.style;
	if (ns6) caldiv = self.document.getElementById("cal");
	}
function setBody(obj,body) {
	if (ns4) {
		obj.document.write(body)
		obj.document.close()
	} else if (ie4) {
		self.document.all["cal"].innerHTML = body
	} else if (ns6) {
		range = self.document.createRange();
		range.setStartBefore(obj);
		frag = range.createContextualFragment(body);
		while (obj.hasChildNodes()) {
			obj.removeChild(obj.lastChild);
			}
		obj.appendChild(frag);
		}
		document.calForm.javBody.value = body;
	}
function set(a) {
	if (a>0 && a<32) {//call from day link
		wrkdate.setDate(a);
		if (document.calForm.wrkdate.value != document.calForm.WebBis.value) {
		document.calForm.wrkdate.value = a+"."+(wrkdate.getMonth()+1)+"."+wrkdate.getFullYear();
		document.calForm.jahr.value = wrkdate.getFullYear();
		document.calForm.monat.value = (wrkdate.getMonth());
		document.calForm.tag.value = a;
		if (document.calForm.tag2.value > a) {
		document.calForm.WebBis.value = a+"."+(wrkdate.getMonth()+1)+"."+wrkdate.getFullYear();
		document.calForm.jahr2.value = wrkdate.getFullYear();
		document.calForm.monat2.value = (wrkdate.getMonth());
		document.calForm.tag2.value = a;
		}
		document.calForm.javboolean.value = "falsch";	
		}
		if (document.calForm.wrkdate.value == document.calForm.WebBis.value) {
		document.calForm.WebBis.value = a+"."+(wrkdate.getMonth()+1)+"."+wrkdate.getFullYear();
		document.calForm.jahr2.value = wrkdate.getFullYear();
		document.calForm.monat2.value = (wrkdate.getMonth());
		document.calForm.tag2.value = a;
		document.calForm.javboolean.value = "falsch";	
		}
		//document.calForm.boolean.value = "false";
			
		return;
	}
	if (a==0) {// first call from page calendar6
		getBrowser();
		if (!(ns4 || ie4 || ns6)) {
			alert('Browser nicht erkannt.\nKalender nicht verfügbar');
			return;}
		if (document.calForm.javboolean.value == "falsch"){
		today=new Date(document.calForm.jahr.value,document.calForm.monat.value,document.calForm.tag.value);
		today.setHours(3,0,0,0);/* avoid  and dst problems*/
		wrkdate = new Date(today.getTime());
		today2=new Date(document.calForm.jahr2.value, document.calForm.monat2.value, document.calForm.tag2.value);
		today2.setHours(3,0,0,0);/* avoid  and dst problems*/
		wrkdate2 = new Date(today2.getTime());
		wrkdate3 = new Date(today.getTime());
		wrkdate.setDate(1); //1st of month
	}
	} // other calls from cal
	else if (a==-32) {wrkdate.setMonth(wrkdate.getMonth()-1);
		document.calForm.monat2.value = wrkdate.getMonth();
		document.calForm.javboolean.value = "wahr";}
	else if (a== 32) {wrkdate.setMonth(wrkdate.getMonth()+1);
		document.calForm.monat2.value = wrkdate.getMonth();
		document.calForm.javboolean.value = "wahr";}

	bodypref='<table class="cal" cellpadding="0" cellspacing="1" border="0" align="right">';
	bodysuff='</table>';
	var wrkmonth = wrkdate.getMonth();
	var wrkyear = wrkdate.getFullYear();
	var charmy='JanFebMarAprMaiJunJulAugSepOktNovDez'.substr(wrkmonth*3,3)+' '+wrkyear;
	document.title = charmy;

	res ='<tr><td class=nav><a class=nav href="javascript:set(-32)"><</a></td>'
	res+='<td class=bol colspan="5">'+charmy+'</td>';
	res+='<td class=nav><a class=nav href="javascript:set(32)">></a></td>';
	//res+='<td class=nav><a class=nav href="javascript:self.close()">x</a></td></tr>\n';
	res+='<tr><td class=norm>Mo</td><td class=norm>Di</td><td class=norm>Mi</td><td class=norm>Do</td><td class=norm>Fr</td><td class=norm>Sa</td><td class=norm>So</td></tr>\n';
	res+='<tr><td colspan="7" height="1" class="black"></td></tr>\n';
	var weekday = wrkdate.getDay(); //0=Sunday
	var monday = 1-weekday+1;
	if (monday>1) {monday-=7;} //was Sunday
	var tmpdate = new Date(today.getTime());
	var tmpdate2 = new Date(today2.getTime());
	var tmpmonth = tmpdate.getMonth();
	if (wrkmonth != tmpmonth){
	var tmpdate = new Date(wrkdate.getTime());
	var tmpdate2 = new Date(wrkdate2.getTime());
	}
	tmpdate.setDate(monday); // first day, can be <1
	tmpdate2.setDate(monday); // first day, can be <1
	for (var k=0;k<6;k++) { // 4 to 6 weeks
		res+='<tr>';		
		for (var i=0;i<7;i++) {
			var j = tmpdate.getDate();
			if (tmpdate.getMonth()!=wrkmonth) {
				res+='<td class="ina">' + j + '</td>';
			} else {
				if (tmpdate-today>=0 && tmpdate-today2<=0) {
					res+='<td class=tod><a class=tod href="javascript:set('+j+')">'+j+'</a></td>';
				} else {
					res+='<td class=norm><a class=norm href="javascript:set('+j+')">'+j+'</a></td>';
					}
			}
			tmpdate.setDate(tmpdate.getDate()+1); // next day
		}
		res+='</tr>\n';
		if (tmpdate.getMonth()!=wrkmonth) {break;}
	}
	setBody(caldiv,bodypref+res+bodysuff);
	}
function setFields(dateval) {
	var target = (window.location.href+'&').replace(/^.*\&t\=/,'').replace(/\&.*/,'');
	if (target.length==0) return;
	var form=window.self.document.forms[0];
	if (!form) return;
	var field=form.elements[target];
	if (!field) return;
//typeof form.elements['DateFormat']=='undefined'
	var tmj=(!form.elements['DateFormat']) ? 'TT.MM.JJJJ':form.elements['DateFormat'].value;
	tmj=tmj.replace('TT',dateval.getDate());
	tmj=tmj.replace('MM',dateval.getMonth()+1);
	tmj=tmj.replace('JJJJ',dateval.getFullYear());
	field.value=tmj;
	field.focus();
	self.close();
	return;
	}

<!--
// Copyright information must stay intact
// FormCheck v1.10
// Copyright NavSurf.com 2002, all rights reserved
// Creative Solutions for JavaScript navigation menus, scrollers and web widgets
// Affordable Services in JavaScript consulting, customization and trouble-shooting
// Visit NavSurf.com at http://navsurf.com

function formCheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("vTitel", "vTitelTeil");
	// field description to appear in the dialog box
	var fieldDescription = Array("Project", "Request");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
// -->

  function NewWindow(Inhalt,Target_Name,nBreite,nHoehe,Scroll){
   FENSTER=window.open(Inhalt,Target_Name,"width="+nBreite+",height="+nHoehe+",toolbar=0,status=0,menubar=0,resizable=no,scrollbars="+Scroll+",directories=0");
   return false;
  }
  
    function CloseWindow(WindowName){
   if(WindowName=="Alert"){
     window.close();
     return true;
   }
  }

function submitForm(s)  {
s.value = "  Sending...  ";
return true;
}
