// order.js
// Copyright 1986-2003 QAD Inc., Carpinteria, CA, USA
// All rights reserved worldwide.  This is an unpublished work.
/* $Revision: 1.4 $       BY: Minchao Fu         DATE: 08/23/07   ECO: *Q19V* */

function doSubmitSearch(ThisForm){
    var myform=ThisForm;
    var keycode;
    if (window.event){
       keycode=window.event.keyCode;
    }
    else if (e){
       keycode=e.which;
    }
    with (myform){
        if (keycode=='13'){
            if (ThisForm=="expressOrder"){
                preSubmit('expressOrder', '', 'centerForm', document.quick_order.html_item_nums.value);
            }
            else{
                goSearch(ThisForm.name);
            }
        }
        else
           return;
    }
}
function goJump (pageJump){
    document.centerForm.recJump.value=pageJump;
    document.centerForm.action=curPage;
    document.centerForm.submit();
}
function goShowImage(curValue){
   document.centerForm.vshowItemThumbImage.value=curValue;
   document.centerForm.action=curPage;
   document.centerForm.submit();
}
function goTemplates(){
   document.templateForm.action="../op/op_ordertemplate.html";
   document.templateForm.target="_top";
   document.templateForm.submit();
}
function goCheck(){
   document.expressForm.action="../op/op_bcitemconfirm.html";
   document.expressForm.target="_top";
   document.expressForm.submit();
}
function goAdvSearch(){
   document.mainSearchForm.centerMode.value="advanced_search";
   document.mainSearchForm.searchMode.value="search";
   document.mainSearchForm.action="../op/op_index.html";
   document.mainSearchForm.target="_top";
   document.mainSearchForm.submit();
}
function goSearch(searchType){
    if(searchType=="")searchType="mainSearchForm";
    var isValid=(document.mainSearchForm.search_criteria.value == ""?false:true);
    if(!isValid){
        alert(e_88msg);
        document.mainSearchForm.search_criteria.focus();
        return;
    }else{
        document.mainSearchForm.centerMode.value="main_search";
        document.mainSearchForm.searchMode.value="search";
        document.mainSearchForm.recJump.value="";
        document.mainSearchForm.searchType.value=searchType;
        document.mainSearchForm.searchAction.value="first";
        document.mainSearchForm.action=curPage;
        document.mainSearchForm.target="_top";
        document.mainSearchForm.submit();
    }
    document.mainSearchForm.searchMode.value = "";
}
function goHDO(){
         document.HDOForm.action="../op/op_hdoframe.html";
         document.HDOForm.submit();
}

