function IsIE() {
	return navigator.userAgent.indexOf("MSIE") > -1;
}

function IEPngAlphaInit( img) {
	
	var imgs = document.getElementsByTagName( "img");
	for (var i = 0; i < imgs.length; i++) {
		var img = imgs[ i];
		if ( typeof( img.alpha) == "undefined") continue;
		var imageurl = img.src;
		img.src = img;
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imageurl+"',sizingMethod='scale');";
	}
}

function CreateHttpReq() {

	var httpreq = null;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  httpreq=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    httpreq=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   httpreq=false
  }
 }
@else
 httpreq=false
@end @*/
	if (!httpreq && typeof XMLHttpRequest!='undefined') {
	 	try {
			httpreq = new XMLHttpRequest();
		} catch (e) {
			httpreq=false
		}
	}
	return httpreq;
}

function GetObjWidth( obj) {
 if ( parseInt( obj.style.width) > 0) 
   return parseInt( obj.style.width);
 if ( obj.style.pixelWidth)
   return obj.style.pixelWidth;
 else
   return obj.clientWidth;
}

function GetObjHeight( obj) {
 if ( parseInt( obj.style.height) > 0) 
   return parseInt( obj.style.height);
 if ( obj.style.pixelHeight)
   return obj.style.pixelHeight;
 else
   return obj.clientHeight;
}

function GetObjLeft( obj) {

	if ( obj.style.left != "")
		return parseInt( obj.style.left);

	var left = obj.offsetLeft;
	var parent = obj.parentNode;
	while ( parent != null && typeof( parent.offsetLeft) == "number") {
		left += parent.offsetLeft;
		parent = parent.parentNode;
	}
	return left;
return parseInt( obj.offsetLeft);		
}

function GetObjRight( obj) {
	return GetObjLeft( obj) + GetObjWidth( obj);
}

function GetObjTop( obj) {
  return parseInt( obj.style.top);
}

function FixEvent( e) {

if (typeof e == 'undefined') e = window.event;
	if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
	if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
	return e;
}
