function ResetShortcuts() {
    for (var i = 0; i < document.LangForm.Language.length; i++) {
        if (document.LangForm.Language.options[i].defaultSelected == true){
            document.LangForm.Language.options[i].selected=true
        }
    }
}

function JumpMenu(item) {
    document.location= item;
}


//RLI: ToggleBox for multi-language 


function toggleBox(obj,lyr, iState, iPosition) // 1 visible, 0 hidden, 1 set position with the cursor, 0 doesn't set position
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	var x = new getObj(lyr);
	if( iPosition == 1)
	{
	 x.style.top = newY - 30 + 'px';
	 x.style.left = newX - 50 + 'px';
        }
	if(document.layers)	   //NN4+
	{
	 x.style.visibility = iState ? "show" : "hide";
	}
	else
	{
	 x.style.visibility = iState ? "visible" : "hidden";
	}
}

// Function to find the x position of an object

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

// Function to find the y position of an object

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	window.status = printstring;
	return curtop;
}

// Function get an object thanks to name, compatible for all web browser.


function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}
