//<!--
	function ovPosXY(obj) {
		var curleft=0, curtop=0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop;
				obj = obj.offsetParent;
			}
		}
		else if (obj.x) {
			curtop += obj.y;
			curleft += obj.x;
		}
		return Array( curleft, curtop );
	}

	function getMonthNum(abbMonth) {
		var arrMon = new Array(0,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
		for(i=1; i<=12; i++)
			if(abbMonth == arrMon[i])
				return i<10?"0"+i:i;
	}

	var heads=0, script_element=0;
	function ovJS( dat ) {
		if (heads==0)
			heads=document.getElementsByTagName("head");
		if (script_element!=0) {
			heads[0].removeChild(script_element);
			delete script_element;
		}
		script_element=document.createElement("script");
		script_element.type="text/javascript";
		script_element.src=dat;
		heads[0].appendChild(script_element);
	}

	var ovObject = new Array();
	function ovObj( name ) {
		if(ovObject[name])
			return ovObject[name];
		if (document.getElementById)
			ovObject[name] = document.getElementById(name);
		else if (document.all)
			ovObject[name] = document.all[name];
		else if (document.layers)
			ovObject[name] = document.layers[name];
		return ovObject[name];
	}
	function $(obj) {
		return ovObj(obj);
	}

	function high( obj, status ) {
		if( status )
			obj.style.backgroundColor = '#ccc';
		else
			obj.style.backgroundColor = '#eee';
	}

	function ovVolumen( feld, maxi, id ) {
		feld.value = feld.value.replace(/[,\.]/, "");
		feld.value = Math.floor( feld.value );
		if( !feld.value && !maxi )
			feld.style.backgroundColor = "#bbb";
		else
			feld.style.backgroundColor = "#eee";
	}

	function ovCheckVolumen( obj, maxi, org ) {
		if( obj.value < maxi ) {
			alert("FEHLER:\n\nEs liegen für diese Anlage Messwerte vor, die das von Ihnen gewählte Volumen überschreiten (höchster gemessener Wert: "+maxi+"L). Bitte bestimmen Sie erneut ein neues Volumen, oder kontaktieren Sie Ihren Administrator um die betreffenden Werte löschen zu lassen.");
			obj.value = org;
			obj.focus();
		}
	}

	function ovTankMO( nr, farbe ) {
		for( var i=1; i<=8; i++ )
			if( ovObj("tank"+i) )
				ovObj("tank"+i).style.backgroundColor = "#FFF";
		if( nr )
			ovObj("tank"+nr).style.backgroundColor = farbe;
	}

	function ovTankView( anlage, nr ) {
		document.location = "verlauf.php?anlage="+anlage+"&tanks[]="+nr;
	}
	function ovShowDetail( anlage ) {
		if( anlage == aktuelleAnlage ) {
			document.location.href = "main.php?anlage="+anlage;
			return;
		}
		document.location.href = "auswahl.php?anlage="+anlage;
	}

	function ovGotoTanksAktuell() {
		if( aktuelleAnlage )
			document.location.href = "main.php?anlage="+aktuelleAnlage;
		else
			return false;
	}

	function ovTabelleClick( anlage ) {
		if( anlage == aktuelleAnlage )
			ovGotoTanks(anlage);
		else
			document.location.href="auswahl.php?sort="+sort+"&ansicht=tabelle&anlage="+anlage;
	}

	function ovGotoTanks( anlage ) {
		document.location.href = "main.php?anlage="+anlage;
	}

	function ovMouseOver( obj, anlage, bild ) {
		if( !aktuelleAnlage && status == 0 ) {
			obj.style.backgroundColor = "#efe";
			ovObj("shortview").src = bild;
			aktuelleanlage = anlage;
		}
	}

	function ovMouseOut( obj, color ) {
		if( !aktuelleAnlage && status == 0 ) {
			obj.style.backgroundColor=color;
		}
	}
	function navSelect(id) {
		for( var i=1; i<=4; i++ )
			ovObj("td"+i).className = id==i ? "pfeil_sel" : "pfeil";
	}
	function ovSwitchInfo(id) {
		parent.head.location = "anlage.php?anlage="+id;
	}

function ovDebug( text ) {
	if( ovObj("debug") ) {
		ovObj("debug").innerHTML = text;
	}
}

function ovHandynummer( id ) {
	var land = ovObj(id+"_land").value;
	var vorwahl = ovObj(id+"_vorwahl").value;
	var nummer = ovObj(id+"_nummer").value;
	if( land && land.length < 2 )
		alert("Warnung:\nL„ndervorwahl muss aus 2 Zeichen bestehen (z.B. 49 fr Deutschland)");
	ovObj(id).value = land+vorwahl+nummer;
}

function ovEmail( id ) {
	var user = ovObj(id+"_user");
	var host = ovObj(id+"_host");
	host.style.backgroundColor = "#fff";
	user.style.backgroundColor = "#fff";
	ovObj(id).value = "";
	if( user.value && !host.value )
		host.style.backgroundColor = "#fee";
	else if( host.value && !user.value )
		user.style.backgroundColor = "#fee";
	else if( host.value && user.value )
		ovObj(id).value = user.value+"@"+host.value;
}
function ovZeitraum() {
	var arr = new Array( "jahrVon", "jahrBis", "monatVon", "monatBis", "tagVon" );
	var v = new Array;
	for(var i in arr)
	v[arr[i]] = $(arr[i]).options[$(arr[i]).selectedIndex].value;
	$('jahrBis').style.visibility = v.jahrVon!=0?'visible':'hidden';
	var monate = $('monate').style.visibility = v.jahrVon!=0&&v.jahrBis==0?'visible':'hidden';
	$('monatBis').style.visibility = monate=='visible'&&v.monatVon!=0?'visible':'hidden';
	$('tage').style.visibility = monate=='visible'&&v.monatVon!=0&&v.monatBis==0?'visible':'hidden';
	$('tagBis').style.visibility = monate=='visible'&&v.monatVon!=0&&v.tagVon!=0&&v.monatBis==0?'visible':'hidden';
}
//-->
