// Uhr
function Clock (offsetSec, style) {
	this.id = Clock.cnt;
	Clock.clocks[Clock.cnt++] = this;
	this.offsetSec = offsetSec || 0;
	this.style = style || '';
	this.writeHTML();
	this.startTimer();
}

function Clock_writeHTML () {
	var html = '';
	if (document.layers) {
	  html += '<SPAN';
	  html += ' ID="Clock' + this.id + '"';
	  html += ' CLASS="rewritable"';
	  html += '>';
	  html += '<SPAN';
	  html += this.style ? ' CLASS="' + this.style + '"' : '';
	  html += '>';
	  html += this.formatTime();
	  html += '<\/SPAN>';
	  html += '<\/SPAN>';
	}
	else {
	  html += '<SPAN';
	  html += ' ID="Clock' + this.id + '"';
	  html += this.style ? ' CLASS="' + this.style + '"' : '';
	  html += '>';
	  html += this.formatTime();
	  html += '<\/SPAN>';
	}
	document.write(html);
}

Clock.prototype.writeHTML = Clock_writeHTML;
function Clock_formatTime () {
	var time = new Date();
	time.setTime(time.getTime() + this.offsetSec * 1000);
	var hours = time.getHours();
	var minutes = time.getMinutes();
	var seconds = time.getSeconds();
	var html = '';
	html += 'Zeit: ';
	html += hours < 10 ? '0' + hours : hours;
	html += ':';
	html += minutes < 10 ? '0' + minutes : minutes;
	html += ':';
	html += seconds < 10 ? '0' + seconds : seconds;
	return html;
}

Clock.prototype.formatTime = Clock_formatTime;
function Clock_startTimer () {
	this.tid = setInterval('Clock.clocks[' + this.id + '].updateTime()',1000);
}

Clock.prototype.startTimer = Clock_startTimer;
function Clock_updateTime () {
	if (document.all)
	  document.all['Clock' + this.id].innerHTML = this.formatTime();
	else if (document.getElementById)
	  document.getElementById('Clock' + this.id).firstChild.nodeValue =
	    this.formatTime();
	else if (document.layers && loaded) {
	  var l = document['Clock' + this.id];
	  if (!l.ol) {
	    var ol = l.ol = new Layer(l.clip.width);
	    ol.clip.height = l.clip.height;
	    ol.left = l.pageX; ol.top = l.pageY;
	    ol.visibility = 'show';
	    l.visibility = 'hide';
	  }
	  var ol = l.ol;
	  var html = '';
	  html += '<SPAN';
	  html += this.style ? ' CLASS="' + this.style + '"' : '';
	  html += '>';
	  html += this.formatTime();
	  html += '<\/SPAN>';
	  ol.document.open();
	  ol.document.write(html);
	  ol.document.close();
	}
}

Clock.prototype.updateTime = Clock_updateTime;
Clock.cnt = 0;
Clock.clocks = new Array();
function init () {
	loaded = true;
}

// X-Mas Counter
var CountdownJahr = 2008;
var CountdownMonat = 12;
var CountdownTag = 24;
var CountdownStunde = 00;
var CountdownMinute = 00;
var CountdownSekunde = 01;

function CountdownAnzeigen()
{
var Jetzt = new Date();
var Countdown = new Date(CountdownJahr, CountdownMonat-1, CountdownTag+1, CountdownStunde-6, CountdownMinute, CountdownSekunde);
var MillisekundenBisCountdown = Countdown.getTime()-Jetzt.getTime();
var Rest = Math.floor(MillisekundenBisCountdown/1000);
var CountdownText = "<table align='center'><tr><!--<td>Tage</td>--><td>Std</td><td>Min</td><td>Sek</td></tr><tr>";

if(Rest>=86400)
	{
		var Tage = Math.floor(Rest/86400);
		Rest = Rest-Tage*86400;
		var temp = "00"+Tage;
		s1= temp.substr ((temp.length-2),1);
		s2= temp.substr ((temp.length-1),1);
		CountdownText += "<td>";
		CountdownText += '<img src="images/xmas-counter/0.gif" width="16" height="21" />';
		CountdownText += '<img src="images/xmas-counter/0.gif" width="16" height="21" />';
		CountdownText += "</td>";
	}
if(Rest>=3600)
	{
		var Stunden = Math.floor(Rest/3600);
		Rest = Rest-Stunden*3600;
		var temp = "00"+Stunden;
		s1= temp.substr ((temp.length-2),1);
		s2= temp.substr ((temp.length-1),1);
		CountdownText += "<td>";
		CountdownText += '<img src="images/xmas-counter/'+s1+'.gif" width="16" height="21" />';
		CountdownText += '<img src="images/xmas-counter/'+s2+'.gif" width="16" height="21" />';
		CountdownText += "</td>";
	}
if(Rest>=60)
	{
		var Minuten = Math.floor(Rest/60);
		Rest = Rest-Minuten*60;
		var temp = "00"+Minuten;
		s1= temp.substr ((temp.length-2),1);
		s2= temp.substr ((temp.length-1),1);
		CountdownText += "<td>";
		CountdownText += '<img src="images/xmas-counter/'+s1+'.gif" width="16" height="21" />';
		CountdownText += '<img src="images/xmas-counter/'+s2+'.gif" width="16" height="21" />';
		CountdownText += "</td>";
	}

var temp = "00"+Rest;
s1= temp.substr ((temp.length-2),1);
s2= temp.substr ((temp.length-1),1);
CountdownText += "<td>";
CountdownText += '<img src="images/xmas-counter/'+s1+'.gif" width="16" height="21" />';
CountdownText += '<img src="images/xmas-counter/'+s2+'.gif" width="16" height="21" />';
CountdownText += "</td>";

CountdownText += "</tr></table>";
document.getElementById('Countdown').innerHTML = CountdownText;
window.setTimeout("CountdownAnzeigen()", 1000);
}

// Streammenü
function checkDel(Text, Link){
	if(confirm(Text) == true) 	{
		document.location.href = Link;
	}
}

function myPopUp_global(breite, hoehe, url, scrolling, oben, links) {
	
	pop=window.open('','Global_Channel','toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars='+scrolling+',resizable=0,fullscreen=0,width='+breite+',height='+hoehe+',top='+oben+',left='+links+'');
	pop.resizeTo(breite,hoehe);
	pop.location=url;
}
 
function myPopUp_player(breite, hoehe, url, scrolling, oben, links) {
	
	pop=window.open('','Angelmusik','toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars='+scrolling+',resizable=0,fullscreen=0,width='+breite+',height='+hoehe+',top='+oben+',left='+links+'');
	pop.resizeTo(breite,hoehe);
	pop.location=url;
}

function myPopUp_guw(breite,hoehe,url,scrolling) {
	var positionX=((screen.availWidth/2)-breite/2);
	var positionY=((screen.availHeight/2)-hoehe/2);
	pop=window.open('','Gruß_&_Wunsch','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scrolling+',resizable=0,fullscreen=0,width='+breite+',height='+hoehe+',top=10000,left=10000');pop.resizeTo(breite,hoehe);
	pop.moveTo(positionX,positionY);
	pop.location=url;
}

function GoToURL(url) {
	document.location.href = url;
}

function myMouseOutTuneIn(tr, CssClass, mnu) {
	document.getElementById(mnu).style.visibility = 'hidden';
}

function ShowMenu(tr, CssClass, mnu) {
	document.getElementById(mnu).style.visibility = 'visible';
}

function HideMenu(mnu) {
	document.getElementById(mnu).style.visibility = 'hidden';
}

function myMouseOutLink(tr, CssClass) {
	tr.className = CssClass;
	tr.style.cursor = 'pointer';
}

