var ver=navigator.appVersion;
var dom=document.getElementById?1:0;
var ns4=(document.layers&&!dom)?1:0;
var ns5=(dom&&parseInt(ver)>=5&&navigator.userAgent.indexOf("Netscape")!=-1)?1:0;
var ie4=(document.all&&!dom)?1:0;
var ie5=(ver.indexOf("MSIE")>-1&&dom)?1:0;
var moz=(navigator.userAgent.indexOf("Gecko")!=-1&&navigator.userAgent.indexOf("Netscape")==-1)?1:0;
var rechner=navigator.platform;
var win=(rechner.substring(0,3)=="Win")?1:0;

function ueber(name,id){
	if(ns4){
		var x=document.layers[id].document.images[name].src;
		x= 	x.replace(/_n\.gif/,'_h.gif');
		document.layers[id].document.images[name].src=x;		
	}
	else{
		var x=document.images[name].src;
		x= x.replace(/_n\.gif/,'_h.gif');
		document.images[name].src=x;
	}
}

function bilder(){
artists = new Image();
artists.src = "images/symbol_artists.gif";
labels = new Image();
labels.src = "images/symbol_labels.gif";
}

function wechsel(Bildobjekt) {
parent.frames[0].document.images[0].src = Bildobjekt.src;
}



function aus(name,id){
	if(ns4){
		var x=document.layers[id].document.images[name].src;
		x= x.replace(/_h\.gif/,"_n.gif");
		document.layers[id].document.images[name].src=x;	
	}
	else{
		var x=document.images[name].src;
		x= x.replace(/_h\.gif/,"_n.gif");
		document.images[name].src=x;	
	}
}

function fenster(wohin){

	if(screen.width=="1024")
	window.open(wohin,'impressum','top=90,left=320,width=380,height=480,resizable=no');
	else if(screen.width=="1152")
	window.open(wohin,'impressum','top=90,left=320,width=380,height=480,resizable=no');
	else
	window.open(wohin,'impressum','top=90,left=320,width=380,height=480,resizable=no');
}

function fenster1(wohin){

	if(screen.width=="1024")
	window.open(wohin,'disclaimer','top=90,left=320,width=380,height=580,resizable=no');
	else if(screen.width=="1152")
	window.open(wohin,'disclaimer','top=90,left=320,width=380,height=580,resizable=no');
	else
	window.open(wohin,'disclaimer','top=90,left=320,width=380,height=580,resizable=no');
}

function disco(wohin){

	if(screen.width=="1024")
	window.open(wohin,'discography','top=90,left=310,width=400,height=480,resizable=no,scrollbars=yes');
	else if(screen.width=="1152")
	window.open(wohin,'discography','top=90,left=310,width=400,height=480,resizable=no');
	else
	window.open(wohin,'discography','top=90,left=310,width=400,height=480,resizable=no');
}

//fuer ns4 - neu laden, wenn sich fenstergroesse aendert
function neuLaden() {
	if (ns4) {
if (innerWidth!=document.breite || innerHeight!=document.hoehe){
history.go(0);
document.breite=innerWidth;
document.hoehe=innerHeight;
	}
 }
}



function umleiten(wohin) {
if(top.frames.length <= 0)
eval("top.location = wohin");
}

function flashin() {
	if((moz || opera)&&win){
	parent.frames[0].document.embeds[0].GotoFrame(2);
	parent.frames[0].document.embeds[0].Play();
	}
}

function flashout() {
	if((moz || opera)&&win){
	parent.frames[0].document.embeds[0].GotoFrame(18);
	parent.frames[0].document.embeds[0].Play();
	}
}



//############################################
//######## Fade-Effekt & Statuszeile #########
//############################################

startColor = "#999999";		// initial link color
endColor = "#FFFFFF";		// final link color

stepIn = 30;					// delay when fading in
stepOut = 30;					// delay when fading out

var fadeId = new Array();

document.onmouseover = domouseover;
document.onmouseout = domouseout;

function makearray(n)
{
   var i = 0;

   this.length = n;
   for(i = 1; i <= n; i++)
   {
        this[i] = 0;
   }
   return this;
}

// Initialize array
hexa = new makearray(16);
for(var i = 0; i < 10; i++)
{
   hexa[i] = i;
}
hexa[10]="a";
hexa[11]="b";
hexa[12]="c";
hexa[13]="d";
hexa[14]="e";
hexa[15]="f";

function hex(i)
{
   if (i < 0)
   {
      return "00";
   }
   else if (i > 255)
   {
      return "ff";
   }
   else
   {
      return "" + hexa[Math.floor(i/16)] + hexa[i%16];
   }
}

function setColor(r, g, b, element)
{
   var hr = hex(r);
   var hg = hex(g);
   var hb = hex(b);

   element.style.color = "#"+hr+hg+hb;
}

function fade(s, e, element, step)
{
   var i = 0;
   var sr = s[0];
   var sg = s[1];
   var sb = s[2];
   var er = e[0];
   var eg = e[1];
   var eb = e[2];

   if (fadeId[0] != null && fade[0] != element)
   {
      setColor(sr, sg, sb, eval(fadeId[0]));
      i = 1;
      while(i < fadeId.length)
      {
         clearTimeout(fadeId[i]);
         i++;
      }
   }

   for(i = 0; i <= step; i++)
   {
      fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +
			step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+
			")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
   }
   fadeId[0] = element;
}

function dehexize(Color)
{
   var i = 0;
   var j = 0;
   var colorArr = new makearray(3);

   for(i = 1; i < 7; i++)
   {
      for(j = 0; j < 16; j++)
      {
         if (Color.charAt(i) == hexa[j])
         {
            if (i%2 != 0)
            {
               colorArr[Math.floor((i-1)/2)]=eval(j)*16;
            }
            else
            {
               colorArr[Math.floor((i-1)/2)]+=eval(j);
            }
         }
      }
   }
   return colorArr;
}

startColor = dehexize(startColor.toLowerCase());
endColor = dehexize(endColor.toLowerCase());

function domouseover()
{
   if (document.all&&win)
   {
      srcElement = event.srcElement;
		if (srcElement.className.indexOf("haupthistory") != -1)
		{
	      window.status="This is dub >> Definition, History and Backgrounds of Dub";
		}
		else if (srcElement.className.indexOf("haupttechniques") != -1)
		{
		   window.status="This is dub >> Production-techniques";
		}
		else if (srcElement.className.indexOf("hauptreviews") != -1)
		{
		   window.status="This is dub >> Record-reviews";
		}
		else if (srcElement.className.indexOf("hauptlabels") != -1)
		{
		   window.status="This is dub >> Labels";
		}
		else if (srcElement.className.indexOf("hauptartists") != -1)
		{
		   window.status="This is dub >> Artists & Producers - Biographies, Discographies, Interviews, Concert-reviews, Picture-galleries";
		}
		else if (srcElement.className.indexOf("hauptresources") != -1)
		{
		   window.status="This is dub >> Databases, Recordstores, Linkpages, other Resources";
		}
		else if (srcElement.className.indexOf("text") != -1)
		{
		   window.status="This is dub, no compromise!";
		}
		else if (srcElement.className.indexOf("klein") != -1)
		{
		   window.status="... just dubwise ...";
		}
		else if (srcElement.className.indexOf("disco") != -1)
		{
		   window.status="... just dubwise ...";
		}
		else if (srcElement.className.indexOf("link") != -1)
		{
		   window.status=srcElement.href;
		}
		else if (srcElement.className.indexOf("ex") != -1)
		{
		   window.status=srcElement.href;
		}
		else if (srcElement.className.indexOf("sub") != -1)
		{
		window.status="... just dubwise ...";
		fade(startColor, endColor, srcElement.uniqueID, stepIn);
		}
      if (srcElement.className.indexOf("fade") != -1)
      {
         fade(startColor, endColor, srcElement.uniqueID, stepIn);
		 
		 if(this.location.pathname.indexOf("kenn")!= -1){
		 if(srcElement.className.indexOf("ex")==-1&&srcElement.className.indexOf("klein")== -1){
		 	if(!ie5){
				if(parent.mainFrame.subFrame.document.embeds[0]){
		 		parent.mainFrame.subFrame.document.embeds[0].GotoFrame(2);
		 		parent.mainFrame.subFrame.document.embeds[0].Play();
				}
		 	}
		 	else{
				if(parent.mainFrame.subFrame.flash){
		 		parent.mainFrame.subFrame.flash.GotoFrame(2);
		 		parent.mainFrame.subFrame.flash.Play();
		 		}
			}
		 }
		 }
		 else if(srcElement.className.indexOf("ex")==-1&&srcElement.className.indexOf("klein")== -1){
		 	if(!ie5){
				if(parent.subFrame.document.embeds[0]){
		 		parent.subFrame.document.embeds[0].GotoFrame(2);
		 		parent.subFrame.document.embeds[0].Play();
		 		}
			}	
		 	else{
				if(parent.subFrame.flash){
		 		parent.subFrame.flash.GotoFrame(2);
		 		parent.subFrame.flash.Play();
		 		}
			}
		 }
      }
   }
   return true;
}

function domouseout()
{
status="This is dub, no compromise!";
   if (document.all&&win)
   {
      srcElement = event.srcElement;
	  if (srcElement.className.indexOf("sub") != -1)
		{
		window.status="... just dubwise ...";
		fade(endColor, startColor, srcElement.uniqueID, stepOut);
		}
      else if (srcElement.className.indexOf("fade") != -1)
      {
         fade(endColor, startColor, srcElement.uniqueID, stepOut);
		
		 if(this.location.pathname.indexOf("kenn")!= -1){
		 if(srcElement.className.indexOf("ex")==-1&&srcElement.className.indexOf("klein")== -1){
		 	if(!ie5){
				if(parent.mainFrame.subFrame.document.embeds[0]){
		 		parent.mainFrame.subFrame.document.embeds[0].GotoFrame(18);
		 		parent.mainFrame.subFrame.document.embeds[0].Play();
		 		}
			}	
		 	else{
				if(parent.mainFrame.subFrame.flash){
		 		parent.mainFrame.subFrame.flash.GotoFrame(18);
		 		parent.mainFrame.subFrame.flash.Play();
		 		}
			}	
		 }
		 }
		else if(srcElement.className.indexOf("ex")==-1&&srcElement.className.indexOf("klein")== -1){
		 	if(!ie5){
				if(parent.subFrame.document.embeds[0]){
		 		parent.subFrame.document.embeds[0].GotoFrame(18);
		 		parent.subFrame.document.embeds[0].Play();
				}
		 	}
		 	else{
				if(parent.subFrame.flash){
		 		parent.subFrame.flash.GotoFrame(18);
		 		parent.subFrame.flash.Play();
				}	
			}
		 }
      }
   }
   return true;
}

// Ende Fadeeffekt & Statuszeile ################


function springartists(){
parent.frames[0].location.replace('submenu_artists.html');
parent.parent.frames[0].location.replace('menu_artists.html');
parent.parent.frames[2].location.replace('kennung_artists.html');
}
function springlabels(){
parent.frames[0].location.replace('submenu_labels.html');
parent.parent.frames[0].location.replace('menu_labels.html');
parent.parent.frames[2].location.replace('kennung_labels.html');
}

