lo2.x={};

lo2.x.className=function(){
	if(lo2.x.isIe())
		return 'className';
	return 'class';
}

lo2.x.isIe=function(){
	return (typeof(ActiveXObject) != 'undefined');
}

lo2.x.getPos=function(obj){
	return [lo2.x.getPosX(obj),lo2.x.getPosY(obj),];
}


function cancelBubble(windowEvent) {
var objEvent;
try {
objEvent=windowEvent;
objEvent.cancelBubble=true;
if(event){
	event.cancelBubble = true;
}
if (objEvent && objEvent.stopPropagation)
	objEvent.stopPropagation();
} catch (ex) {
}
}

lo2.x.cancelBubble=function(e) {
	if (e && e.stopPropagation)
		e.stopPropagation();
	else
		e.cancelBubble=true;
}

lo2.x.getPosX=function(obj){
	var curleft = 0;
	if(obj.offsetParent)
	while(1) {
		curleft += obj.offsetLeft;
		if(!obj.offsetParent)
			break;
		obj = obj.offsetParent;
	}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
}

lo2.x.getPosY=function(obj){
	var curtop = 0;
	if(obj.offsetParent)
	while(1){
		curtop += obj.offsetTop;
		if(!obj.offsetParent)
			break;
		obj = obj.offsetParent;
	}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}

lo2.x.mouseX=function(evt){
	if(window.event){
		return window.event.clientX;
	}else{
		return evt.pageX;
	}
}
lo2.x.mouseY=function(evt){
	if(window.event){
		return window.event.clientY;
	}else{
		return evt.pageY;
	}
}

lo2.x.mouseX=function(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}
lo2.x.mouseY=function(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}

lo2.x.screenX=function(){
	if(window.innerWidth)
		return parseInt(window.innerWidth);
	return parseInt(screen.width);
}

lo2.x.screenY=function(){
	if(window.innerHeight)
		return parseInt(window.innerHeight);
	return parseInt(screen.height);
}

lo2.x.screenX=function() {
	return lo2.x.filterInvalidLengths (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
lo2.x.screenY=function() {
	return lo2.x.filterInvalidLengths (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

lo2.x.scrollX=function() {
	return lo2.x.filterInvalidLengths (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
lo2.x.scrollY=function() {
	return lo2.x.filterInvalidLengths (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

lo2.x.filterInvalidLengths=function(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

lo2.x.getHttpRequestor=function(){
	if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");
}
