function doMWGSubmit(frm,type,action,param)
{
  var cgi_path = '/cgi-bin/dwsrun?mwg';
  frm.action = cgi_path+'/MWGHOME.DWO';
  frm.hidSys.value = "MWGDB";
  frm.hidNext.value = 15*1;
  frm.hidPrev.value = 1*1;
  if (type == 'PO')
  {
    frm.hidBgcolor.value= 'PO';
    if (action == '')
    {
      action='goAddress'
    }
    frm.hidAction.value = action;
    // this is for details information on address
    //if (param != '' )
    //{
      frm.hidParam.value=param;
    //}
    frm.submit();
  }
  else if (type == 'CO' )
  {
    frm.hidBgcolor.value= 'CO';
    if (action == '')
    {
      action='goCountry'
    }
    frm.hidAction.value = action;
    // this is for details information on address
    //if (param != '' )
    //{
      frm.hidParam.value=param;
    //}
    frm.submit();
  }
  else if (type == 'AR' )
  {
    // it's for clear the select box
    frm.hidBgcolor.value= 'AR';
    if (action == '')
    {
      action='goAirport'
    }
    frm.hidAction.value = action;
    // this is for details information on address
    //if (param != '' )
    //{
      frm.hidParam.value=param;
    //}
    frm.submit();
  }
  else if (type == 'CU' )
  {
    // it's for clear the select box
    frm.hidBgcolor.value= 'CU';
    if (action == '')
    {
      action='goCurrency'
    }
    frm.hidAction.value = action;
    // this is for details information on address
    //if (param != '' )
    //{
      frm.hidParam.value=param;
    //}
    frm.submit();
  }
  else if (type == 'CT' )
  {
    // it's for clear the select box
    frm.hidBgcolor.value= 'CT';
    if (action == '')
    {
      action='goCity'
    }
    frm.hidAction.value = action;
    // this is for details information on address
    //if (param != '' )
    //{
      frm.hidParam.value=param;
    //}
    frm.submit();
  }
  else if(type == 'GG')
  {
      //var left = (screen.AvailWidth - 600)/2;
      //var top = (screen.AvailHeight - 700)/2;
      //var searchString = frm.txtSTR.value;
      //var googlePage = "http://www.google.com/search?q="+searchString;
      //var win = window.open(googlePage,"","left="+left+"top="+top+"width=500,height=600" + " statusbar,menubar,toolbar " );
      var searchString = frm.txtSTR.value;
      var options = optionString(1020, 600, true, true);
      var googlePage = "http://www.google.com/search?q="+searchString;
      var win = window.open(googlePage,"",options,true);
  }
}

function newWin1_old(url)
  {
      var left = (screen.AvailWidth - 600)/2;
      var top = (screen.AvailHeight - 700)/2;
      var newPage = url;
      var win =
      window.open(newPage,"","left="+left+"top="+top+"width=500,height=600" +
      " statusbar,menubar,toolbar " );
  }

function newWin(url)
  {
  //var options;
  //options = optionString(_width, _height, resize, scroll);
  var options = optionString(1020, 600, true, true);
  var newPage = url;
  var win = window.open(newPage,"",options,true);
  }



function do_Submit(action)
{
  document.frmLogin.hidAction.value = action;
  document.frmLogin.submit();
}

// calculate the options string
//
function optionString(_width, _height, _resize, _scroll, _where)
{
    var options = "menubar=no,toolbar=no,status=no";

    if (_resize == true) options += ",resizable=yes"; else options += ",resizable=no";
    if (_scroll == true) options += ",scrollbars=yes"; else options += ",scrollbars=no";

    _width = (_width > screen.availWidth) ? screen.availWidth : _width;
    _height = (_height > screen.availHeight) ? screen.availHeight : _height;

    if (typeof(_where) == "undefined")
    {
        _left = Math.round((screen.availWidth - _width) / 2);
        _top = Math.round((screen.availHeight - _height) / 2);
    }
    else if (_where == 1) // top of the desktop
    {
        _left = 0;
        _top  = 0;
    }
    else if (_where == -1) // bottom of the desktop
    {
        _left = screen.availWidth - _width;
        _top  = screen.availHeight - _height;
    }

    // make an adjustment because the size is treated as the size inside borders of the window
    _width -= 10;
    _height -= 30;

    options += ",left=" + _left + ",top=" + _top + ",width=" + _width + ",height=" + _height;

    return options;
}


