<!--
// Browsererkennung

var isWindows = (navigator.platform.toLowerCase().indexOf("win") != -1) ? true : false; // Windows
var isMac = (navigator.platform.toLowerCase().indexOf("mac") != -1) ? true : false; // Mac
var ie = (document.all && navigator.appVersion.substring(0,1) >= 4) ? true : false; // IE 4+
var ns4 = (document.layers) ? true : false; // Netscape 4.x
var ns6 = (document.getElementById && !document.all) ? true : false; // Netscape 6


// Dreamweaver-Scripts


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine gültige E-Mail-Adresse enthalten.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' muss ausgefüllt werden.\n'; }
  } if (errors) alert('Die folgenden Fehler wurden festgestellt, bitte korrigieren:\n'+errors);
  document.MM_returnValue = (errors == '');
}

// Standard Popup-Fenster
function popUp(file,props) {

	myPopUp = window.open(file,'myPopup',props);
	if (myPopUp.focus) {
		myPopUp.focus();
		}
	}


// Site-Tool
function goToUrl (myList) {
	if (myList != "") {
		eval ("myUrl = document.auswahl." + myList + ".options[document.auswahl." + myList +
				".options.selectedIndex].value;");
		if (myUrl != "") {
			top.location.href = myUrl;
			}
		}
	}

// Site-Suche
function showResults() {
	remotesuche = window.open ('','remotesuche','width=400,height=450,scrollbars');
	screenw = screen.availWidth;
	remotesuche.window.moveTo(screenw-410,0);
	if (remotesuche.focus) {
		remotesuche.focus();
		}
	}


function playOnline(refId) {
	if (ns4) {
		playwindowSize = "width=,height=";
		}
	else {
		playwindowSize = "width=100,height=100";
		}
	playwindow = window.open('spiele/' + refId + '/index.php','playwindow',playwindowSize);
	if (playwindow.focus) {
		playwindow.focus();
		}
	}

// Anti-Spam
function diAntiSpam(addy,subj) {
	if (addy != "") {
		document.write ('<a href="mailto:' + addy + '@' + 'digi-info' + '.de');
		if (subj != "") {
			document.write ('?subject=' + subj);
			}
		document.write ('"><img src="/images/icons/ico_mail.gif" alt="" width="16" ' +
										'height="9" border="0">' + addy +
										'@' + 'nikodemus-ngl' + '.de</a>\n');
		}
	}

// Druck- und PDF-Version
function sendTo(what,lang) {
	myForm = document.footer;
	if (!lang) lang = "de";
	if (what == "print" || what == "pdf" || what == "friend") {
		if (what == "print") {
			myForm.action = "/" + lang + "/druckversion/index.php";
			}
		else if (what == "pdf") {
			myForm.action = "/" + lang + "/pdfversion/index.php";
			}
		else if (what == "friend") {
			sendwin = window.open('','sendwin','width=400,height=500');
			screenw = screen.availWidth;
			sendwin.window.moveTo(screenw-410,0);
			if (sendwin.focus) {
				sendwin.focus();
				}
			myForm.action = "/" + lang + "/weitersagen/index.php";
			myForm.target = "sendwin";
			}
		myForm.submit();
		}
	}



	// td high-/lowlighten
	function hiLow(id,mod,clr) {

		if (isWindows) {
			// Highlight-Farbe für gewaehltes Element
			if (clr == "") {
				hiColor = "#ffffff";
				}
			else {
				hiColor = clr;
				}
			var myColor = "";

			if (mod == 1) { // highlighten
				myColor = hiColor;
				}
 	 		if (ie) {
				document.all['td' + id].style.setAttribute("backgroundColor",myColor,0);
				}
			else if (ns6) {
				document.getElementById('td' + id).style.backgroundColor = myColor;
				}

			}

		}


	function showContextHelp(strParam) {
		helpwin = window.open("/de/netlaw/lexikon/kontexthilfe.php?" +
								strParam,"helpwin","width=300,height=400,scrollbars");
		screenw = screen.availWidth;
		helpwin.window.moveTo(screenw-310,0);
		if (helpwin.focus) {
			helpwin.focus();
			}
		}



// htdig: formatiert Titel und Url der Suchergebnisse und gibt diese als Link aus
function outLink(title,url,isTitle) {
	var endFlag = "|";
	var maxUrlLength = 60;
	var displayText = "";
	if (url == "") {
		url = "http://www.nikodemus-ngl.de";
		}

	if (isTitle == 1) { // Title soll bis zum titleEnd ausgegeben werden

		if (title != "") {
			titleParts = title.split(endFlag);
			displayText = titleParts[0];
			displayText = displayText.replace(/Nikodemus - neue geistliche Musik &gt; /,"");
			displayText = displayText.replace(/Nikodemus - neue geistliche Musik &gt; /,"");
			}
		else {
			displayText = "Ohne Titel";
			}

		}
	else { // Url soll bis zu maxUrlLength ausgegeben werden

		if (url.length > maxUrlLength) {
			displayText = url.substr(0,(maxUrlLength-3)) + "...";
			}
		else {
			displayText = url;
			}

		}

	displayText = "<img src='/images/icons/ico_intern_link.gif' width='12' height='11' " +
					"border='0' alt='' align='absmiddle'>" + displayText;

	document.write ("<a href=javascript:showPage('" + url + "');>" + displayText + "</a>");

	}

function showPage (url) {
	/*if (window.opener && window.opener.closed) {
		window.open(url,'newMainWin','width=750,height=550,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
		}
	else {
		window.opener.location.href = url;
		}*/
	if (window.opener != null && !window.opener.closed) {
		window.opener.location.href = url;
		window.opener.focus();
		}
	else {
		window.open(url,'newMainWin','width=750,height=550,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
		}
	}
	
// Rollover von Tabellenzeilen (vgl. PHPMyAdmin)
/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function
	
//-->





