function getAbsoluteLeft(objectId) {
	var o = document.getElementById(objectId); var oLeft = o.offsetLeft ;
	while(o.offsetParent!=null) { oParent = o.offsetParent; oLeft += oParent.offsetLeft; o = oParent; }
	return oLeft; }
function getAbsoluteTop(objectId) {
	var o = document.getElementById(objectId); var oTop = o.offsetTop;
	while(o.offsetParent!=null) { oParent = o.offsetParent; oTop += oParent.offsetTop; o = oParent; }
	return oTop; }

function overLocations(obj,clas) { 
	outLocationDrop = 0;
	if (clas!='!') { document.getElementById(obj.id).className=clas+'over'; }
	if (obj.id=='location_choice') { 
		document.getElementById('location_choice_drop').style.left=getAbsoluteLeft(obj.id);
		document.getElementById('location_choice_drop').style.top=getAbsoluteTop(obj.id);
		document.getElementById('location_choice_drop').style.display='block';
	}
}
var outLocationDrop = 0;
function outLocations(obj,clas) { 
	if (clas!='!') { document.getElementById(obj.id).className=clas+'normal'; }
	if (obj=='closelocationdrop') { if (outLocationDrop==0) { outLocationDrop = 5; } }
}
function closeLocations() {
	if (outLocationDrop>0) {
		outLocationDrop--;
		if (outLocationDrop==0) {
			if (document.getElementById('location_choice').className.indexOf('normal')<0) { 
			document.getElementById('location_choice').className='location_choice_normal';	}
			document.getElementById('location_choice_drop').style.display='none';
		}
	}
}
window.setInterval('closeLocations()',100);

var locationList = new Array();

tmpLocationList = new Array(); tmpLocationList.name = 'be'; tmpLocationList.text = 'Finalyse Brussels'; tmpLocationList.url = 'http://www.finalyse.be';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'fr'; tmpLocationList.text = 'Finalyse Paris'; tmpLocationList.url = 'http://www.finalyse.fr';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'lu'; tmpLocationList.text = 'Finalyse Luxembourg'; tmpLocationList.url = 'http://www.finalyse.be';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'pl'; tmpLocationList.text = 'Finalyse Warsaw'; tmpLocationList.url = 'http://www.finalyse.pl';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'hu'; tmpLocationList.text = 'Finalyse Budapest'; tmpLocationList.url = 'http://www.finalyse.hu';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'nl'; tmpLocationList.text = 'Finalyse Amsterdam'; tmpLocationList.url = 'http://www.finalyse-amsterdam.com';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'com'; tmpLocationList.text = 'Finalyse Group'; tmpLocationList.url = 'http://www.finalyse.com';
locationList.push(tmpLocationList);


/*
tmpLocationList = new Array(); tmpLocationList.natmpLocationList = new Array(); tmpLocationList.name = 'com'; tmpLocationList.text = 'Finalyse Group'; tmpLocationList.url = 'http://www.finalyse.com';
locationList.push(tmpLocationList);me = 'be'; tmpLocationList.text = 'Finalyse Brussels'; tmpLocationList.url = 'index.php?id=contact#c180';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'fr'; tmpLocationList.text = 'Finalyse Paris'; tmpLocationList.url = 'index.php?id=contact#c719';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'lu'; tmpLocationList.text = 'Finalyse Luxembourg'; tmpLocationList.url = 'index.php?id=contact#c720';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'pl'; tmpLocationList.text = 'Finalyse Warsaw'; tmpLocationList.url = 'index.php?id=contact#c721';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'hu'; tmpLocationList.text = 'Finalyse Budapest'; tmpLocationList.url = 'index.php?id=contact#c732';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'nl'; tmpLocationList.text = 'Finalyse Amsterdam'; tmpLocationList.url = 'index.php?id=contact#4847';
locationList.push(tmpLocationList);
tmpLocationList = new Array(); tmpLocationList.name = 'eu'; tmpLocationList.text = 'Finalyse Group'; tmpLocationList.url = 'index.php?id=contact#c180';
locationList.push(tmpLocationList);
*/


function autoCongigLocations() {
	var url = document.location.href;
	var htmlChoice = '';
	var htmlDrop = '';
	for (var i = 0; i < locationList.length; i++) {
		if (
			/*(document.location.href.indexOf(locationList[i].url)>-1) ||*/
			( (i == locationList.length-1) && (htmlChoice=='') ) ) { 
			htmlChoice = '<a href="'+locationList[i].url+'" id="location_choice_link" class="location_choice_'+locationList[i].name+'">'+locationList[i].text+'</a>';
		} else {
			if (htmlDrop=='') { htmlDrop+='<div class="header"></div><div class="content">'; }
			htmlDrop+='<div id="location_choice_drop-'+locationList[i].name+'" class="location_drop_normal"';
			htmlDrop+=' onMouseOver="overLocations(this,\'location_drop_\')" onMouseOut="outLocations(this,\'location_drop_\')">';
			htmlDrop+='<a href="'+locationList[i].url+'" class="location_choice_'+locationList[i].name+'">'+locationList[i].text+'</a>';
			htmlDrop+='</div>';
		}
	}
	if (htmlDrop!='') { htmlDrop+='</div>'; }
	document.getElementById('location_choice').innerHTML=htmlChoice;
	document.getElementById('location_choice_drop').innerHTML=htmlDrop;
}