function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) 
break; 
}
return null;
}
function onClick_CheckID(form){
 if (form.idSignID.value == "")
  {
    alert("Please enter a value for the \"Customer-ID \" field.");
    form.idSignID.focus();
    return (false);
  }
if (form.idSignPsw.value == "")
  {
    alert("Please enter a value for the \"Password \" field.");
    form.idSignPsw.focus();
    return (false);
  }
//var CustId = form.idSignID.value;
//var CustPsw = form.idSignPsw.value;
//alert (CustId+"    "+CustPsw);
return (true);
}
//start Table
document.write('<style>\n .mnu {margin: 5;padding: 0;list-style-type: none;line-height: 100%; }</style>\n');
document.write('<TABLE class="portlet" height="75" width="150"><TBODY>');
document.write('<TR><TD height="25" class="portletHeader">Log-In</TD></TR>');
document.write('<tr><TD vAlign=top  class="portletContent" id="login" ><div>');
var CustomerId=GetCookie('UserAcct')
var CustomerName=GetCookie('UserName')
if (CustomerId!=null)
{
AccessAuth=true;
document.write('Welcome<br> <b>');
document.write(CustomerName);
document.write('</b><br>Your Last Access Was On<br>');
document.write(Date().toLocaleString());
document.write('<br></div></TD></tr></TBODY></TABLE>');
}else{	
AccessAuth=false;
document.write('<form name="SignInForm" method="post" action="../sales/PasswordOK.asp" onSubmit="return onClick_CheckID(this);">');
document.write('<div>Customer-ID');
document.write('<INPUT tabIndex=13 id=idSignID maxLength=40 title="Type your Customer ID " size="13" name="Id"></div>');
document.write('<div>Password&nbsp;&nbsp;&nbsp;');
document.write('<INPUT tabIndex=14 id=idSignPsw type="password" maxLength=40 title="Type your Password" size="13" name="Psw"></div>');
document.write('<div align=center><INPUT tabIndex=15 id=idSignGo type="submit" class=go value=" " title="Start" style="width: 30px; height: 20px"></div></form>');
document.write('</TD></tr></TBODY></TABLE>');
}
document.write('<br>');
document.write('<TABLE class="portlet" height="75" width="150"><TBODY>');
document.write('<TR><TD height="25" class="portletHeader">Related Links</TD></TR>');
document.write('<tr><TD vAlign=top  class="portletContent" id="login" >');
document.write('&nbsp;<img src="../images/bc.jpg"><a class=mbc href="../home/Rlinks.html#AV"> Aviation Links</a><br>');
document.write('&nbsp;<img src="../images/bc.jpg"><a class=mbc href="../home/Rlinks.html#SA"> Safety Reporting</a><br>');
//document.write('&nbsp;<img src="../images/bc.jpg"><a class=mbc href="../home/Rlinks.html#ME"> Maintenance Links</a><br>');
document.write('&nbsp;<img src="../images/bc.jpg"><a class=mbc href="../home/Rlinks.html#EA"> Egyptian Aviation</a><br>');
document.write('</TD></tr></TBODY></TABLE>');


