<!--
var win=thewin=null;

function pv(){
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/**** Open window ****/
function openwindow(theurl,winname,theWidth,theHeight,theScroll ) {
if (thewin && !thewin.closed) {
	thewin.document.close();var thewin = null;
}
if (theScroll) {
	theWidth=eval(theWidth+16);
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,menubar=0,location=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0,directories=0";
thewin = window.open(theurl,winname,winfeatures);
if( thewin ) {
	thewin.focus();
}
}

function openwindowext(theurl,winname,theWidth,theHeight,theScroll,theX,theY){
if (thewin && !thewin.closed) {thewin.document.close();var thewin = null;}
if (theScroll) {
	theWidth=eval(theWidth+16);
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,menubar=0,location=0,scrollbars="+theScroll+",top="+theY+",left="+theX+",screenX="+theX+",screenY="+theY+",resizable=0,directories=0";
thewin = window.open(theurl,winname,winfeatures);
if( thewin ) {
	thewin.focus();
}
}

function open_legal( ){
 /*openwindowext("languages/fr/pops/legal.html","popup",284,489,"no",30,10);*/
 openwindowext("/popup_legal","popup",284,489,"no",30,10)
}

function open_cgv( ){
 /*openwindowext("languages/fr/pops/legal.html","popup",284,489,"no",30,10);*/
 openwindowext("/popup_cgv","popup",284,489,"no",30,10)
}

function open_contact(){
openwindowext("/popup_adresse","popup",300,530,"no",30,10);
}

function openwindowcenter(theurl,winname,theWidth,theHeight,theScroll ) {
	theX = (screen.availWidth-theWidth)/2;
	theY = (screen.availHeight-theHeight)/2;
	return openwindowext(theurl,winname,theWidth,theHeight,theScroll,theX,theY);
}

function windowresize( theWidth, theHeight ) {
if (document.all) {
	window.resizeTo(theWidth,theHeight);
} else  {
	window.outerHeight	= theHeight;
	window.outerWidth	= theWidth;
	window.resizeTo(theWidth,theHeight);
}
}

function makeHome( my_url ) {
	if (document.all) {
		myHomePage.setHomePage(my_url);
	} else {
		alert("Cette fonctionnalité n'est pas disponible avec ce logiciel de navigation.");
	}
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  }
}




var tab_bloc_langue = new Array();
var tab_bloc_titre = new Array();
var tab_bloc_label = new Array();
var tab_bloc_onglet_langue = new Array();
var tab_bloc_onglet_titre = new Array();
var tab_bloc_onglet_label = new Array();
var current_bloc_langue = '1';
var current_bloc_titre = '11';
var current_bloc_label = '111';


/*
fonction generique poru caacher ou afficher es bloc
*/
function show_hide_bloc(name_bloc, couche) {
	if (name_bloc == "bloc_onglet_langue") {
		alterner_couche(tab_bloc_onglet_langue, name_bloc, current_bloc_langue );
		alterner_couche(tab_bloc_onglet_langue, name_bloc, couche );
		alterner_couche(tab_bloc_langue, 'bloc_langue', current_bloc_langue );
		alterner_couche(tab_bloc_langue, 'bloc_langue', couche );

		MM_findObj("bloc_onglet_titre" + current_bloc_titre).style.display = 'none';
		MM_findObj("bloc_onglet_titre" + couche+"1").style.display = 'block';
		MM_findObj("bloc_titre" + current_bloc_titre).style.display = 'none';
		MM_findObj("bloc_titre" + couche+"1").style.display = 'block';
		MM_findObj("bloc_onglet_label" + current_bloc_label).style.display = 'none';
		MM_findObj("bloc_onglet_label" + couche+"11").style.display = 'block';
		MM_findObj("bloc_label" + current_bloc_label).style.display = 'none';
		MM_findObj("bloc_label" + couche+"11").style.display = 'block';
		/*
		alterner_couche(tab_bloc_langue, 'bloc_titre', current_bloc_titre );
		if ( MM_findObj(name + couche+"1").style.display != "none")
			alterner_couche(tab_bloc_langue, 'bloc_titre', couche+"1" );
			*/
		current_bloc_langue = couche;
		current_bloc_titre = couche+"1";
		current_bloc_label = couche+"11";
	}else if (name_bloc == "bloc_onglet_titre") {
		alterner_couche(tab_bloc_onglet_titre, name_bloc, current_bloc_titre );
		alterner_couche(tab_bloc_onglet_titre, name_bloc, couche );
		alterner_couche(tab_bloc_titre, 'bloc_titre', current_bloc_titre );
		alterner_couche(tab_bloc_titre, 'bloc_titre', couche );
		MM_findObj("bloc_onglet_label" + current_bloc_label).style.display = 'none';
		MM_findObj("bloc_onglet_label" + couche+"1").style.display = 'block';
		MM_findObj("bloc_label" + current_bloc_label).style.display = 'none';
		MM_findObj("bloc_label" + couche+"1").style.display = 'block';
		current_bloc_titre = couche;
		current_bloc_label = couche+"1";
	}else{
		alterner_couche(tab_bloc_label, name_bloc, current_bloc_label );
		alterner_couche(tab_bloc_label, name_bloc, couche );
		alterner_couche(tab_bloc_label, 'bloc_label', current_bloc_label );
		alterner_couche(tab_bloc_label, 'bloc_label', couche );
		current_bloc_label = couche;
	}

}

function show_hide_bloc_langue(name_bloc, couche ) { //name_bloc pour un soucis de code generique
	alterner_couche(tab_bloc_onglet_langue, 'bloc_onglet_langue', current_bloc_langue );
	alterner_couche(tab_bloc_onglet_langue, 'bloc_onglet_langue', couche );
	alterner_couche(tab_bloc_langue, 'bloc_langue', current_bloc_langue );
	alterner_couche(tab_bloc_langue, 'bloc_langue', couche );
	current_bloc_langue = couche;

	if ((obj = MM_findObj('bloc_langue'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_langue'))) {
		obj.value = couche;
	}
}

var tab_bloc_section = new Array();
var tab_bloc_onglet_section = new Array();
var current_bloc_section = '1';
function show_hide_bloc_section( couche ) {
	alterner_couche(tab_bloc_onglet_section, 'bloc_onglet_section', current_bloc_section );
	alterner_couche(tab_bloc_onglet_section, 'bloc_onglet_section', couche );
	alterner_couche(tab_bloc_section, 'bloc_section', current_bloc_section );
	alterner_couche(tab_bloc_section, 'bloc_section', couche );
	current_bloc_section = couche;

	if ((obj = MM_findObj('bloc_section'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_section'))) {
		obj.value = couche;
	}
}

var tab_bloc_langue_section1 = new Array();
var tab_bloc_onglet_langue_section1 = new Array();
var current_bloc_langue_section1 = '1';
function show_hide_bloc_langue_section1( couche ) {
	alterner_couche(tab_bloc_onglet_langue_section1, 'bloc_onglet_langue_section1', current_bloc_langue_section1 );
	alterner_couche(tab_bloc_onglet_langue_section1, 'bloc_onglet_langue_section1', couche );
	alterner_couche(tab_bloc_langue_section1, 'bloc_langue_section1', current_bloc_langue_section1 );
	alterner_couche(tab_bloc_langue_section1, 'bloc_langue_section1', couche );
	current_bloc_langue_section1 = couche;

	if ((obj = MM_findObj('bloc_langue_section1'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_langue_section1'))) {
		obj.value = couche;
	}
}

var tab_bloc_langue_section2 = new Array();
var tab_bloc_onglet_langue_section2 = new Array();
var current_bloc_langue_section2 = '1';
function show_hide_bloc_langue_section2( couche ) {
	alterner_couche(tab_bloc_onglet_langue_section2, 'bloc_onglet_langue_section2', current_bloc_langue_section2 );
	alterner_couche(tab_bloc_onglet_langue_section2, 'bloc_onglet_langue_section2', couche );
	alterner_couche(tab_bloc_langue_section2, 'bloc_langue_section2', current_bloc_langue_section2 );
	alterner_couche(tab_bloc_langue_section2, 'bloc_langue_section2', couche );
	current_bloc_langue_section2 = couche;

	if ((obj = MM_findObj('bloc_langue_section2'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_langue_section2'))) {
		obj.value = couche;
	}
}

var tab_bloc_langue_section3 = new Array();
var tab_bloc_onglet_langue_section3 = new Array();
var current_bloc_langue_section3 = '1';
function show_hide_bloc_langue_section3( couche ) {
	alterner_couche(tab_bloc_onglet_langue_section3, 'bloc_onglet_langue_section3', current_bloc_langue_section3 );
	alterner_couche(tab_bloc_onglet_langue_section3, 'bloc_onglet_langue_section3', couche );
	alterner_couche(tab_bloc_langue_section3, 'bloc_langue_section3', current_bloc_langue_section3 );
	alterner_couche(tab_bloc_langue_section3, 'bloc_langue_section3', couche );
	current_bloc_langue_section3 = couche;

	if ((obj = MM_findObj('bloc_langue_section3'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_langue_section3'))) {
		obj.value = couche;
	}
}

var tab_bloc_langue_section4 = new Array();
var tab_bloc_onglet_langue_section4 = new Array();
var current_bloc_langue_section4 = '1';
function show_hide_bloc_langue_section4( couche ) {
	alterner_couche(tab_bloc_onglet_langue_section4, 'bloc_onglet_langue_section4', current_bloc_langue_section4 );
	alterner_couche(tab_bloc_onglet_langue_section4, 'bloc_onglet_langue_section4', couche );
	alterner_couche(tab_bloc_langue_section4, 'bloc_langue_section4', current_bloc_langue_section4 );
	alterner_couche(tab_bloc_langue_section4, 'bloc_langue_section4', couche );
	current_bloc_langue_section4 = couche;

	if ((obj = MM_findObj('bloc_langue_section4'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_langue_section4'))) {
		obj.value = couche;
	}
}

var tab_bloc_participant = new Array();
var tab_bloc_onglet_participant = new Array();
var current_bloc_participant = '1';

function show_hide_bloc_participant(name_bloc, couche ) { //name_bloc pour un soucis de code generique
	alterner_couche(tab_bloc_onglet_participant, 'bloc_onglet_participant', current_bloc_participant );
	alterner_couche(tab_bloc_onglet_participant, 'bloc_onglet_participant', couche );
	alterner_couche(tab_bloc_participant, 'bloc_participant', current_bloc_participant );
	alterner_couche(tab_bloc_participant, 'bloc_participant', couche );
	current_bloc_participant = couche;

	if ((obj = MM_findObj('bloc_participant'))) {
		obj.value = couche;
	}
	if ((obj = MM_findObj('bloc_onglet_participant'))) {
		obj.value = couche;
	}
}

function alterner_couche(tab, name, couche ) {
//alert(name+couche);
	if (!(layer = MM_findObj(name + couche))) {
		//alert('false pour '+name + couche);
		return;
	}
	if (layer.style.display == 'none'){
		//alert(name+couche+" aparait")
		layer.style.display = 'block';
	} else {
		//alert(name+couche+" disparait")
		layer.style.display = 'none';
	}
}

function EcrireCookie(nom, valeur) {
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}

function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom) {
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
	var j=i+alen;
	if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
	i=document.cookie.indexOf(" ",i)+1;
	if (i==0) break;

	}
	return null;
}


function verif_joyauxdechocolat () {
	var reg_mail = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/;
	
	if ( document.f_form.elements["data[CadeauxEntreprise][presence]"][0].checked == false && document.f_form.elements["data[CadeauxEntreprise][presence]"][1].checked == false && document.f_form.elements["data[CadeauxEntreprise][presence]"][2].checked == false && document.f_form.elements["data[CadeauxEntreprise][presence]"][3].checked == false ) {
		msgError = "Veuillez saisir votre presence";
	}else if ( document.f_form.elements["data[CadeauxEntreprise][email]"].value == '' ) {
		msgError = "Veuillez saisir votre adresse mail";
		document.f_form.elements["data[CadeauxEntreprise][email]"].focus();
	}else if (!(reg_mail.exec(document.f_form.elements["data[CadeauxEntreprise][email]"].value)!=null)){
		msgError = "Veuillez saisir un email valide";
		document.f_form.elements["data[CadeauxEntreprise][email]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][prenom]"].value == '' ) {
		msgError = "Veuillez saisir votre prenom";
		document.f_form.elements["data[CadeauxEntreprise][prenom]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][nom]"].value == '' ) {
		msgError = "Veuillez saisir votre nom";
		document.f_form.elements["data[CadeauxEntreprise][societe]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][societe]"].value == '' ) {
		msgError = "Veuillez saisir votre societe";
		document.f_form.elements["data[CadeauxEntreprise][societe]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][adresse1]"].value == '' ) {
		msgError = "Veuillez saisir votre adresse professionelle 1";
		document.f_form.elements["data[CadeauxEntreprise][adresse1]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][zip1]"].value == '' ) {
		msgError = "Veuillez saisir votre Code postal 1";
		document.f_form.elements["data[CadeauxEntreprise][zip1]"].focus();
	}else if ( document.f_form.elements["data[CadeauxEntreprise][ville1]"].value == '' ) {
		msgError = "Veuillez saisir votre ville 1";
		document.f_form.elements["data[CadeauxEntreprise][ville1]"].focus();
	}else{
		document.f_form.submit();
		return true;
	}
	
	
	
	alert(msgError);
	return false;
}
	
//-->
