// JavaScript Document

function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too) {
	var e='',c=',',xf='left=',yf='top=';
	this.n = name;
	if (document.layers) {
		xf='screenX=';
		yf='screenY=';
	}

	this.f = (w?'width='+w+c:e)+(h?'height='+h+c:e)+(x>=0?xf+x+c:e)+
	(y>=0?yf+y+c:e)+'location='+loc+',menubar='+men+',resizable='+res+
	',scrollbars='+scr+',status='+sta+',toolbar='+too;
	
	this.opened = function() {
		return this.w && !this.w.closed;
	};
	
	this.close = function() {
		if(this.opened())
			this.w.close();
	};
	
	this.focus = function() {
		if(this.opened())
			this.w.focus();
	};
	
	this.load = function(sUrl) {
		if (this.opened())
			this.w.location.href = sUrl;
		else
			this.w = window.open(sUrl,this.n,this.f);
		this.focus();
		return false;
	};
}



var win = [	new xWindow(
		'nextdate0',// target namewww.ercros.demu
		311, 440,	// width, height
		100,		// left
		100,		// top
		0,			// location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),
	new xWindow(
		'nextdate1',     // target name
		311, 440,   // width, height
		100, 		// left
		100, 		// top
		0,          // location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),
	new xWindow(
		'nextdate2',     // target name
		311, 440,   // width, height
		100, 		// left
		100, 		// top
		0,          // location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),
	new xWindow(
		'nextdate3',     // target name
		311, 440,   // width, height
		100, 		// left
		100, 		// top
		0,          // location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),
	new xWindow(
		'nextdate4',     // target name
		311, 440,   // width, height
		100, 		// left
		100, 		// top
		0,          // location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),	new xWindow(
		'nextdate5',     // target name
		311, 440,   // width, height
		100, 		// left
		100, 		// top
		0,          // location field
		0,          // menubar
		0,          // resizable
		0,          // scrollbars
		0,          // statusbar
		0           // toolbar
	),

	new xWindow(
		'galery',     // target name
		screen.width-100, screen.height-250,   // width, height
		50,				// left
		50,				// top
		1,				// location field
		1,				// menubar
		1,				// resizable
		1,				// scrollbars
		1,				// statusbar
		1 				// toolbar
	),
	new xWindow(
		'forum',     // target name
		screen.width-100, screen.height-250,   // width, height
		50, // left
		50, // top
		1,          // location field
		1,          // menubar
		1,          // resizable
		1,          // scrollbars
		1,          // statusbar
		1           // toolbar
	)
];






function openpopup(n) {
	if (win[n].opened()) 
		setTimeout('win['+n+'].focus()',500);
	else 
		win[n].load(('./nextdate' + n) + '.html');
}

function openpopup2(n,url) {
	if (win[n].opened()) 
		win[n].focus();
	else 
		win[n].load(url);
}

// Default wert wird eigentlich im html nocheinmal gesetzt. 
var ziel_1= new Date(2003,04,21,20,00,0,0)
var ziel_2= new Date(2003,04,21,20,00,0,0)
var ziel_3= new Date(2003,04,21,20,00,0,0)
var ziel_4= new Date(2003,04,21,20,00,0,0)

function uhr() {
	var AktuellesDatum=new Date();
	var Differenz=new Date();

	Differenz.setTime((ziel_4-AktuellesDatum));
	Differenz.setTime(Differenz.getTime() + (1*1000));
	if ((Differenz.getTime()/1000) >= 0)
		openpopup(3);

	Differenz.setTime((ziel_3-AktuellesDatum));
	Differenz.setTime(Differenz.getTime() + (1*1000));
	if ((Differenz.getTime()/1000) >= 0)
		openpopup(2);

	Differenz.setTime((ziel_2-AktuellesDatum));
	Differenz.setTime(Differenz.getTime() + (1*1000));
	if ((Differenz.getTime()/1000) >= 0)
		openpopup(1);

	Differenz.setTime((ziel_1-AktuellesDatum));
	Differenz.setTime(Differenz.getTime() + (1*1000));
	if ((Differenz.getTime()/1000) >= 0)
		openpopup(0);
}






