// mark and setup content
function masc(sender, linkName) {
	selectNavi(sender);
	// TopPic ist jetzt statisch und Motor
	//set_top_pic("../pics/"+linkName+"Top.jpg");
	setContFrame(linkName+".html");
}

function mascb(sender, linkName) {
	clearNaviSelection();
	// TopPic ist jetzt statisch und Motor
	//set_top_pic("..pics/"+linkName+"Top.jpg");
	setContFrame(linkName+".html");
}


function setContFrame(contUrl) {
	if (contUrl != "" && top.contentIFrame.contentFrame.location != contUrl)
		top.contentIFrame.contentFrame.location = contUrl;
}

//-----------------

var detail = null;

function setup_top_pic() {
	top.top_pic = document.getElementById('top_pic');
	//alert("setup_top_pic feddich");
}

function setup() {
	//alert("setup");
	//top.top_pic = document.getElementById('top_pic'); <- passiert in top.html
	//setContFrame("aktuelles.html");
	//set_top_pic("../pics/aktuellesTop.jpg");
	top.naviSelection=naviFrame.document.getElementById("startSel");
}

function selectNavi(item) {
	if (top.naviSelection != null) {
		top.naviSelection.className = "navi";
	}
	
	top.naviSelection = item;
	item.className="naviSel";
}

function clearNaviSelection() {
	if (top.naviSelection != null) {
		top.naviSelection.className = "navi";
	}
	top.naviSelection = null;
}


/*function selectLeft(item) {
	if (top.leftSelection != null) {
		if (top.leftSelection.className != null) {
			top.leftSelection.className = "dark";
		}
	}
	
	top.leftSelection = item;
	item.className="red";
}*/

function set_top_pic(url) {
	if (url != "" && top.top_pic.src != url) {
		top.top_pic.src = url;
	}
}

function setAll(picUrl, leftUrl, midUrl) {
	set_top_pic(picUrl);
	setFrames(leftUrl, midUrl);
}

function applyOther(picUrl, midUrl) {
	set_top_pic(picUrl);
	if (midUrl != "" && top.midframe.location != midUrl) 
		top.midframe.location.replace(midUrl);
}

function setFrames(leftUrl, midUrl) {
	setLeftFrame(leftUrl);
	setMidFrame(midUrl);
}

function setLeftFrame(leftUrl) {
	if (leftUrl != "" && top.leftframe.location != leftUrl)
		top.leftframe.location = leftUrl;
	
	//neues Fenster, kein Aktuelles :)
	top.leftSelection=null;
}

function setMidFrame(midUrl) {
	if (midUrl != "" && top.midframe.location != midUrl)
		top.midframe.location = midUrl;
}

function check_Anfrageformular_DE() {
	if (document.Anfrageformular.out_005LFirma.value == "" || 
		document.Anfrageformular.out_022LName.value == "" || 
		document.Anfrageformular.out_028LEMail.value == "") {
		alert("Es sind nicht alle Pflichfelder ausgefüllt!\nStellen Sie bitte sicher, dass Sie Firma, Name und E-Mail-Adresse ausgefüllt haben!");
		return false;
	}
	return bestaetigen();
}

function check_Anfrageformular_EN() {
	if (document.Anfrageformular.out_005LFirma.value == "" || 
		document.Anfrageformular.out_022LName.value == "" || 
		document.Anfrageformular.out_028LEMail.value == "") {
		alert("Missing data in mandatory field!\nPlease make sure that the mandatory fields Company, Surname und E-mail address are filled in!");
		return false;
	}
	return bestaetigen_en();
}

function check_Rueckrufformular_DE() {
	if (document.Rueckrufformular.out_005LFirma.value == "" || 
		document.Rueckrufformular.out_022LName.value == "" || 
		document.Rueckrufformular.out_024LTelNr.value == "" || 
		document.Rueckrufformular.out_026LTermin.value == "") {
		alert("Es sind nicht alle Pflichfelder ausgefüllt!\nStellen Sie bitte sicher, dass Sie Firma, Name, Telefonnummer und Rückruftermin ausgefüllt haben!");
		return false;
	}
	return bestaetigen();
}

function check_Rueckrufformular_EN() {
	if (document.Rueckrufformular.out_005LFirma.value == "" || 
		document.Rueckrufformular.out_022LName.value == "" || 
		document.Rueckrufformular.out_024LTelNr.value == "" || 
		document.Rueckrufformular.out_026LTermin.value == "") {
		alert("Missing data in mandatory field!\nPlease make sure that the mandatory fields Company, Surname, Phone no and Appointment to call back are filled in!");
		return false;
	}
	return bestaetigen_en();
}


function bestaetigen() {
	if (confirm("Daten jetzt senden?") == true) {
		return true;
	}
	else {
		return false;
	}
}

function bestaetigen_en() {
	if (confirm("Send data now?") == true) {
		return true;
	}
	else {
		return false;
	}
}

function showDetail(url, target) {
	if (target == "") {
		target = "Detail";
	}
	window.open(url, target);
}