function handleEnter (field, event) { 
        var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; 
        if (keyCode == 13) { 
field.blur();
return false;
        } 
        else 
        return true; 
    }    



function meteFecha(data) {

document.Form1.fecha.value=data;

}


function confirmaBorrarTicket(msg,url) {

//if (confirm(msg)) {
//window.location=(url);
//} 
window.location=('avisa.asp?msg='+msg+'&url='+url);
}

				var linea='c';
				var linea_old='z';
				var base_linea_old='z';


				function cambiaColor(id, src, color)
				{
				document.all[id].bgColor = color;
				src.style.cursor="hand";
				}

				function cambiaColor3(color) {
				if (linea_old!='z') {
				document.all[linea_old].bgColor = color;
				document.all[base_linea_old].bgColor = '#C0C0C0';
				}
				}



				function cambiaColor2(id, t, src, color1, color2) {

				if (id==linea) {
				document.all[id].bgColor = color2;
				//document.all[t].bgColor =  '#C0C0C0';
				}
				else {
				document.all[id].bgColor = color1;
				//document.all[t].bgColor =   '#C0C0C0';
				}

				src.style.cursor="hand";
				}
				
function isEmpty(s) {
	return ((s == null) || (s.length == 0));
}

function isDigit(c)
{
	return ((c >=0) && (c <=9));
}

function isInteger (s)
{
	if (isEmpty(s.value)) return false;
	for (var i = 0; i < s.value.length; i++)
		if (!isDigit(s.value.charAt(i))) return false;
	return true;
}

function isFloat(s)
{
	if (isEmpty(s.value))return false;
	if (isNaN(parseFloat(s.value))) return false;
	return true;
}

		
function isDecimalComa(s)
{
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (c==".") return false;
	}
	data = s.split(",");
	if (data.length > 2) return false;
	parteEntera = data[0];
	if (isEmpty(parteEntera)) return false;
	for (i = 0; i < parteEntera.length; i++)
	{
		var c = parteEntera.charAt(i);
		if (!isDigit(c)) return false;
	}
	if (data.length > 1)
	{
		parteDecimal = data[1];
		if(parteDecimal.length > 2) //numero de decimales
			return false;
		if (isEmpty(parteDecimal)) return false;
		for (i = 0; i < parteDecimal.length; i++)
		{
			var c = parteDecimal.charAt(i);
			if (!isDigit(c)) return false;
		}
	}
	return true;
}

function confirmaBorrar(msg,url) {
if (confirm(msg)) {
window.location = (url);
}  
}  

function confirma_borrar_lugar(item) {
if (confirm("Está seguro de borrar el lugar '"+item+"'")) {
window.location = ('edit_lugares_action.asp?p_delete='+item);
}  
}  

function confirma_borrar_user(item) {
if (confirm("Está seguro de borrar el usuario "+item)) {
window.location = ('edit_users_action.asp?p_delete='+item);
}  
}  


function confirma_borrar_reserva(item) {
if (confirm("Está seguro de borrar la Reserva Número "+item+". Se borrarán también todas las líneas de inmersiones.")) {
window.location = ('edit_reservas_action.asp?p_delete='+item);
}  
}  


function anyCheck() {
var total = 0;
var max = document.delForm.p_dely.length;
if (eval("document.delForm.p_dely.checked") == true) {
    total += 1;
   }
for (var idx=0; idx < max; idx++) {
if (eval("document.delForm.p_dely[" + idx + "].checked") == true) {
    total += 1;
   }
}
if (total < 1) {
alert("No se ha seleccionado ninguna linea.");
return false;
}
else {
if (confirm("Está seguro de borrar las líneas seleccionadas")) {
return true;
}
else {
return false;
}
}
}

var checkflag = "false";
function check(field) {
if (checkflag == "false") {
document.delForm.p_dely.checked = true;
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "Uncheck All"; }
else {
document.delForm.p_dely.checked = false; 
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "Check All"; }
}



function ValidarForm() {
if (document.MyForm.nombre.value =='' ) {
alert ("El campo Nombre no puede quedar en blanco");
return false;
}
else if (document.MyForm.dir.value =='' ) {
alert ("El campo Dirección no puede quedar en blanco");
return false;
}
else if (document.MyForm.pob.value =='' ) {
alert ("El campo Población no puede quedar en blanco");
return false;
}
else if (document.MyForm.cp.value =='' ) {
alert ("El campo Cód. Postal no puede quedar en blanco");
return false;
}
else if (document.MyForm.email.value =='' ) {
alert ("El campo E-mail no puede quedar en blanco");
return false;
}
else {
return true;
}
}



function valForm() {
if (document.calData.nombre.value =='' ) {
alert ("El campo Persona de contacto no puede quedar en blanco");
return false;
}
else if (document.calData.tel.value =='' ) {
alert ("El campo Teléfono contacto no puede quedar en blanco");
return false;
}
else if (document.calData.dire.value =='' ) {
alert ("El campo Dirección de envío no puede quedar en blanco");
return false;
}
else if (document.calData.cp.value =='' ) {
alert ("El campo Código Postal no puede quedar en blanco");
return false;
}
else if (document.calData.pob.value =='' ) {
alert ("El campo Población no puede quedar en blanco");
return false;
}
else if (document.calData.prov.value =='' ) {
alert ("El campo Provincia no puede quedar en blanco");
return false;
}
else if (document.calData.nombre2.value =='' ) {
alert ("El campo Nombre/Empresa no puede quedar en blanco");
return false;
}
else if (document.calData.dni.value =='' ) {
alert ("El campo DNI/NIF no puede quedar en blanco");
return false;
}
else if (document.calData.dire2.value =='' ) {
alert ("El campo Dirección (Datos de facturación) no puede quedar en blanco");
return false;
}
else if (document.calData.cp2.value =='' ) {
alert ("El campo Código Postal (Datos de facturación)  no puede quedar en blanco");
return false;
}
else if (document.calData.pob2.value =='' ) {
alert ("El campo Población (Datos de facturación) no puede quedar en blanco");
return false;
}
else if (document.calData.prov2.value =='' ) {
alert ("El campo Provincia (Datos de facturación) no puede quedar en blanco");
return false;
}
else if (document.calData.pais2.value =='' ) {
alert ("El campo País (Datos de facturación) no puede quedar en blanco");
return false;
}




else if (document.calData.email.value =='' ) {
alert ("El campo E-mail no puede quedar en blanco");
return false;
}
else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.calData.email.value)==false) {
alert("El E-mail introducido no es válido")
return (false)
}
else if (document.calData.password.value =='' ) {
alert ("El campo Clave de acceso no puede quedar en blanco");
return false;
}
else if (document.calData.password.value != document.calData.password2.value ) {
alert ("No coincide la confirmación de la Clave");
return false;
}
//else if (eval("document.calData.condiciones.checked") == false) {
//alert ("Debe aceptar las condiciones de uso y compras en LaButik.com");
//return false;
//}
else {
return true; 
}
}

function meterDatosFacturacion() {

var n1=document.getElementById("nombre").value
var t1=document.getElementById("tel").value
var d1=document.getElementById("dire").value
var cp=document.getElementById("cp").value


var pob=document.getElementById("pob1").options[document.getElementById("pob1").options.selectedIndex].text


var prov=document.getElementById("prov1").value
var pais=document.getElementById("pais1").value

document.calData.nombre2.value=n1
document.calData.tel2.value=t1
document.calData.dire2.value=d1
document.calData.cp2.value=cp
document.calData.pob2.value=pob 
document.calData.prov2.value=prov
document.calData.pais2.value=pais


}

function valPago() {
var total = 0;

var max = document.formPago.formapago.length;
if (eval("document.formPago.formapago.checked") == true) {
    total += 1;
   }

for (var idx=0; idx < max; idx++) {
if (eval("document.formPago.formapago[" + idx + "].checked") == true) {
    total += 1;
   }
}

if (total < 1) {
alert("No ha seleccionado ninguna forma de pago.");
return false;
}
else {
return true;
}

}




function sumar(x, valor) { 
x=(x*1)+(valor*1);
return x;
} 

function restar(x, valor) { 
if (x > valor) { 
x=x-valor; 
} 
return x;
} 


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_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_findObj(n, d) { //v3.0
  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); 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];}
}


function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function new_window(url) {
popupWin = window.open(url,'','width=780,height=500,left=0,top=0,scrollbars=yes')
}
function new_window2(url) {
popupWin = window.open(url,'','width=780,height=400,left=0,top=0,scrollbars=yes')
}

function smallWindow(url) {
var l=320;
var t=470;
var winl = (screen.width - l) / 2;
var wint = (screen.height - t) / 2;
popupWin = window.open(url,'datos','width='+l+',height='+t+',left='+winl+',top='+wint+',status=no,scrollbars=0')
}

function small_window2(url) {
var winl = (screen.width - 600) / 2;
var wint = (screen.height - 500) / 2;
popupWin = window.open(url,'datos2','width=600,height=500,left='+winl+',top='+wint+',scrollbars=1')
}

function small_window3(url) {
var winl = (screen.width - 740) / 2;
var wint = (screen.height - 580) / 2;
popupWin = window.open(url,'datos3','width=740,height=580,left='+winl+',top='+wint+',scrollbars=1')
}

function finestra2(url) {
var winl = (screen.width - 640) / 2;
var wint = (screen.height - 780) / 2;
popupWin = window.open(url,'printTicket','width=640,height=780,left='+winl+',top='+wint+',scrollbars=1')
}

function finestra33(url) {
var winl = (screen.width - 440) / 2;
var wint = (screen.height - 150) / 2;
popupWin = window.open(url,'printTicket','width=440,height=150,left='+winl+',top='+wint+',scrollbars=1')
}


function finestra4(url) {
var winl = (screen.width - 440) / 2;
var wint = (screen.height - 320) / 2;
popupWin = window.open(url,'printTicket','width=440,height=320,left='+winl+',top='+wint+',scrollbars=1')
}

function ventana2(url) {
var winl = (screen.width - 400) ;
var wint = (0) ;
popupWin = window.open(url,'printTicket','width=400,height=680,left='+winl+',top='+wint+',scrollbars=1')
if (parseInt(navigator.appVersion) >= 4) { popupWin.window.focus(); }
}





function mail(mypage, myname, w, h, scroll) {		
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function padout(number) { return (number<10) ? '0' + number : number; }

function ventana0(myurl) {
var w = 0
var h = 0
var winleft = screen.width;
var wint = screen.height;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "aa2", props);
newWindow2.window.focus();
}


function ventana2(myurl) {
var w = 500
var h = 650
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b2", props);
newWindow2.window.focus();
}

function ventana3(myurl) {
var w = 500
var h = 300
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=yes, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b3", props);
newWindow2.window.focus();
}

function ventana3B(myurl) {
var w = 650
var h = 410
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b3b", props);
newWindow2.window.focus();
}


function ventana4(myurl) {
var w = 500
var h = 400
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b4", props);
newWindow2.window.focus();
}

function ventana4b(myurl) {
var w = 500
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b4b", props);
newWindow2.window.focus();
}

function ventana5(myurl) {
var w = 550
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5", props);
newWindow2.window.focus();
}

function ventana5sc(myurl) {
var w = 550
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5", props);
newWindow2.window.focus();
}


function ventana5PRO(myurl) {
var w = 780
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5pro", props);
newWindow2.window.focus();
}

function ventana6(myurl) {
var w = 640
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b6", props);
newWindow2.window.focus();
}


function confirma_borrar(msg,url) {
if (confirm(msg)) {
window.location = (url);
}  
}


var good;
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.biz)|(\.info)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){
good = true
} else {
alert('Por favor introduce un e-mail válido')
field.focus()
field.select()
good = false
}
}

u = window.location;
m = "Pienso que te puede interesar esta página";

function mailThisUrl(){
good = false
checkEmailAddress(document.eMailer.address)
if (good){
// the following expression must be all on one line...
window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+"%0A"+u;
}
}

function buscaRef() {
ref=document.FormRef.Ref.value;
if (!ref) {
return false
} else {
return true
}
}

function showHintCP(capaPOB,capaPRO) {
xmlHttp=GetXmlHttpObject()
var url="/baz/buscadatos2.asp?cp="+document.calData.cp.value
url+="&idMun="+document.calData.muni.value
url+="&idPob="+document.calData.pobid.value+'&sid='+Math.random()

xmlHttp.onreadystatechange=function () { 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {   
document.getElementById(capaPOB).innerHTML=(xmlHttp.responseText)



document.calData.prov.value=document.getElementById("NOMpro1").value
document.calData.pais.value=document.getElementById("NOMpais1").value






	}
} 

xmlHttp.open("GET",url,true)
xmlHttp.send(null)

		
} 


function respuestaOlvido(mail) {
xmlHttpq=GetXmlHttpObject()
var url="/baz/buscamail2.asp?email="+mail+'&sid='+Math.random()
xmlHttpq.onreadystatechange=function () { 
if (xmlHttpq.readyState==4 || xmlHttpq.readyState=="complete") {   
		document.getElementById("clave").innerHTML=(xmlHttpq.responseText)
	}	
} 
xmlHttpq.open("GET",url,true)
xmlHttpq.send(null)
}

function olvidoClave() {
	document.getElementById("clave").innerHTML="<table width=95% border=0 cellspacing=0 cellpadding=2><tr><td colspan=2 valign=top><div align=left><a href=# onclick='volverdeolvidoClave();return false;'><img src='/images/atrasgris.gif' border=0></a></font></div><td><tr><tr><td colspan=2 valign=top><font class=titulares2>Introduzca su e-mail y le enviaremos su clave de acceso en breves instantes.</font><br></td></tr><tr height=30><td></td><td><div id=validate></div></td></tr><tr><td valign=middle width=120>E-mail:</td><td valign=middle><input type=TEXT size=24 onblur=showHint('/baz/buscamail.asp?email='+value,'validate'); onkeypress='return handleEnter(this, event)' name=email tabindex=1></td></tr><tr><td valign=middle></td><td valign=middle><font size=1 color=black><input  type=image src=/images/solicitarclaveA.gif  alt='Solicitar la Clave de Acceso v’a e-mail' name='pAt' onmouseout=MM_swapImgRestore(); onmouseover=MM_swapImage('pAt','','/images/solicitarclaveB.gif',1);return document.MM_returnValue border=0  onclick='respuestaOlvido(document.MyForm.email.value);return false;' name=p_button tabindex=3><br></font></td></tr></table>"
}

function volverdeolvidoClave() {
document.getElementById("clave").innerHTML="<table width=95% border=0 cellspacing=0 cellpadding=2><tr><td valign=top width=100%><font class=titulares2>Introduzca los datos siguientes para identificarse como cliente de Alqui-Envas.<br></font></td></tr><tr><td width=100%><div align=center><table width=100% border=0 cellspacing=0 cellpadding=2><tr><td valign=middle></td><td><table border=0 cellspacing=0 cellpadding=0><tr height=30><td><div id=validate></div></td></tr></table></td></tr><tr><td valign=middle width=120><div align=left><p>E-mail:</p></div></td><td><input type=TEXT size=24 onblur=showHint('/baz/buscamail.asp?email='+value,'validate'); name=email tabindex=1></td></tr><tr><td valign=middle><div align=left><p>Clave de acceso:</p></div></td><td><input type=password size=10 name=pw tabindex=2></td></tr><tr><td valign=middle></td><td valign=middle><input  type=image src=/images/identificarmeA.gif  alt='Enviar los datos para identificarse' name='pAA' onmouseout='MM_swapImgRestore();' onmouseover=MM_swapImage('pAA','','/images/identificarmeB.gif',1);return document.MM_returnValue border=0 tabindex=3></td></tr><tr><td colspan=2 valign=middle>Si olvid&oacute; su clave de acceso haga click <a href=# onclick='olvidoClave();return false;'><b>aqu&iacute;</b></a>.</td></tr></table></div></td></tr></table>"
}


function actualizaPedido(pedido,linea,q) {
urlactualiza='/baz/CambiaEstado.asp?id_pedido='+pedido+'&linea='+linea+'&q='+q;
Hint(urlactualiza,'pedido');
recalCular()
}
function addRefPedido(ref,q,idprod,imgprod,familia) {
Hint('/baz/baz_add_action_from1b.asp?p_ref='+ref+'&p_img='+imgprod+'&p_fam='+familia+'&p_prod_id='+idprod+'&q='+q,'pedido');
recalCular()
}
function borrarLinea(linea) {
Hint('/baz/baz_order_delete_item.asp?linea='+linea,'pedido');
recalCular()
}

function recalCular() {
vol=document.addlista.volumentotal.value;
cp=document.addlista.cp1.value;
pedido=document.addlista.idPedido.value;


xmlHttp33=GetXmlHttpObject()
var url="/baz/buscagastos.asp?cp="+cp
url+="&idPedido="+pedido
url+="&volumen="+vol
url+='&sid='+Math.random()

xmlHttp33.onreadystatechange=function () { 
}
xmlHttp33.open("GET",url,false)
xmlHttp33.send(null)

var strBrowserName=navigator.appName; // Get the Browser Name 

if( strBrowserName == 'Microsoft Internet Explorer' ) 
{ 
window.history.go( 0 ); 
} 
else 
{ 
location.reload()
} 



} 

function Hint(url,capa1) {

if (url.indexOf("?")>=0) {
var url=url+'&sid='+Math.random()
} else {
var url=url+'?sid='+Math.random()
}

xmlHttpPage=GetXmlHttpObject()

xmlHttpPage.open("GET",url,false)
xmlHttpPage.send(null)

} 


function showHint(url,capa1) {

if (url.indexOf("?")>=0) {
var url=url+'&sid='+Math.random()
} else {
var url=url+'?sid='+Math.random()
}

xmlHttpPage=GetXmlHttpObject()

xmlHttpPage.onreadystatechange=function () { 


if (xmlHttpPage.readyState==4 || xmlHttpPage.readyState=="complete") {   
		document.getElementById(capa1).innerHTML=(xmlHttpPage.responseText)
		document.getElementById(capa1).style.visibility = 'visible' 
		
	}
} 

xmlHttpPage.open("GET",url,false)
xmlHttpPage.send(null)
document.getElementById(capa1).innerHTML=(xmlHttpPage.responseText)
document.getElementById(capa1).style.visibility = 'visible' 

} 


function GetXmlHttpObject() { 
var xmlHttp=null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
} catch (e) {
// Internet Explorer
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

var emailfilter2=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail2(e2){
var returnval2=emailfilter2.test(e2.value)
if (!returnval2){
alert("El e-mail introducido no es correcto")
e2.select()
}else{

xmlHttpxx=GetXmlHttpObject()
var url="http://www.visualonline.com/info/getENews.asp";
url=url+"?miemp=Alqui-Envas";
url=url+"&baja=1";
url=url+"&domain=www.alquienvas.com";
url=url+"&mail_con="+document.formAlta.mail.value;
url=url+"&sid="+Math.random();
	xmlHttpxx.onreadystatechange=function () { 
	if (xmlHttpxx.readyState==4 || xmlHttpxx.readyState=="complete") {   
		errstr=xmlHttpxx.responseText
		showHint('/eNewsbajaAction.asp?nomail='+errstr+'&sid='+Math.random()+'&email='+document.formAlta.mail.value,'newsletter')
	}
} 
	xmlHttpxx.open("GET",url,true)
	xmlHttpxx.send(null)
}
}

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (!returnval){
alert("El e-mail introducido no es correcto")
e.select()
}else{
xmlHttp=GetXmlHttpObject()
var url="http://www.visualonline.com/info/getENews.asp";
url=url+"?miemp=alqui-envas";
url=url+"&domain=www.alquienvas.com";
url=url+"&mail_con="+document.form1.mail.value;
url=url+"&sid="+Math.random();

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)

showHint('/eNewsalta.asp?email='+document.form1.mail.value+'&sid='+Math.random(),'newsletter')
}
}


function small_window3(myurl) {
var w = 450
var h = 250
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars=no, resizable=no'
var newWindow;
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}

function finestra1(mypage, w, h) {
var w;
var h;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no'
win = window.open(mypage, '', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function finestra2(url) {
popupWin = window.open(url,'','width=640,height=600,left=0,top=0,scrollbars=yes')
}
function bqddetalls(url) {
popupWin = window.open(url,'','width=750,height=400,left=0,top=0')
}
function calcula(f){
	maxLength = 150;

	ncaracteres=f.p_blurb.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;

   nmen=Math.ceil(ncaracteres/maxLength);
	if (!(nmen > 0)) nmen=0;
	f.nmensajes.value=nmen;
}

function put1(f){
	n=f.horizontal.value;
	f.x.value=n;
}
function put2(f){
	m=f.vertical.value;
	f.y.value=m;
}


function calcula130(f){
	maxLength = 130;

	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;

   nmen=Math.ceil(ncaracteres/maxLength);
	if (!(nmen > 0)) nmen=0;
	f.nmensajes.value=nmen;
}

function calcula100(f){
	maxLength = 100;

	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;

   nmen=Math.ceil(ncaracteres/maxLength);
	if (!(nmen > 0)) nmen=0;
	f.nmensajes.value=nmen;
}

function calcula_consejo(f){
	maxLength = 200;

	ncaracteres=f.p_blurb.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;

   nmen=Math.ceil(ncaracteres/maxLength);
	if (!(nmen > 0)) nmen=0;
	f.nmensajes.value=nmen;
}


function calc2() {   
var w=700;
var h=500;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=yes,status=yes,menubar=no,location=no'
vent = window.open('','tpv', winprops)

document.forms[0].submit();    }    

function calc() { 
vent=window.open('','tpv','width=725,height=600,scrollbars=no,resizable=yes,status=yes,menubar=no,location=no');
document.forms[0].submit();    
}