function getMousePosition(e) 
{
	var IE = document.all?true:false

	pos = new Array(2);

	if ( IE ) 
	{ // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	} 
	else 
	{  // grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	}

	pos['left'] = tempX
	pos['top'] = tempY
}

function getElementSize(element) 
{ // thanks to 'Martin Honnen' for this function 
	var coords = {w: 0, h: 0};
	
	coords.w += element.offsetWidth; 
	coords.h += element.offsetHeight; 

	return coords; 
}

function getPageCoords(element) 
{ // thanks to 'Martin Honnen' for this function 
	var coords = {x: 0, y: 0};
	
	if( typeof( element.offsetParent ) != 'undefined' ) 
	{
		while (element) 
		{ 
			coords.x += element.offsetLeft; 
			coords.y += element.offsetTop; 
			element = element.offsetParent; 
		} 
	} 
	else 
	{
		coords.x = element.x; 
		coords.y = element.y;
	}

	return coords; 
}

var isGoogleMapAttiva = false;

function startOnLoadGoogleMap()
{
    if(isGoogleMapAttiva)
    {
        initialize();
    }
}

function stopOnunLoadGoogleMap()
{
    if(isGoogleMapAttiva)
    {
        GUnload();
    }
}

function cambiaDim(obj,w,h)
{
    obj.style.width = w;
    obj.style.height = h;
}

function getObj(id)
{
    return document.getElementById(id);
}

function mantieniLingua(lang,id_lang,classSel)
{
    //alert(lang+"|"+id_lang+"|"+classSel)
    var ogg = getObj(id_lang);
    ogg.className = classSel;
    var linkOgg = ogg.parentNode;
    
    if (window.detachEvent)
    {
        linkOgg.setAttribute('onmouseover','');
        linkOgg.setAttribute('onmouseout','');
        //linkOgg.detachEvent("onmouseover", cambiaDim);
        //linkOgg.detachEvent("onmouseout", cambiaDim);
    }
    if (window.removeEventListener)
    {
        linkOgg.setAttribute('onmouseover','');
        linkOgg.setAttribute('onmouseout','');
        //linkOgg.removeEventListener("mouseover",cambiaDim);
        //linkOgg.removeEventListener("mouseout",cambiaDim);
    }
}