			function aleatorio(){
				superior=100000;
				inferior=0;
				aleat = Math.random() * 100000; 
				aleat = Math.round(aleat); 
				aleat = parseInt(aleat); 
				document.all.oculto.value = aleat;
				alert ("Copie este codigo: " + aleat);
				return aleat;
				}

function abrepostal (url) {
	AbreVentana (url,'_blank','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=750,height=550,top=30,left=30');
}

 function AbreVentana(url) {
	var ventana=document.open(url,'_blank','toolbar=no,location=no,directories=no,status=NO,scrollbars=yes, left=0, top=0, width=790, height=665,resizable=yes');
}

			function AbreConsulta (url) {
				var ventana = document.open (url, '_blank', 'toolbar=no, location=no, directories=no, status=no, scrollbars=no, left=200, top=200, width=550, height=160, resizable=no');
			}

function imprimir() {
   if (window.print != null) {
      window.print()
   } else {
      alert('Desafortunadamente, tu navegador no soporta este método de impresión.\nPor favor, selecciona la opción de Imprimir del menú de Archivo de tu navegador.')
   }
}
function fav() {
   if (window.confirm ('Si quieres incluir www.ArteAlicia.com en tus Favoritos pulsa Aceptar')) {
     window.external.AddFavorite('http://www.artealicia.com', 'Galeria de pintura [ ArteAlicia.com ]');
	}
}

    function mostrar_informacion(txt){
            var b=/^[^@ $]+@([^@. $]+\.[^@. $]+)+$/
            return b.test(txt)
         }

       function Comprobar () {
         var message = "";
         var obj;

       if ( document.Datos.Nom_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Nom_cli;
            }
            message += "Debe introducir su nombre.\n";
         }
         if ( document.Datos.Ape_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Ape_cli;
            }
            message += "Debe introducir sus apellidos.\n";
         }
         if ( document.Datos.Tfn_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Tfn_cli;
            }
            message += "Debe introducir un teléfono\n";
         }
       /*  if ( document.Datos.Ema_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Ema_cli;
            }
            message += "Debe introducir un E-mail\n";
         } else {
            if ( mostrar_informacion(document.Datos.Ema_cli.value) == false ) {
               if (message.length == 0) {
                  obj = document.Datos.Ema_cli;
               }
               message = message + "El campo E-mail es incorrecto.\n";
            }
         }*/
         if ( document.Datos.Dir_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Dir_cli;
            }
            message += "Debe introducir una dirección.\n";
         }
         if ( document.Datos.C_P_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.C_P_cli;
            }
            message += "Debe introducir un código postal.\n";
         }
         if ( document.Datos.Loc_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Loc_cli;
            }
            message += "Debe introducir una población.\n";
         }
         if ( document.Datos.Pro_cli.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Pro_cli;
            }
            message += "Debe introducir una provincia.\n";
         }
		 if ( document.Datos.Forma_pag.value == "" ) {
            if (message.length == 0) {
               obj = document.Datos.Forma_pag;
            }
            message += "Debe introducir una forma de pago.\n";
         }
         
         if ( message.length > 0 ) {
            obj.focus();
            message = "Se han detectado los siguientes errores:\n\n" + message;
            alert( message );
            return false;
         } else {
            return true;
         }
      }