function addEvent(obj, evType, fn, useCapture){
	if(obj.addEventListener)
	{
		obj.addEventListener(evType, fn, useCapture);
		return true;
	} 
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} 
	else 
	{
    		alert("X.js/addEvent failed");
	}
}

function getWindowSizeX()
{
	var ww, wh;
	if(window.innerWidth)
	{
	        ww = window.innerWidth;
	        wh = window.innerHeight;
	}
	else if(document.documentElement.clientWidth)
	{
		ww = window.document.documentElement.clientWidth;
		wh = window.document.documentElement.clientHeight;
	}
	else if(window.document.body)
	{
		ww = window.document.body.clientWidth;
		wh = window.document.body.clientHeight;
	}
	return new Array(ww, wh);
}

function setOpacityX(el, opacity)
{
	el.style.opacity = opacity / 100;
	el.style.MoxOpacity = opacity / 100;
	el.style.KhtmlOpacity = opacity / 100;
	el.style.filter = "alpha(opacity=" + opacity + ")";
}

htmlElementOuterHTML = function (str) {
   var r = this.ownerDocument.createRange();
   r.setStartBefore(this);
   var df = r.createContextualFragment(str);
   this.parentNode.replaceChild(df, this);
   return str;
}

if(self.HTMLElement && self.HTMLElement.prototype && !self.HTMLElement.prototype.outerHTML)
        eval("HTMLElement.prototype.outerHTML setter = htmlElementOuterHTML;");




