/************************************************
*	JavaScript-Funktionsbibliothek	v1.5.0109	*
*	Copyright (c) 2001-2005 by Jörg Schuchardt	*
************************************************/

var evt_cm = true, evt_md = true, evt_mm = true, evt_ul = true, msec = 25;
var brwObj, mouseX, mouseY, docX, docY, winObj, winPop = "popWin", winPic = "popPic";

if (top != self) {
	if (window.opera) {
		document.writeln('<a name="framed" href="'+self.location.href+'" target="_top"></a>');
		window.onload = unframe;
	}
	else
		top.location = self.location;
}

function Browser() {
	this.nua	= navigator.userAgent;
	this.dom	= document.getElementById?true:false;
	this.ie4	= !this.dom&&document.all?true:false;
	this.ns4	= !this.dom&&document.layers?true:false;
	this.moz = this.dom&&(this.nua.indexOf('Gecko')>=0)?true:false;
	this.op  = this.dom&&window.opera?true:false;
	this.ie	= this.ie4||(this.dom&&this.nua.indexOf('MSIE')>=0&&!this.op)?true:false;
	this.ns	= this.ns4||(this.dom&&this.nua.indexOf('Netscape')>=0)?true:false;

	this.ok	= this.moz||this.op||this.ie;

	this.span = span;
	this.span();

	if (this.ns)	document.captureEvents(Event.MOUSEMOVE|Event.MOUSEDOWN);
	if (evt_cm)	document.oncontextmenu = contextMenu;
	if (evt_md)	document.onmousedown = mouseDown;
	if (evt_mm)	document.onmousemove = mouseMove;
	if (evt_ul)	window.onunload = unload;

	eval("brwObj = this;");

	return this;
}

function CSSObject(obj,nest,width,height) {
// variables
	this.nest		= nest?eval(nest+"Obj"):null; nest = nest?"document."+nest+".":"";
	this.element	= brwObj.dom?document.getElementById(obj):brwObj.ie4?document.all[obj]:brwObj.ns4?eval("document."+obj):null;
	this.css			= brwObj.dom?document.getElementById(obj).style:brwObj.ie4?document.all[obj].style:brwObj.ns4?eval(nest+"document."+obj):null;
	this.initx		= parseInt(this.css.left);
	this.inity		= parseInt(this.css.top);
	this.glueing	= false;
	this.moving		= false;
	this.rolling	= false;

// methods
	this.echo = echo;
	this.fill = fill;
	this.glue = glue;
	this.hide = hide;
	this.move = move;
	this.note = note;
	this.rect = rect;
	this.roll = roll;
	this.show = show;
	this.span = span;
	this.spot = spot;
	this.stop = stop;
	this.swap = swap;

// handles
	this.obj = obj+"Obj";
	eval(this.obj+" = this;");

	this.span(width,height);
	if (this.nest)	this.nest.rect(0,0,parseInt(this.nest.css.width),parseInt(this.nest.css.height));

	return this;
}

function echo(content,keep) {
	if (!brwObj || !brwObj.ok)	return false;

	if (brwObj.ns4) {
		this.css.document.open();
		this.css.document.write(content);
		this.css.document.close();
	}
	else
		this.element.innerHTML = content;

	if (keep)	return;
	this.span();
}

function fill(text,msec,intro,extro) {
	var content = eval(text);
	if (!brwObj || !brwObj.ok || !content[0])	return false;

	if (!this.row)
		this.row = 0;

	if (brwObj.ns4) {
		if (this.row == 0) {
			this.css.document.open();
			this.css.document.writeln(intro);
		}
		if (content[this.row])
			this.css.document.writeln(content[this.row]);
		else {
			this.css.document.writeln(extro);
			this.css.document.close();
		}
	}
	else {
		if (this.row == 0)
			this.element.innerHTML = "";
		if (content[this.row])
			this.element.innerHTML = intro+this.element.innerHTML+content[this.row]+extro+"\n";
	}

	this.span();

	if (content[this.row++])
		window.setTimeout(this.obj+".fill('"+text+"',"+msec+",'"+intro+"','"+extro+"')",msec);
	else
		this.row = 0;
}

function glue(glueX,glueY,offX,offY,gapX,gapY) {
	if (!brwObj || !brwObj.ok)	return false;

	if (this.glueing)	{ window.clearTimeout(this.glueing); this.glueing = false; }

	var argc = glue.arguments.length;
	if (argc>0) {
		var varX	= eval(glueX)?parseInt(eval(glueX)):0;
		var tmpX	= parseInt(offX);
		if (argc>4) {
			var pgX	= brwObj.ns||brwObj.moz?window.pageXOffset:document.body.scrollLeft;
			if (varX+tmpX < pgX+gapX)
				tmpX = pgX+gapX-varX;
			else
			if (varX+tmpX+parseInt(this.css.width) > pgX+brwObj.width-gapX)
				tmpX = (pgX+brwObj.width-gapX)-(varX+parseInt(this.css.width));
		}
		this.css.left	= varX+tmpX;
	}
	if (argc>1) {
		var varY	= eval(glueY)?parseInt(eval(glueY)):0;
		var tmpY	= parseInt(offY);
		if (argc>5) {
			var pgY	= brwObj.ns||brwObj.moz?window.pageYOffset:document.body.scrollTop;
			if (varY+tmpY < pgY+gapY)
				tmpY = pgY+gapY-varY;
			else
			if (varY+tmpY+parseInt(this.css.height) > pgY+brwObj.height-gapY)
				tmpY = (pgY+brwObj.height-gapY)-(varY+parseInt(this.css.height));
		}
		this.css.top	= varY+tmpY;
	}

	this.glueing = window.setTimeout(this.obj+".glue('"+glueX+"','"+glueY+"',"+offX+","+offY+(gapX?","+gapX+(gapY?","+gapY:""):"")+");",msec);
}

function hide(clear) {
	if (!brwObj || !brwObj.ok)	return false;

	if (brwObj.ns4)
		this.css.visibility	= "hide";
	else
		this.css.visibility	= "hidden";

	if (clear) {
		if (brwObj.ns4) {
			this.css.document.open();
			this.css.document.write('');
			this.css.document.close();
		}
		else
			this.element.innerHTML = "";

		this.css.height = this.css.width = 0;
	}
}

function move(moveX,moveY,cmd) {
	if (!brwObj || !brwObj.ok || !this.nest)	return false;

	var tol	= parseInt(this.css.left);
	var tot	= parseInt(this.css.top);
	var tow	= parseInt(brwObj.ns4?this.css.document.width:this.css.width);
	var toh	= parseInt(brwObj.ns4?this.css.document.height:this.css.height);
	var tcw	= parseInt(brwObj.ns4?this.nest.css.clip.left+this.nest.css.clip.right:this.nest.css.width);
	var tch	= parseInt(brwObj.ns4?this.nest.css.clip.top+this.nest.css.clip.bottom:this.nest.css.height);
	var once	= false;

	if (cmd == 'once') {
		once	= true;
		cmd	= false;
	}
	if ((tol+moveX <= this.initx) && (tol+tow+moveX >= tcw))
		this.css.left = tol+moveX;
	else {
		moveX	= Math.floor(Math.abs(moveX)/2)*(moveX>0?1:-1);
		once	= false;
	}
	if ((tot+moveY <= this.inity) && (tot+toh+moveY >= tch))
		this.css.top = tot+moveY;
	else {
		moveY = Math.floor(Math.abs(moveY)/2)*(moveY>0?1:-1);
		once = false;
	}

	if (once)	return true;

	if (moveX || moveY)
		this.moving = window.setTimeout(this.obj+".move("+moveX+","+moveY+(cmd?",'"+cmd.replace(/'/g,"\\'")+"'":"")+")",msec);
	else {
		this.stop('moving');
		if (cmd)	eval(cmd);
	}
}

function note(head,body,width,frame,frcol,bgcol,headc,bodyc,bgimg,keep) {
	var argc = note.arguments.length;
	if ((this.css && (!brwObj || !brwObj.ok)) || argc < 3)	return false;

	frame	= (argc>3?parseInt(frame):2);
	frcol	= (argc>4?frcol:"#000000");
	bgcol	= (argc>5?bgcol:"#FFFFFF");
	headc	= (argc>6?headc:false);
	bodyc	= (argc>7?bodyc:false);
	bgimg	= (argc>8?bgimg:false);

	var pad = 3;
	var txt = '<table width="'+width+'" bgcolor="'+frcol+'" cellspacing="0" cellpadding="'+frame+'" border="0"><tr>';
	if (head) { txt = txt+'<td><table cellspacing="0" cellpadding="0" border="0"><tr><td width="'+pad+'"><br></td><td'+(headc?' class="'+headc+'"':'')+'>'+(headc?'':'<font color="#FFFFFF">')+'<b>'+head+'</b>'+(headc?'':'</font>')+'</td><td width="'+pad+'"><br></td></tr></table></td></tr><tr>'; }
	txt = txt+'<td><table width="100%" bgcolor="'+bgcol+'"'+(bgimg?' background="'+bgimg+'"':'')+' cellspacing="0" cellpadding="'+pad+'" border="0"><tr><td'+(bodyc?' class="'+bodyc+'"':'')+'>'+body+'</td></tr></table></td></tr></table>';

	if (this.css) {
		if (brwObj.ns4) {
			this.css.document.open();
			this.css.document.write(txt);
			this.css.document.close();
		}
		else
			this.element.innerHTML = txt;

		if (!isNaN(width)) {
			this.css.width = width;
		}
		if (keep)	return;
		this.span();
	}
	else
		document.write(txt);
}

function rect(x1,y1,x2,y2) {
	if (!brwObj || !brwObj.ok)	return false;

	this.rectLeft		= Math.max(0,x1);
	this.rectTop		= Math.max(0,y1);
	this.rectRight		= Math.min(x1+x2,parseInt(this.css.width));
	this.rectBottom	= Math.min(y1+y2,parseInt(this.css.height));

	if (brwObj.ns4) {
		this.css.clip.left	= this.rectLeft;
		this.css.clip.top		= this.rectTop;
		this.css.clip.right	= this.rectRight;
		this.css.clip.bottom	= this.rectBottom;
	}
	else
		this.css.clip = "rect("+this.rectTop+"px "+this.rectRight+"px "+this.rectBottom+"px "+this.rectLeft+"px)";
}

function roll(aimX,aimY,stepX,stepY,cmd,auto) {
	if (!brwObj || !brwObj.ok || (this.rolling && !auto))	return false;

	var posX = parseInt(this.css.left);
	var posY = parseInt(this.css.top);

	stepX = Math.abs(stepX)*(aimX>posX?1:-1);
	stepY = Math.abs(stepY)*(aimY>posY?1:-1);

	if ((posX > aimX && posX+stepX >= aimX) || (posX < aimX && posX+stepX <= aimX))
		this.css.left = posX+stepX;
	else
		stepX = Math.floor(Math.abs(stepX)/2)*(aimX>posX?1:-1);

	if ((posY > aimY && posY+stepY >= aimY) || (posY < aimY && posY+stepY <= aimY))
		this.css.top = posY+stepY;
	else
		stepY = Math.floor(Math.abs(stepY)/2)*(aimY>posY?1:-1);

	if (posX!=aimX || posY!=aimY)
		this.rolling = window.setTimeout(this.obj+".roll("+aimX+","+aimY+","+stepX+","+stepY+",'"+(cmd?cmd.replace(/'/g,"\\'"):"")+"',true)",msec);
	else {
		this.stop('rolling');
		if (cmd)	eval(cmd);
	}
}

function show(posX,posY,canX,canY,init) {
	if (!brwObj || !brwObj.ok)	return false;

	if (show.arguments.length)	this.spot(posX,posY,canX,canY,init);

	if (brwObj.ns4)
		this.css.visibility	= "show";
	else {
		this.css.visibility	= "visible";
		this.css.display		= "inline";
	}
}

function span(width,height) {
	if (this.nua) {
		this.width	= document.body?document.body.clientWidth:window.innerWidth;
		this.height	= document.body?document.body.clientHeight:window.innerHeight;
		this.scrollWidth	= document.body?document.body.scrollWidth:document.width;
		this.scrollHeight	= document.body?document.body.scrollHeight:document.height;
	}
	else if (this.css) {
		this.css.width	= width?width:brwObj.ns4?this.css.document.width:this.element?this.element.offsetWidth||(this.element.firstChild?isNaN(this.element.firstChild.offsetWidth):1)?this.element.offsetWidth:this.element.firstChild.offsetWidth:false;
		this.css.height= height?height:brwObj.ns4?this.css.document.height:this.element?this.element.offsetHeight||(this.element.firstChild?isNaN(this.element.firstChild.offsetHeight):1)?this.element.offsetHeight:this.element.firstChild.offsetHeight:false;
	}
}

function spot(posX,posY,canX,canY,init) {
	if (!brwObj || !brwObj.ok)	return false;

	var argc = spot.arguments.length;
	posX = (argc>0?parseInt(eval(posX)):0);
	posY = (argc>1?parseInt(eval(posY)):0);
	canX = (canX?parseInt(canX)+(brwObj.ns4?16:0):0);
	canY = (canY?parseInt(canY)+(brwObj.ns4?16:0):0);

	this.css.left	= ((canX&&canX<brwObj.width)?Math.ceil((brwObj.width-canX)/2):0)+posX;
	this.css.top	= ((canY&&canY<brwObj.height)?Math.ceil((brwObj.height-canY)/2):0)+posY;

	if (init) {
		this.initx = init>0?posX:parseInt(this.css.left);
		this.inity = init>0?posY:parseInt(this.css.top);
	}
}

function stop(action) {
	if (!brwObj || !brwObj.ok)	return false;
	if (!action)	action = 'moving';
	if (eval('this.'+action))	{
		eval('window.clearTimeout(this.'+action+'); this.'+action+' = false;');
	}
}

function swap(name,img) {
	var obj = brwObj?brwObj.ns4?this.css?this.css:this:window:window;
	if (obj.document.images)
		obj.document.images[name].src = img.src;
}

function contextMenu(evt) {
	return false;
}

function mouseDown(evt) {
	if (evt && evt.which != 1)	return false;
	return true;
}

function mouseMove(evt) {
	if (brwObj) {
		if (brwObj.ns || brwObj.moz) {
			docX = window.pageXOffset; docY = window.pageYOffset; mouseX = evt.pageX; mouseY = evt.pageY;
		}
		else {
			docX = document.body.scrollLeft; docY = document.body.scrollTop; mouseX = event.x+docX; mouseY = event.y+docY;
		}
	}
}

function resize() {
	if (brwObj.ie)
		window.history.go(0);
	else if (brwObj.moz)
		window.location.href = window.location.href;
	else
		window.location.reload();
}

function unframe() {
  document.links['framed'].click();
}

function unload() {
	if (winObj && !winObj.closed)	winObj.close();
}

function openWindow(url,posX,posY,width,height,config) {
	if (winObj && !winObj.closed)	winObj.close();

	var data = "left="+posX;
	data+= ",top="+posY;
	data+= ",width="+width;
	data+= ",height="+height;
	data+= ","+(config?config:"scrollbars=no,resizable=no");

	winObj = window.open(url,winPop,data);
	if (parseInt(navigator.appVersion) >= 4)	winObj.focus();

	return winObj;
}

function openPicWin(url,winWidth,winHeight,picWidth,picHeight,config,title) {
	if (winObj && !winObj.closed)	winObj.close();
	if (!title)	title = "click inside to close window";

	var data = "left="+Math.floor((screen.availWidth-winWidth)/8);
	data+= ",top="+Math.floor((screen.availHeight-winHeight)/2);
	data+= ",width="+(winWidth>screen.availWidth-10?screen.availWidth-10:winWidth);
	data+= ",height="+(winHeight>screen.availHeight-10?screen.availHeight-10:winHeight);
	data+= ","+(config?config:"scrollbars=no,resizable=no");
	var size = (picWidth && picHeight);

	winObj = window.open("",winPic,data);
	winObj.document.open();
	winObj.document.writeln('<html>');
	winObj.document.writeln('<head>');
	winObj.document.writeln('<title>'+title+'</title>');
	winObj.document.writeln('<scr'+'ipt>\n<!--');
	winObj.document.writeln('if (document.layers) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP); document.onmousedown=md; document.onmouseup=mu; document.oncontextmenu=cm;');
	winObj.document.writeln('function md(evt) { if (evt&&evt.which==3) return false; return true; } function mu(evt) { '+(size?"if (evt&&evt.which==3) self.close(); return false;":"self.close();")+' } function cm(evt) { return false; }');
	winObj.document.writeln('//-->\n</scr'+'ipt>');
	winObj.document.writeln('</head>');
	winObj.document.writeln('<body background="'+url+'" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">');
	if (size) winObj.document.writeln('<div onclick="self.close();" oncontextmenu="self.close();" style="width:'+picWidth+'px; height:'+picHeight+'px;"></div>');
	winObj.document.writeln('</body>');
	winObj.document.writeln('</html>');
	winObj.document.close();
	if (parseInt(navigator.appVersion) >= 4)	winObj.focus();

	return winObj;
}

