var ver=navigator.appVersion    
var v=parseInt(ver)    
if(ver.indexOf('MSIE 4')>0 || (navigator.appName=="Netscape" && v<=4)){
location.href="/freight/dyn/browserSupport"
}
function openWin(fName) {
if (bow!="ok") return (true);
remote1 =  window.open(fName,"print_page","menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=620,height=400,status=yes");
if (remote1 == null) {
return true;
}
if (bow1 =="ok") {
window.setTimeout('remote1.focus()',1000);
}
return (false);
}
function displayPDF(selectObject) {
if ((selectObject == null) || (selectObject.value.length <= 0)) {
alert("Please select a PDF to display");
return null;
} else {
file = selectObject.value;
window.open(file, 'pdfWin');
return false;
}
}
function SelectRow(rowNo) {
DeselectAll();
eval("self.document.AWBListForm.qfSelect" + rowNo + ".checked = true");
}
function DisplayAWBStatus() {
self.document.DisplayAWBStatusForm.qfSelection.value = GetSelection();
self.document.DisplayAWBStatusForm.submit();
}
function AddToETrack() {
var selectionString = GetSelection();
if (selectionString.indexOf("Y") != -1) {
self.document.AddToETrackForm.qfSelection.value = selectionString;
self.document.AddToETrackForm.submit();
}
else {
alert("Please select one or more air waybills");
}
}
function AddToCompany() {
var selectionString = GetSelection();
if (selectionString.indexOf("Y") != -1) {
self.document.AddToCompanyForm.qfSelection.value = selectionString;
self.document.AddToCompanyForm.submit();
}
else {
alert("Please select one or more air waybills");
}
}
function RemoveSelection() {
var selectionString = GetSelection();
var AWBList = ""
if (selectionString.indexOf("Y") != -1) {
var numSelected = 0;
for (index=0; index<selectionString.length; index++) {
if (selectionString.charAt(index) == "Y") {
numSelected++;
}
}
var questionText = "it"
var plurality = "";
if (numSelected > 1) {
questionText = "them";
plurality = "s";
}
if (confirm(numSelected + " air waybill" + plurality + " selected.\n\nAre you sure you want to remove " + questionText + "?") == true) {
self.document.RemoveSelectionForm.qfSelection.value = selectionString;
self.document.RemoveSelectionForm.submit();
}
}
else {
alert("Please select the air waybill/s you want to remove from this list");
}
}
function SelectRow(rowNo) {
DeselectAll();
eval("self.document.AWBListForm.qfSelect" + rowNo + ".checked = true");
}
function selectText(field) {
field.select();
}
function runSubmit(form, submit) {
var number = true;
if (form.AWP1.value.length == 0 && form.AWN1.value.length == 0) {
validatePrompt (form.AWP1, "Please enter AWP and AWN details.");
return false;
}
if (form.AWP1.value.length == 0) {
validatePrompt (form.AWP1, "Please enter AWP details.");
return false;
}
for (var i = 0; i <form.AWP1.value.length; i++) {
var ch = form.AWP1.value.charAt(i);
if (ch < "0" || "9" < ch) {
validatePrompt (form.AWP1, "AWP '"+ form.AWP1.value +"' is not valid. Must not contain space or alphabetic characters");
number = false;
return false;
}
}
if (number == true) {
if (form.AWP1.value.length < 3) {
validatePrompt (form.AWP1, "AWP '"+ form.AWP1.value +"' is not valid. Must consist of 3 digits.");
return false;
}
}
if (form.AWN1.value.length == 0) {
validatePrompt (form.AWN1, "Please enter AWN details.");
return false;
}
number = true;
for (var i = 0; i <form.AWN1.value.length; i++) {
var ch = form.AWN1.value.charAt(i);
if (ch < "0" || "9" < ch) {
validatePrompt (form.AWN1, "AWN '"+ form.AWN1.value +"' is not valid. Must not contain space or alphabetic characters");
number = false;
return false;
}
}
if (number == true) {
temp_num1 = parseInt(form.AWN1.value.substring(0, 7), 10);
temp_num2 = parseInt(form.AWN1.value.charAt(7), 10);
if (form.AWN1.value.length == 8) {
if ((temp_num1 % 7) == temp_num2) {
}
else {
validatePrompt (form.AWN1, "'"+ form.AWN1.value +"' is not a valid number. Please try again.");
return false;
}
}
else {
validatePrompt (form.AWN1, "AWN '"+ form.AWN1.value +"' is not valid. Must consist of 8 digits.");
return false;
}
}
form.qfAWBs.value = form.AWP1.value + "-" + form.AWN1.value;
document.freightEnq.submit();
return;
}
function validatePrompt (ctrl, PromptStr) {
alert(PromptStr);
ctrl.focus();
return;
}