
    /*
    *
    */
    function bookmark(bookmark)
    {
        window.location = "#" + bookmark;
    }
    
    /*
    *
    */
    function validateBusinessDirectory(area, industry, ownership, sizeClass)
    {
        if(!areaIsValid(area, "a County")) return false;
        if(!industryIsValid(industry)) return false;
        if(!ownershipIsValid(ownership)) return false;
        if(!sizeClassIsValid(sizeClass)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateCpi(year, period, cpiType)
    {
        if(!yearIsValid(year)) return false;
        if(!periodIsValid(period)) return false;
        if(!typeIsValid(cpiType)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateIndustry(year, period, ownership, division, industry)
    {
        if(!yearIsValid(year)) return false;
        if(!periodIsValid(period)) return false;
        if(!ownershipIsValid(ownership)) return false;
        if(!divisionIsValid(division)) return false;
        if(!industryIsValid(industry)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateCes(areaType, area, year, period, industry)
    {
        if(!areaTypeIsValid(areaType)) return false;
        if(!areaIsValid(area)) return false;
        if(!yearIsValid(year)) return false;
        if(!periodIsValid(period)) return false;
        if(!industryIsValid(industry)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateIncome(areaType, area, year, incomeType)
    {
        if(!areaTypeIsValid(areaType)) return false;
        if(!areaIsValid(area)) return false;
        if(!yearIsValid(year)) return false;
        if(!incomeTypeIsValid(incomeType)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateIndPrj(industry, shortTerm, longTerm)
    {
        if(!industryIsValid(industry)) return false;
        
        if(!shortTerm.checked & !longTerm.checked)
        {
            alert("You must select a Report Type to continue");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function validateLaborForce(areaType, area, year, period)
    {
        if(!areaTypeIsValid(areaType)) return false;
        if(!areaIsValid(area)) return false;
        if(!yearIsValid(year)) return false;
        if(!periodIsValid(period)) return false;
        
        return true;
    }
    
    
    /*
    *
    */
    function validateOccPrj(occupation, shortTerm, longTerm)
    {
        if(!occupationIsValid(occupation)) return false;
        
        if(!shortTerm.checked & !longTerm.checked)
        {
            alert("You must select a Report Type to continue");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function validatePopulation(areaType, area, year)
    {
        if(!areaTypeIsValid(areaType)) return false;
        if(!areaIsValid(area)) return false;
        if(!yearIsValid(year)) return false;
        
        return true;
    }
    
    /*
    *
    */
    function validateWageData(area, occupation, hourly, annual)
    {
        if(!areaIsValid(area)) return false;
        if(!occupationIsValid(occupation)) return false;
        
        if(!hourly.checked & !annual.checked)
        {
            alert("You must select a Rate Type to continue");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function validateIomatrix(industry, occupation)
    {
        if(!industryIsValid(industry)) return false;
        if(!occupationIsValid(occupation)) return false;
        
        return true;
    }
    
    
    // ****************************************************************************************************
    //          Field Lookup Functions
    // ****************************************************************************************************
    
    /*
    *
    */
    function areaIsValid(area, n)
    {
        var name = (n == null) ? "an Area" : n;
        
        if(area.selectedIndex == -1)
        {
            alert("You must select " + name + " to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function areaTypeIsValid(areaType)
    {        
        if(areaType.selectedIndex == -1)
        {
            alert("You must select an Area Type to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function industryIsValid(industry)
    {        
        if(industry.selectedIndex == -1)
        {
            alert("You must select an Industry to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function ownershipIsValid(ownership)
    {        
        if(ownership.selectedIndex == -1)
        {
            alert("You must select an Ownership to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function sizeClassIsValid(sizeClass)
    {        
        if(sizeClass.selectedIndex == -1)
        {
            alert("You must select an Employee Size Class to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function periodIsValid(period)
    {        
        if(period.selectedIndex == -1)
        {
            alert("You must select a Time Period to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function yearIsValid(year)
    {        
        if(year.selectedIndex == -1)
        {
            alert("You must select a Year to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function typeIsValid(type)
    {        
        if(type.selectedIndex == -1)
        {
            alert("You must select a CPI Type to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function divisionIsValid(division)
    {        
        if(division.selectedIndex == -1)
        {
            alert("You must select a Division to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function incomeTypeIsValid(incomeType)
    {        
        if(incomeType.selectedIndex == -1)
        {
            alert("You must select an Income Type to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function occupationIsValid(occupation)
    {        
        if(occupation.selectedIndex == -1)
        {
            alert("You must select an Occupation to continue.");
            return false;
        }
        
        return true;
    }
    
    /*
    *
    */
    function showLoading()
    {
        document.getElementById('floatdiv').style.visibility = 'visible';
    }
    
    /*
    *
    */
    function hideLoading()
    {
        document.getElementById('floatdiv').style.visibility = 'hidden';
    }
    
    
    //*********************************************************************************************************
    //                                  Loading DIV
    //*********************************************************************************************************
    
    var target_x = -270;
    var target_y = 10;
    
    var has_inner = typeof(window.innerWidth) == 'number';
    var has_element = document.documentElement
    && document.documentElement.clientWidth;

    var fm_id='floatdiv';
    var floating_menu = document.getElementById ? document.getElementById(fm_id) : document.all
      ? document.all[fm_id]
      : document.layers[fm_id];

    var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y;
    
    function move_menu()
    {
//        if (document.layers)
//        {
//            floating_menu.left = fm_next_x;
//            floating_menu.top = fm_next_y;
//        }
//        else
//        {
//            floating_menu.style.left = fm_next_x + 'px';
//            floating_menu.style.top = fm_next_y + 'px';
//        }
    }

    function compute_shifts()
    {
        fm_shift_x = has_inner
            ? pageXOffset
            : has_element
              ? document.documentElement.scrollLeft
              : document.body.scrollLeft;
        if (target_x < 0)
            fm_shift_x += has_inner
                ? window.innerWidth
                : has_element
                  ? document.documentElement.clientWidth
                  : document.body.clientWidth;

        fm_shift_y = has_inner
            ? pageYOffset
            : has_element
              ? document.documentElement.scrollTop
              : document.body.scrollTop;
        if (target_y < 0)
            fm_shift_y += has_inner
                ? window.innerHeight
                : has_element
                  ? document.documentElement.clientHeight
                  : document.body.clientHeight;
    }

    function float_menu()
    {
        var step_x, step_y;

        compute_shifts();

        step_x = (fm_shift_x + target_x - fm_next_x) * .07;
        if (Math.abs(step_x) < .5)
            step_x = fm_shift_x + target_x - fm_next_x;

        step_y = (fm_shift_y + target_y - fm_next_y) * .07;
        if (Math.abs(step_y) < .5)
            step_y = fm_shift_y + target_y - fm_next_y;

        if (Math.abs(step_x) > 0 ||
            Math.abs(step_y) > 0)
        {
            fm_next_x += step_x;
            fm_next_y += step_y;
            move_menu();
        }

        setTimeout('float_menu()', 20);
    };

    compute_shifts();
    if (document.layers)
    {
        fm_next_x = 0;
        fm_next_y = 0;
    }
    else
    {
        fm_next_x = fm_shift_x + target_x;
        fm_next_y = fm_shift_y + target_y;
        move_menu();
    }
    float_menu();