/*
 * Ext JS Library 2.1
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
function selectCourse(node,e) {
}
 var tree;
Ext.onReady(function(){
    // shorthand

    Ext.QuickTips.init();
    var Tree = Ext.tree;
    var loader = new Tree.TreeLoader({
            dataUrl:'../cours/ajaxcoursnode',
            preloadChildren:true
        });
    tree = new Tree.TreePanel({
        el:'tree-div',
        width:260,
        height:240,
        useArrows:true,
        border:false,
        baseCls:'treestyle',
        rootVisible:false,
        autoScroll:false,
        animate:true,
        enableDD:false,
        containerScroll: false,
        loader: loader
    });

    // set the root node
    var root = new Tree.AsyncTreeNode({
        text: 'Cours Heig',
        draggable:false,
        id:'source'
    });
    tree.setRootNode(root);
    //tree.on("click", openCourse);
    // render the tree
    tree.render();

    root.expand();
    if (courspath!=undefined) {


    tree.selectPath(courspath);
    }
   


});