// Projektspezifische JS-Funktionen
function openPopup(url, ID, mediaID) {
	//der array 'IstrListboxTargetPopupstyle' wird in der methode
	//MainOutputClass.GetClientJSPopupTargets() gefuellt...

	if((mediaID > 0) && (ID == 197)) {
		url = "/main.aspx/G/" + GroupID + "/L/" + LangID + "/A/" + AreaID + "/ID/" + mediaID + "/V/media";
		window.open(url, "ePilotPopup" + ID, IstrListboxTargetPopupstyle[ID]);
	} else {
		//url += "/V/popup/PM/1";
		window.open(url, "ePilotPopup" + ID, IstrListboxTargetPopupstyle[ID]);
	}
}

function openContent(url, ID) {
	switch(ID) {
		case 4:
			parent.location.href = url;
			break;
		case 5:
			parent.window.opener.location.href = url;
			break;
	}
}

function RunSearch(lngPopupMode) {

	var queryval = encodeURI(document.forms["suche"].elements["Z"].value);

	// Die Auswahl des Suchbereiches erfolgt über die Radiobuttons
	var ID = -1;

	if(document.forms["suche"].elements["ID"][0].checked == true)
		ID = document.forms["suche"].elements["ID"][0].value;
	else
		ID = document.forms["suche"].elements["ID"][1].value;

	if(lngPopupMode > 0) {
		var strLink = IstrPopupLink;
		strLink += "/ID/" + ID + "/Z/" + queryval;
		openPopup(strLink, lngPopupMode);
	}
	else {
		var strLink = IstrBaseLink;
		strLink += "/ID/" + ID + "/Z/" + queryval;

		document.location.href = strLink;
	}
}




function runSiteSearch(folderPath, navID, langID, restrictedMode, zValue) {
	if(zValue) {
		var path = folderPath + navID + ',' + langID + ',' + navID + ',' + restrictedMode + ',(' + zValue + '),0,0,0.aspx';
	}
	else {
		var path = folderPath + navID + ',' + langID + ',' + navID + ',' + restrictedMode + ',0,0,0,0.aspx';
	}

	window.location = path;
	return false;
}

function setFieldValue(zValue, fieldID) {
	document.getElementById(fieldID).value = zValue;
}


function schnellnavigation() {
	var linkid = document.glossarselection.glossar.value;
	var link = linkid;
	location.href = link;
}


function mschnellnavigation() {
	var linkid = document.mglossarselection.mglossar.value;
	var link = linkid;
	location.href = link;
}

function checkLangDD() {
	if(document.forms.sprachselection) {
		if(LangID == 1031) {
			document.forms['sprachselection'].elements['L'][0].selected = true;
		}
		else {
			document.forms['sprachselection'].elements['L'][1].selected = true;
		}
	}
}

