/* find out which is the browser */
var isIE = (window.ActiveXObject)?true:false;
var isMozilla = (document.implementation.createDocument)?true:false;
/* the name of the attribute, depending on the browser */
var attributeClass = (isIE)?"className":"class";

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
function newXMLHttpRequest() {
	var ret = null;
	if (typeof XMLHttpRequest!='undefined') {
		try {
			ret = new XMLHttpRequest();
		} catch (e) {
		}
	}
	if ( (ret==null) && window.createRequest) {
		try {
			ret = window.createRequest();
		} catch (e) {
		}
	}
	return ret;
}

xmlhttp = newXMLHttpRequest();


//Restituisce la larghezza in pixels dell'oggetto renderizzato nella pagina
function getElementWidth(elem) {
	var elemWidth = -1;
	if (elem.clip) elemWidth = elem.clip.width;
	else if (elem.style.pixelWidth) elemWidth = elem.style.pixelWidth;
	else elemWidth = elem.offsetWidth;
	return elemWidth;
};

//Restituisce l'altezza in pixels dell'oggetto renderizzato nella pagina
function getElementHeight(elem) {
	var elemHeight = -1;
	if (elem.clip) elemHeight = elem.clip.height;
	else if (elem.style.pixelHeight) elemHeight = elem.style.pixelHeight;
	else elemHeight = elem.offsetHeight;
	return elemHeight;
};

//Restituisce la posizione assoluta dell'oggetto relativamente
//all'angolo superiore sinistro della pagina
function getElementAbsX(elem) {
	var x = 0;
	while( elem!= null ) {
		x += elem.offsetLeft;
		elem = elem.offsetParent;
	}	
	return x;
}

//Restituisce la posizione assoluta dell'oggetto relativamente
//all'angolo superiore sinistro della pagina
function getElementAbsY(elem) {
	var y = 0;
	while( elem!= null ) {
		y += elem.offsetTop;
		elem = elem.offsetParent;
	}	
	return y;
}

var _riseWindowInited = false;
var _window_onLoad = new Array();

function _riseWindowLoad() {
	if (_riseWindowInited==true) return;
	_riseWindowInited = true;
	
	var i;
	for (i=_window_onLoad.length;i>0;i--) { 
		var f = _window_onLoad[i-1];
		if (typeof(f)=='function') f(); 
	}
}


