// topmenu
function init_topmenu(){
	o = document.getElementById("topmenu");
	ucol = o.getElementsByTagName("TD");
	for(i=0;i<ucol.length;i++){
		uo = ucol[i];
		if(uo.getElementsByTagName("UL").length>0){
			uo.chld = uo.getElementsByTagName("UL")[0];
			uo.chld.prt = uo;
			uo.chld.style.width = (parseInt(uo.offsetWidth) - 1) + 'px';
			if(document.all){
				acol = uo.chld.getElementsByTagName("A");
				for(j=0;j<acol.length;j++){
					acol[j].style.width = (parseInt(uo.offsetWidth) - 14) + 'px';
				}
			}
		}
		uo.mstr = o;
		o.curitm = o.tm = null;

		uo.onmouseover = uo.show = function(){
			if(this.mstr.curitm!=null){
				window.clearTimeout(this.mstr.tm);
				this.mstr.tm = null;
				if(this.mstr.curitm!=this){
					this.mstr.curitm.hide();
					this.mstr.curitm = null;
				}
				else
					return;
			}
			if(this.chld)
				this.chld.style.display = 'block';
			this.mstr.curitm = this;
		}

		uo.onmouseout = function(e){
			if(document.all){
				if(this.parentNode.contains(event.toElement))
					return;
			}
			else if(e){
				if(e.relatedTarget!=null){
					o = e.relatedTarget;
					while(o.tagName!="HTML"){
						if(o.parentNode==this.parentNode)
							return;
						o = o.parentNode;
					}
				}
			}
			if(this.mstr.curitm!=null){
				window.mstr = this.mstr;
				this.mstr.tm = window.setTimeout(function(){ this.mstr.curitm.hide(); this.mstr.curitm = null;}, 200);
			}
		}

		uo.hide = function(){
			if(this.chld)
				this.chld.style.display = 'none';
		}

	}
}

function openMap() {
	// cache les listboxes (bug IE6)
	document.getElementById('prod').style.visibility = 'hidden';
	document.getElementById('zone').style.visibility = 'hidden';
	document.getElementById('pays').style.visibility = 'hidden';
	document.getElementById("fullPage_map").style.display = "block";
}

function closeMap() {
	document.getElementById("fullPage_map").style.display = "none";
	// réaffiche les listboxes (bug IE6)
	document.getElementById('prod').style.visibility = 'visible';
	document.getElementById('zone').style.visibility = 'visible';
	document.getElementById('pays').style.visibility = 'visible';
}

function openFrenchPage() {
	if (this_siteacces_name == 'fre') {
		document.getElementById("splash").style.display = "none";
		// réaffiche les listboxes (bug IE6)
		document.getElementById('prod').style.visibility = 'visible';
		document.getElementById('zone').style.visibility = 'visible';
	}
	else {
		window.location = fre_url + "/(splash)/off";
	}

}

function openEnglishPage() {
	if (this_siteacces_name == 'eng') {
		document.getElementById("splash").style.display = "none";
		// réaffiche les listboxes (bug IE6)
		document.getElementById('prod').style.visibility = 'visible';
		document.getElementById('zone').style.visibility = 'visible';
	}
	else {
		window.location = eng_url + "/(splash)/off";
	}
}

window.onload = function() {
	if (document.getElementById("splash")) {
		document.getElementById("splash").style.display = "block";
	}
}

function check_form_ajout_annu()
{
	if ((document.getElementById('entreprise').value == '') ||
		  (document.getElementById('cp_entreprise').value == '') ||
		  (document.getElementById('adresse_entreprise').value == '') ||
		  (document.getElementById('ville_entreprise').value == '') ||
		  (document.getElementById('pays_entreprise').value == '') ||
		  (document.getElementById('tel_entreprise').value == '') ||
		  (document.getElementById('contact_prenom').value == '') ||
		  (document.getElementById('contact_nom').value == '') ||
		  (document.getElementById('contact_email').value == '') ||
		  (document.getElementById('contact_tel').value == ''))
	{
		document.getElementById('error_fields').style.display = 'block';
		return false;
	}
	else
	{
		return true;
	}
}
