//uhrzeit-anzeige
var timerID = null;
var timerRunning = false;

function stopclock()
{
  if(timerRunning)
  {
    clearTimeout(timerID);
    timerRunning = false;
  }
}
function showtime()
{
  var now = new Date();
  var year = now.getYear();
  var month = now.getMonth() + 1;
  var date = now.getDate();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();

  var timeValue = "";

  timeValue += date + ".";
  timeValue += ((month < 10) ? "" : "") + month + ".";
  timeValue += ((year > 200) ? year : (year + 1900)) + " &nbsp;-&nbsp\; ";
  timeValue += ((hours <= 12) ? hours : hours);
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;

  document.getElementById("clock").innerHTML = timeValue;
  timerID = setTimeout("showtime()",1000);
  timerRunning = true
}
function startclock()
{
  stopclock();
  showtime();
}


var d = document;
var agent=navigator.userAgent.toLowerCase();
var mac = (agent.indexOf("mac")>-1)
var opera = ( agent.indexOf("opera")>-1 );

var ie5 = (agent.indexOf("msie 5")>-1);
var ie55 = (agent.indexOf("msie 5.5")>-1);
var ie6 = 	(agent.indexOf("msie 6")>-1);

var ie = ( (ie6 || ie5 || ie55 )&& !opera);

var ns6 = (!ie &&  !opera && (agent.indexOf("6.1")>-1 || agent.indexOf("6")>-1));
var ns62 = (!ie && !opera && ((agent.indexOf("6.2")>-1) || (agent.indexOf("7.0")>-1)) );

function ImageToggler()
{

	this.images = new Array();
	this.controls = new Array();
	this.descriptions = new Array();
	for( var i=0; i< arguments.length-1; i++)
	{
		a = arguments[i].split('|');
		this.images[i] = new Image();
		this.images[i].src = a[0]; // tiffany changed this
		this.controls[i] = d.getElementById( "t"+ i );
		this.descriptions[i] = a[1];
	}
			
	this.index = 0;
	this.targetImage = d.images[arguments[arguments.length-1]];
	//this.label = d.getElementById("togglerText");
	this.controls[0].style.backgroundColor = "#fff";
	if (ie55 || ie6 )
	{
		this.imgObj = this.targetImage.parentNode;
		this.imgObj.style.filter = "FILTER: progid:DXImageTransform.Microsoft.Slide(slidestyle=SWAP,Bands=2)";
	}
			
}

ImageToggler.prototype.GetNext = function()
{
	this.controls[ this.index ].style.backgroundColor = "#d7d7e1";
	this.index = ( this.index+1 == this.images.length ) ? 0 : this.index+1;

	this.doTrans( this.images[ this.index ].src )

	//this.label.innerHTML = this.descriptions[ this.index ];
	this.controls[ this.index ].style.backgroundColor = "#fff";
}

ImageToggler.prototype.GetPrevious = function()
{
	this.controls[ this.index ].style.backgroundColor = "#d7d7e1";
	this.index = ( this.index==0 ) ? this.images.length-1 : this.index-1;
	this.doTrans( this.images[ this.index ].src );
	//this.label.innerHTML = this.descriptions[ this.index ];
	this.controls[ this.index ].style.backgroundColor = "#fff";
}

ImageToggler.prototype.GetById = function( id )
{
	this.controls[ this.index ].style.backgroundColor = "#d7d7e1";
	this.doTrans( this.images[ id ].src );
	this.index = id;
	//this.label.innerHTML = this.descriptions[ id ];
	this.controls[ this.index ].style.backgroundColor = "#fff";
}


ImageToggler.prototype.doTrans = function( s )
{
	if( ie55 || ie6 )
	{
		this.imgObj.filters[0].apply();
		this.targetImage.src = s;
		this.imgObj.filters[0].play();
	}
	else
	{
		this.targetImage.src = s;
	}
}

window.onload = function()
{
	startclock();
}