function sprache(lang)
{
	document.formular.sprache.value=lang;
	//document.formular.Index_Projekt.value = Index_Projekt;	
	document.formular.submit();
}

function notshow(wert)
{
	document.formular.notshow.value=wert;
	document.formular.submit();
}

function xshow(layer)
{
	if (document.layers)
		document[layer].visibility = "show";
	else if (document.all)
		document.all[layer].style.visibility = 'visible';
	else if (document.getElementById)
		document.getElementById(layer).style.visibility = "visible";
}

function xhide(layer)
{
	if (document.layers)
		document[layer].visibility = "hide";
	else if (document.all)
		document.all[layer].style.visibility = 'hidden';
	else if (document.getElementById)
		document.getElementById(layer ).style.visibility = "hidden";
}

function changeblue(id,basis,richtung)
{
	document.getElementById(id).src="../bilder/"+basis+"blau"+richtung+".png";
	document.getElementById(id).background="../bilder/"+basis+"blau"+richtung+".png";
}

function changegray(id,basis,richtung)
{
	document.getElementById(id).src="../bilder/"+basis+"grau"+richtung+".png";
	document.getElementById(id).background="../bilder/"+basis+"grau"+richtung+".png";
}

function questchange(id,farbe)
{
	document.getElementById(id).src="../bilder/fragezeichen"+farbe+".png";
}

function xhideAll()
{
	if (document.layers)
	{
		document['adatei'].visibility = "hide";
		document['aprojekte'].visibility = "hide";
		document['ainfos'].visibility = "hide";
		document['zwischiframe'].visibility = "hide";
		document['aoptionen'].visibility = "hide";
		document['ahilfe'].visibility = "hide";
	}
	else if (document.all)
	{
		document.all['adatei'].style.visibility = 'hidden';
		document.all['aprojekte'].style.visibility = 'hidden';
		document.all['ainfos'].style.visibility = 'hidden';
		document.all['zwischiframe'].style.visibility = 'hidden';
		document.all['aoptionen'].style.visibility = 'hidden';
		document.all['ahilfe'].style.visibility = 'hidden';
	}
	else if (document.getElementById)
	{
		document.getElementById('adatei').style.visibility = "hidden";
		document.getElementById('aprojekte').style.visibility = "hidden";
		document.getElementById('ainfos').style.visibility = "hidden";
		document.getElementById('zwischiframe').style.visibility = "hidden";
		document.getElementById('aoptionen').style.visibility = "hidden";
		document.getElementById('ahilfe').style.visibility = "hidden";
	}
}

function einheitschaltmenu(wert,Index_Projekt,Index_Gehaeuse)
{
	
	document.formular.einheitschalt.value=wert;	
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.submit();
}

function menu(wert)
{
	document.formular.reiter.value=wert;
	document.formular.zauber.value="";
	document.formular.submit();
}

function zaubermenu(wert,Index_Projekt)
{
	document.formular.zauber.value=wert;
	document.formular.verlust.value="";
	document.formular.Index_Projekt.value = Index_Projekt;
	projektspeichern();
}

function verlustmenu(wert,Index_Projekt,Index_Gehaeuse)
{
	document.formular.verlust.value=wert;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function anreihmenu(wert,Index_Projekt)
{
	document.formular.anreihung.value=wert;
	document.formular.Index_Projekt.value = Index_Projekt;
	projektspeichern();
}

function loeschgeraet(geraeteartloesch,Index_Projekt,Index_Gehaeuse)
{
	document.formular.geraeteartloesch.value=geraeteartloesch;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function anbauwahl(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	document.formular.anbauart.value=wert;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function control(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	document.formular.Controller.value=wert;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function edelstahl(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	if (wert == "x")
	{
		document.formular.V2A.value = "";
	}
	else
	{
		document.formular.V2A.value = "x";
	}
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function edelstahl4(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	if (wert == "x")
	{
		document.formular.V4A.value = "";
	}
	else
	{
		document.formular.V4A.value = "x";
	}
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function volumenfluss(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	document.formular.Volumenfluss.value = wert;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function vorlauftemp(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	document.formular.Vorlauftemp.value = wert;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function zusatzinfowahl(wert,geraeteauswahl,Index_Projekt,Index_Gehaeuse)
{
	document.formular.zusatzinfo.value=wert;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Projekt.value = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function reihan(zaehler,Index_Projekt,aktion1)
{
	document.formular.aktion1.value=aktion1;
	document.formular.zaehler1.value=zaehler;
	document.formular.Index_Projekt.value = Index_Projekt;
	projektspeichern();
}

function setzlikasten(wert)
{
	if (document.formular[wert].value == "")
	{
		document.formular[wert].value="on";
		document.getElementById("kasten"+wert).src="../bilder/kastenlimhaken.gif";
	}
	else
	{
		document.formular[wert].value="";
		document.getElementById("kasten"+wert).src="../bilder/kastenliohaken.gif";
	}
}

function setzkasten(wert)
{
	if (document.formular[wert].value == "")
	{
		document.formular[wert].value="on";
		document.getElementById("kasten"+wert).src="../bilder/kastenmhaken.gif";
	}
	else
	{
		document.formular[wert].value="";
		document.getElementById("kasten"+wert).src="../bilder/kastenohaken.gif";
	}
}

function pruefedc()
{
	var s = document.formular.Spannung.value;
	if(s=="24" || s=="48")
 	{
 		if (document.formular.mit230V.value == 'on')
 		{
 			setzkasten('mit230V');
 			document.formular.mit230V.value = '';
 		}
 	document.formular.Frequenz.value = '0';
 	}

	var v = document.formular.mit230V.value;
	if((s=="115" || s=="230") && v=="on")
 	{
 		if (document.formular.mit230V.value == 'on')
 		{
 			setzkasten('mit230V');
 			document.formular.mit230V.value = '';
 		}
 	}

	var f = document.formular.Frequenz.value;
	if((s=="115" || s=="230") && f=="0")
 	{
 		document.formular.Frequenz.value = '50';
 	}
	if((s=="400" || s=="460") && f=="0")
 	{
 		if (document.formular.mit230V.value == '')
 		{
 			setzkasten('mit230V');
 			document.formular.mit230V.value = 'on';
 		}
 		document.formular.Frequenz.value = '50';
 	}
}

function setzeaktion(aktion,Index_Projekt,Index_Gehaeuse)
{
	document.formular.aktion.value = aktion;
	document.formular.Index_Projekt.value  = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.submit();
}

function updateAccesories(haupt, zubehoer, anzahl, Index_Projekt, Index_Gehaeuse)
{
	document.formular.Accesories_haupt.value = haupt;
	document.formular.Accesories_zubehoer.value = zubehoer;
	document.formular.Accesories_anzahl.value = anzahl;
	document.formular.Index_Projekt.value  = Index_Projekt;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.aktion.value = "aktuell";
	document.formular.submit();
}

function projektspeichern()
{
	if (document.formular.Index_Projekt.value == "")
	{
		document.formular.aktion.value = "neu";
	}
	else
	{
		document.formular.aktion.value = "aktuell";
	}
	document.formular.submit();
}

function absenden(ti,ta)
{
	document.formular.maxInnentemp.value = ti;
	document.formular.maxAussentemp.value = ta;

	projektspeichern();
}

function tigtagabsenden(tig,tag,Index_Gehaeuse)
{
	document.formular.Tig.value = tig;
	document.formular.Tag.value = tag;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function htigtagabsenden(HeizminInntemp,HeizminAusstemp,geraeteauswahl,Index_Gehaeuse)
{
	document.formular.HeizminInntemp.value = HeizminInntemp;
	document.formular.HeizminAusstemp.value = HeizminAusstemp;
	document.formular.geraeteauswahl.value=geraeteauswahl;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function mezeabsenden(menge,zeitfaktor,Index_Gehaeuse,verlustaktion,verlustgeraetbearb)
{
	document.formular.menge.value = menge;
	document.formular.zeitfaktor.value = zeitfaktor;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.verlustaktion.value = ""; //verlustaktion;
	document.formular.verlustgeraetbearb.value = verlustgeraetbearb;
	projektspeichern();
}

function verlustwechsel(gruppe,Index_Gehaeuse)
{
	if (gruppe == "haupt")
	{
		document.formular.untergruppe.value = "<?=$text[375]?>";
	}
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	projektspeichern();
}

function verlustakt(verlustaktion,Index_Gehaeuse,Index_Verlustgeraete,Verlustgeraet)
{
	document.formular.verlustaktion.value = verlustaktion;
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.Index_Verlustgeraete.value = Index_Verlustgeraete;
	document.formular.verlustgeraetbearb.value = Verlustgeraet;
	projektspeichern();
}

function updateHeatlossQty(Index_Verlustgeraete, qty, Index_Gehaeuse)
{
	document.formular.verlustaktion.value = 'updateHeatLossQty';
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.Index_Verlustgeraete.value = Index_Verlustgeraete;
	document.formular.HeatLossQty.value = qty;
	
	projektspeichern();
}

function updateHeatlossFactor(Index_Verlustgeraete, factor, Index_Gehaeuse)
{
	document.formular.verlustaktion.value = 'updateHeatLossFactor';
	document.formular.Index_Gehaeuse.value = Index_Gehaeuse;
	document.formular.Index_Verlustgeraete.value = Index_Verlustgeraete;
	document.formular.HeatLossFactor.value = factor;
	
	projektspeichern();
}

function spannung(wert)
{
	document.formular.Spannung.value = wert;
	pruefedc();
	projektspeichern();
}

function frequenz(wert)
{
	document.formular.Frequenz.value = wert;
	pruefedc();
	projektspeichern();
}

var DeMarkColBackground, MarkColBackground, MarkColFont, DeMarkColFont;
MarkColBackground   = "#FCD99B";
DeMarkColBackground = "";
MarkColFont         = "#000000";
DeMarkColFont       = "";

//Ueberpruefen, ob markiertes Feld ueberhaupt existiert
var testRowIDX, RowIDXexists;
testRowIDX   = "";
RowIDXexists = "no";

for(i = 0; i < document.getElementById.length; i++)
{
	if(document.getElementById[i].id == "<%=RowIDXcache%>")
	{
		RowIDXexists = "yes";
	}
}

//Markierung entfernen
function DeMarkRow(RowIDX)
{
	if(document.formular.RowIDXcache.value != "")
	{
		document.getElementById(document.formular.RowIDXcache.value).style.backgroundColor = DeMarkColBackground;
		document.getElementById(document.formular.RowIDXcache.value).style.color           = DeMarkColFont;
	}

	MarkRow(RowIDX);
}

//Markierung setzen
function MarkRow(RowIDX)
{
	if(RowIDX != "")
	{
		document.getElementById(RowIDX).style.backgroundColor = MarkColBackground;
		document.getElementById(RowIDX).style.color           = MarkColFont;
	}

	document.formular.RowIDXcache.value = RowIDX;
	return true;
}

//Markierung entfernen
function DeMarkRowLuef(RowIDX,schemaIDX,techIDX)
{
	if(document.formular.RowIDXcache.value != "")
	{
		document.getElementById(document.formular.RowIDXcache.value).style.backgroundColor = DeMarkColBackground;
		document.getElementById(document.formular.RowIDXcache.value).style.color           = DeMarkColFont;
	}

	if (document.layers)
		var hidi = "hide";
	else if (document.all)
		var hidi = 'hidden';
	else if (document.getElementById)
		var hidi = "hidden";

	if(document.formular.schemaIDXcache.value != "")
	{
		document.getElementById(document.formular.schemaIDXcache.value).style.visibility   = hidi;
	}

	if(document.formular.techIDXcache.value != "")
	{
		document.getElementById(document.formular.techIDXcache.value).style.visibility     = hidi;
	}

	MarkRowLuef(RowIDX,schemaIDX,techIDX);
}

//Markierung setzen
function MarkRowLuef(RowIDX,schemaIDX,techIDX)
{
	if(RowIDX != "")
	{
		document.getElementById(RowIDX).style.backgroundColor = MarkColBackground;
		document.getElementById(RowIDX).style.color           = MarkColFont;

		if (document.layers)
			var visi = "show";
		else if (document.all)
			var visi = 'visible';
		else if (document.getElementById)
			var visi = "visible";

		document.getElementById(schemaIDX).style.visibility   = visi;
		document.getElementById(techIDX).style.visibility     = visi;
	}

	document.formular.RowIDXcache.value = RowIDX;
	document.formular.schemaIDXcache.value = schemaIDX;
	document.formular.techIDXcache.value = techIDX;
	return true;
}

function DeMarkRowLuLu(RowIDX,schemaIDX,techIDX,Anz_Geraet)
{
	if(document.formular.RowIDXcache.value != "")
	{
		document.getElementById(document.formular.RowIDXcache.value).style.backgroundColor = DeMarkColBackground;
		document.getElementById(document.formular.RowIDXcache.value).style.color           = DeMarkColFont;
	}

	if (document.layers)
		var hidi = "hide";
	else if (document.all)
		var hidi = 'hidden';
	else if (document.getElementById)
		var hidi = "hidden";

	if(document.formular.schemaIDXcache.value != "")
	{
		document.getElementById(document.formular.schemaIDXcache.value).style.visibility   = hidi;
	}

	if(document.formular.techIDXcache.value != "")
	{
		document.getElementById(document.formular.techIDXcache.value).style.visibility     = hidi;
	}

	MarkRowLuLu(RowIDX,schemaIDX,techIDX,Anz_Geraet);
}

//Markierung setzen
function MarkRowLuLu(RowIDX,schemaIDX,techIDX,Anz_Geraet)
{
	if(RowIDX != "")
	{
		document.getElementById(RowIDX).style.backgroundColor = MarkColBackground;
		document.getElementById(RowIDX).style.color           = MarkColFont;

		if (document.layers)
			var visi = "show";
		else if (document.all)
			var visi = 'visible';
		else if (document.getElementById)
			var visi = "visible";

		document.getElementById(schemaIDX).style.visibility   = visi;
		document.getElementById(techIDX).style.visibility     = visi;
	}

	document.formular.RowIDXcache.value = RowIDX;
	document.formular.schemaIDXcache.value = schemaIDX;
	document.formular.techIDXcache.value = techIDX;
	document.formular.Anz_Geraet.value = Anz_Geraet;
	return true;
}

function DeMarkRowKuehl(RowIDX,schemaIDX,techIDX,kennlIDX,Anz_Geraet)
{
	if(document.formular.RowIDXcache.value != "")
	{
		document.getElementById(document.formular.RowIDXcache.value).style.backgroundColor = DeMarkColBackground;
		document.getElementById(document.formular.RowIDXcache.value).style.color           = DeMarkColFont;
	}

	if (document.layers)
		var hidi = "hide";
	else if (document.all)
		var hidi = 'hidden';
	else if (document.getElementById)
		var hidi = "hidden";

	if(document.formular.kennlIDXcache.value != "")
	{
		document.getElementById(document.formular.kennlIDXcache.value).style.visibility   = hidi;
	}

	if(document.formular.schemaIDXcache.value != "")
	{
		document.getElementById(document.formular.schemaIDXcache.value).style.visibility   = hidi;
	}

	if(document.formular.techIDXcache.value != "")
	{
		document.getElementById(document.formular.techIDXcache.value).style.visibility     = hidi;
	}

	MarkRowKuehl(RowIDX,schemaIDX,techIDX,kennlIDX,Anz_Geraet);
}

//Markierung setzen
function MarkRowKuehl(RowIDX,schemaIDX,techIDX,kennlIDX,Anz_Geraet)
{
	if(RowIDX != "")
	{
		document.getElementById(RowIDX).style.backgroundColor = MarkColBackground;
		document.getElementById(RowIDX).style.color           = MarkColFont;
	
		if (document.layers)
			var visi = "show";
		else if (document.all)
			var visi = 'visible';
		else if (document.getElementById)
			var visi = "visible";

		document.getElementById(kennlIDX).style.visibility   = visi;
		document.getElementById(schemaIDX).style.visibility   = visi;
		document.getElementById(techIDX).style.visibility     = visi;
	}

	document.formular.RowIDXcache.value = RowIDX;
	document.formular.kennlIDXcache.value = kennlIDX;
	document.formular.schemaIDXcache.value = schemaIDX;
	document.formular.techIDXcache.value = techIDX;
	document.formular.Anz_Geraet.value = Anz_Geraet;
	return true;
}

function zusammSaveFile(type)
{
	document.txtsummaryform.data.value = document.all['summary'].innerHTML;
 	document.txtsummaryform.outputType.value = type;
 	document.txtsummaryform.submit();
}
