1/*** SET BUTTON'S FOLDER HERE ***/ 2var buttonFolder = "buttons/"; 3 4/*** SET BUTTONS' FILENAMES HERE ***/ 5upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png"); 6 7overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png","button8over.png"); 8 9// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS 10subInfo = new Array(); 11subInfo[1] = new Array(); 12subInfo[2] = new Array(); 13subInfo[3] = new Array(); 14subInfo[4] = new Array(); 15subInfo[5] = new Array(); 16subInfo[6] = new Array(); 17subInfo[7] = new Array(); 18subInfo[8] = new Array(); 19 20 21//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***// 22 23subInfo[2][1] = new Array("Page 1","http://www.my-time-machines.net/my_tower_clock_collection1.htm",""); 24subInfo[2][2] = new Array("Page 2","http://www.my-time-machines.net/my_tower_clock_collection2.htm",""); 25subInfo[2][3] = new Array("Page 3","http://www.my-time-machines.net/my_tower_clock_collection3.htm",""); 26subInfo[2][4] = new Array("Page 4","http://www.my-time-machines.net/my_tower_clock_collection4.htm",""); 27subInfo[2][5] = new Array("Page 5","http://www.my-time-machines.net/my_tower_clock_collection5.htm",""); 28subInfo[2][6] = new Array("Page 6","http://www.my-time-machines.net/my_tower_clock_collection6.htm",""); 29 30subInfo[3][1] = new Array("Page 1","http://www.my-time-machines.net/my_skeleton_clock_collection1.htm",""); 31subInfo[3][2] = new Array("Page 2","http://www.my-time-machines.net/my_skeleton_clock_collection2.htm",""); 32subInfo[3][3] = new Array("Page 3","http://www.my-time-machines.net/my_skeleton_clock_collection3.htm",""); 33subInfo[3][4] = new Array("Page 4","http://www.my-time-machines.net/my_skeleton_clock_collection4.htm",""); 34subInfo[3][5] = new Array("Page 5","http://www.my-time-machines.net/my_skeleton_clock_collection5.htm",""); 35subInfo[3][6] = new Array("Page 6","http://www.my-time-machines.net/my_skeleton_clock_collection6.htm",""); 36 37subInfo[4][1] = new Array("Overview","http://www.my-time-machines.net/my_time_lock_collection.htm",""); 38subInfo[4][2] = new Array("Catalog","http://www.my-time-machines.net/timelock_index.htm",""); 39 40subInfo[5][1] = new Array("Master clocks","http://www.my-time-machines.net/master_clocks.htm",""); 41subInfo[5][2] = new Array("Calculators","http://www.my-time-machines.net/other_horological_examples.htm",""); 42subInfo[5][3] = new Array("Remontoire","http://www.my-time-machines.net/remontoire.htm",""); 43subInfo[5][4] = new Array("Papers/Presentations","http://www.my-time-machines.net/papers_and_presentations.htm",""); 44 45subInfo[6][1] = new Array("Tower clocks","http://www.my-time-machines.net/tower_clock_restorations.htm",""); 46subInfo[6][2] = new Array("Skeleton clocks","http://www.my-time-machines.net/skeleton_clock_restorations.htm",""); 47subInfo[6][3] = new Array("Time locks","http://www.my-time-machines.net/time_lock_restorations.htm",""); 48subInfo[6][4] = new Array("Other","http://www.my-time-machines.net/other_restorations.htm",""); 49 50subInfo[7][1] = new Array("Introduction","http://www.my-time-machines.net/my_current_project3.htm",""); 51subInfo[7][2] = new Array("Description","http://www.my-time-machines.net/Astro_presentation_paper_final_web.pdf",""); 52subInfo[7][3] = new Array("Construction index","http://www.my-time-machines.net/astro_index.htm",""); 53subInfo[7][4] = new Array("Completion","http://www.my-time-machines.net/my_current_project4.htm",""); 54subInfo[7][5] = new Array("Arrival","http://www.my-time-machines.net/my_current_project5.htm",""); 55 56 57 58//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***// 59var xSubOffset = 0; 60var ySubOffset = 24; 61 62 63 64//*** NO MORE SETTINGS BEYOND THIS POINT ***// 65var overSub = false; 66var delay = 1000; 67totalButtons = upSources.length; 68 69// GENERATE SUB MENUS 70for ( x=0; x<totalButtons; x++) { 71 // SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU 72 if ( subInfo[x+1].length < 1 ) {
73 document.write('<div id="submenu' + (x+1) + '">'); 74 // SET DIV FOR BUTTONS WITH SUBMENU 75 } else { 76 document.write('<div id="submenu' + (x+1) + '" class="dropmenu" '); 77 document.write('onMouseOver="overSub=true;'); 78 document.write('setOverImg(\'' + (x+1) + '\',\'\');"'); 79 document.write('onMouseOut="overSub=false;'); 80 document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);'); 81 document.write('setOutImg(\'' + (x+1) + '\',\'\');">'); 82 83 84 document.write('<ul>'); 85 for ( k=0; k<subInfo[x+1].length-1; k++ ) { 86 document.write('<li>'); 87 document.write('<a href="' + subInfo[x+1][k+1][1] + '" '); 88 document.write('target="' + subInfo[x+1][k+1][2] + '">'); 89 document.write( subInfo[x+1][k+1][0] + '</a>'); 90 document.write('</li>'); 91 } 92 document.write('</ul>'); 93 } 94 document.write('</div>'); 95} 96 97 98 99 100 101//*** MAIN BUTTONS FUNCTIONS ***// 102// PRELOAD MAIN MENU BUTTON IMAGES 103function preload() { 104 for ( x=0; x<totalButtons; x++ ) { 105 buttonUp = new Image(); 106 buttonUp.src = buttonFolder + upSources[x]; 107 buttonOver = new Image(); 108 buttonOver.src = buttonFolder + overSources[x]; 109 } 110} 111 112// SET MOUSEOVER BUTTON 113function setOverImg(But, ID) { 114 document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1]; 115} 116 117// SET MOUSEOUT BUTTON 118function setOutImg(But, ID) { 119 document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1]; 120} 121 122 123 124//*** SUB MENU FUNCTIONS ***// 125// GET ELEMENT ID MULTI BROWSER 126function getElement(id) { 127 return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 128} 129 130// GET X COORDINATE 131function getRealLeft(id) { 132 var el = getElement(id); 133 if (el) { 134 xPos = el.offsetLeft; 135 tempEl = el.offsetParent; 136 while (tempEl != null) { 137 xPos += tempEl.offsetLeft; 138 tempEl = tempEl.offsetParent; 139 } 140 return xPos; 141 } 142} 143 144// GET Y COORDINATE 145function getRealTop(id) { 146 var el = getElement(id); 147 if (el) { 148 yPos = el.offsetTop; 149 tempEl = el.offsetParent; 150 while (tempEl != null) { 151 yPos += tempEl.offsetTop; 152 tempEl = tempEl.offsetParent; 153 } 154 return yPos; 155 } 156} 157 158// MOVE OBJECT TO COORDINATE 159function moveObjectTo(objectID,x,y) { 160 var el = getElement(objectID); 161 el.style.left = x; 162 el.style.top = y; 163} 164 165// MOVE SUBMENU TO CORRESPONDING BUTTON 166function showSubMenu(subID, buttonID) { 167 hideAllSubMenus(); 168 butX = getRealLeft(buttonID); 169 butY = getRealTop(buttonID); 170 moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset); 171} 172 173// HIDE ALL SUB MENUS 174function hideAllSubMenus() { 175 for ( x=0; x<totalButtons; x++) { 176 moveObjectTo("submenu" + (x+1) + "",-500, -500 ); 177 } 178} 179 180// HIDE ONE SUB MENU 181function hideSubMenu(subID) { 182 if ( overSub == false ) { 183 moveObjectTo(subID,-500, -500); 184 } 185} 186 187 188 189//preload(); 190
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.