Making a multi-level selection menu (NOT a navigation menu) with jQuery - follow up

Making a multi-level selection menu (NOT a navigation menu) with jQuery - follow up


This is a follow up to the post here.

http://forum.jquery.com/topic/making-a-multi-level-selection-menu-not-a-navigation-menu-with-jquery.

I have managed to solve my initial problem, but I am now having difficulty with another...

Thanks to a link in the previous post, I have been able to create a multi-level menu with the "jquery.chained.mini" plugin. Here is the html and js script that I have made (the "chained" function is right at the bottom:

<form name = "LoadCategory">
<select id = "Level1">
<option value = "">--</option>   
<option value = "Life">Life</option>
<option value = "Movement">Movement</option>
<option value = "Thought">Thought</option>
<option value = "Time">Time</option>
</select>



<select id = "Level2">
<option value = "">--</option>
<option value = "Life1" class = "Life">Life1</option>
<option value = "Life2" class = "Life">Life2</option>
<option value = "Movement1" class = "Movement">Movement1</option>
<option value = "Movement2" class = "Movement">Movement2</option>
<option value = "Thought1" class = "Thought">Thought1</option>
<option value = "Thought2" class = "Thought">Thought2</option>
<option value = "Time1" class = "Time">Time1</option>
<option value = "Time2" class = "Time">Time2</option>
</select>
</form>
</div>

<a id="LoadQuestions" href="javascript:void(0);">________LoadQuestions________</a>
</div>

<script type="text/javascript" charset="utf-8">

$(function(){
$("#Level2").chained("#Level1");
});

This works well for me, but I am now unable to connect the user's selection to the jQuery parse function. The below is my original attempt to connect the selection with the parse function. I have tried many variations on it, but to no avail:

$("#LoadWords").click(function()
{

var x;
(function selFile()
{
var p = document.LoadCategory.Load.value;

    if (p == "Life1" ) {x = "Life1.xml"}
    if (p == "Life2" ) {x = "Life.2xml"}           
    if (p == "Movement1" ) {x = "Movement1.xml"}
    if (p == "Movement2" ) {x = "Movement2.xml"}       
    if (p == "Thought1" ) {x = "Thought1.xml"}               
    if (p == "Thought2" ) {x = "Thought2.xml"}           
    if (p == "Time1" ) {x = "Time1.xml"}   
    if (p == "Time2" ) {x = "Time2.xml"}       
})();


 $.ajax({
            url: x,
            type: 'GET',
            dataType: 'xml',
            success: parseXML
       });
})

I'd be grateful for some directions or advice on this matter or on what I am doing. Cheers guys, hope you have a good weekend.