Sub window_onload()

if Right(document.Form1.txtPrintVal.value, 1) = "P" then
document.Form1.txtPrintVal.value = Mid(document.Form1.txtPrintVal.value, 1, len(document.Form1.txtPrintVal.value) - 1)
window.open document.Form1.txtPDF.value, "_blank"
end if
if Right(document.Form1.txtPrintVal.value, 1) = "L" then
document.Form1.txtPrintVal.value = Mid(document.Form1.txtPrintVal.value, 1, len(document.Form1.txtPrintVal.value) - 1)
window.open document.Form1.txtPDF.value, "_blank"
end if
if Right(document.Form1.txtPrintVal.value, 1) = "C" then
document.Form1.txtPrintVal.value = Mid(document.Form1.txtPrintVal.value, 1, len(document.Form1.txtPrintVal.value) - 1)
window.close 
end if

End Sub


