home *** CD-ROM | disk | FTP | other *** search
Wrap
// // Date Last Modified: June 12th, 2007 // // Modified By: Kelsenellenelvian // function SetupWPI() { position="api.js"; whatfunc="SetupWPI()"; SetScriptWaitTimeout(); fillBoxes(); check(CheckOnLoad); ShowMain(); if (Timer) startInterval(); else stopInterval(); window.focus(); } function CheckKey(e) //Remember the (e) { position="api.js"; whatfunc="CheckKey()"; // alert(window.event.keyCode + " = [" + String.fromCharCode(window.event.keyCode) + " ]"); //Use this line to determine the values for the keys you would like to assign if (window.event.altKey) { switch(window.event.keyCode) { case 13: //Enter - "Begin Install" checkInstall('install'); break; case 79: // O - toggle Options Wizard ToggleOptions(); break; case 67: // C - toggle Config Wizard ToggleConfig(); break; case 83: // S - toggle Show Source ToggleSource(); break; case 77: //M - toggle Manual ToggleManual(); break; case 87: //W - toggle About WPI ToggleAboutWPI(); break; case 66: //B - "Show Extra Buttons" ToggleExtraButtons(); break; case 71: //G - "Global Variables" ShowGlobalVariables(); break; case 84: //T - Toggle "ShowToolTips" if (ShowToolTips==0) ShowToolTips=1; else ShowToolTips=0; break; case 65: //A - "Select All" check('all'); if (ShowMultiDefault) document.getElementById("computerList").selectedIndex = '1'; break; case 68: //D - "Select Defaults" check('default'); if (ShowMultiDefault) document.getElementById("computerList").selectedIndex = '0'; break; case 78: //N - "Select None" check('none'); if (ShowMultiDefault) document.getElementById("computerList").selectedIndex = '2'; break; } } else { switch(window.event.keyCode) { case 27: //Esc - If the screen is not the main install screen, "Toggle screen" else you want to "Exit" if (document.getElementById("InstallButton").style.visibility != 'visible') ShowMain(); else checkInstall('exit'); break; case 112: //F1 - toggle Manual ToggleManual(); break; case 113: // F2 - toggle Options Wizard ToggleOptions(); break; case 114: // F3 - toggle Config Wizard ToggleConfig(); break; case 122: // F11 - toggle Show Source ToggleSource(); break; case 123: // F12 - toggle About WPI ToggleAboutWPI(); break; } } } function ShowGlobalVariables() { position="api.js"; whatfunc="ShowGlobalVariables()"; alert("Global variables:\n" + "\n%OSLANG%=" + oslang + "\n%WPIPATH%=" + wpipath + "\n%ROOT%=" + root + "\n%CDROM%="+ cddrv + "\n%DOSPATH%=" + dospath + "\n%SYSTEMDRIVE%=" + sysdrv + "\n%WINDIR%=" + windir + "\n%PROGRAMFILES%=" + programfiles + "\n%TEMP%=" + temp + "\n%SYSDIR%=" + sysdir + "\n%ALLUSERSPROFILE%=" + allusersprofile + "\n%USERPROFILE%=" + userprofile + "\n%APPDATA%=" + appdata + "\n%COMMONPROGRAMFILES%=" + commonprogramfiles); } function ToggleExtraButtons() { position="api.js"; whatfunc="ToggleExtraButtons()"; if (document.all.ExtraButtons.style.display == 'none') document.all.ExtraButtons.style.display = hdd != "" ? 'block' : 'none'; else document.all.ExtraButtons.style.display = 'none'; } function sizer() { position="api.js"; whatfunc="sizer()"; var fW, fH; //Sets the size of the WPI Window. Does not support WXGA like 1400*800 fW = Resolution; //for testing purposes only... switch (fW) { case 800: fH=600; break; case 1024: fH=768; break; case 1280: fH=1024; break; case 1600: fH=1200; break; } if (screen.width == 640 && screen.height == 480) { self.resizeTo(640,480); self.moveTo((screen.width / 2) - (640 / 2), (screen.height / 2) - (480 / 2)); top.status=480; } else if (screen.width == 800 && screen.height == 600) { self.resizeTo(800,600); self.moveTo((screen.width / 2) - (800 / 2), (screen.height / 2) - (600 / 2)); top.status=600; } else if (screen.width == 1024 && screen.height == 768) { self.resizeTo(1024,768); self.moveTo((screen.width / 2) - (1024 / 2), (screen.height / 2) - (768 / 2)); top.status=768; } else if (fW>0) { self.resizeTo(fW,fH); self.moveTo((screen.width / 2) - (fW/ 2), (screen.height / 2) - (fH / 2)); top.status=fH; } else { self.resizeTo(screen.width,screen.height); self.moveTo(0,0); top.status=screen.height; } } function getElementsByClassName(classname) { position="api.js"; whatfunc="getElementsByClassName()"; var rl = new Array(); var re = new RegExp('(^| )'+classname+'( |$)'); var ael = document.getElementsByTagName('*'); var op = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; if (document.all && !op) ael = document.all; for (var i=0, j=0; i<ael.length; i++) { if (re.test(ael[i].className)) { rl[j]=ael[i]; j++; } } return rl; } function getOSver() { position="api.js"; whatfunc="getOSver()"; var ver=""; try { ver=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion"); } catch (ex) { try { ver=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Version"); } catch (ex2) { ; } } if (ver=="6.0") return "Vista"; if (ver=="5.2") return "03"; if (ver=="5.1") return "XP"; if (ver=="5.0") return "2K"; if (ver=="4.0") return "NT"; if (ver=="Windows 98") return "98"; if (ver=="Windows Millennium Edition") return "ME"; if (ver=="Windows 95") return "95"; return "Not found"; } function getSPver() { position="api.js"; whatfunc="getSPver()"; var sp=""; try { sp=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CSDVersion"); } catch (ex) { ; } if (sp != "") return sp.substr(sp.length-1,1); return "Not found"; } function noTags(a) { position="api.js"; whatfunc="noTags()"; var sprg = new String(); var lines = new Array(); sprg=a; lines=sprg.split(/< *(p.|br[ \/]*)>/i); multi=lines.length-1; sprg=sprg.replace(/<[^>]*>/gi,""); return sprg; }