Advertisement
Guest User

Web-based Windows 3.1 simulator

a guest
Jun 2nd, 2022
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 72.01 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  5. <meta name="keywords" lang="en" content="Michael Vincent" />
  6. <meta name="author" content="Michael Vincent" />
  7. <meta name="robots" content="NOODP" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  9. <title>michaelv.org</title>
  10.  
  11. <style type="text/css">
  12. html { overflow: hidden; }
  13. body {
  14.     padding: 0px 0px 0px 0px;
  15.     margin: 0px 0px 0px 0px;
  16.     font-family: System, Arial, sans-serif;
  17.     font-size: 14px;
  18.     color: #000000;
  19.     background-color: #FFFFFF;
  20.     overflow: hidden;
  21. }
  22. a {
  23.     color: #0000FF;
  24. }
  25. img { border: none; }
  26. div#screen {
  27.     padding: 0px 0px 0px 0px;
  28.     margin: 0px 0px 0px 0px;
  29.     background-color: #CCCCCC;
  30.     width: 100px;
  31.     height: 100px;
  32.     z-index: -1;
  33.     visibility: hidden;
  34. }
  35. div#modal {
  36.     position: absolute;
  37.     width: 3px;
  38.     height: 3px;
  39.     left: 0px;
  40.     top: 0px;
  41.     background-color: white;
  42.     filter: Alpha(Opacity=0);
  43.     -moz-opacity: 0.0;
  44.     opacity: 0.0;
  45.     visibility: hidden;
  46.     z-index: -2;
  47. }
  48. div.radiobutton {
  49.     float: left;
  50. }
  51. div.radioimage {
  52.     background: url(/images/icons/smallstrip.png) no-repeat -216px 0px;
  53.     float: left;
  54.     width: 16px;
  55.     height: 16px;
  56.     margin-right: 5px;
  57. }
  58. a.button {
  59.     background: url(/images/icons/buttons2.png) no-repeat top right;
  60.     color: black;
  61.     display: block;
  62.     float: left;
  63.     height: 30px;
  64.     padding-right: 3px;
  65.     text-decoration: none;
  66.     cursor: default;
  67.     outline: none;
  68. }
  69. a.button span {
  70.     background: url(/images/icons/buttons1.png) no-repeat;
  71.     display: block;
  72.     text-align: center;
  73.     line-height: 22px;
  74.     padding: 4px 6px 4px 4px;
  75. }
  76. a.button:active {
  77.     background-position: bottom right;
  78.     outline: none;
  79. }
  80. a.button:active span {
  81.     background-position: bottom left;
  82.     padding: 5px 5px 3px 5px;
  83. }
  84. input.text {
  85.     border: 1px solid black;
  86.     font-family: System, sans-serif;
  87.     font-size: 14px;
  88.     padding-left: 3px; padding-right: 3px;
  89. }
  90. div.comboitem {
  91.     font-size: 14px;
  92.     padding: 0px 0px 0px 4px;
  93. }
  94. div.scrollbar {
  95.     float: right;
  96.     border-left: 1px solid black;
  97.     width: 24px;
  98.     background-color: white;
  99. }
  100. div.sbtop {
  101.     width: 24px; height: 24px;
  102.     background: url(/images/icons/scrollbar.png) no-repeat -96px 0px;
  103. }
  104. div.scrollmc { position: relative; }
  105. div.sbmiddle {
  106.     width: 24px; height: 25px;
  107.     background: url(/images/icons/scrollbar.png) no-repeat -144px 0px;
  108.     visibility: hidden;
  109.     position: absolute;
  110.     top: 0px;
  111. }
  112. div.sbbottom {
  113.     width: 24px; height: 24px;
  114.     background: url(/images/icons/scrollbar.png) no-repeat -120px 0px;
  115. }
  116. div.scrollbarh {
  117.     position: absolute;
  118.     bottom: 3px;
  119.     border-top: 1px solid black;
  120.     height: 24px;
  121.     background-color: white;
  122.     margin-left: -8px;
  123. }
  124. div.scrollmch {
  125.     position: relative;
  126.     height: 24px;
  127.     margin-left: 24px;
  128. }
  129. div.sbmiddleh {
  130.     width: 25px; height: 24px;
  131.     background: url(/images/icons/scrollbar.png) no-repeat -144px -25px;
  132.     visibility: hidden;
  133.     position: absolute;
  134.     top: 0px; left: 24px;
  135. }
  136. div.sbleft {
  137.     position: absolute; bottom: 0px; left: 0px;
  138.     width: 24px; height: 24px;
  139.     background: url(/images/icons/scrollbar.png) no-repeat -96px -25px;
  140. }
  141. div.sbright {
  142.     position: absolute; bottom: 0px; right: 0px;
  143.     width: 24px; height: 24px;
  144.     background: url(/images/icons/scrollbar.png) no-repeat -120px -25px;   
  145. }
  146. div.menubar {
  147.     border-bottom: 1px solid black;
  148.     margin: -8px -8px 5px -8px;
  149.     width: 100%;
  150.     height: 26px;
  151.     background-color: white;
  152. }
  153. div.menu {
  154.     float: left;
  155.     font-family: System, sans-serif;
  156.     font-size: 20px;
  157.     line-height: 26px;
  158.     cursor: default;
  159.     background-color: white;
  160.     padding-left: 10px; padding-right: 10px;
  161. }
  162. div#iconlist { position: absolute; bottom: 0px; z-index: 0; }
  163. div.alistoficons { position: absolute; bottom: 0px; margin-bottom: 10px; }
  164. td.minimizedicon { width: 84px; text-align: center; cursor: default; vertical-align: top; }
  165. div.minicon {
  166.     width: 32px; height: 32px;
  167.     margin-left: auto; margin-right: auto;
  168.     background: url(/images/icons/iconstrip.gif) no-repeat 0px 0px;
  169. }
  170. div.mintext {
  171.     font-family: Verdana, Arial, sans-serif;
  172.     font-size: 12px;
  173.     color: black;
  174.     text-align: center;
  175.     margin-left: auto; margin-right: auto;
  176.     padding-left: 3px; padding-right: 3px; padding-bottom: 2px;
  177. }
  178. div.box {
  179.     position: absolute;
  180.     visibility: hidden;
  181.     left: 100px; top: 72px;
  182.     width: 100px; height: 100px;
  183.     border: 1px solid black;
  184.     background-color: #CCCCCC;
  185.     color: black;
  186.     padding: 2px 2px 2px 2px;
  187.     margin: 2pt 2pt 12px 2pt;
  188. }
  189. div.boxnest {
  190.     border: 1px solid black;
  191. }
  192. div.title {
  193.     border-bottom: 1px solid black;
  194.     padding: 0px 0px 0px 0px;
  195.     color: white;
  196.     background-color: #000080;
  197.     text-align: center;
  198.     line-height: 26px;
  199.     font-family: System, sans-serif;
  200.     font-size: 20px;
  201.     cursor: default;
  202.     white-space: nowrap;
  203. }
  204. div.leftbutton {
  205.     float: left;
  206.     background: url(/images/icons/smallstrip.png) no-repeat 0px 0px;
  207.     width: 27px;
  208.     height: 26px;
  209. }
  210. div.rightbuttons {
  211.     float: right;
  212.     width: 54px;
  213.     height: 26px;
  214.     padding: 0px 0px 0px 0px;
  215. }
  216. div.maxbutton {
  217.     float: right;
  218.     background: url(/images/icons/smallstrip.png) no-repeat -108px 0px;
  219.     width: 27px; height: 26px;
  220. }
  221. div.minbutton {
  222.     float: right;
  223.     background: url(/images/icons/smallstrip.png) no-repeat -54px 0px;
  224.     width: 27px; height: 26px;
  225. }
  226. div.restorebutton {
  227.     float: right;
  228.     background: url(/images/icons/smallstrip.png) no-repeat -162px 0px;
  229.     width: 27px; height: 26px; }
  230. div.popupmenu {
  231.     position: absolute;
  232.     background-color: white;
  233.     border-bottom: 1px solid #C0C0C0;
  234.     border-right: 1px solid #C0C0C0;
  235.     padding: 0px 0px 0px 0px;
  236.     cursor: default;
  237.     visibility: hidden;
  238. }
  239. div.popupinside {
  240.     border: 1px solid black;   
  241.     font-size: 20px;
  242. }
  243. span.pop {
  244.     padding: 0px 15px 0px 15px;
  245.     line-height: 22px;
  246. }
  247. div.menus {
  248.     border-bottom: 1px solid black;
  249.     font-family: Arial, sans-serif;
  250.     font-size: 1px;
  251.     margin: 2px 0px 2px 0px;
  252. }
  253. div.boxtext {
  254.     background-color: white;
  255.     color: black;
  256.     padding: 8px;
  257. }
  258. img.icon {
  259.     width: 32px; height: 32px;
  260.     vertical-align: middle;
  261.     margin-right: 6px;
  262.     background: url(/images/icons/iconstrip.gif) no-repeat 0px 0px;
  263. }
  264. img.miscicon {
  265.     background: url(/images/icons/misc.gif) no-repeat 0px 0px;
  266. }
  267. p {
  268.     margin: 0px;
  269. }
  270. p.center { text-align: center; }
  271. p.indented { text-indent: 15pt; }
  272. </style>
  273.  
  274. <script type="text/javascript">
  275. //<![CDATA[
  276. var args='';
  277. var scrollTimer; var scrollY=-1; var scrollSave; var scrollObj=null;
  278. var refScreen; var gCallback; var refModal; var uniqueID=0; var refProgman;
  279. var modalActive=0; var menuBarCB; var menuBarI; var menuBarS=null;
  280. var modalPreviousZ; var filePickerCB=null; var filePickerPath; var filePickerfilter;
  281. var filePickerFile; var filePickerFileSelected=-1; var filePickerDirSelected=-1;
  282. var resizeActive = -1; var menuActive=0; var systemMenuA=0;
  283. var resizeArray = ['nw-resize', 'w-resize', 'sw-resize', 'n-resize', '', 's-resize', 'ne-resize', 'e-resize', 'se-resize'];
  284. var windowCount = 0; var iconSelected=0;
  285. var highestZ = 0; highestZGroup=0;
  286. var externalFileList = new Array();
  287. //name, icon, type (0=real program), minimized (1/0), code, width, height, left, top, maxed (1/0), cicons (3/1/0), closing callback, ismodal, resize callback, isprogmangrp
  288. //var windows = [['Program Manager', 0, 0, 0, 'progman', 640, 480, 0, 0, 1, cb, modal, resizecb, 0]];
  289. var windows = new Array();
  290. var mouseX; var mouseY; var dragObject; var dragX; var dragY; var lastButton = -1;
  291. var proggroups = [['Main',3,'main'],['Accessories',3,'accessories'],['Games',3,'games'],['Internet Browser',3,'browser'],['Explore Content',3,'content']];
  292. var progManGroupsCount=5; //UPDATE THIS IF A NEW GROUP IS ADDED IN THE LINE ABOVE
  293. var progManMenuStructure=[[['Run...',1],['Exit Windows...',1]],[['1: Main',1],['2: Accessories',1],['3: Games',1],['4: Internet Browser',1],['5: Explore Content',1],['-',1],['<no open programs>',0]],[['About Program Manager...',1]]];
  294. var grouplists = [[['Control Panel',9,'\\windows\\cpanel.exe'],['MS-DOS Prompt',8,'\\command.com'],['Read Me',11,'\\windows\\notepad.exe \\windows\\about.txt'],['michaelv.org Forum',14,'\\windows\\ibrowser.exe http://www.michaelv.org/forum/']],[['Calculator',7,'\\windows\\calc.exe'],['Media Player',5,'\\windows\\mplayer.exe'],['Notepad',4,'\\windows\\notepad.exe'],['Picture Viewer',13,'\\windows\\pviewer.exe']],[['Minesweeper',12,'\\windows\\winmine.exe']],[['Internet Browser',6,'\\windows\\ibrowser.exe'],['User\'s Guide',11,'\\windows\\notepad.exe \\windows\\ibrowser.txt']],[['Computers',19,'\\windows\\ibrowser.exe http://www.michaelv.org/computers/?i=1'],['michaelv.org Forum',14,'\\windows\\ibrowser.exe http://www.michaelv.org/forum/'],['Music',16,'\\windows\\ibrowser.exe http://www.michaelv.org//projects/telephone/?i=1'],['Projects',15,'\\windows\\ibrowser.exe http://www.michaelv.org/projects.php?i=1'],['Radiation',21,'\\windows\\ibrowser.exe http://www.michaelv.org/radiation/?i=1'],['Writings',17,'\\windows\\ibrowser.exe http://www.michaelv.org/writing/?i=1'],['Et Cetera',20,'\\windows\\ibrowser.exe http://www.michaelv.org/index2.php']]];
  295. function hide(self) { self.parentNode.parentNode.parentNode.style.display = 'none'; }
  296. function dragDown(e) {
  297.     if (e == null)
  298.         var e = window.event;
  299.     dragObject = document.getElementById(this.getAttribute('tag'));
  300.     if (dragObject.getAttribute('tag_grp') != 1) {
  301.         if (dragObject.style.zIndex != highestZ)
  302.             dragObject.style.zIndex = ++highestZ;
  303.     } else {
  304.         if (dragObject.style.zIndex != highestZGroup)
  305.             dragObject.style.zIndex = ++highestZGroup;
  306.     }
  307.     lastButton = getMouseButton(e.button);
  308.     if (lastButton != 0)
  309.         return false;
  310.     if (dragObject.getAttribute('tag2') == '1')
  311.         return false;
  312.     if (this.style.cursor != 'move')
  313.         this.style.cursor = 'move';
  314.     mouseX = e.clientX; mouseY = e.clientY;
  315.     dragX = parseInt(dragObject.style.left); dragY = parseInt(dragObject.style.top);
  316.     refScreen.onmousemove = mouseDragger;
  317.     refModal.onmousemove=mouseDragger;
  318.     return false;
  319. }
  320. function getMouseButton(button) {
  321.     if (navigator.userAgent.indexOf('MSIE') == -1)
  322.         return button;
  323.     return --button;
  324. }
  325. function dragUp(e) {
  326.     e = e || window.event;
  327.     if (lastButton != 0)
  328.         return;
  329.     if (document.getElementById(this.getAttribute('tag')).getAttribute('tag2') != '1')
  330.         mouseDragger(e);
  331.     this.style.cursor = 'default';
  332.     refScreen.onmousemove=null;
  333.     refModal.onmousemove=null;
  334. }
  335. function mouseDragger(e) {
  336.     var x; var y; var w; var h;
  337.     var refScreenTemp=refScreen;
  338.     var refScreen_top=refScreen.offsetTop;
  339.     var refScreen_left=refScreen.offsetLeft;
  340.     var refScreen_height=refScreen.offsetHeight;
  341.     var refScreen_width=refScreen.offsetWidth;
  342.     if (dragObject.getAttribute('tag_grp')==1) {
  343.         refScreenTemp=refProgman;
  344.         refScreen_top=0;
  345.         refScreen_left=0;
  346.         refScreen_width=parseInt(refScreenTemp.style.width);
  347.         refScreen_height=parseInt(refScreenTemp.style.height);
  348.     }
  349.     if (e == null)
  350.         var e = window.event;
  351.     if (resizeActive != -1)
  352.     {
  353.         x = dragX; y = dragY; w = dragW; h = dragH;
  354.         if (getMouseButton(e.button) != 0)
  355.             { resizeUp(e); return false; }
  356.         if (resizeActive < 3)
  357.         {
  358.             x = dragX + (e.clientX - mouseX);
  359.             w = dragW - (e.clientX - mouseX);
  360.         }
  361.         if (resizeActive > 5)
  362.             w = dragW + (e.clientX - mouseX);
  363.         if (resizeActive % 3 == 0)
  364.         {
  365.             y = dragY + (e.clientY - mouseY);
  366.             h = dragH - (e.clientY - mouseY);
  367.         }
  368.         if (resizeActive % 3 == 2)
  369.             h = dragH + (e.clientY - mouseY);
  370.         if (w < 125)
  371.             { w = 125; x = parseInt(dragObject.style.left); }
  372.         if (h < 125)
  373.             { h = 125; y = parseInt(dragObject.style.top); }
  374.         if (x < refScreen_left-4 || y < refScreen_top-4 || (x+w)>refScreen_left+refScreen_width || (y+h)>refScreen_top+refScreen_height)
  375.             return false;
  376.         if (dragObject.getAttribute('tag_grp') == 1) {
  377.             if (x<refScreen_left-2 || y<(refScreen_top+document.getElementById('progman_menubar').offsetHeight+25) || (x+w)>refScreen_left+refScreen_width-7 || (y+h)>refScreen_top+refScreen_height-8)
  378.             return false;
  379.         }
  380.         dragObject.style.left = x + 'px';
  381.         dragObject.style.top = y + 'px';
  382.         dragObject.style.width = w + 'px';
  383.         dragObject.style.height = h + 'px';
  384.         var k = document.getElementById(dragObject.id+'_bt');
  385.         resizeBoxText(dragObject,k);
  386.         for (var i=0;i<windowCount;i++) {
  387.             if (windows[i][4]==dragObject.id) {
  388.                 windows[i][13](dragObject); break; }
  389.         }
  390.         return false;
  391.     }
  392.     if (lastButton != 0)
  393.         return false;
  394.     if (getMouseButton(e.button) != 0)
  395.         { document.getElementById(dragObject.id + '_tbar').style.cursor = 'default'; refScreen.onmousemove = null; return false; }
  396.     x = dragX + (e.clientX - mouseX);
  397.     y = dragY + (e.clientY - mouseY);
  398.     if (dragObject.getAttribute('tag_grp')==1) {
  399.         if (x < refScreen_left)
  400.             { x=refScreen_left; mouseDraggerSpecial(); }
  401.         if (y < document.getElementById('progman_menubar').offsetHeight+25)
  402.             { y=document.getElementById('progman_menubar').offsetHeight+25; mouseDraggerSpecial(); }
  403.         if (x > refScreen_width-parseInt(dragObject.style.width)-8)
  404.             { x=refScreen_width-parseInt(dragObject.style.width)-8; mouseDraggerSpecial(); }
  405.         if (y >= refScreen_height-parseInt(dragObject.style.height)-8)
  406.             { y=refScreen_height-parseInt(dragObject.style.height)-8; mouseDraggerSpecial(); }
  407.     } else {
  408.         if (x > refScreen_left + refScreen_width-4)
  409.             x = refScreen_width+refScreen_left-4;
  410.         if (y < refScreen_top-4)
  411.             y = refScreen_top-4;
  412.         if (y > refScreen_top + refScreen_height-4)
  413.             y = refScreen_top + refScreen_height-4;
  414.     }
  415.     dragObject.style.left = x + 'px';
  416.     dragObject.style.top = y + 'px';
  417.     return false;
  418. }
  419. function mouseDraggerSpecial() {
  420.     document.getElementById(dragObject.id + '_tbar').style.cursor = 'default';
  421.     refScreen.onmousemove=null;
  422.     refModal.onmousemove=null;
  423. }
  424. function boxnestCancel(e) {
  425.     e = e || window.event;
  426.     bringTopmost(this.parentNode);
  427.     if (menuActive != 1)
  428.         e.cancelBubble = true;
  429. }
  430. function boxnestCancel2(e) {
  431.     e = e || window.event;
  432.     bringTopmostGroup(this.parentNode);
  433.     bringTopmost(refProgman);
  434.     if (menuActive != 1)
  435.         e.cancelBubble=true;
  436. }
  437. function bringTopmostGroup(t) {
  438.     if (t.style.zIndex != highestZGroup)
  439.         t.style.zIndex = ++highestZGroup;
  440. }
  441. function bringTopmost(t) {
  442.     if (t.style.zIndex != highestZ)
  443.         t.style.zIndex = ++highestZ;
  444. }
  445. function resizeDown(e) {
  446.     e = e || window.event;
  447.     var o_left=this.offsetLeft; var o_top=this.offsetTop;
  448.     var o_width=this.offsetWidth; var o_height=this.offsetHeight;
  449.     if (this.getAttribute('tag_grp') != 1) {
  450.         bringTopmost(this);
  451.     } else {
  452.         var pma=refProgman;
  453.         o_left += parseInt(pma.style.left)+3;
  454.         o_top += parseInt(pma.style.top)+3;
  455.     }
  456.     if (menuActive == 1) {
  457.         menuModalClick(e);
  458.         return;
  459.     }
  460.     if (getMouseButton(e.button) != 0)
  461.         return false;
  462.     var a = 1; var b = 1;
  463.     var x = e.clientX; var y = e.clientY;
  464.     if (Math.abs(x - o_left - 2) < 4)
  465.         a=0;
  466.     if (Math.abs(o_width+o_left - x) < 4)
  467.         a=2;
  468.     if (Math.abs(y - o_top - 2) < 4)
  469.         b=0;
  470.     if (Math.abs(o_height+o_top - y) < 4)
  471.         b=2;
  472.     resizeActive = (3*a)+b;
  473.     mouseX = e.clientX; mouseY = e.clientY;
  474.     dragX = parseInt(this.style.left); dragY = parseInt(this.style.top);
  475.     dragW = parseInt(this.style.width); dragH = parseInt(this.style.height);
  476.     dragObject = this;
  477.     document.body.style.cursor = resizeArray[resizeActive];
  478.     refScreen.onmousemove = mouseDragger;
  479.     document.body.onmouseup = resizeUp;
  480.     if (this.getAttribute('tag_grp') == 1)
  481.         e.cancelBubble=true;
  482. }
  483. function resizeUp(e) {
  484.     e = e || window.event;
  485.     if (resizeActive == -1)
  486.         return;
  487.     resizeActive = -1;
  488.     document.body.style.cursor = 'default';
  489.     refScreen.onmousemove = null;
  490. }
  491. function mouseMoveBox(e) {
  492.     e = e || window.event;
  493.     var a = 1; var b = 1;
  494.     var o_left=this.offsetLeft; var o_top=this.offsetTop;
  495.     var o_width=this.offsetWidth; var o_height=this.offsetHeight;
  496.     if (this.getAttribute('tag_grp')==1) {
  497.         var pg=refProgman;
  498.         o_left += parseInt(pg.offsetLeft);
  499.         o_top += parseInt(pg.offsetTop);
  500.     }
  501.     var x = e.clientX; var y = e.clientY;
  502.     if (Math.abs(x - o_left - 2) < 4)
  503.         a=0;
  504.     if (Math.abs(o_width+o_left - x) < 4)
  505.         a=2;
  506.     if (Math.abs(y - o_top - 2) < 4)
  507.         b=0;
  508.     if (Math.abs(o_height+o_top - y) < 4)
  509.         b=2;
  510.     if (resizeActive==-1)
  511.         this.style.cursor = resizeArray[(a*3)+b];
  512. }
  513. function blockDefault(e) {
  514.     e = e || window.event;
  515.     if (typeof e.preventDefault != 'undefined')
  516.         e.preventDefault();
  517. }
  518. function minIconDoubleClick() {
  519.     iconSelected=0;
  520.     var i=this.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('tag');
  521.     var id=windows[i][4];
  522.     showWindow(id);
  523.     bringTopmost(document.getElementById(id));
  524.     windows[i][3]=0;
  525.     drawDesktop();
  526. }
  527. function minIconClick(e) {
  528.     var o;
  529.     e = e || window.event;
  530.     var z=this.parentNode.parentNode.parentNode.parentNode.parentNode;
  531.     var m=z.getAttribute('tag');
  532.     if (m != '-1') {
  533.         o=document.getElementById('minIcon'+m).childNodes[1];
  534.         o.style.backgroundColor='transparent';
  535.         o.style.color='#000000';
  536.     }
  537.     iconSelected=1;
  538.     o=this.parentNode.childNodes[1]
  539.     o.style.backgroundColor = "#000080";
  540.     o.style.color = "white";
  541.     z.setAttribute('tag',this.getAttribute('tag'));
  542.     e.cancelBubble = true;
  543.     return false;
  544. }
  545. function minIconUnselect() {
  546.     var obj = document.getElementById('minIconText'+document.getElementById('iconlist').getAttribute('tag'));
  547.     obj.style.backgroundColor = "transparent";
  548.     obj.style.color = "black";
  549.     iconSelected=0;
  550. }
  551. function minDepressed() { this.style.backgroundPosition='-81px 0px'; }
  552. function minRestored() { this.style.backgroundPosition='-54px 0px'; }
  553. function maxDepressed() { this.style.backgroundPosition='-135px 0px'; }
  554. function maxRestored() { this.style.backgroundPosition='-108px 0px'; }
  555. function rDepressed() { this.style.backgroundPosition='-189px 0px'; }
  556. function rRestored() { this.style.backgroundPosition='-162px 0px'; }
  557. function sysD() { this.style.backgroundPosition='-27px 0px'; }
  558. function sysR() { this.style.backgroundPosition='0px 0px'; }
  559. function systemMenu(e,w)
  560. {
  561.     e = e || window.event;
  562.     if (getMouseButton(e.button) != 0)
  563.         return;
  564.     var i = findWindow(w);
  565.     var m = [['Restore',(windows[i][9])],['Move',0],['Size',0],['Minimize',windows[i][10]&1],['Maximize',((windows[i][10]&2)>>1)&&(!(windows[i][9]))],['-',1],['Close',1]];
  566.     var o = document.getElementById(w);
  567.     if (systemMenuA==1) {
  568.         closeWindow(w); closeMenu();
  569.         return false;
  570.     }
  571.     menuActive=1;
  572.     dragX=e.clientX; dragY=e.clientY;
  573.     window.setTimeout("systemMenuA=0",550);
  574.     dragObject=document.getElementById(w+'_lb');
  575.     systemMenuA=1;
  576.     if (o.getAttribute('tag_grp') == 1) {
  577.         var cqd=refProgman;launchMenu(parseInt(o.style.left)+parseInt(cqd.style.left)+12,parseInt(o.style.top)+parseInt(cqd.style.top)+39,m,syscb);
  578.     } else {
  579.         launchMenu(parseInt(o.style.left)+7,parseInt(o.style.top)+34,m,syscb);
  580.     }
  581. }
  582. function syscb(v) {
  583.     var a = dragObject.id.substr(0,dragObject.id.length-3);
  584.     v=parseInt(v);
  585. switch(v) {
  586. case 0:
  587.     restoreWindow(a); break;
  588. case 3:
  589.     if (document.getElementById(a).getAttribute('tag_grp')==1)
  590.         destroyGroupWindow(a);
  591.     else
  592.         minimizeWindow(a);
  593.     break;
  594. case 4:
  595.     maximizeWindow(a); break;
  596. case 6:
  597.     closeWindow(a); break;
  598. } }
  599. function launchMenu(x, y, mStruct, cb, wname) {
  600.     var c; var d;
  601.     gCallback=cb;
  602.     menuActive=1;
  603.     var a = document.createElement("div");
  604.     a.setAttribute("class","popupmenu");
  605.     a.setAttribute("className","popupmenu");
  606.     a.setAttribute("id","pmenu");
  607.     a.style.zIndex = highestZ + 1;
  608.     a.style.left=x+'px'; a.style.top=y+'px';
  609.     var b = document.createElement("div");
  610.     b.setAttribute("class","popupinside");
  611.     b.setAttribute("className","popupinside");
  612. b.onselectstart = new Function("return false;");
  613.     for (var i=0;i<mStruct.length;i++) {
  614.         c = document.createElement("div");
  615.         if (mStruct[i][0] != '-')
  616.         {
  617.             c.setAttribute("class","menuc");
  618.             c.setAttribute("className","menuc");
  619.             c.setAttribute("tag",i);
  620.             c.setAttribute('tag_window',wname);
  621.             c.setAttribute("id","menu_"+i);
  622.             if (mStruct[i][1] == 0)
  623.             {
  624.                 c.style.color='#C0C0C0';
  625.             } else {
  626.                 c.onmouseout=menuOut; c.onmousedown=menuDown;
  627.                 c.onmouseup=menuClick; c.onmousemove=menuMove;
  628.             }
  629.             d = document.createElement("span");
  630.             d.setAttribute("class","pop");
  631.             d.setAttribute("className","pop");
  632.             d.appendChild(document.createTextNode(mStruct[i][0]));
  633.             c.appendChild(d);
  634.             c.onselectstart = new Function("return false;");
  635.         } else {
  636.             c.setAttribute("class","menus");
  637.             c.setAttribute("className","menus");
  638.             c.style.width=b.style.width;
  639.         }
  640.         b.appendChild(c);
  641.     }
  642.     a.appendChild(b);
  643.     a.onselectstart = new Function("return false;");
  644.     refScreen.appendChild(a);
  645.     refScreen.onmousedown=menuModalClick;
  646.     a.style.visibility='visible';
  647. }
  648. function menuClick(e) {
  649.     var e = e || window.event;
  650.     lastButton = -1;
  651.     var a = this.getAttribute('tag');
  652.     menuModalClick(e);
  653.     gCallback(a,this.getAttribute('tag_window'));
  654. }
  655. function menuDown(e) {
  656.     e = e || window.event;
  657.     lastButton = getMouseButton(e.button);
  658.     this.style.backgroundColor='#000080';
  659.     this.style.color='white';
  660.     e.cancelBubble=true;
  661.     blockDefault(e);
  662.     return false;
  663. }
  664. function menuMove(e) {
  665.     e = e || window.event;
  666.     if (lastButton == 0) {
  667.         this.style.backgroundColor='#000080';
  668.         this.style.color='white';
  669.         e.cancelBubble=true;
  670.         blockDefault(e);
  671.         return false;
  672.     }
  673. }
  674. function menuOut() {
  675.     this.style.backgroundColor='white';
  676.     this.style.color='black';
  677. }
  678. function modalclick(e) {
  679.     e = e || window.event;
  680.     if (modalActive==1)
  681.         return false;
  682. }
  683. function menuModalClick(e) {
  684.     e = e || window.event;
  685.     var obj = document.getElementById('pmenu'); var z;
  686.     refScreen.onmousedown=null;
  687.     closeMenu();
  688. }
  689. function closeMenu(c) {
  690.     if (!document.getElementById('pmenu'))
  691.         return;
  692.     var obj=document.getElementById('pmenu');
  693.     var z;
  694.     if (c != 201)
  695.         menuActive=0;
  696.     obj.style.visibility='hidden';
  697.     while (obj.firstChild) { z=obj.removeChild(obj.firstChild); z=null; }
  698.     z=refScreen.removeChild(obj); z=null;
  699.     if (menuBarS) {
  700.         menuBarS.style.backgroundColor='#FFFFFF';
  701.         menuBarS.style.color='#000000';
  702.         menuBarS=null;
  703.     }
  704. }
  705. function globalClick() {
  706.     if (iconSelected == 1)
  707.         minIconUnselect();
  708. }
  709. function startProgMan() {
  710.     refScreen = document.getElementById('screen');
  711.     refModal = document.getElementById('modal');
  712.     refScreen.style.width = parseInt(document.documentElement.clientWidth) + 'px';
  713.     refScreen.style.height = parseInt(document.documentElement.clientHeight) + 'px';
  714.     refModal.style.left = refScreen.offsetLeft + 'px';
  715.     refModal.style.top = refScreen.offsetTop + 'px';
  716.     refModal.style.width = refScreen.style.width;
  717.     refModal.style.height = refScreen.style.height;
  718.     refScreen.style.visibility = 'visible';
  719.     var a=setCoords(.85,.80,0.055,.07);
  720.     newWindow('Program Manager', 0, 'progman', a[0], a[1], a[2], a[3], 0, 3, progManClose,0,progManResize);
  721.     refProgman=document.getElementById('progman');
  722.     highestZGroup=0;
  723.     addMenuBar(progManMenuStructure,['File','Windows','Help'],document.getElementById('progman_bt'),progManMenu,'progman');
  724.     var z=document.getElementById('progman_bt');
  725.     z.style.position='relative';
  726.     var y=document.createElement('div');
  727.     y.setAttribute('class','alistoficons');
  728.     y.setAttribute('className','alistoficons');
  729.     y.setAttribute('id','progman_groups');
  730.     var x=document.createElement('table');
  731.     x.setAttribute('id','progman_groups_table');
  732.     y.appendChild(x);
  733.     z.appendChild(y);
  734.     progManGroupsAdd('progman',proggroups,progManGroupsDblClick,progManGroupsClick);
  735.     showWindow('progman');
  736.     window.onresize=browserResized;
  737.     //Desktop wallpaper
  738.     var f=readCookie('desktopwallpaper');
  739.     if (f) {
  740.         f=unescape(f);
  741.         var g=f.split('~');
  742.         var zz='no-repeat'; var yy='center center';
  743.         if (g[1] == '1') {
  744.             zz='repeat';
  745.             yy='top left';
  746.         }
  747.             getFile(g[0],function (c,f,i,f2) { progManStartDesktop(c,f,i,f2,zz,yy); });
  748.     }
  749.     //Pre-load images
  750.     var img0=new Image();
  751.     img0.src='/images/icons/buttons1.png';
  752.     var img1=new Image();
  753.     img1.src='/images/icons/buttons2.png';
  754.     var img2=new Image();
  755.     img2.src='/images/icons/iconstrip.gif';
  756.     var img3=new Image();
  757.     img3.src='/images/icons/misc.gif';
  758.     var img4=new Image();
  759.     img4.src='/images/icons/scrollbar.png';
  760.     var img5=new Image();
  761.     img5.src='/images/icons/smallstrip.png';
  762. }
  763. function progManStartDesktop(contents,found,isexec,f,zz,yy) {
  764.     if (found != 1) {
  765.         document.cookie='desktopwallpaper=; expires=Fri, 3 Aug 2001 12:12:12 GMT; path=/';
  766.         return;
  767.     }
  768.     var a=new Function(contents);
  769.     var tf=a();
  770.     refScreen.style.backgroundImage='url('+tf+')';
  771.     refScreen.style.backgroundPosition=yy;
  772.     refScreen.style.backgroundRepeat=zz;
  773. }
  774. function browserResized() {
  775.     var w=document.documentElement.clientWidth;
  776.     var h=document.documentElement.clientHeight;
  777.     if (parseInt(refScreen.style.width) != w)
  778.         refScreen.style.width=w+'px';
  779.     if (parseInt(refScreen.style.height) != h)
  780.         refScreen.style.height=h+'px';
  781. }
  782. function progManGroupsAdd(tt,gr,dblcb,singcb) {
  783.     var z;
  784.     var d=document.getElementById(tt+'_groups_table');
  785.     while (d.firstChild) { z=d.removeChild(d.firstChild); z=null; }
  786.     d.parentNode.setAttribute('tag',-1);
  787.     var etb=document.createElement('tbody');
  788.     var etr=document.createElement('tr');
  789.     var cr=0;
  790.     var ll=Math.floor(parseInt(document.getElementById(tt+'_bt').style.width)/84)-1;
  791.     for (var i=0;i<gr.length;i++) {
  792.         ediv=document.createElement('td');
  793.         ediv.onmousedown=function (e) { e=e||window.event; e.cancelBubble=true; return false; };
  794.         ediv.setAttribute('class','minimizedicon');
  795.         ediv.setAttribute('className','minimizedicon');
  796.         ediv.setAttribute('id',tt+'_groups_icon'+i);
  797.         ediv.setAttribute('tag',i);
  798.         ediv.style.width='84px';
  799.         eimg=document.createElement('div');
  800.         eimg.setAttribute("class","minicon");
  801.         eimg.setAttribute("className","minicon");
  802.         eimg.setAttribute("tag",i);
  803.         eimg.style.backgroundPosition='-'+parseInt(32*gr[i][1])+'px 0px';
  804.         eimg.onclick=singcb;
  805.         eimg.ondblclick=dblcb;
  806.         ediv.appendChild(eimg);
  807.         espan=document.createElement('div');
  808.         espan.setAttribute("tag", i);
  809.         espan.setAttribute("class", "mintext");
  810.         espan.setAttribute("className", "mintext");
  811.         espan.onselectstart = new Function("return false;");
  812.         espan.onmousedown = blockDefault;
  813.         espan.appendChild(document.createTextNode(gr[i][0]));
  814.         espan.onclick=singcb;
  815.         espan.ondblclick=dblcb;
  816.         ediv.appendChild(espan);
  817.         etr.appendChild(ediv);
  818.         cr++;
  819.         if (cr>ll) {
  820.             etb.appendChild(etr);
  821.             etr=document.createElement('tr');
  822.             cr=0;
  823.         }
  824.     }
  825.     etb.appendChild(etr);
  826.     d.appendChild(etb);
  827. }
  828. function progManGroupsClick(e) {
  829.     e = e || window.event; var o;
  830.     var z=this.parentNode.parentNode.parentNode.parentNode.parentNode;
  831.     bringTopmost(refProgman);
  832.     var m=z.getAttribute('tag');
  833.     if (m != '-1') {
  834.         o=document.getElementById(z.id+'_icon'+m).childNodes[1];
  835.         o.style.backgroundColor='#FFFFFF';
  836.         o.style.color='#000000';
  837.     }
  838.     o=this.parentNode.childNodes[1];
  839.     o.style.backgroundColor='#000080';
  840.     o.style.color='#FFFFFF';
  841.     z.setAttribute('tag',this.getAttribute('tag'));
  842.     if (document.getElementById('pmenu'))
  843.         closeMenu();
  844.     e.cancelBubble=true;
  845.     return false;
  846. }
  847. function progManGroupsDblClick(ovr,ovr2) {
  848.     if (ovr == 1)
  849.         var z=ovr2;
  850.     else
  851.         var z=this.parentNode.getAttribute('tag');
  852.     var y='progman_groupw_'+proggroups[z][2];
  853.     for (var i=0;i<windowCount;i++) {
  854.         if (windows[i][4] == y) {
  855.             bringTopmostGroup(document.getElementById(y));
  856.             showWindow(y);
  857.             windows[i][3]=0;
  858.             return false; }
  859.     }
  860.     var p=refProgman;
  861.     var a=Math.floor(parseInt(p.style.width)*.7);
  862.     var b=Math.floor(parseInt(p.style.height)*.5);
  863.     var nm='progman_groupw_'+proggroups[z][2];
  864.     newWindow(proggroups[z][0],3,nm,a,b,parseInt(p.style.left)+50+Math.floor(Math.random()*40),parseInt(p.style.top)+70+Math.floor(Math.random()*40),0,3,progManGroupClose,0,progManGroupResize,1);
  865.     zz=document.getElementById(nm);
  866.     var y=document.createElement('div');
  867.     y.setAttribute('class','alistoficons');
  868.     y.setAttribute('className','alistoficons');
  869.     y.setAttribute('id',nm+'_groups');
  870.     y.style.top='38px';
  871.     y.onmousedown=boxnestCancel2;
  872.     var x=document.createElement('table');
  873.     x.setAttribute('id',nm+'_groups_table');
  874.     y.appendChild(x);
  875.     zz.appendChild(y);
  876.     zz.setAttribute('tag_groupnum',z);
  877.     progManGroupsAdd(nm,grouplists[z],groupWindowDblClick,progManGroupsClick);
  878.     showWindow(nm);
  879. }
  880. function groupWindowDblClick(ovr,ovr2) {
  881.     var z=this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
  882.     var g=z.getAttribute('tag_groupnum');
  883.     var i=this.getAttribute('tag');
  884.     executeFile(grouplists[g][i][2]);
  885. }
  886. function progManGroupClose(i) { destroyGroupWindow(windows[i][4]); }
  887. function progManGroupResize(w) {
  888.     var a=document.getElementById(w.id+'_groups_table').getElementsByTagName('tr')[0].getElementsByTagName('td').length;
  889.     var b=parseInt(document.getElementById(w.id+'_bt').style.width)
  890.     if (a*85>=b || ((a+1)*85<b && (a+2)*85>=b))
  891.         progManGroupsAdd(w.id,grouplists[w.getAttribute('tag_groupnum')],groupWindowDblClick,progManGroupsClick);
  892. }
  893. function progManResize() {
  894.     var a=document.getElementById('progman_groups_table').getElementsByTagName('tr')[0].getElementsByTagName('td').length;
  895.     var b=parseInt(document.getElementById('progman_bt').style.width)
  896.     if (a*85>=b || ((a+1)*85<b && (a+2)*85>=b))
  897.         progManGroupsAdd('progman',proggroups,progManGroupsDblClick,progManGroupsClick);
  898.     var h=parseInt(refProgman.style.height);
  899.     var w=parseInt(refProgman.style.width);
  900.     var z;
  901.     for (var i=0;i<windowCount;i++) {
  902.         if (windows[i][4].indexOf('progman_groupw_')==0) {
  903.             z=document.getElementById(windows[i][4]);
  904.             if (parseInt(z.style.top)+parseInt(z.style.height)>h-8) {                       z.style.height=(h-parseInt(z.style.top)-8)+'px';
  905.                 if (parseInt(z.style.height)<125) { progManGroupClose(i); return; }
  906.             resizeBoxText(z,document.getElementById(windows[i][4]+'_bt')); progManGroupResize(z); }
  907.             if (parseInt(z.style.left)+parseInt(z.style.width)>w-8) {
  908.                 z.style.width=(w-parseInt(z.style.left)-8)+'px';
  909.                 if (parseInt(z.style.width)<125) { progManGroupClose(i); return; }
  910.             resizeBoxText(z,document.getElementById(windows[i][4]+'_bt')); progManGroupResize(z); }
  911.             if (windows[i][9] == 1) {
  912.                 z.style.width = (w-6) + 'px';
  913.                 z.style.height =    (h-document.getElementById('progman_menubar').offsetHeight-33) + 'px';
  914.                 z.style.top = document.getElementById('progman_menubar').offsetHeight+25+'px';
  915.                 z.style.left = '-2px';
  916.                 resizeBoxText(z,document.getElementById(windows[i][4]+'_bt'));
  917.                 progManGroupResize(z);
  918.             }
  919.         }
  920.     }
  921. }
  922. function aboutProgramManager() {
  923.     var a = centerWindow(500,350);
  924.     createModalWindow('About Program Manager','progmanabout', 500,350,a[0],75,progManAboutClose,0);
  925.     var b=document.getElementById('progmanabout_bt');
  926.     b.innerHTML='<img class="miscicon" src="/images/colors/clearpixel.gif" style="float: left; width: 64px; height: 64px; background-position: 0px 0px" /><a href="#" class="button" style="float: right; width: 80px" onclick="this.blur(); destroyModalWindow(\'progmanabout\'); return false"><span>OK</span></a><div style="margin-left: 70px; padding-right: 80px">michaelv.org Program Manager<br />Version 3.1<br /><br />Best viewed in Firefox 3.<br />IE 8, 7, and 6 acceptable.<br />Resolution of 1024x768 or greater recommended.<br /><br /><br />' + (navigator.javaEnabled() ? 'Java ' : '') + (navigator.cookieEnabled ? '+ Cookie ' : '') + 'Enhanced Mode<br />System Resources:<span style="padding-left: 20px">314% Free</span></div>';
  927.     showWindow('progmanabout');
  928. }
  929. function progManAboutClose() { destroyModalWindow('progmanabout'); }
  930. function aboutThisProgram(title,icon,txt) {
  931.     var a = centerWindow(500,300);
  932.     createModalWindow('About '+title,'sysappabout', 500,300,a[0],75,sysAboutAppClose,0);
  933.     var b=document.getElementById('sysappabout_bt');
  934.     b.innerHTML='<img class="icon" src="/images/colors/clearpixel.gif" style="float: left; width: 32px; height: 32px; margin: 0px 0px 0px 10px; background-position: -'+parseInt(icon*32)+'px 0px" /><a href="#" class="button" style="float: right; width: 80px" onclick="this.blur(); destroyModalWindow(\'sysappabout\'); return false"><span>OK</span></a><div style="margin-left: 70px; padding-right: 80px">'+txt+'<br />Version 3.1<br /><br />Best viewed in Firefox 3.<br />IE 8, 7, 6 acceptable.<br />Resolution of 1024x768 or greater recommended.</div>';
  935.     showWindow('sysappabout');
  936. }
  937. function sysAboutAppClose() { destroyModalWindow('sysappabout'); }
  938. function progManMenu(x,y) {
  939.     x=parseInt(x);y=parseInt(y);
  940.     if (x==0) {
  941.         switch (y) {
  942.         case 0:
  943.             openRunDialog(); break;
  944.         case 1:
  945.             closeWindow('progman'); break;
  946.         }
  947.     }
  948.     if (x==1) {
  949.         if (y>progManGroupsCount)
  950.             progManWindowDisplay(y);
  951.         else
  952.             progManGroupsDblClick(1,y);
  953.     }
  954.     if (x==2) { aboutProgramManager(); }
  955. }
  956. function progManWindowDisplay(y) {
  957.     var i=findWindow(progManMenuStructure[1][y][2])
  958.     if (i==-1)
  959.         return;
  960.     var id=windows[i][4];
  961.     if (windows[i][3]==1) {
  962.  
  963.         showWindow(id);
  964.         bringTopmost(document.getElementById(id));
  965.         windows[i][3]=0;
  966.         drawDesktop();
  967.     } else {
  968.         bringTopmost(document.getElementById(id));
  969.     }      
  970. }
  971. function findWindowByName(n) {
  972.     for (var i=0;i<windowCount;i++) {
  973.         if (windows[i][0]==n)
  974.             return i;
  975.     }
  976.     return -1;
  977. }
  978. function filePickerKey(e) {
  979.     e = e || window.event;
  980.     if (e.keyCode == 27)
  981.         filePickerClose();
  982.     if (e.keyCode == 13)
  983.         filePickerDecision();
  984. }
  985. function filePickerDecision() {
  986.     var t;
  987.     if (filePickerFile == '') {
  988.         t=document.getElementById('filepicker_file');
  989.         if (t.value != '') {
  990.             filePickerFilter=t.value;
  991.             if (filePickerFilter.indexOf('*')==-1 && filePickerFilter.indexOf('?')==-1)
  992.                 filePickerCD(filePickerPath,1);
  993.             else
  994.                 filePickerCD(filePickerPath);
  995.         }
  996.     } else {
  997.         filePickerClose(1);
  998.     }
  999. }
  1000. function filePickerStart(m,c,p,f,ref) {
  1001.     modalPreviousZ=m; //0 if no modal already open
  1002.     filePickerCB=c;
  1003.     filePickerPath=p;
  1004.     filePickerFilter=f; filePickerFile='';
  1005.     r=document.getElementById(ref); createModalWindow('Open','filepicker',580,270,parseInt(r.style.left)+50,parseInt(r.style.top)+70,filePickerClose,0);
  1006.     var b=document.getElementById('filepicker_bt');
  1007.     b.style.cursor='default';
  1008.     b.onkeydown=filePickerKey;
  1009.     b.innerHTML='<div><div style="float: left">File name:<br /><input type="text" class="text" name="filepicker_file" id="filepicker_file" value="'+f+'" style="width: 164px" /><div style="width: 170px; border: 1px solid black; margin-top: 7px" onselectstart="return false"><div class="scrollbar" style="height: 150px" id="filepicker_files_scrollbar"></div><div style="height: 150px; overflow: hidden" id="filepicker_files_scrollme"></div></div></div><div style="float: right"><a href="#" class="button" id="filepicker_ok" style="float: none; width: 90px; margin-bottom: 7px;" onclick="this.blur(); filePickerDecision(); return false"><span>OK</span></a><a href="#" class="button" style="float: none; width: 90px; margin-bottom: 7px" onclick="this.blur(); filePickerClose(); return false"><span>Cancel</span></a></div><div style="margin-left: 200px;">Directories:<br /><span id="filepicker_dlabel"></span><div style="width: 220px; border: 1px solid black; margin-top: 11px" onselectstart="return false"><div class="scrollbar" style="height: 160px" id="filepicker_dirs_scrollbar"></div><div style="height: 160px; overflow: hidden" id="filepicker_dirs_scrollme"></div></div></div></div>';
  1010.     initializeScrollbar('filepicker_files');
  1011.     initializeScrollbar('filepicker_dirs');
  1012.     filePickerCD(p);
  1013.     showWindow('filepicker');
  1014.     document.getElementById('filepicker_file').focus();
  1015.     document.getElementById('filepicker_file').select();
  1016. }
  1017. function filePickerCD(d,ovr) {
  1018.     filePickerFileSelected=-1; filePickerDirSelected=-1;
  1019.     var w=document.getElementById('filepicker_dlabel');
  1020.     if (d == '')
  1021.         w.innerHTML='c:\\';
  1022.     else
  1023.         w.innerHTML='c:'+d;
  1024.     filePickerPath=d;
  1025.     var xmlhttp;
  1026.     if (window.XMLHttpRequest)
  1027.         xmlhttp=new XMLHttpRequest();
  1028.     else if (window.ActiveXObject)
  1029.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  1030.     if (ovr == 1) {
  1031.         xmlhttp.open('GET','/apps/ls.php?dir='+escape(filePickerPath)+'&filter='+escape(filePickerFilter)+'&lh=1',true);
  1032.         xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState==4 && xmlhttp.status==200) filePickerDirList(xmlhttp.responseXML,1); };
  1033.     } else {
  1034.         xmlhttp.open('GET','/apps/ls.php?dir='+escape(filePickerPath)+'&filter='+escape(filePickerFilter),true);
  1035.         xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState==4 && xmlhttp.status==200) filePickerDirList(xmlhttp.responseXML); };
  1036.     }
  1037.     xmlhttp.send(null);
  1038. }
  1039. function filePickerDirList(o,ovr) {
  1040.     var a=o.getElementsByTagName('files'); var z; var st='';
  1041.     var b=document.getElementById('filepicker_files_scrollme');
  1042.     while (b.firstChild) { z=b.removeChild(b.firstChild); z=null; }
  1043.     b.scrollTop=0;
  1044.     for (var i=0;i<a[0].childNodes.length;i++) {
  1045.         z=document.createElement('div');
  1046.         z.setAttribute('class','comboitem');
  1047.         z.setAttribute('className','comboitem');
  1048.                 z.setAttribute('tag',a[0].childNodes[i].firstChild.firstChild.nodeValue.toLowerCase());
  1049.         z.setAttribute('tag2',i);
  1050.         z.appendChild(document.createTextNode(a[0].childNodes[i].firstChild.firstChild.nodeValue.toLowerCase()));
  1051.         z.onclick=filePickerfileClick; z.ondblclick=filePickerfileDblClick;
  1052.         z.onmousedown=cancelme;
  1053.         z.onselectstart=function () { return false; };
  1054.         z.style.width=b.style.width;
  1055.         b.appendChild(z);
  1056.     }
  1057.     updateScrollbar('filepicker_files','filepicker',40,20);
  1058.     b=document.getElementById('filepicker_dirs_scrollme');
  1059.     while (b.firstChild) { z=b.removeChild(b.firstChild); z=null; }
  1060.     b.scrollTop=0;
  1061.     var dl=filePickerPath.split('\\');
  1062.     var indent=0; var y;
  1063.     for (var i=0;i<dl.length;i++) {
  1064.         z=document.createElement('div');
  1065.         z.setAttribute('class','comboitem');
  1066.         z.setAttribute('className','comboitem');
  1067.         st=st+'\\'+dl[i].toLowerCase();
  1068.         if (dl[i] == '')
  1069.             st='';
  1070.         z.setAttribute('tag',st);
  1071.         y=document.createElement('img');
  1072.         y.setAttribute('class','miscicon');
  1073.         y.setAttribute('className','miscicon');
  1074.         y.setAttribute('src','/images/colors/clearpixel.gif');
  1075.         y.style.width='18px'; y.style.height='12px';
  1076.         if (i == dl.length-1)
  1077.             y.style.backgroundPosition='-64px -12px';
  1078.         else
  1079.             y.style.backgroundPosition='-64px 0px';
  1080.         y.style.paddingRight='2px';
  1081.         z.setAttribute('tag2',i);
  1082.         z.style.padding='1px 0px 1px 4px';
  1083.         z.style.paddingLeft=indent+4+'px';
  1084.         z.appendChild(y);
  1085.         if (dl[i] == '')
  1086.             z.appendChild(document.createTextNode('c:\\'));
  1087.         else
  1088.             z.appendChild(document.createTextNode(dl[i].toLowerCase()));
  1089.         z.style.width=b.style.width;
  1090.         z.onclick=filePickerDirClick; z.ondblclick=filePickerDirDblClick;
  1091.         z.onmousedown=cancelme; z.onselectstart=function () { return false; };
  1092.         b.appendChild(z);
  1093.         indent += 4;
  1094.     }
  1095.     a=o.getElementsByTagName('dirs');
  1096.     for (var i=0;i<a[0].childNodes.length;i++) {
  1097.         z=document.createElement('div');
  1098.         z.setAttribute('class','comboitem');
  1099.         z.setAttribute('className','comboitem');
  1100.         z.setAttribute('tag',filePickerPath+'\\'+a[0].childNodes[i].firstChild.firstChild.nodeValue.toLowerCase());
  1101.         y=document.createElement('img');
  1102.         y.setAttribute('class','miscicon');
  1103.         y.setAttribute('className','miscicon');
  1104.         y.setAttribute('src','/images/colors/clearpixel.gif');
  1105.         y.style.width='18px'; y.style.height='12px';
  1106.         y.style.backgroundPosition='-64px -24px';
  1107.         y.style.paddingRight='2px';
  1108.         z.setAttribute('tag2',i+dl.length);
  1109.         z.style.padding='1px 0px 1px 4px';
  1110.         z.style.paddingLeft=indent+4+'px';
  1111.         z.appendChild(y);
  1112.         z.appendChild(document.createTextNode(a[0].childNodes[i].firstChild.firstChild.nodeValue.toLowerCase()));
  1113.         z.style.width=b.style.width;
  1114.         z.onclick=filePickerDirClick; z.ondblclick=filePickerDirDblClick;
  1115.         z.onmousedown=cancelme; z.onselectstart=function () { return false; };
  1116.         b.appendChild(z);
  1117.     }
  1118.     updateScrollbar('filepicker_dirs','filepicker',25,10);
  1119.     if (ovr == 1) {
  1120.         y=document.getElementById('filepicker_files_scrollme');
  1121.         if (y.childNodes.length == 1) {
  1122.             filePickerFile=y.childNodes[0].firstChild.nodeValue;
  1123.             filePickerClose(1); }
  1124.     }
  1125. }
  1126. function cancelme(e) {
  1127.     e = e || window.event;
  1128.     e.cancelBubble=true;
  1129.     blockDefault(e);
  1130.     return false;
  1131. }
  1132. function filePickerDirClick() {
  1133.     if (filePickerDirSelected != -1) {
  1134.         var a=this.parentNode.childNodes[filePickerDirSelected];
  1135.         a.style.backgroundColor='#FFFFFF';
  1136.         a.style.color='#000000';
  1137.     }
  1138.     this.style.backgroundColor='#000080';
  1139.     this.style.color='#FFFFFF';
  1140.     filePickerDirSelected=this.getAttribute('tag2');
  1141.     return false;
  1142. }
  1143. function filePickerDirDblClick(e) {
  1144.     filePickerPath=this.getAttribute('tag');
  1145.     filePickerCD(filePickerPath);
  1146. }
  1147. function filePickerfileDblClick() {
  1148.     filePickerClose(1);
  1149. }
  1150. function filePickerfileClick() {
  1151.     if (filePickerFileSelected != -1) {
  1152.         var a=this.parentNode.childNodes[filePickerFileSelected];
  1153.         a.style.backgroundColor='#FFFFFF';
  1154.         a.style.color='#000000';
  1155.     }
  1156.     this.style.backgroundColor='#000080';
  1157.     this.style.color='#FFFFFF';
  1158.     filePickerFileSelected=this.getAttribute('tag2');
  1159.     document.getElementById('filepicker_file').value=this.getAttribute('tag');
  1160.     filePickerFile=this.getAttribute('tag');
  1161.     return false;
  1162. }
  1163. function updateScrollbar(sb,topl,maj,min) {
  1164.     var content=document.getElementById(sb+'_scrollme');
  1165.     var sbar=document.getElementById(sb+'_scrollbar');
  1166.     if (parseInt(content.scrollHeight)>parseInt(content.clientHeight)) {
  1167.         enableScrollbar(sb,topl,maj,min);
  1168.     } else {
  1169.         disableScrollbar(sb);
  1170.     }
  1171. }
  1172. function scrollDown(t,sb,am,ov) {
  1173.     var tar=document.getElementById(t);
  1174.     var o=parseInt(tar.scrollTop);
  1175.     var b=parseInt(tar.clientHeight);
  1176.     var c=parseInt(tar.scrollHeight);
  1177.     if (o+am<0)
  1178.         am=-o;
  1179.     if (o+am+b>c)
  1180.         am=c-b-o;
  1181.     scrollTo(t,o+am,sb);
  1182.     if (ov != 1)
  1183.     scrollTimer=window.setTimeout("scrollDown('"+t+"','"+sb+"',"+am+")",scrollTimer ? 100 : 300);
  1184. }
  1185. function scrollTo(t,pt,sb,ov) {
  1186.     var a=document.getElementById(t);
  1187.     a.scrollTop=pt;
  1188.     var b=document.getElementById(sb+'_scrollmc');
  1189.     var c=document.getElementById(sb+'_sbmiddle');
  1190.     var h=parseInt(b.offsetHeight)-25;
  1191.     if (ov != 1)
  1192.         c.style.top=Math.floor(pt/(a.scrollHeight-a.clientHeight)*h)+'px';
  1193. }
  1194. function trackerBarClick(e,t,sb,am,topl) {
  1195.     e = e || window.event;
  1196.     var a=document.getElementById(topl);
  1197.     var b=document.getElementById(sb+'_sbmiddle');
  1198.     var c=parseInt(a.style.top)+parseInt(b.offsetTop)+parseInt(b.offsetParent.offsetTop)+4;
  1199.     if (document.getElementById(sb+'_menubar'))
  1200.         c+=57;
  1201.     if (parseInt(e.clientY) < c)
  1202.         scrollDown(t,sb,-am,1);
  1203.     else
  1204.         scrollDown(t,sb,am,1);
  1205. }
  1206. function startScrollDrag(e,sb) {
  1207.     e = e || window.event;
  1208.     var zz=document.getElementById(sb+'_sbmiddle');
  1209.     scrollObj=zz;
  1210.     scrollY=parseInt(e.clientY);
  1211.     scrollSave=parseInt(zz.style.top);
  1212.     refScreen.onmouseup=scrollUp;
  1213.     e.cancelBubble=true;
  1214.     blockDefault(e);
  1215.     return false;
  1216. }
  1217. function scrollUp(e) {
  1218.     if (scrollY != -1)
  1219.     {
  1220.         scrollY=-1;
  1221.         scrollObj.style.backgroundPosition="-144px 0px";
  1222.         refScreen.onmouseup=null;
  1223.     }
  1224. }
  1225. function scrollDrag(e,t,sb) {
  1226.     e = e || window.event; var z; var y; var x; var w;
  1227.     if (getMouseButton(e.button) == 0 && scrollY != -1) {
  1228.         z=e.clientY-scrollY+scrollSave;
  1229.         if (z < 0)
  1230.             z=0;
  1231.         y=parseInt(document.getElementById(sb+'_scrollmc').style.height)-25;
  1232.         if (z > y)
  1233.             z=y;
  1234.         t.style.top=z+'px';
  1235.         w=document.getElementById(sb+'_scrollme');
  1236.         x=Math.floor(z*(w.scrollHeight-w.clientHeight)/y);
  1237.         scrollTo(sb+'_scrollme',x,sb,1);
  1238.     }
  1239. }
  1240. function enableScrollbar(sb,topl,maj,min) {
  1241.     var a=document.getElementById(sb+'_scrollmc');
  1242.     //if (a.style.backgroundColor=='#FFFFFF')
  1243.     //  return;
  1244.     a.onmousedown=new Function('e','trackerBarClick(e,"'+sb+'_scrollme","'+sb+'",'+maj+',"'+topl+'")');
  1245.     a.onmousemove=function (e) { if (scrollY != -1) scrollDrag(e,document.getElementById(sb+'_sbmiddle'),sb); };
  1246.     a.style.backgroundColor='#C0C0C0';
  1247.     a=document.getElementById(sb+'_sbtop');
  1248.     a.onmousedown=new Function('this.style.backgroundPosition="-24px 0px"; scrollDown("'+sb+'_scrollme","'+sb+'",-'+min+')');
  1249.     a.onmouseout=new Function("cancelScrolling(); this.style.backgroundPosition='0px 0px';");
  1250.     a.onmouseup=new Function("cancelScrolling(); this.style.backgroundPosition='0px 0px';");
  1251.     a.style.backgroundPosition='0px 0px';
  1252.     a=document.getElementById(sb+'_sbmiddle');
  1253.     a.onmousedown=function (e) { this.style.backgroundPosition="-168px 0px"; startScrollDrag(e,sb);};
  1254.     a.style.visibility='visible';
  1255.     a=document.getElementById(sb+'_sbbottom');
  1256.     a.onmousedown=new Function('this.style.backgroundPosition="-72px 0px"; scrollDown("'+sb+'_scrollme","'+sb+'",'+min+')');
  1257.     a.onmouseout=new Function("cancelScrolling(); this.style.backgroundPosition='-48px 0px';");
  1258.     a.onmouseup=new Function("cancelScrolling(); this.style.backgroundPosition='-48px 0px';");
  1259.     a.style.backgroundPosition='-48px 0px';
  1260. }
  1261. function disableScrollbar(sb) {
  1262.     var a=document.getElementById(sb+'_sbtop');
  1263.     a.onmousedown=null; a.onmouseout=null; a.onmouseup=null;
  1264.     a.style.backgroundPosition='-96px 0px';
  1265.     a=document.getElementById(sb+'_scrollmc');
  1266.     a.onmousedown=null; a.onmousemove=null;
  1267.     a.style.backgroundColor='#FFFFFF';
  1268.     a=document.getElementById(sb+'_sbmiddle');
  1269.     a.onmousedown=null;
  1270.     a.style.visibility='hidden';
  1271.     a=document.getElementById(sb+'_sbbottom');
  1272.     a.onmousedown=null; a.onmouseout=null; a.onmouseup=null;
  1273.     a.style.backgroundPosition='-120px 0px';
  1274. }
  1275. function initializeScrollbar(sb) {
  1276.     var sbar=document.getElementById(sb+'_scrollbar');
  1277.     var a=document.createElement('div');
  1278.     a.setAttribute("class","sbtop");
  1279.     a.setAttribute("className","sbtop");
  1280.     a.setAttribute("id",sb+'_sbtop');
  1281.     sbar.appendChild(a);
  1282.     var b=document.createElement('div');
  1283.     b.setAttribute("class","sbmiddle");
  1284.     b.setAttribute("className","sbmiddle");
  1285.     b.setAttribute("id",sb+'_sbmiddle');
  1286.     b.style.top='0px';
  1287.     a=document.createElement('div');
  1288.     a.setAttribute("class","scrollmc");
  1289.     a.setAttribute("className","scrollmc");
  1290.     a.setAttribute("id",sb+'_scrollmc');
  1291.     a.style.height=parseInt(sbar.offsetHeight)-48+'px';
  1292.     a.appendChild(b);
  1293.     sbar.appendChild(a);
  1294.     a=document.createElement('div');
  1295.     a.setAttribute("class","sbbottom");
  1296.     a.setAttribute("className","sbbottom");
  1297.     a.setAttribute("id",sb+'_sbbottom');
  1298.     sbar.appendChild(a);
  1299. }
  1300. function cancelScrolling() {
  1301.     if (scrollTimer != null)
  1302.     window.clearTimeout(scrollTimer);
  1303.     scrollTimer=null;
  1304. }
  1305. function cancelScrollingH() {
  1306.     if (scrollTimer != null)
  1307.     window.clearTimeout(scrollTimer);
  1308.     scrollTimer=null;
  1309. }
  1310. function initializeScrollbarH(sb) {
  1311.     var sbar=document.getElementById(sb+'_scrollbarh');
  1312.     var a=document.createElement('div');
  1313.     a.setAttribute("class","sbleft");
  1314.     a.setAttribute("className","sbleft");
  1315.     a.setAttribute("id",sb+'_sbleft');
  1316.     sbar.appendChild(a);
  1317.     var b=document.createElement('div');
  1318.     b.setAttribute("class","sbmiddleh");
  1319.     b.setAttribute("className","sbmiddleh");
  1320.     b.setAttribute("id",sb+'_sbmiddleh');
  1321.     b.style.left='0px';
  1322.     a=document.createElement('div');
  1323.     a.setAttribute("class","sbright");
  1324.     a.setAttribute("className","sbright");
  1325.     a.setAttribute("id",sb+'_sbright');
  1326.     sbar.appendChild(a);
  1327.     a=document.createElement('div');
  1328.     a.setAttribute("class","scrollmch");
  1329.     a.setAttribute("className","scrollmch");
  1330.     a.setAttribute("id",sb+'_scrollmch');
  1331.     a.style.width=parseInt(sbar.offsetWidth)-48+'px';
  1332.     a.appendChild(b);
  1333.     sbar.appendChild(a);
  1334. }
  1335. function updateScrollbarH(sb,topl,maj,min) {
  1336.     var content=document.getElementById(sb+'_scrollme');
  1337.     var sbar=document.getElementById(sb+'_scrollbarh');
  1338.     if (parseInt(content.scrollWidth)>parseInt(content.clientWidth)) {
  1339.         enableScrollbarH(sb,topl,maj,min);
  1340.     } else {
  1341.         disableScrollbarH(sb);
  1342.     }
  1343. }
  1344. function scrollDownH(t,sb,am,ov) {
  1345.     var tar=document.getElementById(t);
  1346.     var o=parseInt(tar.scrollLeft);
  1347.     var b=parseInt(tar.clientWidth);
  1348.     var c=parseInt(tar.scrollWidth);
  1349.     if (o+am<0)
  1350.         am=-o;
  1351.     if (o+am+b>c)
  1352.         am=c-b-o;
  1353.     scrollToH(t,o+am,sb);
  1354.     if (ov != 1)
  1355.     scrollTimer=window.setTimeout("scrollDownH('"+t+"','"+sb+"',"+am+")",scrollTimer ? 100 : 300);
  1356. }
  1357. function scrollToH(t,pt,sb,ov) {
  1358.     var a=document.getElementById(t);
  1359.     a.scrollLeft=pt;
  1360.     var b=document.getElementById(sb+'_scrollmch');
  1361.     var c=document.getElementById(sb+'_sbmiddleh');
  1362.     var h=parseInt(b.offsetWidth)-25;
  1363.     if (ov != 1)
  1364.         c.style.left=Math.floor(pt/(a.scrollWidth-a.clientWidth)*h)+'px';
  1365. }
  1366. function trackerBarClickH(e,t,sb,am,topl) {
  1367.     e = e || window.event;
  1368.     var a=document.getElementById(topl);
  1369.     var b=document.getElementById(sb+'_sbmiddleh');
  1370.     var c=parseInt(a.style.left)+parseInt(b.offsetLeft)+parseInt(b.offsetParent.offsetLeft+8);
  1371.     if (parseInt(e.clientX) < c)
  1372.         scrollDownH(t,sb,-am,1);
  1373.     else
  1374.         scrollDownH(t,sb,am,1);
  1375. }
  1376. function startScrollDragH(e,sb) {
  1377.     e = e || window.event;
  1378.     var zz=document.getElementById(sb+'_sbmiddleh');
  1379.     scrollObj=zz;
  1380.     scrollY=parseInt(e.clientX);
  1381.     scrollSave=parseInt(zz.style.left);
  1382.     refScreen.onmouseup=scrollUpH;
  1383.     e.cancelBubble=true;
  1384.     blockDefault(e);
  1385.     return false;
  1386. }
  1387. function scrollUpH(e) {
  1388.     if (scrollY != -1)
  1389.     {
  1390.         scrollY=-1;
  1391.         scrollObj.style.backgroundPosition="-144px -25px";
  1392.         refScreen.onmouseup=null;
  1393.     }
  1394. }
  1395. function scrollDragH(e,t,sb) {
  1396.     e = e || window.event; var z; var y; var x; var w;
  1397.     if (getMouseButton(e.button) == 0 && scrollY != -1) {
  1398.         z=e.clientX-scrollY+scrollSave;
  1399.         if (z < 0)
  1400.             z=0;
  1401.         y=parseInt(document.getElementById(sb+'_scrollmch').style.width)-25;
  1402.         if (z > y)
  1403.             z=y;
  1404.         t.style.left=z+'px';
  1405.         w=document.getElementById(sb+'_scrollme');
  1406.         x=Math.floor(z*(w.scrollWidth-w.clientWidth)/y);
  1407.         scrollToH(sb+'_scrollme',x,sb,1);
  1408.     }
  1409. }
  1410. function enableScrollbarH(sb,topl,maj,min) {
  1411.     var a=document.getElementById(sb+'_scrollmch');
  1412.     a.onmousedown=new Function('e','trackerBarClickH(e,"'+sb+'_scrollme","'+sb+'",'+maj+',"'+topl+'")');
  1413.     a.onmousemove=function (e) { if (scrollY != -1) scrollDragH(e,document.getElementById(sb+'_sbmiddleh'),sb); };
  1414.     a.style.backgroundColor='#C0C0C0';
  1415.     a=document.getElementById(sb+'_sbleft');
  1416.     a.onmousedown=new Function('this.style.backgroundPosition="-24px -25px"; scrollDownH("'+sb+'_scrollme","'+sb+'",-'+min+')');
  1417.     a.onmouseout=new Function("cancelScrollingH(); this.style.backgroundPosition='0px -25px';");
  1418.     a.onmouseup=new Function("cancelScrollingH(); this.style.backgroundPosition='0px -25px';");
  1419.     a.style.backgroundPosition='0px -25px';
  1420.     a=document.getElementById(sb+'_sbmiddleh');
  1421.     a.onmousedown=function (e) { this.style.backgroundPosition="-169px -25px"; startScrollDragH(e,sb);};
  1422.     a.style.visibility='visible';
  1423.     a=document.getElementById(sb+'_sbright');
  1424.     a.onmousedown=new Function('this.style.backgroundPosition="-72px -25px"; scrollDownH("'+sb+'_scrollme","'+sb+'",'+min+')');
  1425.     a.onmouseout=new Function("cancelScrollingH(); this.style.backgroundPosition='-48px -25px';");
  1426.     a.onmouseup=new Function("cancelScrollingH(); this.style.backgroundPosition='-48px -25px';");
  1427.     a.style.backgroundPosition='-48px -25px';
  1428. }
  1429. function disableScrollbarH(sb) {
  1430.     var a=document.getElementById(sb+'_sbleft');
  1431.     a.onmousedown=null; a.onmouseout=null; a.onmouseup=null;
  1432.     a.style.backgroundPosition='-96px -25px';
  1433.     a=document.getElementById(sb+'_scrollmch');
  1434.     a.onmousedown=null; a.onmousemove=null;
  1435.     a.style.backgroundColor='#FFFFFF';
  1436.     a=document.getElementById(sb+'_sbmiddleh');
  1437.     a.onmousedown=null;
  1438.     a.style.visibility='hidden';
  1439.     a=document.getElementById(sb+'_sbright');
  1440.     a.onmousedown=null; a.onmouseout=null; a.onmouseup=null;
  1441.     a.style.backgroundPosition='-120px -25px';
  1442. }
  1443. function filePickerClose(o) {
  1444.     destroyModalWindow('filepicker');
  1445.     if (modalPreviousZ != 0) {
  1446.         refModal.style.zIndex=modalPreviousZ;
  1447.         refModal.style.visibility='visible';
  1448.         modalPreviousZ=0;
  1449.     }
  1450.     if (o==1)
  1451.         filePickerCB(1,filePickerPath,filePickerFile);
  1452.     else
  1453.         filePickerCB(0,filePickerPath,filePickerFile);
  1454. }
  1455. function executeFile(f) {
  1456.     document.body.style.cursor='wait';
  1457.     var z=f.indexOf(' ');
  1458.     var fn; var args2='';
  1459.     if (z==-1)
  1460.         fn=f;
  1461.     else {
  1462.         fn=f.slice(0,z);
  1463.         args2=f.slice(z+1);
  1464.     }
  1465.     getFile(fn,executeFileCB,args2);
  1466. }
  1467. function executeDataCB(contents,found,isexec,f) {
  1468.     document.body.style.cursor='default';
  1469.     if (found != '1') {
  1470.         throwError('Application Execution Error','Cannot find file. Check to ensure the path and filename are correct and that all required libraries are available.');
  1471.         return;
  1472.     }
  1473.     f(contents);
  1474. }
  1475. function executeFileCB(contents,found,isexec,f2,args2) {
  1476.     document.body.style.cursor='default';
  1477.     if (found != '1') {
  1478.         throwError('Application Execution Error','Cannot find file. Check to ensure the path and filename are correct and that all required libraries are available.');
  1479.         return;
  1480.     }
  1481.     if (isexec != '1') {
  1482.         throwError('Application Execution Error','There is no program associated with this file.');
  1483.         return;
  1484.     }
  1485.     var func=new Function(contents);
  1486.     args=args2;
  1487.     func();
  1488. }
  1489. function getFile(f,cb,args2) {
  1490.     var g=f;
  1491.     f=f.toLowerCase();
  1492.     if (f.indexOf('c:') == 0)
  1493.         f=f.substr(2,f.length-2);
  1494.     if (f.indexOf('\\') != 0)
  1495.         f='\\windows\\'+f;
  1496.     var a=f.lastIndexOf('\\');
  1497.     var d=f.slice(0,a);
  1498.     f=f.slice(a+1);
  1499.     var xmlhttp;
  1500.     if (window.XMLHttpRequest)
  1501.         xmlhttp=new XMLHttpRequest();
  1502.     else if (window.ActiveXObject)
  1503.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  1504.     try {
  1505.     xmlhttp.open('GET','/apps/getfile.php?dir='+escape(d)+'&file='+escape(f),true);
  1506.     xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState==4 && xmlhttp.status==200) cb(xmlhttp.responseText,xmlhttp.getResponseHeader('X-Found'),xmlhttp.getResponseHeader('X-Executable'),g,args2); };
  1507.     xmlhttp.send(null);
  1508.     }
  1509.     catch (e) {
  1510.         cb('','0','0',args2);
  1511.     }
  1512. }
  1513. function populateRunDialog(fpcode,d,f) {
  1514.     var a=document.getElementById('rundialog_cmdline');
  1515.     if (fpcode == 1)
  1516.         a.value='C:'+d.toUpperCase()+'\\'+f.toUpperCase();
  1517. }
  1518. function openRunDialog() {
  1519.     var pm=refProgman;
  1520.     var bbb=createModalWindow('Run','rundialog', 450,150,parseInt(pm.style.left)+50,parseInt(pm.style.top)+75,runDialogClose,0);
  1521.     bbb.onkeydown = function (e) { e=e||window.event; if (e.keyCode==13) runDialogRun(); };
  1522.     var b=document.getElementById('rundialog_bt');
  1523.     b.style.cursor='default';
  1524.     b.innerHTML='<div style="float: right;"><a href="#" class="button" id="rundialog_ok" style="float: none; width: 90px; margin-bottom: 7px;" onclick="this.blur(); runDialogRun(); return false"><span>OK</span></a><a href="#" class="button" style="float: none; width: 90px; margin-bottom: 7px" onclick="this.blur(); runDialogClose(); return false"><span>Cancel</span></a><a href="#" class="button" id="rundialog_browse" style="float: none; width: 90px"><span>Browse...</span></a></div><div style="margin-top: 15px">Command Line:<br /><input type="text" class="text" name="rundialog_cmdline" id="rundialog_cmdline" value="" style="width: 300px" /></div>';
  1525.     document.getElementById('rundialog_browse').onclick=function () { this.blur(); filePickerStart(refModal.style.zIndex,populateRunDialog,'\\windows','*.exe','rundialog'); return false; };
  1526.     showWindow('rundialog');
  1527.     document.getElementById('rundialog_cmdline').focus();
  1528. }
  1529. function runDialogRun() {
  1530.     var z=document.getElementById('rundialog_cmdline').value;
  1531.     runDialogClose();
  1532.     executeFile(z);
  1533. }
  1534. function runDialogClose() { destroyModalWindow('rundialog'); }
  1535. function throwError(t,m) {
  1536.     var a = centerWindow(420,150);
  1537.     var bb=createModalWindow(t,'errdialog',420,150,a[0],a[1],throwErrDestroy,0);
  1538.     var b=document.getElementById('errdialog_bt');
  1539.     bb.onkeydown=function (e) { e=e||window.event; if (e.keyCode==27 || e.keyCode==13) destroyModalWindow('errdialog'); };
  1540.     b.innerHTML='<div style="float: left; margin-left: 10px; margin-top: 10px; background: url(/images/icons/iconstrip.gif) no-repeat -64px 0px; width: 32px; height: 32px"></div><div style="margin-left: 60px; height: 73px">'+m+'</div><div style="margin-left: 156px;"><a href="#" class="button" style="width: 75px" onclick="this.blur(); destroyModalWindow(\'errdialog\'); return false"><span>OK</span></a></div>';
  1541.     showWindow('errdialog');
  1542. }
  1543. function throwErrDestroy() { destroyModalWindow('errdialog'); }
  1544. function newWindow(title, icon, titlecode, width, height, left, top, maxed, cicons, cb, modal,resizecb,isprogmangrp) {
  1545.     //title: window title
  1546.     //icon: icon number (starts at 0)
  1547.     //titlecode: internal unique title (e.g. "progman")
  1548.     //width pixels
  1549.     //height pixels
  1550.     //maxed = 1 if maximized by default
  1551.     //cicons = 0 for none, 3 for min/max/restore, 1 for min only
  1552.     //cb = closing callback
  1553.     //modal = 1 if modal window
  1554.     //resizecb = resize callback
  1555.     //isprogmangrp = 1 if lives inside progman
  1556.     var obj = document.getElementById('screen');
  1557.     var obj_width = obj.offsetWidth;
  1558.     var obj_height = obj.offsetHeight;
  1559.     var obj_left = obj.offsetLeft;
  1560.     var obj_top = obj.offsetTop;
  1561.     if (isprogmangrp == 1) {
  1562.         obj = refProgman;
  1563.         obj_width=parseInt(obj.style.width);
  1564.         obj_height=parseInt(obj.style.height);
  1565.         obj_left=0;
  1566.         obj_top=0;
  1567.     }
  1568.     ediv = document.createElement("div");
  1569.     ediv.setAttribute("class","box");
  1570.     ediv.setAttribute("className","box");
  1571.     ediv.setAttribute("id", titlecode);
  1572.     ediv.setAttribute("tag2", maxed);
  1573.     ediv.onmousedown=bringTopmost;
  1574.     if ((cicons & 1) && (maxed == 0))
  1575.     {
  1576.         ediv.onmousedown = resizeDown;
  1577.         ediv.onmousemove = mouseMoveBox;
  1578.         ediv.onmouseup = resizeUp;
  1579.     }
  1580.     ediv2 = document.createElement("div");
  1581.     ediv2.setAttribute("class","boxnest");
  1582.     ediv2.setAttribute("className","boxnest");
  1583.     ediv2.onmousedown = boxnestCancel;
  1584.     if (isprogmangrp == 1) {
  1585.         ediv2.onmousedown=boxnestCancel2;
  1586.         ediv.setAttribute('tag_grp',1);
  1587.     }
  1588.     ediv3 = document.createElement("div");
  1589.     ediv3.setAttribute("class","title");
  1590.     ediv3.setAttribute("className","title");
  1591.     ediv4 = document.createElement("div");
  1592.     ediv4.setAttribute("class","leftbutton");
  1593.     ediv4.setAttribute("className","leftbutton");
  1594.     ediv4.setAttribute("id",titlecode+"_lb");
  1595.     ediv4.onmousedown = sysD;
  1596.     ediv4.onmouseout = sysR;
  1597.     ediv4.onmouseup = new Function('e','systemMenu(e,"'+titlecode+'")');
  1598.     ediv3.appendChild(ediv4);
  1599.     if (cicons & 1 == 1)
  1600.     {
  1601.         ediv7 = document.createElement("div");
  1602.         ediv7.setAttribute("class", "rightbuttons");
  1603.         ediv7.setAttribute("className", "rightbuttons");
  1604.         ediv8 = document.createElement("div");
  1605.         ediv8.setAttribute("class","minbutton");
  1606.         ediv8.setAttribute("className","minbutton");
  1607.         ediv8.setAttribute("id",titlecode + "_min");
  1608.         ediv8.onmousedown = minDepressed;
  1609.         ediv8.onmouseout = minRestored;
  1610.         if (isprogmangrp == 1)
  1611.             ediv8.onmouseup=function () { destroyGroupWindow(titlecode); };
  1612.         else
  1613.             ediv8.onmouseup = new Function("minimizeWindow('" + titlecode + "')");
  1614.         ediv9 = document.createElement("div");
  1615.         ediv9.setAttribute("id",titlecode + "_maxr");
  1616.         if (cicons & 2) {
  1617.         if (maxed == 0)
  1618.         {
  1619.             ediv9.setAttribute("class","maxbutton");
  1620.             ediv9.setAttribute("className","maxbutton");
  1621.             ediv9.onmousedown = maxDepressed;
  1622.             ediv9.onmouseout = maxRestored;
  1623.             ediv9.onmouseup = new Function("maximizeWindow('" + titlecode + "')");
  1624.             ediv7.appendChild(ediv9);
  1625.         } else {
  1626.             ediv9.setAttribute("class","restorebutton");
  1627.             ediv9.setAttribute("className", "restorebutton");
  1628.             ediv9.onmousedown = rDepressed;
  1629.             ediv9.onmouseout = rRestored;
  1630.             ediv9.onmouseup = new Function("restoreWindow('" + titlecode + "')");
  1631.             ediv7.appendChild(ediv9);
  1632.         }
  1633.         } else {
  1634.             ediv7.style.width='27px';
  1635.         }
  1636.         ediv7.appendChild(ediv8);
  1637.         ediv3.appendChild(ediv7);
  1638.     }
  1639.     ediv5 = document.createElement("div");
  1640.     ediv5.setAttribute("tag", titlecode);
  1641.     ediv5.setAttribute("id", titlecode + "_tbar");
  1642.     ediv5.onmousedown = dragDown;
  1643.     ediv5.onselectstart = new Function("return false;");
  1644.     ediv5.onmouseup = dragUp;
  1645.     ediv5.appendChild(document.createTextNode(title));
  1646.     ediv3.appendChild(ediv5);
  1647.     ediv2.appendChild(ediv3);
  1648.     ediv6 = document.createElement("div");
  1649.     ediv6.setAttribute("class", "boxtext");
  1650.     ediv6.setAttribute("className", "boxtext");
  1651.     ediv6.setAttribute("id",titlecode+"_bt");
  1652.     ediv6.setAttribute("tag",titlecode);
  1653.     ediv6.style.paddingLeft='8px';
  1654.     ediv6.style.paddingRight='8px';
  1655.     ediv2.appendChild(ediv6);
  1656.     ediv.appendChild(ediv2);
  1657.     if (isprogmangrp != 1) {
  1658.         highestZ++;
  1659.         ediv.style.zIndex = highestZ;
  1660.     } else {
  1661.         highestZGroup++;
  1662.         ediv.style.zIndex=highestZGroup;
  1663.     }
  1664.     if (maxed == 0)
  1665.     {
  1666.     ediv.style.width = width + 'px'; ediv.style.height = height + 'px';
  1667.     ediv.style.top = top + obj_top + 'px'; ediv.style.left = left + obj_left + 'px';
  1668.     }
  1669.     else
  1670.     {
  1671.     ediv.style.width = (obj_width-1)+ 'px'; ediv.style.height = obj_height-1+'px';
  1672.     ediv.style.top = '-7px'; ediv.style.left = '-7px';
  1673.     }
  1674.     resizeBoxText(ediv,ediv6);
  1675.     if (modal==1) {
  1676.         ediv.style.borderColor='#000080';
  1677.         ediv.style.backgroundColor='#000080';
  1678.         ediv2.style.borderColor='white';
  1679.     } else {
  1680.         if (isprogmangrp != 1) {
  1681.             var menu1=progManMenuStructure[1].slice(progManGroupsCount+1);
  1682.             if (menu1[0][0]=='<no open programs>')
  1683.                 menu1.pop();
  1684.             menu1.push(new Array(title,1,titlecode));
  1685.             menu1.sort();
  1686.             progManMenuStructure[1]=progManMenuStructure[1].slice(0,progManGroupsCount+1).concat(menu1);
  1687.         }
  1688.     }
  1689.     windows[windowCount]=[title, icon, 0, 0, titlecode, width, height, obj.offsetLeft+left, obj.offsetTop+top, maxed, cicons, cb, modal, resizecb, isprogmangrp];
  1690.     windowCount++; uniqueID++;
  1691.     obj.appendChild(ediv);
  1692.     return ediv;
  1693. }
  1694. function resizeBoxText(a,b) {
  1695.     b.style.width=parseInt(a.style.width)-18+'px';
  1696.     b.style.height=parseInt(a.style.height)-45+'px';
  1697.     var c=document.getElementById(a.getAttribute('id')+'_menubar');
  1698.     if (c)
  1699.         c.style.width=parseInt(b.style.width)+parseInt(b.style.paddingLeft)+parseInt(b.style.paddingRight)+'px';
  1700. }
  1701. function createModalWindow(title, titlecode, width, height, left, top, cb,cicons) {
  1702.     var a=newWindow(title,0,titlecode,width,height,left,top,0,cicons,cb,1,dummy);
  1703.     var o = document.getElementById(titlecode);
  1704.     var p = document.getElementById(titlecode+'_lb');
  1705.     p.onmouseup=sysR;
  1706.     p.ondblclick=function () { cb(titlecode) };
  1707.     o.style.zIndex=highestZ+1;
  1708.     refModal.style.zIndex=highestZ;
  1709.     refModal.onmousedown=modalclick;
  1710.     modalActive=1;
  1711.     refModal.style.visibility='visible';
  1712.     return a;
  1713. }
  1714. function progManDestroy(w) {
  1715.     destroyModalWindow(w);
  1716. }
  1717. function progManClose(i) {
  1718.     var a = centerWindow(380,120);
  1719.     var bb=createModalWindow('Exit Windows','modalprogman',380,120,a[0],a[1],progManDestroy,0);
  1720.     var b=document.getElementById('modalprogman_bt');
  1721.     bb.onkeydown=function (e) { e=e||window.event; if (e.keyCode==27) destroyModalWindow('modalprogman'); };
  1722.     b.innerHTML='<img class="icon" style="background-position: -32px 0px" src="/images/colors/clearpixel.gif" /><span>This will end your Windows session.</span><br /><div style="margin-top: 7px; margin-left: 75px;"><a href="#" class="button" style="width: 75px" onclick="this.blur(); window.location=\'/forum/\';return false"><span>OK</span></a><a href="#" class="button" style="margin-left: 50px; width: 75px" onclick="this.blur(); destroyModalWindow(\'modalprogman\'); return false"><span>Cancel</span></a></div>';
  1723.     showWindow('modalprogman');
  1724. }
  1725. function centerWindow(w,h) {
  1726.     var e = new Array();
  1727.     e[0]=Math.floor(parseInt(refScreen.offsetLeft)+(parseInt(refScreen.style.width)/2)-(w/2));
  1728.     e[1]=Math.floor(parseInt(refScreen.offsetTop)+(parseInt(refScreen.style.height)/2)-(h/2));
  1729.     return e;
  1730. }
  1731. function setCoords(w,h,l,t) {
  1732.     var e = new Array();
  1733.     e[0]=Math.floor(parseInt(refScreen.style.width)*w);
  1734.     e[1]=Math.floor(parseInt(refScreen.style.height)*h);
  1735.     e[2]=Math.floor((parseInt(refScreen.style.width)*l)+parseInt(refScreen.offsetLeft));
  1736.     e[3]=Math.floor((parseInt(refScreen.style.height)*t)+parseInt(refScreen.offsetTop));
  1737.     return e;
  1738. }
  1739. function addMenuBar(menus,c,obj,cb,k) {
  1740.     var b;
  1741.     var a=document.createElement('div');
  1742.     a.setAttribute("class","menubar");
  1743.     a.setAttribute("className","menubar");
  1744.     a.setAttribute("id",k+'_menubar');
  1745.     a.style.width=parseInt(document.getElementById(k+'_bt').style.width)+16+'px';
  1746.     a.onselectstart=new Function("return false");
  1747.     a.onmousedown=blockDefault;
  1748.     for (var i=0;i<menus.length;i++) {
  1749.         b=document.createElement("div");
  1750.         b.setAttribute("class","menu");
  1751.         b.setAttribute("className","menu");
  1752.         b.setAttribute("tag",i);
  1753.         b.onmousemove = function() { menuBarMove(this,obj,menus,c,cb) };
  1754.         b.onmousedown = function (e) { menuBarDown(e,this,obj,menus,c,cb) };
  1755.         b.appendChild(document.createTextNode(c[i]));
  1756.         a.appendChild(b);
  1757.     }
  1758.     obj.appendChild(a);
  1759. }
  1760. function menuBarMove(a,obj,menus,c,cb) {
  1761.     if (menuActive == 1) {
  1762.         closeMenu(201);
  1763.         menuBarLaunch(a,obj,menus,c,cb);
  1764.     }
  1765. }
  1766. function menuBarLaunch(a,obj,menus,c,cb) {
  1767.     menuActive=1;
  1768.     a.style.color='#FFFFFF';
  1769.     a.style.backgroundColor='#000080';
  1770.     var o=document.getElementById(obj.getAttribute("tag"));
  1771.     var x=parseInt(o.style.left)+parseInt(a.offsetLeft)+8-parseInt(a.parentNode.offsetLeft);
  1772.     var y=parseInt(o.style.top)+61;
  1773.     var i=parseInt(a.getAttribute("tag"));
  1774.     menuBarCB=cb;
  1775.     menuBarI=i;
  1776.     menuBarS=a;
  1777.     launchMenu(x,y,menus[i],menuBarCallback,o.id);
  1778. }
  1779. function menuBarDown(e,a,obj,menus,c,cb) {
  1780.     e = e || window.event;
  1781.     if (lastButton=getMouseButton(e.button) != 0)
  1782.         return;
  1783.     if (menuActive == 1) {
  1784.         closeMenu(); return;
  1785.     }
  1786.     menuBarLaunch(a,obj,menus,c,cb);
  1787.     e.cancelBubble=true;
  1788.     blockDefault(e);
  1789.     return false;
  1790. }
  1791. function menuBarCallback(v,wn) {
  1792.     v=parseInt(v);
  1793.     menuBarCB(menuBarI,v,wn);
  1794. }
  1795. function closeWindow(w) {
  1796.     var i = findWindow(w);
  1797.     windows[i][11](i);
  1798. }
  1799. function destroyModalWindow(w) {
  1800.     modalActive=0;
  1801.     refModal.style.visibility='hidden';
  1802.     refModal.style.zIndex=-2;
  1803.     destroyWindow(w);
  1804. }
  1805. function destroyWindow(w) {
  1806.     var i = findWindow(w); var z;
  1807.     var o = document.getElementById(w);
  1808.     if (windows[i][12] == 0 && windows[i][14] != 1) {
  1809.         var j=-1;
  1810.         for (var k=progManGroupsCount+1;k<progManMenuStructure[1].length-progManGroupsCount-1;k++)
  1811.         {
  1812.             if (windows[i][4]==progManMenuStructure[1][k][2])
  1813.                 j=k;   
  1814.         }
  1815.         progManMenuStructure[1].splice(k,1);
  1816.     }
  1817.     o.style.visibility='hidden';
  1818.     for (var j=i;j<windowCount;j++)
  1819.         windows[j] = windows[j+1];
  1820.     windowCount--;
  1821.     while (o.firstChild) { z=o.removeChild(o.firstChild); z=null; }
  1822.     z=refScreen.removeChild(o); z=null;
  1823.     drawDesktop();
  1824. }
  1825. function destroyGroupWindow(w) {
  1826.     var i = findWindow(w); var z;
  1827.     var o = document.getElementById(w);
  1828.     o.style.visibility='hidden';
  1829.     for (var j=i;j<windowCount;j++)
  1830.         windows[j] = windows[j+1];
  1831.     windowCount--;
  1832.     while (o.firstChild) { z=o.removeChild(o.firstChild); z=null; }
  1833.     z=refProgman.removeChild(o); z=null;
  1834. }
  1835. function findWindow(w) {
  1836.     for (var i=0;i<windowCount;i++) {
  1837.         if (windows[i][4] == w)
  1838.             return i;
  1839.     }
  1840.     return -1;
  1841. }
  1842. function minimizeWindow(w) {
  1843.     document.getElementById(w).style.visibility = 'hidden';
  1844.     windows[findWindow(w)][3]=1;
  1845.     if (w=='progman') {
  1846.         for (var i=0;i<windowCount;i++) {
  1847.             if (windows[i][4].indexOf('progman_groupw_') == 0)
  1848.                 document.getElementById(windows[i][4]).style.visibility='hidden';
  1849.         }
  1850.     }
  1851.     drawDesktop();
  1852. }
  1853. function maximizeWindow(w) {
  1854.     var o = document.getElementById(w);
  1855.     o.style.visibility = 'hidden';
  1856.     var refScreen_width=refScreen.offsetWidth;
  1857.     var refScreen_height=refScreen.offsetHeight;
  1858.     if (o.getAttribute('tag_grp') == 1) {
  1859.         var prgm=refProgman;
  1860.         refScreen_width=parseInt(prgm.style.width);
  1861.         refScreen_height=parseInt(prgm.style.height);
  1862.     }
  1863.     var i = findWindow(w);
  1864.     windows[i][9] = 1;
  1865.     windows[i][5] = parseInt(o.style.width);
  1866.     windows[i][6] = parseInt(o.style.height);
  1867.     windows[i][7] = parseInt(o.style.left);
  1868.     windows[i][8] = parseInt(o.style.top);
  1869.     if (o.getAttribute('tag_grp') == 1) {
  1870.         o.style.width = (refScreen_width-6) + 'px';
  1871.         o.style.height =    (refScreen_height-document.getElementById('progman_menubar').offsetHeight-33) + 'px';
  1872.         o.style.top = document.getElementById('progman_menubar').offsetHeight+25+'px';
  1873.         o.style.left = '-2px';
  1874.     } else {
  1875.         o.style.width = refScreen_width+'px';
  1876.         o.style.height = (refScreen_height-1)+'px';
  1877.         o.style.top='-7px';
  1878.         o.style.left='-7px';
  1879.     }
  1880.     var q = document.getElementById(w+'_bt');
  1881.     resizeBoxText(o,q);
  1882.     windows[i][13](o);
  1883.     var p = document.getElementById(w + '_maxr');
  1884.     p.className = 'restorebutton';
  1885.     p.setAttribute("class","restorebutton");
  1886.     p.onmouseup = new Function("restoreWindow('" + w + "')");
  1887.     p.onmousedown = rDepressed;
  1888.     p.onmouseout = rRestored;
  1889.     p.style.backgroundPosition='-162px 0px';
  1890.     o.setAttribute('tag2', '1');
  1891.     o.onmousedown = null;
  1892.     o.onmousemove = null;
  1893.     o.onmouseup = null;
  1894.     o.style.visibility = 'visible';
  1895. }
  1896. function restoreWindow(w) {
  1897.     var o = document.getElementById(w);
  1898.     o.style.visibility = 'hidden';
  1899.     var i = findWindow(w);
  1900.     windows[i][9] = 0;
  1901.     o.style.top = windows[i][8] + 'px';
  1902.     o.style.left = windows[i][7] + 'px';
  1903.     o.style.width = windows[i][5] + 'px';
  1904.     o.style.height = windows[i][6] + 'px';
  1905.     var p = document.getElementById(w + '_maxr');
  1906.     var q = document.getElementById(w+'_bt');
  1907.     resizeBoxText(o,q);
  1908.     windows[i][13](o);
  1909.     p.className = 'maxbutton';
  1910.     p.setAttribute("class","maxbutton");
  1911.     p.onmouseup = new Function("maximizeWindow('" + w + "')");
  1912.     p.onmousedown = maxDepressed;
  1913.     p.onmouseout = maxRestored;
  1914.     p.style.backgroundPosition='-108px 0px';
  1915.     o.setAttribute('tag2', '0');
  1916.     o.onmousedown = resizeDown;
  1917.     o.onmousemove = mouseMoveBox;
  1918.     o.onmouseup = resizeUp;
  1919.     o.style.visibility = 'visible';
  1920. }
  1921. function showWindow(titlecode) {
  1922.     var a=document.getElementById(titlecode);
  1923.     a.style.visibility = 'visible';
  1924.     a.focus();
  1925.     if (titlecode=='progman') {
  1926.         for (var j=0;j<windowCount;j++) {
  1927.             if (windows[j][4].indexOf('progman_groupw_') == 0)
  1928.                 document.getElementById(windows[j][4]).style.visibility='visible';
  1929.         }
  1930.     }
  1931. }
  1932. function loadExternalFile(f,type) {
  1933.     var z='launchapp_'+f.split('.')[0]+'js';
  1934.     for (var i=0; i<externalFileList.length; i++)
  1935.     {
  1936.         if (externalFileList[i]==f) {
  1937.             if (type=='js') { var a=new Function(z+'();'); a(); }
  1938.             return;
  1939.         }
  1940.     }
  1941.     externalFileList[externalFileList.length]=f;
  1942.     var ref;
  1943.     if (type=='css') {
  1944.         ref=document.createElement('link');
  1945.         ref.setAttribute('rel','stylesheet');
  1946.         ref.setAttribute('type','text/css');
  1947.         ref.setAttribute('href','/apps/'+f);   
  1948.     } else if (type=='js') {
  1949.         ref=document.createElement('script');
  1950.         ref.setAttribute('type','text/javascript');
  1951.         ref.setAttribute('src','/apps/'+f);
  1952.     }
  1953.     document.getElementsByTagName('head')[0].appendChild(ref);
  1954. }
  1955. function dummy() { return; }
  1956. function drawDesktop()
  1957. {
  1958.     var obj = document.getElementById('icontable'); var z;
  1959.     obj.parentNode.setAttribute('tag',-1);
  1960.     while (obj.firstChild) { z=obj.removeChild(obj.firstChild); z=null; }
  1961.     var etb=document.createElement("tbody");
  1962.     var etr=document.createElement("tr");
  1963.     var cr=0;
  1964.     var ll=Math.floor(parseInt(refScreen.style.width)/84)-1;
  1965.     for (var i=0;i<windowCount;i++)
  1966.     {
  1967.         if (windows[i][3] == 1)
  1968.         {
  1969.             eDIV = document.createElement("td");
  1970.             eDIV.setAttribute("class","minimizedicon");
  1971.             eDIV.setAttribute("className","minimizedicon");
  1972.             eDIV.setAttribute("id", "minIcon" + i);
  1973.             eimg = document.createElement("div");
  1974.             eimg.setAttribute("class","minicon");
  1975.             eimg.setAttribute("className","minicon");
  1976.             eimg.setAttribute("tag", i);
  1977.             eimg.ondblclick = minIconDoubleClick;
  1978.             eimg.onclick = minIconClick;
  1979.             eimg.style.backgroundPosition="-" + (windows[i][1]*32) + 'px 0px';
  1980.             eDIV.appendChild(eimg);
  1981.             espan = document.createElement("div");
  1982.             espan.setAttribute("id", "minIconText" + i);
  1983.             espan.setAttribute("class", "mintext");
  1984.             espan.setAttribute("className", "mintext"); //IE workaround
  1985.             espan.ondblclick = minIconDoubleClick;
  1986.             espan.setAttribute("tag", i);
  1987.             espan.onclick = minIconClick;
  1988.             espan.onselectstart = new Function("return false;");
  1989.             espan.onmousedown = blockDefault;
  1990.             espan.appendChild(document.createTextNode(windows[i][0]));
  1991.             eDIV.appendChild(espan);
  1992.             etr.appendChild(eDIV);
  1993.             cr++;
  1994.             if (cr>ll) {
  1995.                 etb.appendChild(etr);
  1996.                 etr=document.createElement("tr");
  1997.                 cr=0;
  1998.             }
  1999.         }
  2000.     }
  2001.     etb.appendChild(etr);
  2002.     obj.appendChild(etb);
  2003. }
  2004. function readCookie(name) {
  2005.     var nameEQ = name + "=";
  2006.     var ca = document.cookie.split(';');
  2007.     for(var i=0;i < ca.length;i++) {
  2008.         var c = ca[i];
  2009.         while (c.charAt(0)==' ') c = c.substring(1,c.length);
  2010.         if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  2011.     }
  2012.     return null;
  2013. }
  2014. function radioButtonActive() {
  2015.     this.style.backgroundPosition='-232px 0px';
  2016. }
  2017. function radioButtonInactive() {
  2018.     this.style.backgroundPosition='-216px 0px';
  2019. }
  2020. function radioButtonOut() {
  2021.     var cb=this.parentNode.parentNode.getAttribute('tag');
  2022.     if (cb == this.id)
  2023.         this.style.backgroundPosition='-248px 0px';
  2024.     else
  2025.         this.style.backgroundPosition='-216px 0px';
  2026. }
  2027. function radioButtonChange() {
  2028.     var cb=this.parentNode.parentNode.getAttribute('tag');
  2029.     document.getElementById(cb).style.backgroundPosition='-216px 0px';
  2030.     this.style.backgroundPosition='-248px 0px';
  2031.     this.parentNode.parentNode.setAttribute('tag',this.id);
  2032.     this.parentNode.parentNode.setAttribute('tag_num',this.getAttribute('tag_num'));
  2033. }
  2034. //]]>
  2035. </script>
  2036. </head>
  2037.  
  2038. <body onload="startProgMan()">
  2039. <div id="screen" onclick="globalClick();">
  2040. <div id="iconlist"><table id="icontable"><tr><td></td></tr></table></div>
  2041. </div>
  2042. <div id="modal" onmousedown="modalClick();"></div>
  2043. <noscript><div>Please enable JavaScript in order to view the full michaelv.org experience. If you are unable to, <a href="/index2.php">click here</a> to view the vanilla XHTML index page.</div></noscript>
  2044. </body>
  2045. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement