/*-------------------------------------------------------------------------------*/
/* JAVASCRIPT LamasBolano.com :: Programador : Jose Cuellar JOANCUVI@hotmail.com */
/*-------------------------------------------------------------------------------*/

var message=" Opción reservada por LamasBolano.com ";
function click(e) {if (document.all) {if (event.button == 2) {alert(message);return false;}}
if (document.layers) {if (e.which == 3) {alert(message);return false;}}}

function ValidarFrmSearch(i,pc,f,p,cm){
hacersubmit = "true";
mensaje = "- No se ha podido enviar la búsqueda debido a:\n";
if ((i == '') && (pc == '') && (f == '') && (p == '') && (cm == '')){mensaje= mensaje + "  Como mínimo debe introducir un parámetro de búsqueda.\n";hacersubmit = "false";}
if (hacersubmit == "true"){
window.document.frmSearch.submit();}else{alert(mensaje);}}
function PintarFechaCompleta(){
var monthNames = new makeArray(12);
monthNames[0] = "Enero";
monthNames[1] = "Febrero";
monthNames[2] = "Marzo";
monthNames[3] = "Abril";
monthNames[4] = "Mayo";
monthNames[5] = "Junio";
monthNames[6] = "Julio";
monthNames[7] = "Agosto";
monthNames[8] = "Septiembre";
monthNames[9] = "Octubre";
monthNames[10] = "Noviembre";
monthNames[11] = "Diciembre";

// Array de los días

var dayNames = new makeArray(7);
dayNames[0] = "Domingo";
dayNames[1] = "Lunes";
dayNames[2] = "Martes";
dayNames[3] = "Mi&eacute;rcoles";
dayNames[4] = "Jueves";
dayNames[5] = "Viernes";
dayNames[6] = "S&aacute;bado";

var now = new Date();
var year = now.getYear();

if (year < 2000) year = year + 1900;

function makeArray(len) 
{
for (var i = 0; i < len; i++) this[i] = null;
this.length = len;
}
document.write( dayNames[now.getDay()] + " " + now.getDate() + " de " + monthNames[now.getMonth()] + " " +" del " + year);
}
function ChaparSesionActualONo(){}

function ValidarFrmLoginHome(confirmarEntradaSesion,usuario){
if(confirmarEntradaSesion=='true'){

login = window.document.FrmLogin.txtLogin.value;
psw = window.document.FrmLogin.txtPsw.value;
hacersubmit=true;
mensaje='';
if(login==''){mensaje=mensaje + '- Debe introducir el Login\n';hacersubmit=false;}
if(psw==''){mensaje=mensaje + '- Debe introducir el Password\n';hacersubmit=false;}
if(hacersubmit){
if (confirm('Actualmente existe una sesión abierta por el señor ' + usuario + '.\nSi elige ACEPTAR y el nuevo usuario es correcto cerrará la actual sesión para iniciar una nueva sesión, si no es correcto se cerrarán todas las sesiones.\n Si elige CANCELAR se mantendrá la sesión actual.')){
window.document.FrmLogin.submit();}
}else{alert(mensaje);}
}else{
login = window.document.FrmLogin.txtLogin.value;
psw = window.document.FrmLogin.txtPsw.value;
hacersubmit=true;
mensaje='';
if(login==''){mensaje=mensaje + '- Debe introducir el Login\n';hacersubmit=false;}
if(psw==''){mensaje=mensaje + '- Debe introducir el Password\n';hacersubmit=false;}

if(hacersubmit){window.document.FrmLogin.submit();}else{alert(mensaje);}
}
}

function validarFrmAltaUsuario(Adminbolean,ActionJS){
if (Adminbolean == 'true'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminUsersLB;
enviarfrm=true;

if (frm.Nombre.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.Nombre.style.background='#FFFE98';}else{frm.Nombre.style.background='#FFFBF7';}
if (frm.Apellidos.value==''){mensaje=mensaje + '- Los Apellidos són obligatórios.\n';enviarfrm=false;frm.Apellidos.style.background='#FFFE98';}else{frm.Apellidos.style.background='#FFFBF7';}
if (frm.Direccion.value==''){mensaje=mensaje + '- La Dirección es obligatoria.\n';enviarfrm=false;frm.Direccion.style.background='#FFFE98';}else{frm.Direccion.style.background='#FFFBF7';}
if (frm.ciudad.value==''){mensaje=mensaje + '- La Ciudad es obligatoria.\n';enviarfrm=false;frm.ciudad.style.background='#FFFE98';}else{frm.ciudad.style.background='#FFFBF7';}
if (frm.cp.value==''){mensaje=mensaje + '- El Código Postal es obligatorio.\n';enviarfrm=false;frm.cp.style.background='#FFFE98';}else{frm.cp.style.background='#FFFBF7';}
if (frm.provincia.value==''){mensaje=mensaje + '- La Província es obligatoria.\n';enviarfrm=false;frm.provincia.style.background='#FFFE98';}else{frm.provincia.style.background='#FFFBF7';}
if (frm.telf.value==''){mensaje=mensaje + '- El teléfono es obligatorio.\n';enviarfrm=false;frm.telf.style.background='#FFFE98';}else{frm.telf.style.background='#FFFBF7';}
if (frm.newsletter.value=='VACIO'){mensaje=mensaje + '- Indique si desea recibir información de LamasBolano.com.\n';enviarfrm=false;frm.newsletter.style.background='#FFFE98';}else{frm.newsletter.style.background='#FFFBF7';}

if (frm.login.value=='')
{
mensaje=mensaje + '- El Login o Nombre de Usuario es obligatorio.\n';enviarfrm=false;frm.login.style.background='#FFFE98';
}else{
if (frm.existe.value=='true'){			
mensaje=mensaje + '- El login que ha indicado no se puede utilizar debido a que otro usuario lo tiene asignado.\n';enviarfrm=false;frm.login.style.background='#FFFE98';
}	
if (frm.existe.value==''){			
mensaje=mensaje + '- El login que ha indicado lo tiene que validar, pulsando el botón situado al lado.\n';enviarfrm=false;frm.login.style.background='#FFFE98';
}	
}
																												

if (frm.psw.value==''){mensaje=mensaje + '- El campo Password es obligatorio.\n';enviarfrm=false;frm.psw.style.background='#FFFE98';}else{frm.psw.style.background='#FFFBF7';}
if (frm.pregunta.value==''){mensaje=mensaje + '- Se requiere una pregunta.\n';enviarfrm=false;frm.pregunta.style.background='#FFFE98';}else{frm.pregunta.style.background='#FFFBF7';}
if (frm.respuesta.value==''){mensaje=mensaje + '- Se requiere la respuesta a su pregunta.\n';enviarfrm=false;frm.respuesta.style.background='#FFFE98';}else{frm.respuesta.style.background='#FFFBF7';}
if (ActionJS=='UpdateUser'){
if (enviarfrm){frm.ASPActionAdmin.value='UpdateUser';frm.submit();}else{alert(mensaje);}
}else{
if (enviarfrm){frm.ASPActionAdmin.value='InsertUser';frm.submit();}else{alert(mensaje);}
}
																											

}else{
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.frmAltaUser
enviarfrm=true;
if (frm.txtNombre.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.txtNombre.style.background='#FFFE98';}else{frm.txtNombre.style.background='#FFFBF7';}
if (frm.txtApellidos.value==''){mensaje=mensaje + '- Los Apellidos són obligatórios.\n';enviarfrm=false;frm.txtApellidos.style.background='#FFFE98';}else{frm.txtApellidos.style.background='#FFFBF7';}
if (frm.txtDireccion.value==''){mensaje=mensaje + '- La Dirección es obligatoria.\n';enviarfrm=false;frm.txtDireccion.style.background='#FFFE98';}else{frm.txtDireccion.style.background='#FFFBF7';}
if (frm.txtCiudad.value==''){mensaje=mensaje + '- La Ciudad es obligatoria.\n';enviarfrm=false;frm.txtCiudad.style.background='#FFFE98';}else{frm.txtCiudad.style.background='#FFFBF7';}
if (frm.txtCp.value==''){mensaje=mensaje + '- El Código Postal es obligatorio.\n';enviarfrm=false;frm.txtCp.style.background='#FFFE98';}else{frm.txtCp.style.background='#FFFBF7';}
if (frm.txtProvincia.value==''){mensaje=mensaje + '- La Província es obligatoria.\n';enviarfrm=false;frm.txtProvincia.style.background='#FFFE98';}else{frm.txtProvincia.style.background='#FFFBF7';}
if (frm.txtTelf.value==''){mensaje=mensaje + '- El teléfono es obligatorio.\n';enviarfrm=false;frm.txtTelf.style.background='#FFFE98';}else{frm.txtTelf.style.background='#FFFBF7';}
if (frm.newsletter.value=='VACIO'){mensaje=mensaje + '- Indique si desea recibir información de LamasBolano.com.\n';enviarfrm=false;frm.newsletter.style.background='#FFFE98';}else{frm.newsletter.style.background='#FFFBF7';}
if (frm.txtLogin.value=='')
{
mensaje=mensaje + '- El Login o Nombre de Usuario es obligatorio.\n';enviarfrm=false;frm.txtLogin.style.background='#FFFE98';
}else{
if (frm.existe.value=='true'){			
mensaje=mensaje + '- El login que ha indicado no se puede utilizar debido a que otro usuario lo tiene asignado.\n';enviarfrm=false;frm.txtLogin.style.background='#FFFE98';
}	
if (frm.existe.value==''){			
mensaje=mensaje + '- El login que ha indicado lo tiene que validar, pulsando el botón situado al lado.\n';enviarfrm=false;frm.txtLogin.style.background='#FFFE98';
}	
}
																												
if (frm.txtPsw.value==''){mensaje=mensaje + '- El campo Password es obligatorio.\n';enviarfrm=false;frm.txtPsw.style.background='#FFFE98';}else{frm.txtPsw.style.background='#FFFBF7';}
if (frm.txtConfirmPsw.value==''){mensaje=mensaje + '- Se requiere confirmar el password.\n';enviarfrm=false;frm.txtConfirmPsw.style.background='#FFFE98';}else{frm.txtConfirmPsw.style.background='#FFFBF7';}
if (frm.txtPreg.value==''){mensaje=mensaje + '- Se requiere una pregunta.\n';enviarfrm=false;frm.txtPreg.style.background='#FFFE98';}else{frm.txtPreg.style.background='#FFFBF7';}
if (frm.txtResp.value==''){mensaje=mensaje + '- Se requiere la respuesta a su pregunta.\n';enviarfrm=false;frm.txtResp.style.background='#FFFE98';}else{frm.txtResp.style.background='#FFFBF7';}
																											

if (frm.txtPsw.value!=frm.txtConfirmPsw.value){mensaje=mensaje + '- Revise el password ya que no ha sido confirmado correctamente.\n';enviarfrm=false;frm.txtConfirmPsw.style.background='#FFFE98';frm.txtPsw.style.background='#FFFE98';frm.txtPsw.value='';frm.txtConfirmPsw.value='';}else{frm.txtConfirmPsw.style.background='#FFFBF7';frm.txtPsw.style.background='#FFFBF7';}
																												

if (enviarfrm){frm.submit();}else{alert(mensaje);window.document.location.href='#Empezar'}
}
}

function VaciarCarrito(){
resp = confirm('Se dispone a eliminar todos los artículos de su carrito de la compra.\nEsta acción no se puede deshacer.');
if (resp){window.location.href='Default.asp?ASPAction=TratarASP&ASPSubAction=DeleteAllHome';}else{}
}

function validarFrmAltaUsersAdminLB(accionjs){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminUsersLB;
enviarfrm=true;
if (frm.Nombre.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.Nombre.style.background='#FFFE98';}else{frm.Nombre.style.background='#FFFBF7';}
if (frm.Apellidos.value==''){mensaje=mensaje + '- Los Apellidos són obligatórios.\n';enviarfrm=false;frm.Apellidos.style.background='#FFFE98';}else{frm.Apellidos.style.background='#FFFBF7';}
if (frm.Login.value==''){mensaje=mensaje + '- El Login o Nombre de Usuario es obligatorio.\n';enviarfrm=false;frm.Login.style.background='#FFFE98';}else{frm.Login.style.background='#FFFBF7';}
if (frm.psw.value==''){mensaje=mensaje + '- El campo Password es obligatorio.\n';enviarfrm=false;frm.psw.style.background='#FFFE98';}else{frm.psw.style.background='#FFFBF7';}
if (accionjs=='updatar'){if (enviarfrm){frm.ASPActionAdmin.value='UpdateUser';frm.submit();}else{alert(mensaje);}}else{if (enviarfrm){frm.ASPActionAdmin.value='InsertUser';frm.submit();}else{alert(mensaje);}}
}

function validarFrmArticulos(){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmModificarArt;
enviarfrm=true;

if (frm.NomArt.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NomArt.style.background='#FFFE98';}else{frm.NomArt.style.background='#FFFBF7';}
if (frm.categoria.value==''){mensaje=mensaje + '- La Categoria es obligatoria.\n';enviarfrm=false;frm.categoria.style.background='#FFFE98';}else{frm.categoria.style.background='#FFFBF7';}	
if (frm.Imagen.value==''){mensaje=mensaje + '- La categoria es obligatoria (RECUERDE QUE TIENE QUE SER NUMÉRICO!!).\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}			
if (frm.DescArt.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.DescArt.style.background='#FFFE98';}else{frm.DescArt.style.background='#FFFBF7';}						


if (enviarfrm){frm.ASPActionAdmin.value='UpdatarArticulo';frm.submit();	
}else{alert(mensaje);}
}

function validarFrmArticulosInsertar(){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.FrmInsertarArt;
enviarfrm=true;

if (frm.NomArt.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NomArt.style.background='#FFFE98';}else{frm.NomArt.style.background='#FFFBF7';}
if (frm.categoria.value==''){mensaje=mensaje + '- La categoria es obligatoria.\n';enviarfrm=false;frm.categoria.style.background='#FFFE98';}else{frm.categoria.style.background='#FFFBF7';}	
if (frm.Imagen.value==''){mensaje=mensaje + '- La imagen es obligatoria (RECUERDE QUE TIENE QUE SER NUMÉRICO!!).\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}			
if (frm.DescArt.value==''){mensaje=mensaje + '- La descripción es obligatoria.\n';enviarfrm=false;frm.DescArt.style.background='#FFFE98';}else{frm.DescArt.style.background='#FFFBF7';}						
if (enviarfrm){frm.submit();}else{alert(mensaje);}

}

function validarTiendasFolletos(tiendaOfolleto,accion){
if (accion=='updatar'){
if (tiendaOfolleto=='tienda'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmNuevaTienda;
enviarfrm=true;
if (frm.NombreTienda.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTienda.style.background='#FFFE98';}else{frm.NombreTienda.style.background='#FFFBF7';}		
if (frm.Imagen.value==''){mensaje=mensaje + '- La Imagen es obligatoria.\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}		
if (frm.DescTienda.value==''){mensaje=mensaje + '- La Descripción es obligatoria.\n';enviarfrm=false;frm.DescTienda.style.background='#FFFE98';}else{frm.DescTienda.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdateTienda';frm.submit();}else{alert(mensaje);}
}
if (tiendaOfolleto=='folleto'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmNuevaTienda;
enviarfrm=true;
if (frm.NombreTienda.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTienda.style.background='#FFFE98';}else{frm.NombreTienda.style.background='#FFFBF7';}		
if (frm.Imagen.value==''){mensaje=mensaje + '- La Imagen es obligatoria.\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}		
if (frm.DescTienda.value==''){mensaje=mensaje + '- La Descripción es obligatoria.\n';enviarfrm=false;frm.DescTienda.style.background='#FFFE98';}else{frm.DescTienda.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdateFolleto';frm.submit();}else{alert(mensaje);}
}
}
if (accion=='insertar'){
if (tiendaOfolleto=='tienda'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmNuevaTienda;
enviarfrm=true;
if (frm.NombreTienda.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTienda.style.background='#FFFE98';}else{frm.NombreTienda.style.background='#FFFBF7';}		
if (frm.Imagen.value==''){mensaje=mensaje + '- La Imagen es obligatoria.\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}		
if (frm.DescTienda.value==''){mensaje=mensaje + '- La Descripción es obligatoria.\n';enviarfrm=false;frm.DescTienda.style.background='#FFFE98';}else{frm.DescTienda.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertTienda';frm.submit();}else{alert(mensaje);}
}
if (tiendaOfolleto=='folleto'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmNuevaTienda;
enviarfrm=true;
if (frm.NombreTienda.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTienda.style.background='#FFFE98';}else{frm.NombreTienda.style.background='#FFFBF7';}		
if (frm.Imagen.value==''){mensaje=mensaje + '- La Imagen es obligatoria.\n';enviarfrm=false;frm.Imagen.style.background='#FFFE98';}else{frm.Imagen.style.background='#FFFBF7';}		
if (frm.DescTienda.value==''){mensaje=mensaje + '- La Descripción es obligatoria.\n';enviarfrm=false;frm.DescTienda.style.background='#FFFE98';}else{frm.DescTienda.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertFolleto';frm.submit();}else{alert(mensaje);}
}
}

}

function validarCategorias(accion){
if (accion=='updatar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminCategoria;
enviarfrm=true;
if (frm.NombreCategoria.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreCategoria.style.background='#FFFE98';}else{frm.NombreCategoria.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdateCategoria';frm.submit();}else{alert(mensaje);}
}
if (accion=='insertar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminCategoria;
enviarfrm=true;
if (frm.NombreCategoria.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreCategoria.style.background='#FFFE98';}else{frm.NombreCategoria.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertCategoria';frm.submit();}else{alert(mensaje);}
}
}
function validarGamas(accion){
if (accion=='updatar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.NombreGama.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreGama.style.background='#FFFE98';}else{frm.NombreGama.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdateGama';frm.submit();}else{alert(mensaje);}
}
if (accion=='insertar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.NombreGama.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreGama.style.background='#FFFE98';}else{frm.NombreGama.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertGama';frm.submit();}else{alert(mensaje);}
}
}
function validarTemas(accion){
if (accion=='updatar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.NombreTema.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTema.style.background='#FFFE98';}else{frm.NombreTema.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdateGama';frm.submit();}else{alert(mensaje);}
}
if (accion=='insertar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.NombreTema.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.NombreTema.style.background='#FFFE98';}else{frm.NombreTema.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertGama';frm.submit();}else{alert(mensaje);}
}
}


function OlvidoContra(){
window.open("Utils/INC_ASP/OlvidoContra.asp?ProximaPantalla=Paso1","OlvidoContrasena","status=no,scrollbars=no,width=400,height=120,top=250,left=250");
}

function abrirprivacidad(){
window.open("Utils/PLANTILLAS_ESTATICAS/Confidencialidad.htm","condiciones","status=no,scrollbars=yes,width=500,height=400,top=2,left=2");
}



function ValidarBoletinPedidoSinFrac(frm,importesuperado){
hacersubmit=true;
mensaje='No se enviará el formulario por las causas siguientes:\n';
if ((frm.elements[0].checked == false) && (frm.elements[1].checked == false) && (frm.elements[2].checked == false) && (frm.elements[3].checked == false))
{
mensaje = mensaje + "- Debe seleccionar la forma de envio.\n";
hacersubmit = false;
frm.elements[0].style.background='yellow';
frm.elements[1].style.background='yellow';
frm.elements[2].style.background='yellow';
frm.elements[3].style.background='yellow';
}else{
frm.elements[0].style.background='white';
frm.elements[1].style.background='white';
frm.elements[2].style.background='white';
frm.elements[3].style.background='white';
}

if ((frm.elements[4].checked == false) && (frm.elements[5].checked == false) && (frm.elements[6].checked == false))
{
mensaje = mensaje + "- Debe seleccionar la forma de pago.\n";
hacersubmit = false;
frm.elements[4].style.background='yellow';
frm.elements[5].style.background='yellow';
frm.elements[6].style.background='yellow';
}else{
if ((frm.elements[4].checked == true) || (frm.elements[5].checked == true)){
frm.elements[4].style.background='white';
frm.elements[5].style.background='white';
frm.elements[6].style.background='white';
}else{
if (frm.elements[6].checked == true){
if (frm.elements[7].value == ''){mensaje = mensaje + "- Debe seleccionar el numero de Tarjeta VISA.\n";hacersubmit = false;frm.elements[7].style.background = 'yellow';}else{frm.elements[7].style.background = '#FFFBF7';}
if (frm.elements[8].value == ''){mensaje = mensaje + "- Debe seleccionar la fecha de caducidad de su tarjeta VISA.\n";hacersubmit = false;frm.elements[8].style.background = 'yellow';}else{frm.elements[8].style.background = '#FFFBF7';}
}
}
}
if (importesuperado=='False'){mensaje = mensaje + "- IMPORTE MÍNIMO NO SUPERADO.\n";hacersubmit = false;}
if (hacersubmit){frm.submit();}else{alert(mensaje);}
}

function ValidarBoletinPedido(frm,importesuperado){
hacersubmit=true;
mensaje='No se enviará el formulario por las causas siguientes:\n';
if ((frm.elements[0].checked == false) && (frm.elements[1].checked == false) && (frm.elements[2].checked == false) && (frm.elements[3].checked == false))
{
mensaje = mensaje + "- Debe seleccionar la forma de envio.\n";
hacersubmit = false;
frm.elements[0].style.background='yellow';
frm.elements[1].style.background='yellow';
frm.elements[2].style.background='yellow';
frm.elements[3].style.background='yellow';
}else{
frm.elements[0].style.background='white';
frm.elements[1].style.background='white';
frm.elements[2].style.background='white';
frm.elements[3].style.background='white';
}

if ((frm.elements[4].checked == false) && (frm.elements[5].checked == false) && (frm.elements[6].checked == false) && (frm.elements[13].checked == false))
{
mensaje = mensaje + "- Debe seleccionar la forma de pago.\n";
hacersubmit = false;
frm.elements[4].style.background='yellow';
frm.elements[5].style.background='yellow';
frm.elements[6].style.background='yellow';
frm.elements[13].style.background='yellow';
}else{
																											
if ((frm.elements[4].checked == true) || (frm.elements[5].checked == true)){
frm.elements[4].style.background='white';
frm.elements[5].style.background='white';
frm.elements[6].style.background='white';
frm.elements[13].style.background='white';
}else{
if (frm.elements[6].checked == true){
if (frm.elements[7].value == ''){mensaje = mensaje + "- Debe seleccionar el numero de Tarjeta para el pago fraccionado.\n";hacersubmit = false;frm.elements[7].style.background = 'yellow';}else{frm.elements[7].style.background = '#FFFBF7';}
if (frm.elements[8].value == ''){mensaje = mensaje + "- Debe seleccionar la fecha de caducidad para el pago fraccionado.\n";hacersubmit = false;frm.elements[8].style.background = 'yellow';}else{frm.elements[8].style.background = '#FFFBF7';}
if (frm.elements[9].value == ''){mensaje = mensaje + "- Debe seleccionar el numero de la cuenta corriente o ahorro para el pago fraccionado.\n";hacersubmit = false;frm.elements[9].style.background = 'yellow';}else{frm.elements[9].style.background = '#FFFBF7';}
if (frm.elements[10].value == ''){mensaje = mensaje + "- Debe seleccionar el nombre del titular de la cuenta de crédito o ahorro para el pago fraccionado.\n";hacersubmit = false;frm.elements[10].style.background = 'yellow';}else{frm.elements[10].style.background = '#FFFBF7';}
if (frm.elements[11].value == ''){mensaje = mensaje + "- Debe seleccionar el DNI del titular para el pago fraccionado.\n";hacersubmit = false;frm.elements[11].style.background = 'yellow';}else{frm.elements[11].style.background = '#FFFBF7';}
if (frm.elements[12].value == ''){mensaje = mensaje + "- Debe seleccionar la fecha de nacimiento para el pago fraccionado.\n";hacersubmit = false;frm.elements[12].style.background = 'yellow';}else{frm.elements[12].style.background = '#FFFBF7';}
}
if (frm.elements[13].checked == true){
if (frm.elements[14].value == ''){mensaje = mensaje + "- Debe seleccionar el número de Tarjeta VISA.\n";hacersubmit = false;}else{frm.elements[14].style.background='#FFFBF7';}
if (frm.elements[15].value == ''){mensaje = mensaje + "- Debe seleccionar la fecha de caducidad de la Tarjeta VISA.\n";hacersubmit = false;}else{frm.elements[15].style.background='#FFFBF7';}			
}
}
}
if (importesuperado=='False'){mensaje = mensaje + "- IMPORTE MÍNIMO NO SUPERADO.\n";hacersubmit = false;}
if (hacersubmit){frm.submit();}else{alert(mensaje);}
}

function ClickRadioTarjeta(){
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
window.document.Pedido.elements[13].style.background='white';
window.document.Pedido.NumeroTarjeta.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidad.style.background ='#FFFBF7';
window.document.Pedido.DNITitular.style.background ='#FFFBF7';
window.document.Pedido.FechaNac.style.background ='#FFFBF7';
window.document.Pedido.TitularCuenta.style.background ='#FFFBF7';
window.document.Pedido.NumeroCuenta.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.style.background ='yellow';
window.document.Pedido.FechaCaducidadVISA.style.background ='yellow';
window.document.Pedido.TarjetaVISA.disabled =false;
window.document.Pedido.FechaCaducidadVISA.disabled =false;
window.document.Pedido.NumeroTarjeta.disabled ='true';
window.document.Pedido.FechaCaducidad.disabled ='true';
window.document.Pedido.DNITitular.disabled ='true';
window.document.Pedido.FechaNac.disabled ='true';
window.document.Pedido.TitularCuenta.disabled ='true';
window.document.Pedido.NumeroCuenta.disabled ='true';
window.document.Pedido.NumeroTarjeta.value ='';
window.document.Pedido.FechaCaducidad.value ='';
window.document.Pedido.DNITitular.value ='';
window.document.Pedido.FechaNac.value ='';
window.document.Pedido.TitularCuenta.value ='';
window.document.Pedido.NumeroCuenta.value ='';
}


function ClickRadioTarjetaSinFrac(){
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
window.document.Pedido.TarjetaVISA.style.background ='yellow';
window.document.Pedido.FechaCaducidadVISA.style.background ='yellow';
window.document.Pedido.TarjetaVISA.disabled =false;
window.document.Pedido.FechaCaducidadVISA.disabled =false;
}



function ClickFenvio1(){
window.document.Pedido.elements[0].style.background='white';
window.document.Pedido.elements[1].style.background='white';
window.document.Pedido.elements[2].style.background='white';
window.document.Pedido.elements[3].style.background='white';
}
function ClickFenvio2(){
window.document.Pedido.elements[0].style.background='white';
window.document.Pedido.elements[1].style.background='white';
window.document.Pedido.elements[2].style.background='white';
window.document.Pedido.elements[3].style.background='white';	
}
function ClickFenvio3(){
window.document.Pedido.elements[0].style.background='white';
window.document.Pedido.elements[1].style.background='white';
window.document.Pedido.elements[2].style.background='white';
window.document.Pedido.elements[3].style.background='white';
}
function ClickFenvio4(){
window.document.Pedido.elements[0].style.background='white';
window.document.Pedido.elements[1].style.background='white';
window.document.Pedido.elements[2].style.background='white';
window.document.Pedido.elements[3].style.background='white';
}
function ClickFpago1(){
window.document.Pedido.NumeroTarjeta.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidad.style.background ='#FFFBF7';
window.document.Pedido.DNITitular.style.background ='#FFFBF7';
window.document.Pedido.FechaNac.style.background ='#FFFBF7';
window.document.Pedido.TitularCuenta.style.background ='#FFFBF7';
window.document.Pedido.NumeroCuenta.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidadVISA.style.background ='#FFFBF7';
window.document.Pedido.NumeroTarjeta.value ='';
window.document.Pedido.FechaCaducidad.value ='';
window.document.Pedido.DNITitular.value ='';
window.document.Pedido.FechaNac.value ='';
window.document.Pedido.TitularCuenta.value ='';
window.document.Pedido.NumeroCuenta.value ='';
window.document.Pedido.TarjetaVISA.value ='';
window.document.Pedido.FechaCaducidadVISA.value ='';
window.document.Pedido.TarjetaVISA.disabled ='true';
window.document.Pedido.FechaCaducidadVISA.disabled ='true';
window.document.Pedido.NumeroTarjeta.disabled ='true';
window.document.Pedido.FechaCaducidad.disabled ='true';
window.document.Pedido.DNITitular.disabled ='true';
window.document.Pedido.FechaNac.disabled ='true';
window.document.Pedido.TitularCuenta.disabled ='true';
window.document.Pedido.NumeroCuenta.disabled ='true';
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
window.document.Pedido.elements[13].style.background='white';

}
function ClickFpago1SinFrac(){
window.document.Pedido.TarjetaVISA.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidadVISA.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.value ='';
window.document.Pedido.FechaCaducidadVISA.value ='';
window.document.Pedido.TarjetaVISA.disabled ='true';
window.document.Pedido.FechaCaducidadVISA.disabled ='true';
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
}
function ClickFpago2(){
window.document.Pedido.NumeroTarjeta.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidad.style.background ='#FFFBF7';
window.document.Pedido.DNITitular.style.background ='#FFFBF7';
window.document.Pedido.FechaNac.style.background ='#FFFBF7';
window.document.Pedido.TitularCuenta.style.background ='#FFFBF7';
window.document.Pedido.NumeroCuenta.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidadVISA.style.background ='#FFFBF7';
window.document.Pedido.NumeroTarjeta.value ='';
window.document.Pedido.FechaCaducidad.value ='';
window.document.Pedido.DNITitular.value ='';
window.document.Pedido.FechaNac.value ='';
window.document.Pedido.TitularCuenta.value ='';
window.document.Pedido.NumeroCuenta.value ='';
window.document.Pedido.TarjetaVISA.value ='';
window.document.Pedido.FechaCaducidadVISA.value ='';
window.document.Pedido.TarjetaVISA.disabled ='true';
window.document.Pedido.FechaCaducidadVISA.disabled ='true';
window.document.Pedido.NumeroTarjeta.disabled ='true';
window.document.Pedido.FechaCaducidad.disabled ='true';
window.document.Pedido.DNITitular.disabled ='true';
window.document.Pedido.FechaNac.disabled ='true';
window.document.Pedido.TitularCuenta.disabled ='true';
window.document.Pedido.NumeroCuenta.disabled ='true';
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
window.document.Pedido.elements[13].style.background='white';

}

function ClickFpago2SinFrac(){
window.document.Pedido.TarjetaVISA.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidadVISA.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.disabled ='true';
window.document.Pedido.FechaCaducidadVISA.disabled ='true';
window.document.Pedido.TarjetaVISA.value ='';
window.document.Pedido.FechaCaducidadVISA.value ='';
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
}

function ClickPFrac(){
window.document.Pedido.NumeroTarjeta.style.background ='yellow';
window.document.Pedido.FechaCaducidad.style.background ='yellow';
window.document.Pedido.NumeroCuenta.style.background ='yellow';
window.document.Pedido.TitularCuenta.style.background ='yellow';
window.document.Pedido.DNITitular.style.background ='yellow';
window.document.Pedido.FechaNac.style.background ='yellow';
window.document.Pedido.TarjetaVISA.style.background ='#FFFBF7';
window.document.Pedido.FechaCaducidadVISA.style.background ='#FFFBF7';
window.document.Pedido.TarjetaVISA.value ='';
window.document.Pedido.FechaCaducidadVISA.value ='';
window.document.Pedido.TarjetaVISA.disabled ='true';
window.document.Pedido.FechaCaducidadVISA.disabled ='true';
window.document.Pedido.NumeroTarjeta.disabled =false;
window.document.Pedido.FechaCaducidad.disabled =false;
window.document.Pedido.DNITitular.disabled = false;
window.document.Pedido.FechaNac.disabled =false;
window.document.Pedido.TitularCuenta.disabled =false;
window.document.Pedido.NumeroCuenta.disabled =false;
window.document.Pedido.elements[4].style.background='white';
window.document.Pedido.elements[5].style.background='white';
window.document.Pedido.elements[6].style.background='white';
window.document.Pedido.elements[13].style.background='white';															
}

function ValidarContactar(){
if(window.document.FrmContactar.SugerenciaOConsulta.value==''){
window.document.FrmContactar.SugerenciaOConsulta.style.background='#FFFF9C';
alert('Debe de completar area de texto para proceder al envio.');}
else{
window.document.FrmContactar.submit();
}
}

function ValidarContactar2(){

hacersubmit=true;
mensaje= 'No se puede enviar su consulta debido a que:\n';

if(window.document.FrmContactar.SugerenciaOConsulta.value==''){
	hacersubmit=false;
	window.document.FrmContactar.SugerenciaOConsulta.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de completar area de texto para proceder al envio.\n";
}else{window.document.FrmContactar.SugerenciaOConsulta.style.background='white';}

if(window.document.FrmContactar.txtNombre.value==''){
	hacersubmit=false;
	window.document.FrmContactar.txtNombre.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su nombre.\n";
}else{window.document.FrmContactar.txtNombre.style.background='white';}

if(window.document.FrmContactar.txtApellidos.value==''){
	hacersubmit=false;
	window.document.FrmContactar.txtApellidos.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar sus apellidos.\n";
}else{window.document.FrmContactar.txtApellidos.style.background='white';}

if(window.document.FrmContactar.cp.value==''){
	hacersubmit=false;
	window.document.FrmContactar.cp.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su Código Postal.\n";
}else{window.document.FrmContactar.cp.style.background='white';}

if(window.document.FrmContactar.poblacion.value==''){
	hacersubmit=false;
	window.document.FrmContactar.poblacion.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su población.\n";
}else{window.document.FrmContactar.poblacion.style.background='white';}

if(window.document.FrmContactar.direccion.value==''){
	hacersubmit=false;
	window.document.FrmContactar.direccion.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su Dirección.\n";
}else{window.document.FrmContactar.direccion.style.background='white';}

if(window.document.FrmContactar.provincia.value==''){
	hacersubmit=false;
	window.document.FrmContactar.provincia.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su provincia.\n";
}else{window.document.FrmContactar.provincia.style.background='white';}

if(window.document.FrmContactar.mail.value==''){
	hacersubmit=false;
	window.document.FrmContactar.mail.style.background='#FFFF9C';
	mensaje = mensaje + "- Debe de indicar su Mail o Teléfono de contacto.\n";
}else{window.document.FrmContactar.mail.style.background='white';}

																										
if(hacersubmit){window.document.FrmContactar.submit();}else{alert(mensaje);}

}





function ValidarSoloSolicitarInfo(frm){
frm.submit();
}

function anclar(){window.location.href="#Ancla";}
function anclar2(){window.location.href="#AnclaCarrito";}
function anclar4(){window.location.href='#Paginacion';}
function anclar5(){window.location.href='#Paginacion';}
function anclar6(){window.location.href='#Paginacion';}
function anclar7(){window.open("Utils/PLANTILLAS_ESTATICAS/BienvenidoUsrRegistrado.htm","Bienvenida","status=no,scrollbars=no,width=400,height=120,top=250,left=250");}
function anclar8(){	window.open("Utils/PLANTILLAS_ESTATICAS/PedidoEnviado.htm","PedidoEnviado","status=no,scrollbars=no,width=550,height=420,top=150,left=150");}
function anclar9(){	window.open("Utils/INC_ASP/ResultadosEncuesta.asp","resultadosencuesta","status=no,scrollbars=no,width=400,height=450,top=150,left=150");}






function ver(theform)
{
theform.action="Default.asp?ASPAction=VerDetalle";
theform.submit();
}
function anadirpuja(theform,valor)
{
if (theform.puja.value=="")
{
alert("Debe de poner la cantidad de la nueva puja")
theform.puja.focus();
return;
}
if (theform.puja.value != parseInt(theform.puja.value))
{
alert("La cantidad de la nueva puja es errónea, debe ser numérica");
theform.puja.focus();
return;
}	
if ((theform.maxima.value!="") && (theform.maxima.value != parseInt(theform.maxima.value)))
{
alert("La cantidad de la puja máxima es errónea, debe ser numérica");
theform.maxima.focus();
return;
}	
if (theform.puja.value<=valor)
{
alert("La cantidad de la nueva puja debe ser superior al precio de salida")
theform.puja.focus();
return;
}
if ((theform.maxima.value!="") && (parseInt(theform.maxima.value)<=parseInt(theform.puja.value)))
{
alert("La puja máxima debe ser superior a la nueva puja")
theform.maxima.focus();
return;
}
theform.submit()
theform.puja.value=""
theform.maxima.value=""
}

function validar5(theform)
{
if (theform.seccion.value=="") 
{
alert("Debe de escojer una seccion");
theform.seccion.focus();
return;
}
theform.action='Default.asp?ASPAction=Busqueda';	
theform.submit()
theform.nombre.value=""
}

function validar6(theform)
{
if (theform.lote.value=="") 
{
alert("Debe de escojer un lote");
theform.lote.focus();
return;
}
theform.action='Default.asp?ASPAction=Busqueda';	
theform.submit()
theform.lote.value="";
}


function validar(seccion)
{
window.document.frmseccion.seccion.value=seccion
window.document.frmseccion.submit();
}


function carritosubastapuja(theform){theform.submit()}


function mod(theform)
{
if (theform.puja.value=="")
{
alert("Debe de poner la cantidad de la nueva puja")
theform.puja.focus();
return;
}
theform.target="subasta";
theform.submit();
}

function validarenviarpujassubasta(theform)
{
if (theform.nombre.value=="") 
{
alert("Debe de escribir un nombre antes \n       de pulsar a enviar");
theform.nombre.focus();
return;
}
if (theform.direccion.value=="") 
{
alert("Debe de escribir una dirección antes \n       de pulsar a enviar");
theform.direccion.focus();
return;
}
if (theform.poblacion.value=="") 
{
alert("Debe de escribir una población antes \n       de pulsar a enviar");
theform.poblacion.focus();
return;
}
if (theform.provincia.value=="") 
{
alert("Debe de escribir una provincia antes \n       de pulsar a enviar");
theform.provincia.focus();
return;
}
if (theform.cp.value=="") 
{
alert("Debe de escribir un codigo postal antes \n       de pulsar a enviar");
theform.cp.focus();
return;
}
if (theform.dni.value=="") 
{
alert("Debe de escribir su dni antes \n       de pulsar a enviar");
theform.dni.focus();
return;
}
if (theform.telefono.value=="") 
{
alert("Debe de escribir un teléfono antes \n       de pulsar a enviar");
theform.telefono.focus();
return;
}
if (theform.mail.value=="") 
{
alert("Debe de escribir un E-mail antes \n       de pulsar a enviar");
theform.mail.focus();
return;
}
if (theform.mail.value.indexOf('@',0)==-1) 
{
alert ('La dirección de e-mail no es válida.');
theform.mail.focus();
return;
}
if (theform.mail.value.indexOf('.',theform.mail.value.indexOf('@',0))==-1) 
{
alert ('La dirección de e-mail no es válida.');
theform.mail.focus();
return;
}
theform.submit();
}
function AbrirAyudaGeneral(){window.open("Utils/INC_ASP/AyudaGeneral.htm","AyudaGeneral","status=no,scrollbars=yes,width=550,height=420,top=150,left=150");}
function AbrirCalendario(){window.open("Utils/PLANTILLAS_ESTATICAS/Calendar.asp","Calendario","status=no,scrollbars=yes,width=305,height=215,top=150,left=150");}
function DarmeDeBaja(){
	if (confirm("¿Esta seguro que desea darse de Baja en LamasBolano.com?")){
		window.open("Utils/INC_ASP/Baja.asp","Baja","status=no,scrollbars=no,width=400,height=120,top=250,left=250");
	}
}

function SubmitTiendas(idtienda,fecha,pais){
	window.document.Tiendas.IdTienda.value=idtienda;
	window.document.Tiendas.Pais.value=pais;
	window.document.Tiendas.Fecha.value=fecha;
	window.document.Tiendas.submit();
}
function SubmitDistribuidores(idDis){
	window.document.Distribuidores.IdDistribuidor.value=idDis;
	window.document.Distribuidores.submit();
}
function SubmitOtrasPromociones(idtienda){
	window.document.OtrasPromociones.IdTienda.value=idtienda;
	window.document.OtrasPromociones.submit();
}
function SubmitPromocionesAntiguas(idtienda){
	window.document.PromocionesAntiguas.IdTienda.value=idtienda;
	window.document.PromocionesAntiguas.submit();
}
function SubmitPromociones(idtienda){
	window.document.Promociones.IdTienda.value=idtienda;
	window.document.Promociones.submit();
}
function SubmitArtDestacadosHome(idart){
	window.document.DestacadosHome.IdArticulo.value=idart;
	window.document.DestacadosHome.submit();
}
function SubmitVerTienda(ASPAction,IdTienda,ActualPage,Pais,Fecha,maxRecords,ruta,IdArticulo,IdDistribuidor){
	window.document.TiendaFolleto.ASPAction.value=ASPAction;
	window.document.TiendaFolleto.IdTienda.value=IdTienda;
	window.document.TiendaFolleto.IdArticulo.value=IdArticulo;
	window.document.TiendaFolleto.IdDistribuidor.value=IdDistribuidor;	
	window.document.TiendaFolleto.ActualPage.value=ActualPage;
	window.document.TiendaFolleto.Pais.value=Pais;
	window.document.TiendaFolleto.Fecha.value=Fecha;
	window.document.TiendaFolleto.maxRecords.value=maxRecords;
	window.document.TiendaFolleto.ruta.value=ruta;
	window.document.TiendaFolleto.submit();
}
function Recomendar(remitente,destinatario,cuerpo){
	mensaje='';
	enviarfrm='true';
	if (remitente==''){mensaje=mensaje + '- Debe indicar su dirección de E-mail.\n';enviarfrm='false';}
	if (destinatario==''){mensaje=mensaje + '- Debe indicar la dirección de E-mail del destinatario.\n';enviarfrm='false';}
	if (enviarfrm=='true'){window.open("Utils/INC_ASP/RecomendacionEnviada.asp?remitente=" + remitente + "&destinatario=" + destinatario + "&cuerpo=" + cuerpo,"RecomendacionEnviada","status=no,scrollbars=no,width=300,height=50,top=150,left=350");}else{alert(mensaje);}
}


function validarPaises(accion){
if (accion=='updatar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.Pais.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.Pais.style.background='#FFFE98';}else{frm.Pais.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='UpdatePais';frm.submit();}else{alert(mensaje);}
}
if (accion=='insertar'){
mensaje='No se puede enviar el formulario debido a:\n';
frm = window.document.FrmAdminGamas;
enviarfrm=true;
if (frm.Pais.value==''){mensaje=mensaje + '- El Nombre es obligatorio.\n';enviarfrm=false;frm.Pais.style.background='#FFFE98';}else{frm.Pais.style.background='#FFFBF7';}		
if (enviarfrm){frm.ASPActionAdmin.value='InsertPais';frm.submit();}else{alert(mensaje);}
}
}


function accesodirecto(idtienda){
	if (idtienda!=0){window.location.href='Default.asp?ASPAction=VerTienda&IdTienda=' + idtienda + '&maxRecords=0&ActualPage=1';}
}
function accesodirectoPromocion(idtienda){
	if (idtienda!=0){window.location.href='Default.asp?ASPAction=VerFolleto&IdTienda=' + idtienda + '&maxRecords=0&ActualPage=1';}
}
function relacionfolletotienda(idtienda){
	if (idtienda!=0){window.location.href='Default.asp?ASPAction=VerFolleto&IdTienda=' + idtienda + '&maxRecords=0&ActualPage=1';}
}

