<!--
//FUNCTIONS ONLY FOR CURRENT PROJECT
//*******************************************************************************************
theImages = new Array();
if (document.images&&!parseInt(navigator.appVersion)>=5) preload('db','lb');
//*******************************************************************************************
//*******************************************************************************************
function preload(name1,name2) 
{
 theImages[0]    = new Array();
 theImages[0][0] = new Image(); theImages[0][0].src = '/orders/images/' + name1 + '0.gif';
 theImages[0][1] = new Image(); theImages[0][1].src = '/orders/images/' + name1 + '1.gif';
 theImages[1]    = new Array();
 theImages[1][0] = new Image(); theImages[1][0].src = '/orders/images/' + name2 + '0.gif';
 theImages[1][1] = new Image(); theImages[1][1].src = '/orders/images/' + name2 + '1.gif';
}
//*******************************************************************************************
function hilite(name,pic,flag) 
{
if (document.images) {
 pic=(pic==0)?"db":"lb";
 document.images[name].src = '/orders/images/'+pic+flag+'.gif';
 }
}
//*******************************************************************************************
function logout()
{
 if (self.confirm('Are you sure you want to log out?')) {
    if (self.vWinChild&&!self.vWinChild.closed)
        {
          self.vWinChild.close();
         }
    if(self.opener&&!self.opener.closed){
               opener.location.href="/NASApp/orders/Logout";
                           self.close();
    }else{
                   self.location.href="/NASApp/orders/Logout";
        }       
  }
}
//*******************************************************************************************
function closeApp() {
  
           if (confirm('Are you sure you want to close this window?')){
            
                if (self.vWinChild&&!self.vWinChild.closed)
        {
          self.vWinChild.close();
         }
                 self.close();
           }
        
}

//*******************************************************************************************
var currentServletName=0;
function PressButton(NumButton)
{
 closeCalendar();
 switch (NumButton)     
        {
                 case 0: logout();      
                 break;         
         case 1:self.location.href="/NASApp/orders/Search";     
                        hideBody();     
                 break;         
         case 2:self.location.href="/NASApp/orders/Browse?act=browseAll";
                        hideBody();
                 break;
          case 4:self.location.href="/NASApp/orders/OrderDetails";
                        hideBody();     
                 break;
                 case 5:self.location.href="/NASApp/orders/Browse";
                        hideBody();     
                 break;
                case 99:stepBack(currentServletName);   
                 break;
                 case 77:if(IE){
                           wheight=document.body.clientHeight;
                                   wwidth=document.body.clientWidth;
                                 }else if(NN||NN6){
                                   wheight=innerHeight;
                                   wwidth=innerWidth;
                                 }
                         openChildWindow("/NASApp/orders/UnderConstruction",Math.round(0.9*wwidth),Math.round(0.9*wheight));
                             break;
        default:self.location.href="/NASApp/orders/UnderConstruction";
                        hideBody();     
                 break;  
                 break;
        } 
         
 return;
}

function beforeCheck(f, vact) { return true; }
function beforeSubmit(f, vact) { return true; }
//*******************************************************************************************
function stepBack(ServletName)
{
 if(!ServletName){self.location.back();}
 else
 {
  document.forms.backForm.action="/NASApp/orders/"+ServletName;
  buttonSubmit(document.forms.backForm,"Back",false,true);
 }
 
}

//*******************************************************************************************
function buttonSubmit(f, vact, needValidate,hflag)
{ 
 closeCalendar()

   if(needValidate==null)needValidate=false
    //hideStatus()
        f.act.value = vact;
        if(needValidate) {
         if(checkForm(f,vact)){hideBody();f.submit();}
        }else{
            if(hflag)hideBody();        
            f.submit();
        }
        
}
//*******************************************************************************************
function hideStatus()
{
    if(NN)document.layers["statDiv"].visibility="hide";
        else if(IE)document.all["statDiv"].style.visibility="hidden";

}

//********************************************************************************************
function ask(action, text_)
{
        var text = '';
        if (text_ != null) {
                text = text_;
        } else {
                if (action == 'delete') text = "Do you really want to delete record?";
        }

        if (confirm(text)) return true;
        else return false;
}
// -->
