<!--
function showAbstimmung(current_id) {
	document.getElementById(current_id + '_bew_abst').style.display = 'inline';
	document.getElementById(current_id + '_bew_erg').style.display = 'none';
}

function swap_bild(b_id,b_nummer,b_reset) {
	var bildname = '';
	var formname =  'poll_form_' + b_id;
	if ( b_reset == true || document.forms[formname].poll_bewertung.value == 0 ) {
		for ( var i = 1; i < 6; i++ ) {
			bildname = b_id + '_stern_' + i;
			document.getElementById(bildname).src = "/fm/1268/stern_deaktiv.png";
		}
		
		if ( b_nummer > 0 ) {
			for ( var i = 1; i <= b_nummer; i++ ) {
				bildname = b_id + '_stern_' + i;
				document.getElementById(bildname).src = "/fm/1268/stern_aktiv.png";
			}
		}
	}
}

function set_bewertung(b_id,b_nummer) {
	var formname =  'poll_form_' + b_id;
	document.forms[formname].poll_bewertung.value = b_nummer;
	swap_bild(b_id,0,true);
	swap_bild(b_id,b_nummer,true);
}
	
function trim(value) {
	var endpos;
	var startpos = 0;
	while((value.charAt(startpos) == " ") && (startpos<value.length)) {
		startpos++;
	}
	if (startpos == value.length) {
		value = "";
	} else {
		value = value.substring(startpos,value.length);
		endpos = (value.length)-1;
		while(value.charAt(endpos) == " ") {
			endpos--;
		}
		value = value.substring(0,endpos+1);
	}
	return(value);
}

function setFormValue(formName,formElement,formElementValue) {
	var myForm;
	eval('myForm = document.'+formName+'["'+formElement+'"]');
	if (myForm.length>0 && myForm[0].type == "radio") {
		for (var i=0; i<myForm.length; i++) {
			myForm[i].checked = (myForm.options[i].value == formElementValue) ? true : false;
		}
	} else if (myForm.type == "checkbox") {
		myForm.checked = (myForm.value == formElementValue) ? true : false;
	} else if (myForm.type == "select-one" || myForm.type == "select-multiple") {
		for (var i=0; i<myForm.length; i++) {
			if (myForm.options[i].value == formElementValue) {
				myForm.options[i].selected = true;
			}
		}
	} else if (myForm.type == "text" || myForm.type == "textarea") {
			myForm.value = formElementValue;
	}
}

function quickSearch(value) {
	var mySearch;
	mySearch = trim(value);
	if (mySearch == "Stichworteingabe") {
		document.schnellsuche['schnellsuche[suchbegriff]'].value = '';
		mySearch = "";
	}
	if (mySearch == "") {
		alert('Bitte geben Sie einen Suchbegriff ein');
		document.schnellsuche['schnellsuche[suchbegriff]'].focus();
		return false;
	} else {
		return true;
	}
}

function ShowResults(value) {
	document.detailsuche.twQuery.value = value;
	document.detailsuche.submit();
}

function Download(pathfile)	{
	if (pathfile != "")	{
		var WinURL = pathfile;
		var WinName = "WinDownload";
		var WinOptions = "";
		var FensterBreite = 950;
		var FensterHoehe = 640;
		var AbstandLeft = 200;
		var AbstandTop = 100;
		if ((screen.width > 0) && (screen.width > FensterBreite))	{AbstandLeft = Math.round((screen.width - FensterBreite) / 2);}
		if ((screen.height > 0) && (screen.height > FensterHoehe))	{AbstandTop = Math.round((screen.height - FensterHoehe) / 2);}
		WinOptions = "width=" + FensterBreite + ",innerWidth=" + FensterBreite + ",height=" + FensterHoehe + ",innerHeight=" + FensterHoehe + ",left=" + AbstandLeft + ",screenX=" + AbstandLeft + ",top=" + AbstandTop + ",screenY=" + AbstandTop + ",dependent=yes,hotkeys=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no";
		WinDownload = window.open(WinURL,WinName,WinOptions);
		WinDownload.focus();
	}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// launch the popup with the customer registration page
function launchRegistrationPopup(targetUrl) {
	aWindow = open(targetUrl,'Neuanmeldung','width=640,height=574,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
}

// Achtung: diese Funktionalität erscheint zur Zeit im gleiche Fenster,
// d.h. es wird kein Popup aufgemacht
// (vergleiche Anwendungsfälle Neuanmeldung, Login und Kaufvorgang!!)
// launch the popup with the recover password page
function launchRecoverPasswordPopup(targetUrl) {
	aWindow = open(targetUrl,'PasswortVergessen','width=640,height=300,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
}

// launch the popup with the newsletter subscription page
function launchNewsletterPopup(targetUrl) {
	aWindow = open(targetUrl,'Newsletter','width=640,height=574,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
}

function launchBOPopupKontostand(popupUrl, reloadUrl) {
  return launchBOPopup(popupUrl, 'Kontostand', reloadUrl, 540, 300);
}

function launchBOPopupQuittung(popupUrl, reloadUrl) {
  return launchBOPopup(popupUrl, 'Quittung', reloadUrl, 460, 307);
}

function launchBOPopupZahlung(popupUrl, reloadUrl) {
  return launchBOPopup(popupUrl, 'Zahlung', reloadUrl, 460, 300);
}

// launch a BO-Popup. In the main browser window the reloadUrl is loaded
function launchBOPopup(popupUrl, title, reloadUrl) {
	aWindow = open(popupUrl,title,'width=460,height=300,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
	this.location.href = reloadUrl;
}

// launch a BO-Popup for Abos.
function launchBOAboPopup(popupUrl, title) {
	aWindow = open(popupUrl,title,'width=460,height=400,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
}

function launchTWPopupPasswordInfo(popupUrl) {
  return launchTWPopup(popupUrl, 'InfoPasswort', 374);
}

function launchTWPopupMaterialKommentar(popupUrl) {
  return launchTWPopup(popupUrl, 'EditDownload', 396);
}

function launchTWPopupAboKuendigen(popupUrl) {
  return launchTWPopup(popupUrl, 'cancelsubscription', 346);
}

function launchTWPopupContactForm(popupUrl) {
  return launchTWPopup(popupUrl, 'Kontaktformular', 600);
}

// launch a normal TeachWeb popup. They all have the same width but different heights.
function launchTWPopup(popupUrl, title, height, width) {
		if (width==undefined){
				width=416;
			}
	aWindow = open(popupUrl,title,'width=' + width + ',height=' + height + ',left=100,top=100,resizable=yes,scrollbars=yes');
    // Clemens (05.04.2004): check if popup is blocked; popupblocker logging
    if (aWindow == null || aWindow == 'undefined' || aWindow == '') {
		// make a hhtp request to store settings in stat
		imageRequest = new Image();
		imageRequest.src = "http://www07.cornelsen.de/dcs.gif?popupsenabled=false";
		// setCookie( 'cookie_popups_enabled', 'NEIN', null, '/teachweb', 'www.cornelsen.de');
		alert('Sehr geehrter Nutzer,\n um fortzufahren, müssen Sie ein Popupfenster in ihrem Browser zulassen.');
		// alert('Die Einstellungen Ihres Browsers erlauben keine fehlerfreie Nutzung unseres Angebots.  \nBitte deaktivieren Sie den Popup-Blocker oder stellen Sie diesen so ein, \ndass Fenster mit der Internetadresse \"*.cornelsen.de\" erlaubt sind. \nWeitere Informationen zu den Browser-Einstellungen finden Sie in unserer Hilfe unter http://www.cornelsen.de/tw_statisch_neu/hilfe/index.html. ');
		// window.location.reload();
		
		// javascript setCookie("Sie_paranoider_AFFE");
    } else { // make a hhtp request to store settings in stat
		imageRequest = new Image();
		imageRequest.src = "http://www07.cornelsen.de/dcs.gif?popupsenabled=true";
		// setCookie( 'cookie_popups_enabled', 'JA', null, '/teachweb', 'www.cornelsen.de');
		
    }
    //aWindow.focus();
}

// launch a not yet implemented Popup.
function launchNYIPopup() {
	launchTWPopup('/jsps/open/nyi.jsp','NYI','120');
}

// launch a popup with the print preview
function launchTWPrintviewPopup(printactionurl, width) {
	aWindow = open(printactionurl + '?print=true', 'Druckansicht','width=' + width + ',height=600,left=100,top=100,resizable=yes,scrollbars=yes');
	aWindow.focus();
}

// add parameter to request to force reload from server (disable cache)
function addArbitraryParam(url) {
  var connector = url.indexOf('?') == -1 ? '?' : '&';
  var dCurrent = new Date();
  return url + connector + 'cuid=' + escape(dCurrent.getTime());
}

// initializes a reload for counting the downloads
// again
function startInit() {
	this.location.reload();
}

// opens a centered Popup
function openCenteredPopup(URI,ti,b,h) {
	var eigenschaft,sbreite,shoehe,fenster02;
	// stellt die Bildschirmabmessungen fest
	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);

	if(ns6||ns4) {
		sbreite = innerWidth;
		shoehe = innerHeight;
	}
	else if(ie4) {
		sbreite = document.body.clientWidth;
		shoehe = document.body.clientHeight;
	}

	// Fensterpossition linke obere Ecke
	x = ((sbreite-b)/2);
	y = (shoehe-h)/2;

	var eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y;
	// weitere Attribiute hinzufügen
	eigenschaften= eigenschaften + ",width="+b+",height="+h+",menubar=no";

	fenster02=window.open(URI,ti,eigenschaften);
}




/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */



function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}


/**
 * Gets the value of the specified cookie.
 * name  Name of the desired cookie.
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * adds an url to the bookmarks
 */
function addToBookmarks(currentURL, currentPageName) {
	
	if (window.sidebar) { 
		window.sidebar.addPanel(currentPageName, currentURL, ""); 
	} else if (document.all) {
		window.external.AddFavorite(currentURL, currentPageName);
	} else if(window.opera && window.print) {
		return true;
	}
}



//-->