var $j = jQuery.noConflict();

$j(function(){

    $j("#li1").click(function() {
        $j("#desc1").toggle('slow');
    });
    $j("#li2").click(function() {
        $j("#desc2").toggle('slow');
    });
    $j("#li3").click(function() {
        $j("#desc3").toggle('slow');
    });
    $j("#li4").click(function() {
        $j("#desc4").toggle('slow');
    });
    $j("#li5").click(function() {
        $j("#desc5").toggle('slow');
    });
    $j("#li6").click(function() {
        $j("#desc6").toggle('slow');
    });


});

$j(document).ready(function() {
                
    // *********************************************
    // Options
    // *********************************************
    arrOptions = new Array();
    arrOptions[0] = "Die Cast";
    arrOptions[1] = "Powdered Metal";
    arrOptions[2] = "Stamping";
    arrOptions[3] = "Forging";
    arrOptions[4] = "Permanent Mold";
    arrOptions[5] = "Plaster Mold";
    arrOptions[6] = "Sand Casting";
    arrOptions[7] = "Fabrication";
    // *********************************************
    
    // *********************************************
    // Details
    // *********************************************
    arrDetails = new Array();
    arrDetails[0] = "Most;Best;Best;Few;Average;High;Long;High;Low;Low"; // Die Cast
    arrDetails[1] = "Least;Best;Best;Average;Small;High;Medium;Average;Low;Low"; // Powdered Metal
    arrDetails[2] = "Average;Best;Best;Average;Average;High;Medium;High;Low;Low"; // Stamping
    arrDetails[3] = "Least;Poor;Average;Average;Average;High;Long;Average;Average;High"; // Forging
    arrDetails[4] = "Average;Average;Average;Average;Average;All;Medium;Average;Average;Average"; // Permanent Mold
    arrDetails[5] = "Average;Average;Average;Few;Average;Low;Short;Low;High;Average"; // Plaster Mold
    arrDetails[6] = "Average;Poor;Poor;Most;Large;All;Medium;Low;Average;High"; // Sand Casting
    arrDetails[7] = "Average;Average;Poor;Average;Large;All;Short;Low;High;High"; // Fabrication
    
    // *********************************************
    // Load default details (Die Cast)
    loadDetails("Die Cast",arrDetails[0]);
    

    // onchange event for select box
    $j("#options").change(function () {
        var selid = $j("option:selected",this).val();
        loadDetails(arrOptions[selid],arrDetails[selid])
    });
    
    function loadDetails (title,values)
    {
        // build html
        html = '<div class="cell centered bold borderright bordertop">'+ title +'</div>';
        arrValues = values.split(';');
        for (x=0;x<arrValues.length;x++)
        {
            html += '<div class="cell centered borderright">'+ arrValues[x] +'</div>';
        }
        $j("#selected_option").html(html);
    }
});
