var ns4 = (document.layers)? true : false;
var ie4up = (document.all)? true : false;

function capEvents() {
	if (ns4) {
		window.captureEvents(Event.MOUSEMOVE);
		window.onMouseMove = MouseMove;
	} else {
		document.onmousemove = MouseMove;
	}
}

function MouseMove(e) {
	if (ns4) {
		mX = e.pageX; mY = e.pageY;
	} else {
		mX = eval(event.clientX);
		mY = eval(event.clientY);
	}
}



function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight) {
		document.location.href = document.location.href;
	}
}

if (ns4) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.captureEvents(Event.RESIZE);
	window.onResize = resizeFix;
}

function layerMakeReturn(n,w,h,x,y,z,cls,vis,cnt,exn,exe) {
	
		if (ns4) {
			vis==1 ? vis='show' : vis='hide';
			return '<layer width='+w+' height='+h+' left='+x+' top='+y+' id="'+n+'" z-index='+z+' visibility='+vis+' class="'+cls+'" '+exn+'>'+cnt+'</layer>';
		} else if (ie4up) {
			vis==1 ? vis='visible' : vis='hidden';
			return '<div id="'+n+'" style="position:absolute; width:'+w+';height:'+h+';left:'+x+';top:'+y+';z-index:'+z+';visibility:'+vis+';" '+exe+' class="'+cls+'" >'+cnt+'</div>';
		}
	}

