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(b){if(bow!="ok"){return(true)}remote1=window.open(b,"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(b){if((b==null)||(b.value.length<=0)){alert("Please select a PDF to display");return null}else{file=b.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 b=GetSelection();if(b.indexOf("Y")!=-1){self.document.AddToETrackForm.qfSelection.value=b;self.document.AddToETrackForm.submit()}else{alert("Please select one or more air waybills")}}function AddToCompany(){var b=GetSelection();if(b.indexOf("Y")!=-1){self.document.AddToCompanyForm.qfSelection.value=b;self.document.AddToCompanyForm.submit()}else{alert("Please select one or more air waybills")}}function RemoveSelection(){var f=GetSelection();var i="";if(f.indexOf("Y")!=-1){var j=0;for(index=0;index<f.length;index++){if(f.charAt(index)=="Y"){j++}}var g="it";var h="";if(j>1){g="them";h="s"}if(confirm(j+" air waybill"+h+" selected.\n\nAre you sure you want to remove "+g+"?")==true){self.document.RemoveSelectionForm.qfSelection.value=f;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(b){b.select()}function runSubmit(f,j){var g=true;if(f.AWP1.value.length==0&&f.AWN1.value.length==0){validatePrompt(f.AWP1,"Please enter AWP and AWN details.");return false}if(f.AWP1.value.length==0){validatePrompt(f.AWP1,"Please enter AWP details.");return false}for(var i=0;i<f.AWP1.value.length;i++){var h=f.AWP1.value.charAt(i);if(h<"0"||"9"<h){validatePrompt(f.AWP1,"AWP '"+f.AWP1.value+"' is not valid. Must not contain space or alphabetic characters");g=false;return false}}if(g==true){if(f.AWP1.value.length<3){validatePrompt(f.AWP1,"AWP '"+f.AWP1.value+"' is not valid. Must consist of 3 digits.");return false}}if(f.AWN1.value.length==0){validatePrompt(f.AWN1,"Please enter AWN details.");return false}g=true;for(var i=0;i<f.AWN1.value.length;i++){var h=f.AWN1.value.charAt(i);if(h<"0"||"9"<h){validatePrompt(f.AWN1,"AWN '"+f.AWN1.value+"' is not valid. Must not contain space or alphabetic characters");g=false;return false}}if(g==true){temp_num1=parseInt(f.AWN1.value.substring(0,7),10);temp_num2=parseInt(f.AWN1.value.charAt(7),10);if(f.AWN1.value.length==8){if((temp_num1%7)==temp_num2){}else{validatePrompt(f.AWN1,"'"+f.AWN1.value+"' is not a valid number. Please try again.");return false}}else{validatePrompt(f.AWN1,"AWN '"+f.AWN1.value+"' is not valid. Must consist of 8 digits.");return false}}f.qfAWBs.value=f.AWP1.value+"-"+f.AWN1.value;document.freightEnq.submit();return}function validatePrompt(d,c){alert(c);d.focus();return};
