//-------------------------------------------------------
// afelio GmbH - JavaScript für HTML-Seiten mit afelio.lmm
// (c) 2005,2006,2007  afelio GmbH Wedel  - Alle Rechte vorbehalten
// Version 3.20 Autor: Oliver Pincus
//-------------------------------------------------------

//-------------------------------------------------------
// aktive Navigation
//-------------------------------------------------------

function start(theURL) {  
var Browser = "unbekannt";
if (navigator.appName == "Netscape")
window.open(theURL, '', 'left=0,top=0,height=739,width=1018,scrollbars=no,toolbar=no,menubar=no,status=no');    
else if (navigator.appName == "Microsoft Internet Explorer")
window.open(theURL, '', 'left=0,top=0,height=739,width=1018,scrollbars=yes,toolbar=no,menubar=no,status=no');    
else
alert('Unbekannter Browser. Die Datei kann nicht angezeigt werden.');
}

function neue_seite(theURL) {
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	if (strParam != '') {
		theURL = theURL + '?' + strParam;    
	} else {
		theURL = theURL;
	}
	window.location.href= theURL
}
function modul_neue_seite(theURL) {
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	if (strParam != '') {
		theURL = theURL + '?' + strParam;    
	} else {
		theURL = theURL;
	}
	window.location.href= theURL
}

function neue_kategorie(theURL) {
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	if (strParam != '') {
		theURL = theURL + '?' + strParam;    
	} else {
		theURL = theURL;
	}
	window.location.href= theURL
}

function weiter(theID) {
	// detecting modus
	var arrGet = new Array();
    if(window.location.search != ""){
     var strParam = window.location.search;
     strParam = strParam.substr(1,strParam.length);
      var arrGroups = strParam.split("&");
      var arrHelp = new Array();
      for(var i=0; i<arrGroups.length; i++){
        arrHelp = arrGroups[i].split("=");
       if(arrHelp.length == 2)
        arrGet[arrHelp[0]] = arrHelp[1];
        if(arrHelp.length == 1)
        arrGet[arrHelp[0]] = arrHelp[0];
        arrHelp.length = 0;
    }
    }
	var modus = arrGet["m"];
	//alert('Modus:' + modus);

	switch (modus) {
	
	case "s":
		// Seiten werden nicht-linear angezeigt
		break;
    default:	 
		var strParam = window.location.search;
		strParam = strParam.substr(1,strParam.length);
		var thenextID = theID + 1;
		if (strParam != '') {
			theID = 'page' + thenextID + '.htm?' + strParam;
		} else {
			theID = 'page' + thenextID + '.html';
		}
		window.location.href= theID 
		break;
	}
	
 }

function zurueck(theID) {
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	thenextID = theID - 1;
	if (strParam != '') {
		theID = 'page' + thenextID + '.htm?' + strParam;
	} else {
		theID = 'page' + thenextID + '.html';
	}
	window.location.href= theID
 }
 
function modulweiter(theID) {
var thenextID = theID + 1;
var strParam = window.location.search;
strParam = strParam.substr(1,strParam.length);
theID = 'modul' + thenextID + '.htm?' + strParam;
 window.location.href= theID 
 }

//sequence 
 
function sequence_next(theID) {
//next page
var arrGet = new Array();
   if(window.location.search != ""){
     var strParam = window.location.search;
     strParam = strParam.substr(1,strParam.length);
      var arrGroups = strParam.split("&");
      var arrHelp = new Array();
      for(var i=0; i<arrGroups.length; i++){
        arrHelp = arrGroups[i].split("=");
       if(arrHelp.length == 2)
        arrGet[arrHelp[0]] = arrHelp[1];
        if(arrHelp.length == 1)
        arrGet[arrHelp[0]] = arrHelp[0];
        arrHelp.length = 0;
    }
    }	
	var thenextID= arrGet[theID];
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	theID = 'sequence_page' + thenextID + '.htm?' + strParam;
	window.location.href= theID 
 }

function sequence_previous(theID) {
var arrGet = new Array();
   if(window.location.search != ""){
     var strParam = window.location.search;
     strParam = strParam.substr(1,strParam.length);
      var arrGroups = strParam.split("&");
      var arrHelp = new Array();
      for(var i=0; i<arrGroups.length; i++){
        arrHelp = arrGroups[i].split("=");
       if(arrHelp.length == 2)
        arrGet[arrHelp[0]] = arrHelp[1];
        if(arrHelp.length == 1)
        arrGet[arrHelp[0]] = arrHelp[0];
        arrHelp.length = 0;
    }
    }	
	theID = theID - 1;
	var thenextID= arrGet[theID];
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);
	theID = 'sequence_page' + thenextID + '.htm?' + strParam;
	window.location.href= theID 
 }
 
function sequence_index(theID) {
var strParam = window.location.search;
strParam = strParam.substr(1,strParam.length);
theID = 'sequence_index.htm?' + strParam;
window.location.href= theID 
 } 
 
// 

function modulzurueck(theID) {
var strParam = window.location.search;
strParam = strParam.substr(1,strParam.length);
theID = theID - 1;
theID = 'modul' + theID + '.htm?' + strParam;
window.location.href= theID 
 }

function previewweiter(theID) {
	var thenextID = theID + 1;
	theID = 'previewpage' + thenextID + '.html';
	if(window.location.search != ""){
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);	
		theID = 'previewpage' + thenextID + '.htm?' + strParam;
	}
	window.location.href= theID 
 }

function previewzurueck(theID) {
	var thenextID = theID - 1;
	theID = 'previewpage' + thenextID + '.html';
	if(window.location.search != ""){
	var strParam = window.location.search;
	strParam = strParam.substr(1,strParam.length);	
		theID = 'previewpage' + thenextID + '.htm?' + strParam;
	}
	window.location.href= theID  
	}
 
//-------------------------------------------------------
// geplante Aufrufe von Lernmediendateien
//-------------------------------------------------------
 
 function tutorialderwoche() {					
	var cTime=new Date()
	var sYear=new Date(cTime.getYear(),0,1)
	sYear=sYear.getTime()-(sYear.getDay()-1)*(24*60*60*1000)
	var cWeek=Math.ceil((cTime.getTime()-sYear)/(7*24*60*60*1000))-1
	alert('Aktuelle Woche: ' + cWeek);
	captivate1014(cWeek) 
}

//-------------------------------------------------------
// Aufruf von Lernmediendateien
//-------------------------------------------------------

function Acrobat(PDFFileName) {
	NameWindow = window.open(PDFFileName + '.pdf','Fenster','width=800,height=600,top=0,left=0,scrollbars=yes,resizable=yes')
	NameWindow.focus()
}

function Acrobat_l(PDFFileName) {
	theURL_path = get_theURL();
	theURL = theURL_path + PDFFileName + '.pdf';
	NameWindow = window.open(theURL,'Fenster','width=800,height=600,top=0,left=0,scrollbars=yes,resizable=yes')
	NameWindow.focus()
}

function captivate1000(theURL) {  
  
var Browser = "unbekannt";
if (navigator.appName == "Netscape")
window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1018,scrollbars=no,toolbar=no,menubar=no,status=no');    
else if (navigator.appName == "Microsoft Internet Explorer")
//window.open(theURL  + '.htm', '', 'fullscreen=yes, scrollbars=no');
window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1018,scrollbars=no,toolbar=no,menubar=no,status=no');    
else
alert('Unbekannter Browser. Die Datei kann nicht angezeigt werden.');
}

function captivate1024(theURL) {
  if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   var g_fIsSP2 = false; 
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
   if (g_fIsSP2) 
   { 
   //öffnet in Windows XP SP2 ohne Fullscreen Voraussetzung für XP SP2: in den Internet Explorer Sicherheitseinstellungen muss Skript initiierte Fenster ohne Größen- und Positionsbeschränkung" aktiviert sein.
   //alert('SP2');
   window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   //öffnet als FullScreen
   //alert('FullScreen');
    //winref = window.open(theURL + '_cp.htm', '', 'fullscreen=yes, scrollbars=no');  
	window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
   } 
  }
   if (n > 1){
   //Windows 2003-Server - öffnet ohne Fullscreen
	;alert('2003 Server');
    window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
  }
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }
}

function captivate1024_l(theURL) {

	theURL_path = get_theURL();
	theURL = theURL_path + theURL;
	
	// opening page
	
	if (screen.width > 800){
	n = window.navigator.appVersion.substring(40,41); 
	if (n < 2){
    //Windows 2000 oder XP
	var g_fIsSP2 = false; 
	g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
	if (g_fIsSP2) 
	{ 
		window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
		} 
	else 
	{ 
		winref = window.open(theURL + '_cp.htm', '', 'fullscreen=yes, scrollbars=auto');  
	} 
	}
	if (n > 1){
		window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
	}
	}
	else{
	alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }	
		
}

function captivate1024_t1(theURL) {
  window.open('cptracker.htm?' + theURL +'*mode1', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');    
}

function captivate1024_t1_l(theURL) {
	theURL_path = get_theURL();
	theURL = theURL_path + theURL;
    window.open('cptracker.htm?' + theURL +'*mode1', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');    
}

function captivate1014(theURL) {
  if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   var g_fIsSP2 = false; 
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
   if (g_fIsSP2) 
   { 
   //öffnet in Windows XP SP2 ohne Fullscreen 
  //Voraussetzung für XP SP2: in den Internet Explorer Sicherheitseinstellungen muss
  //"Skript initiierte Fenster ohne Größen- und Positionsbeschränkung" aktiviert sein.
 //alert('Das Tutorial wird als Fenster vom Server geöffnet.');
  window.open(theURL + '.htm', '', 'left=0,top=0,height=675,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   //öffnet als FullScreen
   //alert('Das Tutorial wird als Fullscreen vom Server geöffnet.');
   winref = window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');  
   } 
  }
   if (n > 1){
    //Windows 2003-Server - öffnet ohne Fullscreen
  //alert('Das Tutorial wird als Fenster vom Terminalserver geöffnet.');
  window.open(theURL + '.htm', '', 'left=0,top=0,height=675,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
  }
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }
}

function quizmaker2q(theURL) {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
var popW = 800;
var popH = 600;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable';
Win = window.open(theURL + 'output/quizmaker.html?testID=' + theURL + '&testMode=Q', 'Quiz', winProp);
}

function quizmaker2qs(theURL) {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
var popW = 800;
var popH = 600;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable';
Win = window.open(theURL + 'output/quizmaker.html?testID=' + theURL + '&testMode=QS', 'Quiz', winProp);
}

function quizmaker2a(theURL) {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
var popW = 800;
var popH = 600;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable';
Win = window.open(theURL + 'output/quizmaker.html?testID=' + theURL + '&testMode=A', 'Quiz', winProp);
}

function quizmaker2as(theURL,testID) {
pnummer = document.personalnummer.personalnummer.value;
if (pnummer != '') {
a = confirm('Ist die Personalnummer ' + pnummer + ' richtig?');
if ( a == true) {
	a = confirm(unescape('M%F6chten Sie jetzt die Abschlussfragen beantworten?' + '\n' + '\n' + 'Der Aufruf wird als Versuch gez%E4hlt.'));
	if ( a == true) {
		var winleft = (screen.width - 800) / 2;
		var winUp = (screen.height - 600) / 2;
		var popW = 800;
		var popH = 600;
		winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
		Win = window.open(theURL + 'output/quizmaker.html?pid=' + pnummer + '&testID=' + testID + '&testMode=AS', 'Quiz', winProp)
	}
	}
	}
else {
	alert('Bitte tragen Sie Ihre Personalnummer ein, bevor Sie die Fragen starten.');
}
}

function assessment_start(theCAT,theURL,theID) {
		var winleft = (screen.width - 800) / 2;
		var winUp = (screen.height - 600) / 2;
		var popW = 800;
		var popH = 600;
		winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
		Win = window.open('../../afragen_frame.htm?testCAT=' + theCAT + '&testURL=' + theURL + '&testID=' + theID, 'Quiz', winProp)
}
	
function articulate41(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 580) / 2;
theURL= theURL + '-files/player.html';
winProp = 'width=800,height=580,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
}




function popup(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
winProp = 'width=800,height=600,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function popup1024(theURL) { 
winProp = 'width=1014,height=780,left=10,top=10,scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function slideshow(theURL) {
  if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   var g_fIsSP2 = false; 
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
   if (g_fIsSP2) 
   { 
   //öffnet in Windows XP SP2 ohne Fullscreen Voraussetzung für XP SP2: in den Internet Explorer Sicherheitseinstellungen muss Skript initiierte Fenster ohne Größen- und Positionsbeschränkung" aktiviert sein.
   window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=yes,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   //öffnet als FullScreen
    winref = window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=yes');  
   } 
  }
   if (n > 1){
   //Windows 2003-Server - öffnet ohne Fullscreen
    window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=yes,toolbar=no,menubar=no,status=no');
  }
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }
}

//------------------------------------------------------------------------
// noch zu erstellen
//-------------------------------------------------------------------------

function mp3(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
winProp = 'width=800,height=600,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

//------------------------------------------------------------------------
// Aufruf von Lernmediendateien 
//-------------------------------------------------------------------------

function explicanto(theURL) {
  window.open(theURL,'course','width=1014,height=693');
}

function captivate800(theURL) {
 if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   var g_fIsSP2 = false; 
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
   if (g_fIsSP2) 
   { 
   //öffnet in Windows XP SP2 ohne Fullscreen Voraussetzung für XP SP2: in den Internet Explorer Sicherheitseinstellungen muss Skript initiierte Fenster ohne Größen- und Positionsbeschränkung" aktiviert sein.
   window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   //öffnet als FullScreen
    winref = window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');  
   } 
  }
   if (n > 1){
   //Windows 2003-Server - öffnet ohne Fullscreen
    window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
  }
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }

}

// benötigt für alte Versionen

function tutorial_l(theURL) {
theURL_path = get_theURL();
	theURL = theURL_path + theURL;
	
	// opening page
	
	if (screen.width > 800){
	n = window.navigator.appVersion.substring(40,41); 
	if (n < 2){
    //Windows 2000 oder XP
	var g_fIsSP2 = false; 
	g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
	if (g_fIsSP2) 
	{ 
		window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
		} 
	else 
	{ 
		winref = window.open(theURL + '_cp.htm', '', 'fullscreen=yes, scrollbars=auto');  
	} 
	}
	if (n > 1){
		window.open(theURL + '_cp.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
	}
	}
	else{
	alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }	
}

function tutorial1024(theURL) {
   if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');
   } 
   if (n > 1){
    //Windows 2003-Server - öffnet ohne Fullscreen
  //alert('Das Tutorial wird als Fenster vom Terminalserver geöffnet.');
   //öffnet Fenster für Terminalserver mit _ts-Datei
   alert('Sie nutzen einen Terminalserver. Aus technischen Gründen kann das Tutorial nur in eingeschränkter Qualität genutzt werden. Vielen Dank für Ihr Verständnis!');
   window.open(theURL + '_ts.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
   } 
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }
}

function tutorial1024_l(theURL) {
pfad = window.location.pathname;
pfadtext = new String(pfad);
pfadtext = pfadtext.slice(1,pfadtext.length - 9);
lokal = window.location.href.indexOf('?',0);
 if (lokal < 1) {
  // --- vom Server
 }
 else{
  // --- lokal
  plaenge = pfadtext.length;
  var trenner = 0;
  //nur erforderlich, wenn Dateien in einem Unterordner liegen
  //for (var ii = 0; ii < plaenge; ii++) {
  //  zeichen = pfadtext.charCodeAt(ii);
  //    if (zeichen == '47') {
  //   trenner = ii+1;
  //   break;
  //   }
  //}
  //
  pfadtext = pfadtext.substring(trenner,plaenge);
  pfadtext = 'q:\\tk-lernen\\' + pfadtext + theURL;
  theURL = pfadtext;
 }
   if (screen.width > 800){
   n = window.navigator.appVersion.substring(40,41); 
   if (n < 2){
    //Windows 2000 oder XP
   window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');
   } 
   if (n > 1){
    //Windows 2003-Server - öffnet ohne Fullscreen
  //alert('Das Tutorial wird als Fenster vom Terminalserver geöffnet.');
   //öffnet Fenster für Terminalserver mit _ts-Datei
   alert('Sie nutzen einen Terminalserver. Aus technischen Gründen kann das Tutorial nur in eingeschränkter Qualität genutzt werden. Vielen Dank für Ihr Verständnis!');
  window.open(theURL + '_ts.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');
   } 
  }
 else{
alert('Für dieses Angebot müssen Sie Ihre Bildschirmauflösung auf mindestens 1024x768 erhöhen. Wechseln Sie zum Desktop, klicken Sie mit der rechten Maustaste, wählen EIGENSCHAFTEN und erhöhen im Register Einstellungen Ihre Bildschirmauflösung. Nach der Bearbeitung dieses Angebots können Sie die Bildschirmauflösung wieder ändern. Vielen Dank für Ihr Verständnis!');
   }
}

function quizmaker(theURL) {
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
var popW = 800;
var popH = 600;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable';
Win = window.open(theURL + '/quizmaker.html', 'Quiz', winProp);
}

function afragenquizmaker(theURL) {
pnummer = document.personalnummer.personalnummer.value;
if ( pnummer != '') {
a = confirm('Ist die Personalnummer ' + pnummer + ' richtig?');
if ( a == true) {
	a = confirm(unescape('M%F6chten Sie jetzt die Abschlussfragen beantworten?' + '\n' + '\n' + 'Der Aufruf wird als Versuch gez%E4hlt.'));
	if ( a == true) {
		var winleft = (screen.width - 800) / 2;
		var winUp = (screen.height - 600) / 2;
		var popW = 800;
		var popH = 600;
		winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
		Win = window.open(theURL + '/quizmaker.html?' + pnummer + "-" + theURL, 'Quiz', winProp)
		window.close();
	}
	}
	}
else {
	alert('Bitte tragen Sie Ihre Personalnummer ein, bevor Sie die Fragen starten.');
}
}

//------------------------------------------------------------------------
// Sonstige Funktionen Techniker Krankenkasse
//-------------------------------------------------------------------------

function CookieData(){
 
  this.put = function(key, value){
    this[key] = value;
  };
  
  this.get = function(name){
    if(this[name])
      return this[name];
    else
      return null;
  };
  
  this.contains = function( key ){
    return (typeof this[key] != undefined)?true:false;
  };
  
  this.join = function(){
    var tmp = "";
    var counter = 0;
    for(var i in this){
      if (typeof this[i] == "function" || typeof this[i] == "object") 
        continue;
      if(counter > 0) tmp += "&";
      tmp += escape(i) + ":" + escape(this[i]);
      counter++;
    }
    return tmp;
  }
  
  this.set = function(str){
    if(str.length == 0)
      return false;
    var arr = unescape(str).split("&");
    var datas = new Array();
    for(var i = 0; i < arr.length; i++){
      datas[i] = arr[i].split(":");
    }
    for(var i = 0; i < datas.length; i++){
      this.put(datas[i][0], datas[i][1]);
    }
    return true;
  }

  this.toString = function(){
    var ret = "{";
    for(p in this ){
      if (typeof this[p] == "function" || typeof this[p] == "object") continue;
      if(ret.length > 1)
        ret += ",";
      ret += p + ":" + this[p];
    }
    return ret + "}";
  }
  
  this.setData = function(cookies, cookieName){
    var a = cookies.split("; ");
    var val = "";
    for(var i = 0; i < a.length; i++){
      // name steht am Anfang des cookie-Strings
      if( a[i].search(cookieName) == 0 ){
        var paramString = a[i].substring(cookieName.length+1);
        this.set( paramString );
        return paramString;
      }
    }
    return false;
  }
}

function Cookie(name, cookieTest){
  this.name = name;
  this.expires = new Date().getTime() + 24 * 60 * 60 * 1000;
  this.data = new CookieData();
  this.domain;
  this.path;
  this.paramString = this.data.setData(document.cookie, this.name);
  this.fromUser = this.paramString.length > 0 ? true : false;
  this.enabled = false;
  
  if(typeof cookieTest != "undefined" && cookieTest == true)
    this.test();
}

Cookie.prototype.getName = function(){
  return this.name;
}
Cookie.prototype.setExpires = function(timestamp){
  this.expires = timestamp;
}
Cookie.prototype.setPath = function(path){
  this.path = path;
}
Cookie.prototype.setDomain = function(domain){
  this.domain = domain;
}
Cookie.prototype.setValue = function(key, value){
  this.data.put(key, value);
}
Cookie.prototype.getValue = function(name){
  return this.data.get(name);
}
Cookie.prototype.getParamString = function(){
  return this.paramString;
}
Cookie.prototype.send = function(){
  document.cookie = this.name +"=" + this.data.join() +
                    "; expires=" + new Date(this.expires).toGMTString() +
                    (this.path ? "; path=" + this.path : "") +
                    (this.domain ? "; domain=" + this.domain : "");
}
Cookie.prototype.test = function(){
  if(this.fromUser == true) return true;
  var now = new Date().getTime();
  document.cookie = "cookieEnabled="+now + 
                    "; expires=" + new Date(now + 5000).toGMTString() +
                    "; path=/";
  var re = new RegExp("cookieEnabled="+now, "g");
  this.enabled = re.test(document.cookie);
}

Cookie.prototype.remove = function(){
 alert(new Date().getTime());
  this.expires = new Date().getTime()-1;
  this.data = new CookieData();
  this.send();
}

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function CalPrice() {

var Tot = document.frmOrder.txtPUnit.value*document.frmOrder.txtQty.value;
var rd = Math.round(Tot*100)/100;
document.frmOrder.txtPTotal.value = rd;
}

function DisplayStr() {
var Title, Number;
var str = window.location.search.substring(1);  
var rExp, newstr;
rExp = /%20/gi;

newstr = str.replace(rExp, " ");
var pair = newstr.split('*');
Title = pair[0];
Number = pair[1];
document.frmOrder.Titel.value = Title;
document.frmOrder.Nummer.value = Number;
}


function setCookies() {
var name, value;
var days = 365 //number of days before cookie expires
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();

name="Salutation"
value = document.frmOrder.Anrede.value
document.cookie = name+"="+value+expires+"; path=/";

name="FName"
value = document.frmOrder.Vorname.value
document.cookie = name+"="+value+expires+"; path=/";

name="LName"
value = document.frmOrder.Nachname.value
document.cookie = name+"="+value+expires+"; path=/";

name="Zip"
value = document.frmOrder.Dst.value
document.cookie = name+"="+value+expires+"; path=/";

name="Email"
value = document.frmOrder.EMail.value
document.cookie = name+"="+value+expires+"; path=/";

}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function returnCookies() {
if (document.cookie) {
  document.frmOrder.Anrede.value = readCookie("Salutation");
  document.frmOrder.Vorname.value = readCookie("FName");
  document.frmOrder.Nachname.value = readCookie("LName");
  document.frmOrder.Dst.value = readCookie("Zip");
  document.frmOrder.EMail.value = readCookie("Email");
 }
}

function DisplayID() {
document.myform.kursID_Q7_A1.value=window.location.href.substring(window.location.href.indexOf('?')+1,window.location.href.length)
}

function fehler() {
alert('Die Datei kann nicht geöffnet werden');
}
	
