//initialize
var com;
var context;
var uimanager;
var tablist;
var toolbtn;
var hoverwindow;
var taskbar;
var DesktopList;
var WindowList;
var FormList;
var logout;
var userName="";



function GetRole(user)
{
 userRole=user;
}
function appinit()
{
    com=new Common();
    com.initialize();
    context=new Context();
    uimanager=new UIManager();
    tablist=new TabList();
    toolbtn=new ToolButtons();
    hoverwindow=new HoverWindow();
    taskbar=new Taskbar();
    DesktopList=new Hashtable();
    WindowList=new Hashtable();
    FormList=new Hashtable();
   // userRole=new UserRole();
    calendarinit();
    context.request("DesktopHandler.ashx?action=load");
    //initialize
    //logout skip
    logout=true;
    window.onunload=function()
    {
        if(logout)
        {
            context.request(LoginHandler_URL,"action=logout");
            //alert('kkk');
        }
    }
}



//var jsM =
// {     
//    page        : false  ,    
//    dhtmlXTree  : false ,     
//    photo_tree  : false    
// };  
// function getJSM(f)  
// {   
//     var reg = /\/(\w+)\./;   
//         jF = f.match(reg);
//         return jF[jF.length-1];  
//  }    
//  function loadJS(js)  
//  {    id = getJSM(js); 
//       var scriptId = document.getElementById(id); 
//       var head = document.getElementsByTagName('head').item(0); 
//       if(scriptId)    
//       {   
//         //head.removeChild(id);   
//       }   
//       else  
//       {    
//        script  = document.createElement('script'); 
//        script.src = js;   
//        script.type = 'text/javascript'; 
//        script.id = id;   
//        head.appendChild(script);                             
//        }  
//  } 
