<!--

var IE = (document.all)? true : false;
var NS = (document.layers)? true : false;

var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o ,p, q, r, s, t, u, v, w, x, y, z;

function layerOpen() {
	if (IE) document.writeln("<div id=\"" + u + "\" style=\"position:absolute; left:" + x + "px; top:" + y + "px; width:" + w + "px; height:" + h + "px; z-index:" + z + ";" + ((b==0 || b.length==0)?"":" background:"+b+";") + " visibility:" + ((v==0)?"hidden":"visible") + ";\">");
	if (NS) document.writeln("<layer name=\"" + u + "\" left=" + x + " top=" + y + " width=" + w + " height=" + h + " z-index=" + z + ((b==0 || b.length==0)?"":" bgColor=\""+b+"\"") + " visibility=\"" + ((v==0)?"hide":"show") + "\">");
}

function layerClose() {
	if (IE) document.writeln("</div>");
	if (NS) document.writeln("</layer>");
}

function layerPos(u,x,y) {
	if (IE) {
		document.all[u].style.left = x + "px";
		document.all[u].style.top  = y + "px";
	}
	if (NS) {
		document.layers[u].left = x;
		document.layers[u].top  = y;
	}
}

function layerShow(u,v) {
	if (IE) document.all[u].style.visibility = (v==0)? "hidden" : "visible";
	if (NS) document.layers[u].visibility = (v==0)? "hide" : "show";
}

function layerColor(u,b) {
	if (IE) document.all[u].style.background = b;
	if (NS) document.layers[u].bgColor = b;
}

var win_w, win_h;

function getSize() {
	win_w = (IE)? document.body.clientWidth : (NS)? (window.innerWidth - ((document.height > window.innerHeight)? 12 : 0)) : 600;
	win_h = (IE)? document.body.clientHeight : (NS)? (window.innerHeight - ((document.width > window.innerWidth)? 12 : 0)) : 400;
}

var ofsx, ofsy;

function getScroll() {
	ofsx = (IE)? document.body.scrollLeft : (NS)? window.pageXOffset : 0;
	ofsy = (IE)? document.body.scrollTop  : (NS)? window.pageYOffset : 0;
}

var posx = 0, posy = 0;

function mousePosIE() {
	posx = event.x + document.body.scrollLeft;
	posy = event.y + document.body.scrollTop;
}
if (IE) {
	document.onmousemove = mousePosIE;
}

function mousePosNS(e) {
	posx = e.pageX;
	posy = e.pageY;
}
if (NS) {
	document.captureEvents(Event.MOUSEMOVE);
	document.onMouseMove = mousePosNS;
}

function new_win(f,n,w,h,m,r,s) {
	if (f.length>0) {
		if (n.length==0) n = "newWin"; // by default
		k = "width=" + ((w<1)?1:w) + ",height=" + ((h<1)?1:h) + ((m==0)?"":",menubar") + ((r==0)?"":",resizable") + ((s==0)?"":",scrollbars");
		window.open(f,n,k);
	}
}

function ni(m,n) {
	m += "";
	while (m.length<n) {m = "0" + m;}
	return(m);
}

function rn(r) {
	r = Math.floor(Math.random() * r);
	return(r);
}

function rm(r) {
	r = Math.floor((Math.random() - Math.random()) * r + 0.5);
	return(r);
}

//-->

