//Uwd.System.Fisheye

Uwd.System.Fisheye = function(config){
	Uwd.System.Fisheye.superclass.constructor.call(this, config);
};

Ext.extend(Uwd.System.Fisheye, Ext.util.Observable, {
	 //Ext.ux.StartMenu
	 
	 initStartmenu : function() {
		var system = window.system;
		this.desktop = system.getDesktop();
		
		var userName = system.user.getName();
		// Namen aller erstellten Programm Menus

		var code = '';
		// Programmmenus bilden
		Ext.each(Uwd.System.ProgramStack.getStack(), function(module){
			module.loadIconCss();
			code += '<a class="dock-item2" href="#" onclick="Uwd.System.ProgramStack.getProgramByName(\'' + module.getName() + '\').openWindow()"><span>' + module.getName() + '</span><img src="' + module.getViewPath() + 'resources/default/icons/icon-fisheye.png" alt="' + module.getName() + '" /></a>';
		}.createDelegate(this));
		
		code += '<a class="dock-item2" href="#" onclick="var restartApp = new Uwd.System.Restart();"><span>Reboot</span><img src="resources/default/images/system/restart-round.png" alt="restart" /></a>';
		code += '<a class="dock-item2" href="#" onclick="var logoutApp = new Uwd.System.Logout();"><span>logout</span><img src="resources/default/images/system/logout-round.png" alt="logout" /></a>';
		
		Ext.get('dock-container2').update(code);
	
	
		$('#dock2').Fisheye(
			{
				maxWidth: 60,
				items: 'a',
				itemsText: 'span',
				container: '.dock-container2',
				itemWidth: 40,
				proximity: 50,
				alignment : 'left',
				valign: 'top',
				halign : 'center'
			}
		)
		Ext.get('dock2').removeClass('x-hidden');
		//jQuery.iFisheye.build();
	 }
});
