﻿//=========================================

// map variables
// These must be in the aspx page for the map_ functions to work
var id_cbRegion = "cbRegion";
var id_pleft = "pleft";
var id_pright = "pright";
var id_ptop = "ptop";
var id_pbottom = "pbottom";
var bid_popupMap = "popupMap";  // behavior id

// These must be in the aspx page for wgShowDlgMsg to work
var bid_popDlgMsg = "popDlgMsg";
var id_lblPopMsgDlg = "lblPopMsgDlg";

var IGNORE = -9999;

//=========================================
function wgGetHdrMenuWidth()
{
    // Use this for VS framework
    return 270;

    // Use this for KVD framework
    //return 420;
}

function wgHidePane(pn) { if (pn != null) pn.style.visibility = "hidden"; }
function wgShowPane(pn) { if (pn != null) pn.style.visibility = "visible"; }
function wgSizePane(pn, nLeft, nTop, nWidth, nHeight)
{
    if (pn != null)
    {
        if (nWidth < 0) nWidth = 0;
        if (nHeight < 0) nHeight = 0;

        pn.style.left = nLeft + "px";
        pn.style.top = nTop + "px";
        pn.style.width = nWidth + "px";
        pn.style.height = nHeight + "px";
    }
}
function wgSetPaneSize(pn, nWidth, nHeight)
{
    if (pn != null)
    {
        if (nWidth < 0) nWidth = 0;
        if (nHeight < 0) nHeight = 0;

        pn.style.width = nWidth + "px";
        pn.style.height = nHeight + "px";
    }
}
function wgMovePane(pn, nLeft, nTop)
{
    if (pn != null)
    {
        pn.style.left = nLeft + "px";
        pn.style.top = nTop + "px";
    }
}
function wgSetPaneHeight(pn, cy)
{
   if (pn != null && cy >= 0)
      pn.style.height = cy + "px";
}
function wgSetPaneLeft(pn, nLeft)
{
    if (pn != null)
        pn.style.left = nLeft + "px";
}
function wgSetPaneTop(pn, nTop)
{
    if (pn != null)
        pn.style.top = nTop + "px";
}
function wgCenterPane(pn, nWidth)
{
    if (pn != null)
    {
        nWidth = parseInt(nWidth);
        var cxPane = parseInt(pn.style.width);
        var nLeft = (nWidth - cxPane) / 2;
        if (nLeft < 0) nLeft = 0;
                
        pn.style.left = nLeft + "px";
        pn.style.top = "0px";
    }
}
function wgSizePaneId(pnId, nLeft, nTop, nWidth, nHeight)
{
    var pn = $get(pnId);
    if (pn != null)
    {
        if (nWidth < 0) nWidth = 0;
        if (nHeight < 0) nHeight = 0;

        pn.style.left = nLeft + "px";
        pn.style.top = nTop + "px";
        pn.style.width = nWidth + "px";
        pn.style.height = nHeight + "px";
    }
}
function wgMovePaneId(pnId, nLeft, nTop)
{
    var pn = $get(pnId);
    if (pn != null)
        wgMovePane(pn, nLeft, nTop);
}
function wgCenterPaneInBrowser(pn)
{
    // center for width, not height
    if (pn != null)
    {
        var cx = 1024;    // if all else fails
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer)
            cx = document.documentElement.clientWidth;
        else
            cx = window.innerWidth;

        wgCenterPane(pn, cx);
    }
}
function wgVmovePaneTo(pn, x, y1, y2)
{
    if (pn != null)
    {
        pn.style.left = x + "px";
        pn.style.top = y1 + "px";
        pn.style.height = (y2 - y1) + "px";
        pn.style.width = "1px";
        wgShowPane(pn);
    }
}
function wgHmovePaneTo(pn, y, x1, x2)
{
    if (pn != null)
    {
        pn.style.left = x1 + "px";
        pn.style.top = y + "px";
        pn.style.width = (x2 - x1) + "px";
        pn.style.height = "1px";
        wgShowPane(pn);
    }
}

function wgSizeGrid(pn, gridId)
{
    if (pn != null)
    {
        var grid = igtbl_getGridById(gridId);
        if (grid != null)
        {
            grid.resize(pn.clientWidth, pn.clientHeight);
            //wgSizeLastGridCol(grid, pn.clientWidth);
        }
    }
}
function wgRemoveCommas(sText)
{
    var regexp = /,/g;
    return(sText.replace(regexp, ""));
}
function wgSyncIgButton(id, bEnable)
{
    var btn = ig_getWebControlById(id);
    if (btn != null)
    {
        btn.setEnabled(bEnable);
        btn.paint(true);
    }
}
function wgSetTextIgButton(id, sText)
{
    var btn = ig_getWebControlById(id);
    if (btn != null)
    {
        btn.setText(sText);
    }
}
function wgClearIgValue(id)
{
    var ctl = igedit_getById(id);
    if (ctl != null)
        ctl.setValue("");
}
function wgClearIgText(id)
{
    var ctl = igedit_getById(id);
    if (ctl != null)
        ctl.setText("");
}
function wgGetIgText(id)
{
   var rc = "";
   var ctl = igedit_getById(id);
   if (ctl != null)
      rc = ctl.getText();
   return rc;
}
function map_nomove()
{
}
function map_showin(ar)
{
    var coords = ar.coords.split(",");
    var nleft = parseInt(coords[0]);
    var ntop = parseInt(coords[1]);
    var nright = parseInt(coords[2]);
    var nbottom = parseInt(coords[3]);

    var pL = $get(id_pleft);
    var pR = $get(id_pright);
    var pT = $get(id_ptop);
    var pB = $get(id_pbottom);

    wgVmovePaneTo(pL, nleft, ntop, nbottom);
    wgVmovePaneTo(pR, nright, ntop, nbottom);

    wgHmovePaneTo(pT, ntop, nleft, nright);
    wgHmovePaneTo(pB, nbottom, nleft, nright + 1);

}
function map_showout(ar)
{
    var pL = $get(id_pleft);
    var pR = $get(id_pright);
    var pT = $get(id_ptop);
    var pB = $get(id_pbottom);
    wgHidePane(pL);
    wgHidePane(pR);
    wgHidePane(pT);
    wgHidePane(pB);
}
function map_mapClose_click(Button, Event)
{
    map_mapsel(-1);
}
function map_mapsel(nSelected)
{
    var cb = $get(id_cbRegion);
    if (cb != null)
    {
        if (nSelected >= 0)
            cb.selectedIndex = nSelected;

        // technique from http://forums.asp.net/t/1123522.aspx
        var bh = $find(bid_popupMap);  // behavior ID
        bh.hidePopup();
    }
}
function map_resetRegion()
{
    var cb = $get(id_cbRegion);
    if (cb != null)
        cb.selectedIndex = 0;
}
function wgIgFilterDigits(oEdit, keyCode, oEvent)
{
    // do not accept any chars that are not in the allowed string below
    var filter = "0123456789";
    var newChar = String.fromCharCode(keyCode);
    var rc = filter.indexOf(newChar);

    if (rc == -1)
        oEvent.cancel = true;
}
function wgIgFilterFloatNeg(oEdit, keyCode, oEvent)
{
   // do not accept any chars that are not in the allowed string below
   var filter = "0123456789.-";
   var newChar = String.fromCharCode(keyCode);
   var rc = filter.indexOf(newChar);

   if (rc == -1)
      oEvent.cancel = true;
}
function wgIgFilterFloat(oEdit, keyCode, oEvent)
{
    // do not accept any chars that are not in the allowed string below
    var filter = "0123456789.";
    var newChar = String.fromCharCode(keyCode);
    var rc = filter.indexOf(newChar);

    if (rc == -1)
        oEvent.cancel = true;
}
function wgIgFilterInt(oEdit, keyCode, oEvent)
{
    // do not accept any chars that are not in the allowed string below
    var filter = "1234567890,+-";
    var newChar = String.fromCharCode(keyCode);
    var rc = filter.indexOf(newChar);

    if (rc == -1)
        oEvent.cancel = true;
}
function wgIgFilterAlphaNumericSp(oEdit, keyCode, oEvent)
{
    // do not accept any chars that are not in the allowed string below
    var filter = "abcdefghijklmnopqrstuvwxyz0123456789 ";
    var newChar = String.fromCharCode(keyCode);
    newChar = newChar.toLowerCase();
    var rc = filter.indexOf(newChar);

    if (rc == -1)
        oEvent.cancel = true;
}
// Not currently using this.  (Curently using AjaxControlToolkit for filtering.)
//function gc_keyPressFilterSicNaics(oEdit, keyCode, oEvent)
//{
//    // do not accept any chars that are not in the allowed string below
//    var filter = "0123456789, ";
//    var newChar = String.fromCharCode(keyCode);
//    var rc = filter.indexOf(newChar);
//
//    if (rc == -1)
//        oEvent.cancel = true;
//}
function wgShowDlgMsg(sText)
{
    // technique from http://forums.asp.net/t/1123522.aspx
    //sText = sText + "<br>" + sText + "<br>" + sText;
    var bh = $find(bid_popDlgMsg);  // behavior ID

    var lbl = $get(id_lblPopMsgDlg);
    if(lbl != null)
        lbl.innerHTML = sText;

    bh.show();
}
function wg_GridCellClick(gridName, cellId, button)
{
    // server processes column clicks, but does not want cell clicks
    return true;    // cancel the server event
}
function wg_goToBlankWindow(url)
{
    var newWin;
    newWin = window.open(url, '_blank');
    if (newWin != null)
        newWin.focus();
    return true;
}
function wg_goToVsHelpWindow(url)
{
    var newWin;
    newWin = window.open(url, 'Vs_Help');
    if (newWin != null)
        newWin.focus();
    return true;
}
function wg_goToVsAppWindow(url)
{
    var newWin;
    newWin = window.open(url, 'Vs_App', 'width=1024,height=768,close,minimizable,resizable');
    if (newWin != null)
        newWin.focus();
    return true;
}
function wg_goToKvdAppWindow(url)
{
    var newWin;
    newWin = window.open(url, 'Vs_App', 'width=1024,height=768,close,minimizable');
    if (newWin != null)
        newWin.focus();
    return true;
}
function getTabContentWidth(pTabs, cTabs)
{
   return pTabs.clientWidth - cTabs.Tabs[0].elemDiv.offsetLeft - 2;
}
function getTabContentHeight(pTabs, cTabs)
{
   var tabItem = cTabs.Tabs[0];
   return pTabs.clientHeight - tabItem.elemDiv.offsetTop - tabItem.element.offsetHeight - 1;
}
function sizeTabContent(cTabs, iTabIndex, contentId, cxContent, cyContent)
{
   var pn = cTabs.Tabs[iTabIndex].findControl(contentId);
   if (pn != null)
      wgSizePane(pn, 0, 0, cxContent, cyContent);
}

//=========================================
// Generic
//=========================================
function pn_sizeToBrowser(pnId)
{
   var pn = $get(pnId);
   if (pn != null)
   {
      var cx = 1024, cy = 768;    // if all else fails
      if (Sys.Browser.agent == Sys.Browser.InternetExplorer)
      {
         cx = document.documentElement.clientWidth;
         cy = document.documentElement.clientHeight;
      }
      else
      {
         cx = window.innerWidth;
         cy = window.innerHeight;
      }

      wgSizePane(pn, 0, 0, cx, cy);
   }
   return pn;
}
function pn_resize(pn, nLeft, nTop, nWidth, nHeight)
{
   if (pn != null)
   {
      if (nLeft != IGNORE) pn.style.left = nLeft + "px";
      if (nTop != IGNORE) pn.style.top = nTop + "px";

      if (nWidth != IGNORE)
      {
         if (nWidth < 0) nWidth = 0;
         pn.style.width = nWidth + "px";
      }
      if (nHeight != IGNORE)
      {
         if (nHeight < 0) nHeight = 0;
         pn.style.height = nHeight + "px";
      }
   }
}
function pnId_resize(pnId, nLeft, nTop, nWidth, nHeight)
{
   var pn = $get(pnId);
   pn_resize(pn, nLeft, nTop, nWidth, nHeight);
   return pn;
}
function pnId_show(pnId)
{
   var pn = $get(pnId);
   wgShowPane(pn);
   return pn;
}
function pnId_hide(pnId)
{
   var pn = $get(pnId);
   wgHidePane(pn);
   return pn;
}

//=========================================
// Named
//=========================================
function pnMain_resize()
{
   return pn_sizeToBrowser("pnMain");
}

//=========================================
//=========================================
function wgEndRequestErrorHandled(sender, args)
{
   if (args.get_error() != undefined)
   {
      var errorMessage;
      if (args.get_response().get_statusCode() == '200')
         errorMessage = args.get_error().message;    // error on server
      else
         errorMessage = 'An unspecified error occurred. ';   // error not on server

      args.set_errorHandled(true);
      alert(errorMessage);
      return true;
   }
   else
      return false;
}

function sbi_syncsize()
{
   var cyHdr = 40;
   var cyTools = 30;
   var cyHdrMenu = 20;
   var cxMenu = wgGetHdrMenuWidth();
   var cxProg = 240;
   var cyProg = 80;
   
   var pMain = pnMain_resize();
   var cxMain = pMain.clientWidth;
   var cyMain = pMain.clientHeight;
   pnId_resize("ctlProgress_pnProgress", (cxMain - cxProg) / 2, (cyMain - cyProg) / 2, cxProg, cyProg);

   //pnId_resize("pnHdr", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHeader", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHdrMenu", cxMain - cxMenu, 0, cxMenu, cyHdrMenu);
   pnId_resize("ctlNotAuth_pnNotAuth", 0, cyHdr, cxMain, cyMain - cyHdr);
   pnId_resize("pnTools", 0, cyHdr, cxMain, cyTools);

   var yTabs = cyHdr + cyTools + 5;
   var pTabs = pnId_resize("pnTabs", 0, yTabs, cxMain, cyMain - yTabs);

   if (pTabs != null)
   {
      var ctlTabs = igtab_getTabById("ctlTabs");
      if (pTabs != null && ctlTabs != null)
      {
         var cxContent = getTabContentWidth(pTabs, ctlTabs);
         var cyContent = getTabContentHeight(pTabs, ctlTabs);
         sizeTabContent(ctlTabs, 0, "pnDeciles", cxContent, cyContent);
         sizeTabContent(ctlTabs, 1, "pnIndustry", cxContent, cyContent);
      }
   }
}
function mgs_syncsize()
{
   var cyHdr = 40;
   var cyTools = 30;
   var cyHdrMenu = 20;
   var cxMenu = wgGetHdrMenuWidth();
   var cxProg = 240;
   var cyProg = 80;
   var cxCopyright = 195;
   
   var pMain = pnMain_resize();
   var cxMain = pMain.clientWidth;
   var cyMain = pMain.clientHeight;
   pnId_resize("ctlProgress_pnProgress", (cxMain - cxProg) / 2, (cyMain - cyProg) / 2, cxProg, cyProg);

   pnId_resize("pnHdr", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHeader", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHdrMenu", cxMain - cxMenu, 0, cxMenu, cyHdrMenu);
   pnId_resize("ctlNotAuth_pnNotAuth", 0, cyHdr, cxMain, cyMain - cyHdr);
   pnId_resize("pnTools", 0, cyHdr, cxMain, cyTools);
   pnId_resize("pnCopyright", cxMain - cxCopyright, 2, cxCopyright, IGNORE);

   var yTabs = cyHdr + cyTools;
   var pTabs = pnId_resize("pnGrid", 0, yTabs, cxMain, cyMain - yTabs);
}
function dd_syncsize()
{
   var cyHdr = 40;
   var cyTools = 30;
   var cyHdrMenu = 20;
   var cxMenu = wgGetHdrMenuWidth();
   var cxProg = 240;
   var cyProg = 80;
   var cxCopyright = 195;
   var cySearch = 107;
   
   var pMain = pnMain_resize();
   var cxMain = pMain.clientWidth;
   var cyMain = pMain.clientHeight;
   pnId_resize("ctlProgress_pnProgress", (cxMain - cxProg) / 2, (cyMain - cyProg) / 2, cxProg, cyProg);

   //pnId_resize("pnHdr", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHeader", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHdrMenu", cxMain - cxMenu, 0, cxMenu, cyHdrMenu);
   pnId_resize("ctlNotAuth_pnNotAuth", 0, cyHdr, cxMain, cyMain - cyHdr);
   
   srch_syncSize();
   
   var top = cyHdr + cyTools + cySearch;
   pnId_resize("ctlGrid_pnDataGrid", 0, top, cxMain, cyMain - top - cyTools);
   pnId_resize("pnBottomTools", 0, cyMain - cyTools, cxMain, cyTools);
   //   pnId_resize("pnCopyright", cxMain - cxCopyright, 2, cxCopyright, IGNORE);

//   var yTabs = cyHdr + cyTools;
//   var pTabs = pnId_resize("pnGrid", 0, yTabs, cxMain, cyMain - yTabs);
}
function dlom_syncDetail()
{
   var dGrid = $find("ctlGrid_dGrid");
   var Button = ig_getWebControlById("btnToggle");
   if (dGrid != null && Button != null)
   {
      var sText = Button.getText();
      if (sText == "Show Detail")
      {
         pnId_hide("pnDetail");
         pnId_hide("pnRecNav");
         pnId_show("pnSort");
         pnId_show("pnPager");
         dGrid.set_visible(true);
      }
      else
      {
         pnId_show("pnDetail");
         pnId_show("pnRecNav");
         pnId_hide("pnSort");
         pnId_hide("pnPager");
         dGrid.set_visible(false);
      }
   }
}
function dlom_syncsize()
{
   var cyHdr = 40;
   var cyTools = 30;
   var cyHdrMenu = 20;
   var cxMenu = wgGetHdrMenuWidth();
   var cxProg = 240;
   var cyProg = 80;
   var cxCopyright = 195;
   var cySearch = 107;

   var pMain = pnMain_resize();
   var cxMain = pMain.clientWidth;
   var cyMain = pMain.clientHeight;
   pnId_resize("ctlProgress_pnProgress", (cxMain - cxProg) / 2, (cyMain - cyProg) / 2, cxProg, cyProg);

   //pnId_resize("pnHdr", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHeader", 0, 0, cxMain, cyHdr);
   pnId_resize("ctlHeader_pnHdrMenu", cxMain - cxMenu, 0, cxMenu, cyHdrMenu);
   pnId_resize("ctlNotAuth_pnNotAuth", 0, cyHdr, cxMain, cyMain - cyHdr);

   srch_syncSize();

   pnId_resize("pnToggleView", cxMain - 90, IGNORE, IGNORE, IGNORE);

   var top = cyHdr + cyTools + cySearch;
   pnId_resize("ctlGrid_pnDataGrid", 0, top, cxMain, cyMain - top - cyTools);
   pnId_resize("pnDetail", 0, top, cxMain, cyMain - top - cyTools);
   pnId_resize("pnBottomTools", 0, cyMain - cyTools, cxMain, cyTools);
   pnId_resize("pnRights", cxMain - 250, 2, 240, IGNORE);
   dlom_syncDetail();
}
function dlom_toggleView(Button, Event)
{
   var sText = Button.getText();
   var dGrid = $find("ctlGrid_dGrid");
   if (sText == "Show Detail")
   {
      // get select row key

      // need to check to make sure a row is selected..

      var oValue = null; 
      var selRows = dGrid.get_behaviors().get_selection().get_selectedRows();
      if (selRows != null)
      {
         var lCount = selRows.get_length();
         if (lCount == 1)
         {
            var oRow = selRows.getItem(0);
            var oCell = oRow.get_cell(0);
            oValue = oCell.get_value();
            Button.setText("Show Grid");
         }
         else
            alert("Please click a row first.");  
      }
      if (oValue != null)
         dlom_updateDetail(oValue);
   }
   else
   {
      // update the UI
      Button.setText("Show Detail");
      //dGrid.set_visible(true);
      //pnId_hide("pnDetail");
   }
   dlom_syncDetail();
}
function dlom_nextRec()
{
   var dGrid = $find("ctlGrid_dGrid");
   var rowCurrent = dlom_getCurrentRow(dGrid);
   var iCurrent = rowCurrent.get_index();
   iCurrent++;
   dlom_showRec(dGrid, rowCurrent, iCurrent);
}
function dlom_prevRec()
{
   var dGrid = $find("ctlGrid_dGrid");
   var rowCurrent = dlom_getCurrentRow(dGrid);
   var iCurrent = rowCurrent.get_index();
   iCurrent--;
   dlom_showRec(dGrid, rowCurrent, iCurrent);
}
function dlom_firstRec()
{
   var dGrid = $find("ctlGrid_dGrid");
   var rowCurrent = dlom_getCurrentRow(dGrid);
   dlom_showRec(dGrid, rowCurrent, 0);
}
function dlom_lastRec()
{
   var dGrid = $find("ctlGrid_dGrid");
   var rowCurrent = dlom_getCurrentRow(dGrid);
   var iMax = dGrid.get_rows().get_length() - 1;
   dlom_showRec(dGrid, rowCurrent, iMax);
}
function dlom_getCurrentRow(dGrid)
{
   var rc = null;
   if (dGrid != null)
   {
      var selRows = dGrid.get_behaviors().get_selection().get_selectedRows();
      if (selRows != null)
         rc = selRows.getItem(0);
   }
   return rc;
}

function dlom_showRec(dGrid, rowCurrent, iRow)
{
   var selRows = dGrid.get_behaviors().get_selection().get_selectedRows();
   var allRows = dGrid.get_rows();
   var iMax = allRows.get_length() - 1;
   var oValue = null;

   if (iRow < 0) iRow = 0;
   if (iRow > iMax) iRow = iMax;
   
   // unselect current
   selRows.remove(rowCurrent);

   // select passed row
   var oRowToShow = allRows.get_row(iRow);
   selRows.add(oRowToShow);

   var oCell = oRowToShow.get_cell(0);
   oValue = oCell.get_value();

   if (oValue != null)
      dlom_updateDetail(oValue);
}
function dlom_syncRecordUI()
{
   var dGrid = $find("ctlGrid_dGrid");
   var rowCurrent = dlom_getCurrentRow(dGrid);
   var iCurrent = rowCurrent.get_index();
   var iMax = dGrid.get_rows().get_length() - 1;
   
   var sId = "#ctlRecNav_lblCurrentRec";
   var oLbl = $(sId);
   if (oLbl != null && oLbl[0] != null)
      oLbl.text(parseInt(iCurrent + 1));

   if (iCurrent == 0)
   {
      // disable
      wgSyncIgButton("ctlRecNav_ibtnRecFirst", false);
      wgSyncIgButton("ctlRecNav_ibtnRecPrev", false);
   }
   else
   {
      // enable
      wgSyncIgButton("ctlRecNav_ibtnRecFirst", true);
      wgSyncIgButton("ctlRecNav_ibtnRecPrev", true);
   }
   if (iCurrent == iMax)
   {
      // disable
      wgSyncIgButton("ctlRecNav_ibtnRecLast", false);
      wgSyncIgButton("ctlRecNav_ibtnRecNext", false);
   }
   else
   {
      // enable
      wgSyncIgButton("ctlRecNav_ibtnRecLast", true);
      wgSyncIgButton("ctlRecNav_ibtnRecNext", true);
   }
}

function dlom_updateDetailSuccess(results)
{
   dlom_syncRecordUI();
   
   var sId = "#lblDetail";
   var oStats = $(sId);
   if (oStats != null && oStats[0] != null)
      oStats.html(results);
}
function dlom_updateDetailFailure(errors)
{
   alert(errors.get_Message());
}
function dlom_updateDetail(nKey)
{
   PageMethods.GetDetail(nKey, dlom_updateDetailSuccess, dlom_updateDetailFailure);
}

function dd_clearForm(Button, Event)
{
// called by old DoneDeals uc search
   wgClearIgText("ctlSearch_itxtSic1");
   wgClearIgText("ctlSearch_itxtSic2");
   wgClearIgText("ctlSearch_itxtSic3");
   wgClearIgText("ctlSearch_itxtDesc");

   wgClearIgText("ctlSearch_ed1Lo");
   wgClearIgText("ctlSearch_ed1Hi");
   wgClearIgText("ctlSearch_ed2Lo");
   wgClearIgText("ctlSearch_ed2Hi");
   wgClearIgText("ctlSearch_ed3Lo");
   wgClearIgText("ctlSearch_ed3Hi");

   // same as with dates
   wgClearIgText("ctlSearch_dtStart");
   wgClearIgText("ctlSearch_dtEnd");

}
function dd_btnSearch_click(Button, Event)
{
//   var rc = _wgValidateISic();
//   if (!rc)
//   {
//      var msg = "Please enter valid Industry Code(s) in section \"A\".<br><br>Valid SIC and NAICS codes must start with at least 1 digit.  Note that some SIC codes have a leading zero (i.e. 0181, 0742, 0752, 0781, 0782, 0783).";
//      wgShowDlgMsg(msg);
//   }
//   if (rc) rc = _wgiValidateLoHi(id_edRevLo, id_edRevHi, "REVENUE ($000)");
//   if (rc) rc = _wgiValidateLoHi(id_edSdeLo, id_edSdeHi, "SDE ($000)");
//   if (rc) rc = _wgiValidateLoHi(id_edPriceLo, id_edPriceHi, "Sale Price ($000)");
//   if (rc) rc = _wgiValidateLoHi(id_edAskPriceLo, id_edAskPriceHi, "Ask. Price ($000)");
//
//   if (!rc)
//      Event.cancel = true;
}


//=========================================
// End
//=========================================
// must have this, unless is part of an assembly
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
