//-----------------
//LanguageSelection

var boolActive = false;
var intMo_Left = 0;
var intMo_Right = 0;
var intMo_Top = 0;
var intMo_Bottom = 0;

function getGlobalCoord(e)
{
	var e;
	if(!e){
		window.MouseX = event.clientX;
		window.MouseY = event.clientY;	
	}else{
		window.MouseX = e.pageX;
		window.MouseY = e.pageY;
	}
	return false;
}

function getPosition(obj) {
  var arrResult = { x:0, y:0 };

  do {
    arrResult.x += obj.offsetLeft;
    arrResult.y += obj.offsetTop;
  } while (obj = obj.offsetParent);

  return arrResult;
}

function getLanguageSelection()
{
	var objBox = document.getElementById('LanguageSelectionBox');
	if(objBox == null)
		return false;
	
	var objHead = document.getElementById('LanguageSelectionTail');
	if(objHead == null)
		return false;
	
	var objTail = document.getElementById('LanguageSelectionTail');
	if(objTail == null){
		return false;
	}else{
		objTail.style.visibility="visible";
	}
	
	arrPos=getPosition(objBox);
	
	intMo_Left = arrPos.x;
	intMo_Right = intMo_Left+objBox.offsetWidth;
	intMo_Top = arrPos.y;
	intMo_Bottom = intMo_Top+objBox.offsetHeight;
	
	boolActive = true;
	document.onmousemove = handleLanguageSelection;

	return false;
}

function handleLanguageSelection(e)
{
	
	void getGlobalCoord(e);
	if(boolActive == false)
		return;
	
	if(intMo_Left == 0)
		return;

	var intOffset = 5;
	if(parseInt(window.MouseX+intOffset) > parseInt(intMo_Left)){
		if(parseInt(window.MouseX-intOffset) < parseInt(intMo_Right) ){
			if(parseInt(window.MouseY+intOffset) > parseInt(intMo_Top) ){
				if(parseInt(window.MouseY-intOffset) < parseInt(intMo_Bottom) ){
					return false;
				}
			}
		}
	}
	
	var objTail = document.getElementById('LanguageSelectionTail');
	if(objTail == null){
		return false;
	}else{
		objTail.style.visibility="hidden";
	}
	
	document.onmousemove = null;
	boolActive = false;
	
	return false;
}

//LanguageSelection
//-----------------