//-------------------------------------------------------
// afelio GmbH - JavaScript für HTML-Seiten mit afelio.lmm
// (c) 2005 afelio GmbH Wedel 
// Version 1.15 Autor: Oliver Pincus
//-------------------------------------------------------
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 externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;

function schritte(WindowURL) {
 WindowURL = WindowURL + '.htm'
 NameWindow = window.open(WindowURL,'Fenster','width=640,height=480,top=0,left=0,scrollbars=yes,resizable=yes')
 NameWindow.focus()
}

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');
}

function weiter(theID) {
var thenextID = theID + 1;
theID = 'page' + thenextID + '.htm';
 window.location.href= theID 
 }

function zurueck(theID) {
theID = theID - 1;
theID = 'page' + theID + '.htm';
 window.location.href= theID 
 }
 
 function rd(swffilename,swfwidth,swfheight){
   if (swffilename.length==0) {
    alert('Fehler');
    window.close();
   }
   else 
{
   newwin = window.open("","robodemowin","fullscreen=1,scrollbars=1");window.opener=''
   newwin.resizeBy(15,0)
   screen_h = screen.height;
   screen_w = screen.width;
   //alert(screen_w + ',' + screen_h);
   //Top-Margin neu berechnen in Abhängigkeit der Bildschirmauflösung und der Filmgröße;
   //;
   var htmlString=
   "<HTML> "+
   "<BODY onLoad='window.document.robodemo.focus();'><center>"+
  "<BODY SCROLL='no' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>"+    "<OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id=robodemo WIDTH='" + swfwidth + "' HEIGHT='" + swfheight + "' CODEBASE='http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0'> "+
   "<PARAM NAME=movie VALUE='" + swffilename + ".swf'> "+
   "<PARAM NAME=play VALUE=true> "+
   "<PARAM NAME=loop VALUE=0>"+
   "<PARAM NAME=quality VALUE=high>"+
   "<EMBED name=robodemo SRC='" + swffilename + ".swf' WIDTH=' + swfwidth + 'HEIGHT=' + swfheight +  "+
   "loop=0 quality=high "+
   "TYPE='application/x-shockwave-flash' "+
   "swLiveConnect=true "+
   "PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>"+
   "</EMBED>"+
   "</OBJECT>"+
   "</center>"+
   "</BODY></HTML>"
   newwin.document.open();
   newwin.document.write(htmlString)
   newwin.document.close()
   }
}

function ppctutorial(newURL) {
   newwin = window.open("","robodemowin","fullscreen=1,scrollbars=1");window.opener=''
   newwin.resizeBy(15,0)
   swfheight = 319;
   swfwidth = 239;
   swffilename = newURL; 
   var htmlString=
   "<HTML> "+
   "<BODY onLoad='window.document.robodemo.focus();'><center>"+
  "<BODY SCROLL='no' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>"+    "<OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id=robodemo WIDTH='" + swfwidth + "' HEIGHT='" + swfheight + "' CODEBASE='http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0'> "+
   "<PARAM NAME=movie VALUE='" + swffilename + ".swf'> "+
   "<PARAM NAME=play VALUE=true> "+
   "<PARAM NAME=loop VALUE=0>"+
   "<PARAM NAME=quality VALUE=high>"+
   "<EMBED name=robodemo SRC='" + swffilename + ".swf' WIDTH=' + swfwidth + 'HEIGHT=' + swfheight +  "+
   "loop=0 quality=high "+
   "TYPE='application/x-shockwave-flash' "+
   "swLiveConnect=true "+
   "PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>"+
   "</EMBED>"+
   "</OBJECT>"+
   "</center>"+
   "</BODY></HTML>"
   newwin.document.open();
   newwin.document.write(htmlString);
   newwin.document.close();
}

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) 
}

function neue_seite(theURL) {
lokal = window.location.href.indexOf('?',0);
 if (lokal < 1) {
  // --- vom Server
  window.location.href= theURL
 }
 else{
  // --- lokal
   window.location.href= theURL + '?l' 
 }
}

function neue_kategorie(theURL) {
basis_url=top.window.location.pathname;
basis_ende=0;
for (i = 0; i < basis_url.length; i++) {
	if ((basis_url.charAt(i) == '/')||(basis_url.charAt(i) == '\\')) {
		basis_ende=i;};
	};
basis_url=basis_url.substring(0,basis_ende+1);
lokal = window.location.href.indexOf('?',0);
checkv =theURL.substring (0,2);
if (checkv == ".." ) {
  letzterslash = theURL.lastIndexOf("/",theURL.length);
  url = theURL.substring(letzterslash+1,theURL.length);
   theURL = basis_url + url;
}

 if (lokal < 1) {
  // --- vom Server
  window.location.href= theURL
 }
 else{
  // --- lokal
   window.location.href= theURL + '?l' 
 }

}

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('Das Tutorial wird als Fenster vom Server geöffnet.');
  window.open(theURL + '.htm', '', 'left=0,top=0,height=739,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=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) {
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
   var g_fIsSP2 = false; 
   g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); 
   if (g_fIsSP2) 
   { 
  window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   winref = window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');  
   } 
  }
   if (n > 1){
  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!');
   }
}

function captivate1024s(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) 
   { 
  window.open(theURL + '.htm', '', 'left=0,top=0,height=739,width=1014,scrollbars=no,toolbar=no,menubar=no,status=no');  
  } 
   else 
   { 
   winref = window.open(theURL + '.htm', '', 'fullscreen=yes, scrollbars=auto');  
   } 
  }
   if (n > 1){
  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!');
   }
}

function tutorial(newURL) {
   newwin = window.open("","robodemowin","fullscreen=1,scrollbars=1");window.opener=''
   newwin.resizeBy(15,0)
   swfheight = 600;
   swfwidth = 800;
   swffilename = newURL; 
   var htmlString=
   "<HTML> "+
   "<BODY onLoad='window.document.robodemo.focus();'><center>"+
  "<BODY SCROLL='no' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>"+    "<OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id=robodemo WIDTH='" + swfwidth + "' HEIGHT='" + swfheight + "' CODEBASE='http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0'> "+
   "<PARAM NAME=movie VALUE='" + swffilename + ".swf'> "+
   "<PARAM NAME=play VALUE=true> "+
   "<PARAM NAME=loop VALUE=0>"+
   "<PARAM NAME=quality VALUE=high>"+
   "<EMBED name=robodemo SRC='" + swffilename + ".swf' WIDTH=' + swfwidth + 'HEIGHT=' + swfheight +  "+
   "loop=0 quality=high "+
   "TYPE='application/x-shockwave-flash' "+
   "swLiveConnect=true "+
   "PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>"+
   "</EMBED>"+
   "</OBJECT>"+
   "</center>"+
   "</BODY></HTML>"
   newwin.document.open();
   newwin.document.write(htmlString);
   newwin.document.close();
}

function tutorial_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;
 }
   newwin = window.open("","robodemowin","fullscreen=1,scrollbars=1");window.opener=''
   newwin.resizeBy(15,0)
   swfheight = 600;
   swfwidth = 800;
   swffilename = theURL; 
   var htmlString=
   "<HTML> "+
   "<BODY onLoad='window.document.robodemo.focus();'><center>"+
  "<BODY SCROLL='no' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>"+    "<OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id=robodemo WIDTH='" + swfwidth + "' HEIGHT='" + swfheight + "' CODEBASE='http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0'> "+
   "<PARAM NAME=movie VALUE='" + swffilename + ".swf'> "+
   "<PARAM NAME=play VALUE=true> "+
   "<PARAM NAME=loop VALUE=0>"+
   "<PARAM NAME=quality VALUE=high>"+
   "<EMBED name=robodemo SRC='" + swffilename + ".swf' WIDTH=' + swfwidth + 'HEIGHT=' + swfheight +  "+
   "loop=0 quality=high "+
   "TYPE='application/x-shockwave-flash' "+
   "swLiveConnect=true "+
   "PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>"+
   "</EMBED>"+
   "</OBJECT>"+
   "</center>"+
   "</BODY></HTML>"
   newwin.document.open();
   newwin.document.write(htmlString);
   newwin.document.close();
}

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 popup(theURL) { 
//var winleft = (screen.width - 800) / 2;
//var winUp = (screen.height - 600) / 2;
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 popupklein(theURL) { 
var winleft = (screen.width - 640) / 2;
var winUp = (screen.height - 480) / 2;
winProp = 'width=640,height=480,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function articulate(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
theURL= theURL + 'output/quizmaker.html';
winProp = 'width=800,height=600,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
}

function articulate41(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 580) / 2;
theURL= theURL + '/player.html';
winProp = 'width=800,height=580,left='+winleft+',top='+winUp+',scrollbars=1,resizable'
Win = window.open(theURL, 'Fenster', winProp)
}


function afeliocmm(theURL) { 
var winleft = (screen.width - 800) / 2;
var winUp = (screen.height - 600) / 2;
theURL= '../../cmm/index.php?e=' + theURL;
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 NewWindow(WindowURL) {
 NameWindow = window.open(WindowURL,'Fenster','width=800,height=600,top=0,left=0,scrollbars=yes,resizable=yes')
 NameWindow.focus()
}

function Acrobat(PDFFileName) {
 NameWindow = window.open(PDFFileName + '.pdf','Fenster','width=800,height=600,top=0,left=0,scrollbars=yes,resizable=yes')
 NameWindow.focus()
}

function Unterlage(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) {
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 + PDFFileName + '.pdf';
 PDFFileName = pfadtext;
 }
 NameWindow = window.open(PDFFileName,'Fenster','width=800,height=600,top=0,left=0,scrollbars=yes,resizable=yes')
 NameWindow.focus()
}

function NewPopup(theURL, Name, popW, popH, scroll) { 
var winleft = (screen.width - popW) / 2;
var winUp = (screen.height - popH) / 2;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
Win = window.open(theURL, Name, winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function NewShow(newURL) {
{window.open(newURL + '/player.html','','width=800,height=600,scrollbars=no')};
}

function afeliotracker_counter(afeliotracker_ID) {
//--- Aufruf übertragen ---
//document.form1.storeInMe.value = afeliotracker_ID;
//document.form1.action = 'http://www.afelio.de/afeliocounter.php'; 
//document.form1.method = 'post';  
//document.form1.submit();
//--- Skript eintragen ---
//alert('Vielen Dank. Der Aufruf des Tutorials ' + afeliotracker_ID + ' wurde protokolliert.');
}

function explicanto(theURL) {
  window.open(theURL,'course','width=1014,height=693');
}


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('pcf/' + 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.');
}
}

function quizmaker2(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', 'Quiz', winProp);
}

function afragenquizmaker2(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.');
}
}

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;
  }
}

// format der Speicherung:
// name=value; name2=value2; ...
// wobei value = "k1=v1&k2=v2..."

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");
 }
}