function ValidarCliente()
{	if (document.getElementById('Usuario').value=='')
	{	alert("Informe el usuario");
		document.getElementById('Usuario').focus();
		return false;
	}
	if (document.getElementById('Contrasena').value=='')
	{	alert("Informe la contraseña");
		document.getElementById('Contrasena').focus();
		return false;
	}
	document.FormularioCliente.submit();	
}

function EnviarFormularioCA()
{	if (document.getElementById('CA').value=='')
	{	alert("Informe el código artículo.");
		document.getElementById('CA').focus();
		return false;
	}
	document.FormularioCA.submit();
}

function EnviarFormularioBusqueda()
{	document.FormularioBusqueda.action="resultados.asp";
	document.FormularioBusqueda.submit();
}

function EnviarFormularioPC()
{	if (document.getElementById('PC').value=='')
	{	alert("Informe la palabra clave.");
		document.getElementById('PC').focus();
		return false;
	}
	document.FormularioPC.submit();
}


function Tecla(Campo,funcion)
{	if (self.event.keyCode == 13 )
	{	self.event.keyCode = 9;
		if (self.event.srcElement.name == Campo)
		{	if (funcion=='ValidarCliente')
			{	ValidarCliente();	}	
		}
		if (self.event.srcElement.name == Campo)
		{	if (funcion=='FormularioCA')
			{	EnviarFormularioCA();	}	
		}
		if (self.event.srcElement.name == Campo)
		{	if (funcion=='FormularioBusqyeda')
			{	EnviarFormularioBusqueda();	}	
		}
		if (self.event.srcElement.name == Campo)
		{	if (funcion=='FormularioPC')
			{	EnviarFormularioPC();	}	
		}
	}	
}


function RevisarCantidad(obj)
{	if (obj.value!="")
	{	var number = parseFloat(obj.value);
		//alert(obj.value);
		if (isNaN(number)==true)
		{	alert("Sólo valores numéricos ..."); 
			obj.focus();
		}
		else
		{	if(number<=0)
			{	alert("Informar un valor mayor de 0."); 
				obj.focus();
			}
		}
	}	
}

function WindowOpenCentrado(url, name, param,w, h, perc) 
{ 	var winX = (screen.availWidth - w)*perc*.01;
	var winY = (screen.availHeight - h)*perc*.01;
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h +',left=' + winX + ',top=' + winY + ','+param);
}

function EnviarPedido2()
{	if (Formulario.DatosEnvioDiferentes.checked)	
	{	
		if (document.getElementById('RazonSocial').value=='')
		{	alert("Informe la razón social.");
			document.getElementById('RazonSocial').focus();
			return false;
		}
		if (document.getElementById('Domicilio').value=='')
		{	alert("Informe el domicilio.");
			document.getElementById('Domicilio').focus();
			return false;
		}
		if (document.getElementById('CodigoPostal').value=='')
		{	alert("Informe el codigo postal.");
			document.getElementById('CodigoPostal').focus();
			return false;
		}
		if (document.getElementById('Municipio').value=='')
		{	alert("Informe el municipio.");
			document.getElementById('Municipio').focus();
			return false;
		}
		if (document.getElementById('Provincia').value=='')
		{	alert("Informe la provincia.");
			document.getElementById('Provincia').focus();
			return false;
		}
		if (document.getElementById('Nacion').value=='')
		{	alert("Informe la Nacion.");
			document.getElementById('Nacion').focus();
			return false;
		}
		if (document.getElementById('Telefono').value=='')
		{	alert("Informe el Telefono.");
			document.getElementById('Telefono').focus();
			return false;
		}
	}
	document.Formulario.submit();	
}


Numero=0
function EfectoImagenDefault()
{	if (navigator.appName=="Microsoft Internet Explorer") 
	{	
		if (Numero < 5)
		{	Numero=Numero+1;	}
		else
		{	Numero=1;	}
		
		Imagen.src='img/fotos_header/'+Numero+'.jpg';
		Imagen.filters.item(0).Apply();
		Imagen.filters.item(0).Transition = 16;
		Imagen.filters.item(0).Play(2.0);
		Imagen.style.visibility="inherit";
		setTimeout("EfectoImagenDefault()",8000);
	}
	else
	{	document.getElementById('Imagen').style.visibility="inherit";
		document.getElementById('Imagen').src='img/fotos_header/1.jpg'; 	
		document.getElementById('SelectLlegadaDefault').style.visibility="hidden";
		document.getElementById('SelectSalidaDefault').style.visibility="hidden";
	}
}
function EfectoImagenDefault2()
{	if (navigator.appName=="Microsoft Internet Explorer") 
	{	
		if (Numero < 6)
		{	Numero=Numero+1;	}
		else
		{	Numero=1;	}
		
		Imagen.src='img/fotos_header/'+Numero+'.jpg';
		Imagen.filters.item(0).Apply();
		Imagen.filters.item(0).Transition = 9;
		Imagen.filters.item(0).Play(2.0);
		Imagen.style.visibility="inherit";
		setTimeout("EfectoImagenDefault2()",8000);
	}
	else
	{	document.getElementById('Imagen').style.visibility="inherit";
		document.getElementById('Imagen').src='img/fotos_header/1.jpg'; 	
		document.getElementById('SelectLlegadaDefault').style.visibility="hidden";
		document.getElementById('SelectSalidaDefault').style.visibility="hidden";
	}
}