function DealerSearch()
{
    sZip = $get(txtZipId).value;
    if(ValidateZip(sZip))
    {
        DealerSearchExecute(sZip);
    }
    else
    {
        zipPromptVar.Open("Dealer", DealerSearchExecute, sZip);    
    }
    
    return false;
}

function DealerSearchExecute(sZip)
{
  $get(txtZipId).value = sZip;
  $get(btnSearchId).click();
  
  fixIEHeight();
  if (typeof adjustToolsHeight=="function")
  {
    adjustToolsHeight();
  }
  if (typeof adjustNewUsedHeight=="function")
  {
    adjustNewUsedHeight();
  }
  if (typeof adjustResearchHeight=="function")
  {
    adjustResearchHeight();
  }
  
  return false;
}

function DlrSearchCheckKey(evt)
{
    // evt is a Sys.UI.DomEvent object
    if (mapKeyToAction(evt))
    {
        DealerSearch();
        setFixValidation();
        return false;
    }
}

function showLimitMessage(mess)
{
    
  if (mess == 'NO')
  {
     $get('messageDiv2').className = 'fDMessageDiv';
     $get('messageDiv2').innerHTML = 'Hmmm... Looks like we didn\'t find a dealer close enough! Try expanding your search.';
     $get('dealerList').className = 'hide';
     if (typeof adjustToolsHeight=="function")
     {
        adjustToolsHeight();
     }
     if (typeof adjustResearchHeight=="function")
     {
        adjustResearchHeight();
     }
     if (typeof adjustNewUsedHeight=="function")
     {
        adjustNewUsedHeight();
     }
  }
  else
  {
    if (mess == 'YES')
    {
      $get('messageDiv2').className = 'hide';
      $get('messageDiv2').innerHTML = '';
    }
    else
    {
      $get('messageDiv2').className = 'fDMessageDiv';
      $get('messageDiv2').innerHTML = 'Closest 50 dealers returned.';
    }
    $get('dealerList').className = 'show';
    if (typeof adjustToolsHeight=="function")
    {
        adjustToolsHeight();
    }
    if (typeof adjustResearchHeight=="function")
    {
        adjustResearchHeight();
    }
    if (typeof adjustNewUsedHeight=="function")
    {
        adjustNewUsedHeight();
    }
  }
     
  return false;
}


function init_rrScroll() {
    var wndo = new rrscrollObj('outerDiv', 'contentDiv');
    wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
    wndo.setUpScrollControls('scrollbar');
}

 //if code supported, link in the style sheet and call the init function onload
 function loadInitScroll()
 {
   if ( rrscrollObj.isSupported() ) {
                 init_rrScroll();
   };
 }
