function toggle_object (id)
{
	var obj = document.getElementById('detail_'+id);
	var arr = document.getElementById('arrow_'+id);
	var height = stripPx(obj.style.height);
	
	if(obj.style.display == 'none')
	{
		arr.src = './_res/open.gif';
		obj.style.display = 'block';
	}
	else
	{
		arr.src = './_res/closed.gif';
		obj.style.display = 'none';
	}
}

function stripPx (value)
{
	if (value == "") return 0;
	return parseFloat(value.substring(0, value.length - 2));
}

function image_pop_up (path, width, height, ln)
{
	var rnd= parseInt(Math.random()*99999999);
	x = screen.width/2-width/2;
	y = screen.height/2-height/2;
	
	new_div = document.createElement('div');
	new_div.id = "image_pop_up";
	new_div.onclick = function(){document.body.removeChild(document.getElementById('image_pop_up'));};
	new_div.style.marginLeft = '-'+parseInt(width/2)+'px';
	new_div.style.marginTop = '-'+parseInt(height/2)+'px';
	switch(ln)
	{
		case 'fr': 	var close = 'Fermer'; break;
		case 'en': 	var close = 'Close'; 	break;
		case 'de': 	var close = 'Schlie&szlig;en'; 	break;
		default : 	var close = 'Fermer'; 	break;
	}
	if(document.getElementById('image_pop_up'))
	{
		document.body.removeChild(document.getElementById('image_pop_up'));
	}
	new_div.innerHTML = '<p style="text-align:center;padding:2px;"><a href="#"><strong>' + close + '</strong></a></p><p><img src="'+path+'" /></p>';
	
	document.body.appendChild(new_div);
	
	/*
	var popupWindow = window.open('','Photo'+rnd,'width='+width+',height='+height+',left='+x+',top='+y+',toolbar=0, menubar=0, location=0, status=0, scrollbars=0, resizable=0');
	var text = '<style>*{margin:0;}</style><img src="'+path+'" width="'+width+'" height="'+height+'">';       
	popupWindow.document.write(text);
	popupWindow.focus();*/
}

function toggle_lang_container(object)
{
	for(var i = 1; i <= 3; i++)
	{
		document.getElementById('language_'+i).style.display = 'none';
		document.getElementById('switch_'+i).style.backgroundColor = '#BBB'; 
	}
	document.getElementById('language_'+object).style.display = 'block';
	document.getElementById('switch_'+object).style.backgroundColor = '#EEE'; 
}

function check_contact_form(ln)
{
	switch(ln)
	{
		case 'fr': 	var message = 'Veuillez entrer votre nom, numéro de téléphone et adresse email.\n\nMerci'; var short_nm = 'Nom'; var short_tel= 'Téléphone';var short_mail = 'Email'; break;
		case 'en': 	var message = 'Please specify your Name, Phone and Email.\n\nThank you';									 var short_nm = 'Name'; var short_tel= 'Telephone';var short_mail = 'Email'; 	break;
		case 'de': 	var message = 'Bitte geben sie Ihren Namen, Telefonnumer und Emailadresse an.\n\nDanke';	 var short_nm = 'Name'; var short_tel= 'Telefon';var short_mail = 'Email'; 	break;
		default : 	var message = 'Veuillez entrer votre nom, numéro de téléphone et adresse email.\n\nMerci'; var short_nm = 'Nom'; var short_tel= 'Téléphone';var short_mail = 'Email'; 	break;
	}
	var nm = document.getElementById('form_name');
	var tel = document.getElementById('form_tel');
	var mail = document.getElementById('form_email');
	if(nm.value != '' && tel.value != '' && mail.value != '' && nm.value != short_nm && tel.value != short_tel && mail.value != short_mail)
	{
		return true;
	}
	else
	{
		alert(unescape(message));
		return false;
	}
}