function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 3));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie   = (agent.indexOf("msie") != -1);
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
}

var is = new Is()

if(is.ns4) {
	doc = "document.layers";
	sty = "";
	htm = ".document"
} else if(is.ie4) {
	doc = "document.all";
	sty = ".style";
	htm = ""
}


var count = 0;

var width;
var height;

function layerSetup(w,h) {

	moveLyr = eval(doc + '["moveLayer"]' + sty);
	moveLyr.left = (available_width-250)/2;
	moveLyr.top = 100;

	width = w;
	height = h;

	visibilitySetup();
}


function visibilitySetup() {
	moveLyr.visibility = "visible";

	animate();
}


var x_pos, y_pos;
var int_x, int_y;

function animate() {
	setInterval("moveLayer()",25);

	x_pos = parseInt(moveLyr.left);
	y_pos = parseInt(moveLyr.top);

	int_x = 2;	// Start-Intervall in x-Richtung
	int_y = 2;	// Start-Intervall in y-Richtung
}

function moveLayer() {
	x_pos = x_pos + int_x;
	y_pos = y_pos + int_y;

	if((x_pos <= 0) || (x_pos > available_width - width - 10)) { int_x = - int_x; }
	if((y_pos <= 0) || (y_pos > available_height - height - 10)) { int_y = - int_y; }

	moveLyr.left = x_pos;
	moveLyr.top = y_pos;
}