var DesktopIcons = new Object();
DesktopIcons.Item = new Array();

DesktopIcons.Write = function () {
  document.write("<div id=\"divDesktopIcons\">");

  for(var intItem = 0 ; intItem < DesktopIcons.Item.length ; intItem++){
    var intLeft = Math.floor(intItem / 3) * 80;
    var intTop = (intItem - (Math.floor(intItem / 3) * 3)) * 85;
    document.write("<div class=\"DesktopIcon\" style=\"left:"+intLeft+"px;top:"+intTop+"px;" + DesktopIcons.Item[intItem].CSS + "\"  onclick=\"Menu.Hide('all');"+DesktopIcons.Item[intItem].Action + "\"><a href=\"javascript:;\"><img src=\"../themes/" + Gnextop.ThemeDir + "/" + DesktopIcons.Item[intItem].Icon + "\" /></a>"+
    "<div class=\"DesktopIconTextShadow\">" + DesktopIcons.Item[intItem].Title + "</div>"+
    "<div class=\"DesktopIconText\">" + DesktopIcons.Item[intItem].Title + "</div></div>\n");
  }

  document.write("</div>\n");
}

Menu.DefineDesktopIcon = function (strTitle, strIcon, strAction, strCss) {
  var intItem = DesktopIcons.Item.length;
  DesktopIcons.Item[intItem] = new Object();
  var currItem = DesktopIcons.Item[intItem];
  currItem.Title = strTitle;
  currItem.Icon = strIcon;
  currItem.Action = strAction;
  currItem.CSS = (isset(strCss)) ? strCss : "";
}

Menu.DefineDesktopIcon("File Browser","images/icons/large/file.png","Window.Open('apps/accessories/filebrowser.html');");
Menu.DefineDesktopIcon("Web Browser","images/icons/large/webbrowser.png","Window.Open('apps/internet/webbrowser/index.html');");
Menu.DefineDesktopIcon("Word Processor","images/icons/large/wordpro.png","Window.Open('apps/office/writer/index.html');");
Menu.DefineDesktopIcon("Instant Messenger","images/icons/large/im.png","Window.Open('apps/internet/messenger.html');");
Menu.DefineDesktopIcon("Image Organiser","images/icons/large/imageviewer.png","Window.Open('apps/graphics/imageorganiser/index.html');");