function ingresar(frm, vinculo){
  if(esVacio(frm.awb.value))
	  {
		alert("Awb No. Not Found.");
		frm.awb.focus();
		}
		else
	if(esNumero(frm.awb.value))
	  {
		alert("Awb No. Not Found.");
		frm.awb.focus();
		}else				
		{	
		frm.target = '_blank';
		frm.action = vinculo+'?awbno='+frm.awb.value;
		frm.submit();	
		}
}

function cargar(code, url, atributos){
	var x=url+"?awbno="+code;
	window.showModalDialog(x,"", atributos);
	
	}
function ventana(vinculo, atributos){
	window.open(vinculo,'',atributos);
	}	
	
function recargarWSH(url){
	window.parent.frames[3].location=url 
}
function recargarAWBWSH(url){
	window.parent.frames[2].location=url 
}
function accion(url){
	document.form1.action=url;
	document.form1.submit();
}



function chequearOpcion()
{
	for (var i=0;i < document.forms[0].elements.length;i++)
	{	var elemento = document.forms[0].elements[i];
		if (elemento.type == "radio"){
			if (elemento.checked)
				return (true);
		}		
	}
	return (false);
}

function validar(frm, vinculo){
	if (!chequearOpcion()) {
		alert("Debe seleccionar el registro que desea Procesar.");
	}else  {
		frm.action = vinculo;
		frm.submit();	
	}
}

function esVacio(valor){
	if(valor==null){return true;}
	for(var i=0;i<valor.length;i++) {
		if ((valor.charAt(i)!=' ')&&(valor.charAt(i)!="\t")&&(valor.charAt(i)!="\n")&&(valor.charAt(i)!="\r")){return false;}
	}
	return true;
}

function esNumero(val) {
	for(var i=0;i<val.length;i++){
		if(!esDigito(val.charAt(i))){return true;}
		}
	return false;
	}
function esDigito(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
	}	