YAHOO.util.Event.onContentReady("productsandservices", function () {

    var oMenuBar = new YAHOO.widget.MenuBar("productsandservices", { 
					autosubmenudisplay: true, 
					hidedelay: 750, 
					lazyload: true });
    var aSubmenuData = [
        {
            id: "mIntro", 
            itemdata: [ 
                { text: "Getting Started", url: "/intro/index.html" },
                { text: "Skates", url: "/intro/skates.html" },
                { text: "Equipment", url: "/intro/equipment.html" },
                { text: "Terms", url: "/glossary.html" },
                { text: "Rinks", url: "/rinks/rinkSearch.html" }
            ]
        },
        {
            id: "mTraining", 
            itemdata: [
                { text: "Group Lessons", url: "/training/group.html" },
                { text: "Private Instruction", url: "/training/private.html" },
                { text: "Selecting a Coach", url: "/training/coaches.html" },
                { text: "Practice Sessions", url: "/training/practice.html" },
                { text: "Off Ice Training", url: "/training/office.html" }
            ] 
        },
        {
            id: "mSkills", 
            itemdata: [ 
                { text: "Intro", url: "/skills/index.html" },
                {
                    text: "Basics", 
                    submenu: { 
						id: "mBasics", 
						itemdata: [
							{ text: "Edges", url: "/basics/edges.html" },
							{ text: "Gliding", url: "/basics/gliding.html" },
							{ text: "Posture",  url: "/basics/posture.html" },
							{ text: "Stopping", url: "/basics/stopping.html" },
							{ text: "Stroking", url: "/basics/stroking.html" },
							{ text: "Crossovers", url: "/basics/crossovers.html" },
							{ text: "Swizzles", url: "/basics/stroking.html" }
						] 
					}
                }, 
                {
                    text: "Turns", 
                    submenu: { 
						id: "mTurns", 
						itemdata: [
							{ text: "3-turn", url: "/skills/turns/3turn.html" },
							{ text: "Bracket", url: "/skills/turns/bracket.html" },
							{ text: "Counter",  url: "/skills/turns/counter.html" },
							{ text: "Rocker", url: "/skills/turns/rocker.html" },
							{ text: "Twizzles", url: "/skills/turns/twizzles.html" }
						] 
					}
                }, 
                {
                    text: "Steps", 
                    submenu: { 
						id: "mSteps", 
						itemdata: [
							{ text: "Chasses", url: "/skills/steps/chasses.html" },
							{ text: "Crossrolls",  url: "/skills/steps/crossrolls.html" },
							{ text: "Mohawk", url: "/skills/turns/mohawk.html" },
							{ text: "Choctaw", url: "/skills/turns/choctaw.html" },
							{ text: "Two Steps", url: "/skills/turns/twosteps.html" },
							{ text: "Compete", url: "/skills/steps/compete.html" }
						] 
					}
                }, 
                {
                    text: "Spins", 
                    submenu: { 
						id: "mSpins", 
						itemdata: [
							{ text: "Intro", url: "/skills/spins/intro.html" },
							{ text: "Scratch Spin", url: "/skills/spins/scratchSpin.html" },
							{ text: "Back Spin",  url: "/skills/spins/backSpin.html" },
							{ text: "Sit Spin", url: "/skills/spins/sitSpin.html" },
							{ text: "Camel Spin", url: "/skills/spins/camelSpin.html" },
							{ text: "Layback Spin", url: "/skills/spins/laybackSpin.html" },
							{ text: "Biellmann Spin", url: "/skills/spins/BielmanSpin.html" },
							{ text: "Doughnut Spin", url: "/skills/spins/DoughnutSpin.html" },
							{ text: "Flying Sit Spin", url: "/skills/spins/flyingSitSpin.html" },
							{ text: "Flying Camel Spin", url: "/skills/spins/flyingCamel.html" },
							{ text: "Competing", url: "/skills/spins/compete.html" }
						] 
					}
                
                }, 
                {
                    text: "Jumps", 
                    submenu: { 
						id: "mJumps", 
						itemdata: [
							{ text: "Intro", url: "/skills/jumps/intro.html" },
							{ text: "Waltz Jump", url: "/skills/jumps/waltz.html" },
							{ text: "Loop Jump",  url: "/skills/jumps/loopjump.html" },
							{ text: "Salchow", url: "/skills/jumps/salchowjump.html" },
							{ text: "Axel Jump", url: "/skills/jumps/axeljump.html" },
							{ text: "Toe Loop", url: "/skills/jumps/toeloopjump.html" },
							{ text: "Flip Jump", url: "/skills/jumps/flipjump.html" },
							{ text: "Lutz Jump", url: "/skills/jumps/lutzjump.html" },
							{ text: "Split Jump", url: "/skills/jumps/splitjump.html" },
							{ text: "Stag Jump", url: "/skills/jumps/stagjump.html" },
							{ text: "Competing", url: "/skills/jumps/compete.html" }
						] 
					}
                
                }, 
                {
                    text: "Spirals", 
                    submenu: { 
						id: "mSpirals", 
						itemdata: [
							{ text: "Intro", url: "/skills/spirals/spirals.html" },
							{ text: "Arabesque ", url: "/skills/spirals/arabesque.html" },
							{ text: "Catch Foot",  url: "/skills/spirals/catchfootspiral.html" },
							{ text: "Biellmann", url: "/skills/spirals/biellmann.html" },
							{ text: "Cross Grab", url: "/skills/spirals/crossgrab.html" },
							{ text: "Charlotte", url: "/skills/spirals/charlotte.html" },
							{ text: "Fan Spiral", url: "/skills/spirals/fan.html" },
							{ text: "Kerrigan Spiral", url: "/skills/spirals/kerrigan.html" },
							{ text: "Inverted Spiral", url: "/skills/spirals/inverted.html" },
							{ text: "Spread Eagle", url: "/skills/spirals/spreadeagle.html" },
							{ text: "Patterns", url: "/skills/spirals/spirals.html" }
						] 
					}
                }, 
                { text: "Moves", url: "/skills/mif.html" }
            ]
        },
        {
            id: "mTests", 
            itemdata: [
                { text: "Intro", url: "/tests/index.html" },
                {
                    text: "Basic Skills", 
                    submenu: { 
						id: "mBasicSkills", 
						itemdata: [
							{ text: "Basic 1", url: "/tests/BS/tone.html" },
							{ text: "Basic 2", url: "/tests/BS/two.html" },
							{ text: "Basic 3",  url: "/tests/BS/three.html" },
							{ text: "Basic 4", url: "/tests/BS/four.html" },
							{ text: "Basic 5", url: "/tests/BS/five.html" },
							{ text: "Basic 6", url: "/tests/BS/six.html" },
							{ text: "Basic 7", url: "/tests/BS/seven.html" },
							{ text: "Basic 8", url: "/tests/BS/eight.html" }
						] 
					}
                }, 
                {
                    text: "Moves", 
                    submenu: { 
						id: "mMovesTests", 
						itemdata: [
							{ text: "Intro", url: "/tests/MV/intro.html" },
							{ text: "Pre-Preliminary", url: "/tests/MV/prepre.html" },
							{ text: "Preliminary",  url: "/tests/MV/preliminary.html" },
							{ text: "Pre-Juvenile", url: "/tests/MV/prejuve.html" },
							{ text: "Juvenile", url: "/tests/MV/juve.html" },
							{ text: "Intermediate", url: "/tests/MV/intermediate.html" },
							{ text: "Noveice", url: "/tests/MV/novice.html" },
							{ text: "Junior", url: "/tests/MV/junior.html" },
							{ text: "Senior", url: "/tests/MV/senior.html" }
						] 
					}
                }, 
                {
                    text: "Freestyle", 
                    submenu: { 
						id: "mFSTests", 
						itemdata: [
							{ text: "Intro", url: "/tests/FS/intro.html" },
							{ text: "Pre-Preliminary", url: "/tests/FS/prepre.html" },
							{ text: "Preliminary",  url: "/tests/FS/preliminary.html" },
							{ text: "Pre-Juvenile", url: "/tests/FS/prejuev.html" },
							{ text: "Juvenile", url: "/tests/FS/juev.html" },
							{ text: "Intermediate", url: "/tests/FS/intermediate.html" },
							{ text: "Noveice", url: "/tests/FS/novice.html" },
							{ text: "Junior", url: "/tests/FS/junior.html" },
							{ text: "Senior", url: "/tests/FS/senior.html" }
						] 
					}
                }, 
                {
                    text: "Dance", 
                    submenu: { 
						id: "mDanceTests", 
						itemdata: [
							{ text: "Intro", url: "/tests/DN/intro.html" },
							{ text: "Preliminary",  url: "/tests/DN/preliminary.html" },
							{ text: "Pre-Bronze", url: "/tests/DN/prebronze.html" },
							{ text: "Bronze", url: "/tests/DN/bronze.html" },
							{ text: "Pre-Silver", url: "/tests/DN/presilver.html" },
							{ text: "Silver", url: "/tests/DN/silver.html" },
							{ text: "Pre-Gold", url: "/tests/DN/pregold.html" },
							{ text: "Gold", url: "/tests/DN/gold.html" }
						] 
					}
                }, 
                {
                    text: "Pairs", 
                    submenu: { 
						id: "mPairsTests", 
						itemdata: [
							{ text: "Intro", url: "/tests/PR/intro.html" },
							{ text: "Preliminary",  url: "/tests/PR/preliminary.html" },
							{ text: "Juvenile", url: "/tests/PR/juve.html" },
							{ text: "Intermediate", url: "/tests/PR/intermediate.html" },
							{ text: "Noveice", url: "/tests/PR/novice.html" },
							{ text: "Junior", url: "/tests/PR/junior.html" },
							{ text: "Senior", url: "/tests/PR/senior.html" }
						] 
					}
                } 
            ] 
        },
        {
            id: "mCompeting", 
            itemdata: [
                { text: "Intro", url: "/compete/index.html" },
                {
                    text: "Freestyle", 
                    submenu: { 
						id: "mFSComp", 
						itemdata: [
							{ text: "Intro", url: "/compete/FS/intro.html" },
							{ text: "Pre-Preliminary", url: "/compete/FS/prepre.html" },
							{ text: "Preliminary",  url: "/compete/FS/preliminary.html" },
							{ text: "Pre-Juvenile", url: "/compete/FS/prejuve.html" },
							{ text: "Juvenile", url: "/compete/FS/juev.html" },
							{ text: "Intermediate", url: "/compete/FS/intermediate.html" },
							{ text: "Noveice", url: "/compete/FS/novice.html" },
							{ text: "Junior", url: "/compete/FS/junior.html" },
							{ text: "Senior", url: "/compete/FS/senior.html" }
						] 
					}
                }, 
                { text: "Dance", url: "/compete/dance.html" },
                { text: "Pairs", url: "/compete/pairs.html" },
                { text: "Qualifying", url: "/compete/qualifying.html" },
                { text: "Scoring", url: "/compete/scoring.html" },
                { text: "Olympics", url: "/compete/olympics.html" },
                { text: "Music", url: "/compete/music.html" }              
            ] 
        }
    ];

    oMenuBar.subscribe("beforeRender", function () {
		var nSubmenus = aSubmenuData.length, i;
        if (this.getRoot() == this) {
			for (i = 0; i < nSubmenus; i++) {
            	this.getItem(i+2).cfg.setProperty("submenu", aSubmenuData[i]);
			}
        }
    });
	oMenuBar.render();         
});

var jsDemoURL;
var jsTitle;
function goToDemo(){
	theForm = document.DemoForm;
	theForm.DEMO_URL.value=jsDemoURL;
	theForm.DEMO_TITLE.value=jsTitle;
	theForm.submit();
	return true;
}


