function searchDirectory()
{
    //Validation Here
    var blnError = false;
    var frmSearch = document.forms['frmSearch'];
    if (frmSearch.txtCompany.value == '' && frmSearch.txtKeyword.value == '' && frmSearch.cboSH.value == 0)
    {
        alert('No Search Criteria selected.');
        return;
    }
    if (frmSearch.txtCompany.value != '' && frmSearch.txtKeyword.value != '')
    {
        alert('Searches cannot include both company name and keywords.');
        return;
    }
    if (frmSearch.cboSH.value != 0 && frmSearch.txtCompany.value != '')
    {
        alert('Service Headings searches cannot include company name or keywords.');
        return;
    }
    if (frmSearch.cboSH.value != 0 && frmSearch.txtKeyword.value != '')
    {
        alert('Service Headings searches cannot include company name or keywords.');
        return;
    }
    performSearch();
}
function performSearch()
{
    var frmSearch = document.forms['frmSearch'];
    if (frmSearch.cboSH.value != 0)
    {
        var strType = 'sh';
        var strValue = escape(frmSearch.cboSH.value);
    }
    if (frmSearch.txtCompany.value != '')
    {
        var strType = 'co';
        var strValue = escape(frmSearch.txtCompany.value);
    }
    if (frmSearch.txtKeyword.value != '')
    {
        var strType = 'key';
        var strValue = escape(frmSearch.txtKeyword.value);
    }
    strLoc = 'search-results-iframe.php?type=' + strType + '&value=' + strValue;
    window.location.href = strLoc;
//    frmSearch.submit();
}
function document_onkeypress(e)
{
    if (navigator.appName == 'Netscape')
    {
        if (e.which == 13)
        {
            searchDirectory();
        }
    }
    else
    {
        if (window.event.keyCode == 13)
        {
            searchDirectory();
            window.event.returnValue = false;
        }
    }
}
function body_onload()
{
    //runSlideShow();
}
