var lockBar=0;var aOffset = new Array(16,136,256,376,496,569); var aIFrmHt = new Array()
/* Funcion de cambio de CSS para el tamaño de las letras */
function txtSz(text_size) {
  oLnk = document.getElementById("txtSz"); oLnk.href = "/css/"+text_size+".css"
  var datDate = new Date(); var datNextYear = datDate
	datNextYear.setTime(datDate.getTime()+31536000000)
  document.cookie = "txtSz="+text_size+"; expires="+datNextYear.toGMTString()+"; path=/"
}


/* Funciones del Menu desplegable */
function mDsp(menuId) {
  var tmpWidth = 0; lockBar = menuId
  for (ii=1; ii<7;ii++) {
    if (document.body.clientWidth-752 > 0) {tmpWidth = document.body.clientWidth-751} else {tmpWidth = 1}
    if (menuId == ii) {
      document.getElementById("tpMnu"+ii).style.display = "block";document.getElementById("tpMnu"+ii).style.left=aOffset[ii-1]+tmpWidth/2+"px"
      if (navigator.userAgent.indexOf("Opera") < 0) {document.getElementById("navIFrm"+ii).style.display = "block";document.getElementById("navIFrm"+ii).style.left=aOffset[ii-1]+tmpWidth/2+"px"}
      document.getElementById("mnSpn"+ii).style.backgroundImage = "url(/img/bgNavSlct.gif)";document.getElementById("mnSpn"+ii).style.backgroundRepeat = "repeat";
    }
    else {document.getElementById("tpMnu"+ii).style.display = "none";document.getElementById("navIFrm"+ii).style.display = "none";document.getElementById("mnSpn"+ii).style.backgroundImage = "none";}
  }
}

function mOff(menuId) {lockBar=0;setTimeout("mHide("+menuId+")",700)}

function mHide(menuId) {if (menuId != lockBar) {document.getElementById("tpMnu"+menuId).style.display = "none";document.getElementById("navIFrm"+menuId).style.display = "none";document.getElementById("mnSpn"+menuId).style.backgroundImage = "none";}}



/* Funciones relacionadas con el WebMail */

function validarEmail(email) {
	var lsAT;
	lsAT = email.indexOf("@");
	if (lsAT == -1 || email.indexOf(" ") != -1 ) {
		return false;
	}
	return true;
}//validarEmail	
	
	
// Abrir Ventana
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Funcion de PopUp genérico
var ventana;
function popUpGenerico(fichero){

	ventana=window.open('','ventana','width=500,height=380,status=yes')
	var texto = "<html><head><title>Ampliación de la imagen</title>";
	texto = texto +"</head><body bgcolor='#c7d9e0' text='#666666' leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' onClick='javascript:window.close();'>";
	texto = texto + "<img src='"+fichero+"' width='480' height='360'></body></html>"	
	ventana.document.open("text/html","replace");
	ventana.document.write(texto);
	ventana.focus();
}

// Funcion de PopUp pasando el fijo de la imagen
function popUpFijo(fichero,ancho,alto){

	if (typeof(ventana)!="undefined")
		if (!ventana.closed)
			ventana.close();
	ventana=window.open('','ventana','width='+(parseInt(ancho)+10)+',height='+(parseInt(alto)+10)+',status=yes')

	var texto = "<html><head><title>Wine Meeting Point</title>";
	texto = texto +"</head><body bgcolor='#FFFFFF' text='#666666' leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' onClick='javascript:window.close();'>";
	texto = texto + "<img src='"+fichero+"' width='"+ancho+"' height='"+alto+"'></body></html>"	
	//Abrimos la ventana
	ventana.document.open("text/html","replace");
	ventana.document.write(texto);
	ventana.focus();
}

// Funcion de PopUp Resize Automatico
function popUp(fichero){

	imagen=new Image(); 
	imagen.src=fichero;
	var ancho=imagen.width;
	var alto=imagen.height;
	
	if (typeof(ventana)!="undefined")
		if (!ventana.closed)
			ventana.close();
	ventana=window.open('','ventana','width='+(parseInt(ancho)+10)+',height='+(parseInt(alto)+10)+',status=yes')

	var texto = "<html><head><title>Wine Meeting Point</title>";
	texto = texto +"</head><body bgcolor='#FFFFFF' text='#666666' leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' onClick='javascript:window.close();'>";
	texto = texto + "<img src='"+fichero+"' width='"+ancho+"' height='"+alto+"'></body></html>"	
	//Abrimos la ventana
	ventana.document.open("text/html","replace");
	ventana.document.write(texto);
	ventana.focus();
}

function imprimirPagina(quediv)
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_value = document.getElementById(quediv).innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>Wine Meeting Point</title>'); 
   docprint.document.write('</head><body onLoad="self.print()">');          
   docprint.document.write(content_value);          
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

function agregarFavoritos() {
	if (window.sidebar&&window.sidebar.addPanel)
		window.sidebar.addPanel("WineMeetingPoint",location.href,"");
	else
		window.external.AddFavorite(location.href,"WineMeetingPoint");
}

function testPasswd(form) {	
	if (form.password.value!=form.password2.value){
		alert("Atención, la contraseña y su repetición no coinciden.\nVuelva a teclearlas.");
		return false;
	}
	else 
		return true;
}
