// JavaScript Document

/*------ Musik Player Window ------*/
function PlayerWindow (doedl) {
  if (doedl == 2) {
  	Musikfenster.focus();
  	doedl == 0;}
  else {
  	Musikfenster = window.open("musicplayer/netaudio-player-start.html", "Jukebox", "height=348, width=340");
  	Musikfenster.focus();}
}

/*------ change navi images ------*/
pics=new Array();

/*------ open fixed size browser window ------*/
function setHover()
{
p=new Image();p.src=document.images.imageMap.src;pics[0]=p;
for(a=0;a<document.getElementsByTagName('area').length;++a)
	{
	o=document.getElementsByTagName('area')[a];nr=eval(a+1);
	p=new Image();p.src='data/navi/'+o.id+'.gif';pics[pics.length]=p;
	aOVER=new Function('F','colored('+nr+');');aOUT=new Function('F','colored(0);');
	o.onmouseover=aOVER;o.onmouseout=aOUT;
	}
}

/*------ xxxx ------*/
function colored(i)
{
document.images.imageMap.src=pics[i].src;
}
if(document.getElementsByTagName){window.onload=setHover;}

/*------ open fixed size browser window ------*/
function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

/*------ open hyperlink in _blank ------*/
function blank(obj) {
obj.target = '_blank';
}

/*------ open hyperlink in _top ------*/
function top(obj) {
obj.target = '_top';
}

/*------ navigation menu highlighting ------*/
function highlightLinks() {
   var anzHrefs = document.getElementsByTagName("a").length;
   for (var i = 0; i <= anzHrefs - 1; i++) {
      if (document.getElementsByTagName("a")[i].href == document.location.href) {
		 var currentClassName = document.getElementsByTagName("a")[i].className; 
		 var newClassName = currentClassName.replace(/inaktiv/,"aktiv");
         document.getElementsByTagName("a")[i].className = newClassName; 
      }
   }
}

/*------ search function ------*/
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;
}

/*------ form field validation ------*/
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+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' darf nur Ziffern enthalten.\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('Bitte überprüfen Sie folgende Angaben:\n'+errors);
  document.MM_returnValue = (errors == '');
}

/*------ PictureWindow-Fever Popup ------*/
function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}