// JavaScript Document
<!--   

function popUp(URL) {
	day = new Date();
	id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=1,width=980,height=520,left = 150,top = 135');");
}

var win = null;

function launchCenter(url, name, height, width) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  return window.open(url, name, str);
}


function OpenWin(url, alto, ancho)

 {
    if (win && win.open && !win.closed) {win.close(); win = launchCenter(url,"",500,660);}
	else
	 win = launchCenter(url,"",500,660);
	
   }





function comillas(string) {
    string = string.replace(/"/g, '“');
    return string;
}
function run(){
	document.getElementById('video').style.display="inherit";
	document.getElementById('wine_library_hiden').style.display="inherit";
	document.getElementById('wine_library').style.display="none";
}
function stop(){
	document.getElementById('video').style.display="none";
	document.getElementById('wine_library_hiden').style.display="none";
	document.getElementById('wine_library').style.display="inherit";
}
function show(){
	document.getElementById('submenu').style.visibility="visible";
	document.getElementById('submenuauberge').style.visibility="hidden";
	document.getElementById('video').style.visibility="visible";
}
function show2(){
	document.getElementById('submenuauberge').style.visibility="visible";
	document.getElementById('submenu').style.visibility="hidden";
}
function hide(){
	document.getElementById('submenu').style.visibility='hidden';
	document.getElementById('submenuauberge').style.visibility='hidden';
}  
//-->  
function validarFormulario(){
	var ok=1;

	if(document.forms.formulario_contacto.nombre.value==""){

		document.getElementById("id_nombre").className="texto_error";

		ok = 0;		

	} else { document.getElementById("id_nombre").className="texto_borbon_12"; 

	}
	
	if(document.forms.formulario_contacto.pais.value==""){

		document.getElementById("id_pais").className="texto_error";

		ok = 0;		

	} else { document.getElementById("id_pais").className="texto_borbon_12"; 

	}
	
	if(isEmail(document.forms.formulario_contacto.mail.value)){
		

		document.getElementById("id_mail").className="texto_error";

		
		alert("S’il vous plaît entrer le bon E-mail");
		
		
		
		ok = 0;	
		
		return false;
		

	} else { document.getElementById("id_mail").className="texto_borbon_12"; 

	}	

	
	if(ok==1){document.forms.formulario_contacto.submit();

	}else{ 
		alert ('Les champs en vert sont obligatoires.')
		
		return false;

	}
	

}


function isEmail(smail) {

	

	var re=/^[a-z0-9\-\.]+@[a-z0-9\-\.]+\.[a-z]{2,}$/i;

	

	if(smail.match(re))	{

		

		return false;

		

	} else {

				

		return true;

		

	}

}

