// which DOM ? var isDHTML = 0; var isNetscape = navigator.appName.indexOf('Netscape') != -1; var isOpera = navigator.userAgent.indexOf( 'Opera' ) != -1; var isIE = (navigator.appName.indexOf('Microsoft Internet Explorer') != -1) && ! isOpera; var isLayers = 0; var isAll = 0; var isID = 0; var browserVersion = parseInt( navigator.appVersion ); if( document.getElementById ) { isID = 1; isDHTML = 1; } if( document.all ) { isAll = 1; isDHTML = 1; } if( (browserVersion == 4) && isNetscape ) { isLayers = 1; isDHTML = 1; } function whichBrowser() { alert( navigator.appName ); alert( navigator.userAgent ); if( isNetscape ) alert( "Netscape" ); if( isOpera ) alert( "Opera" ); if( isIE ) alert( "IE" ); } function findDOM(objectID,withStyle) { if(isLayers) { return document.layers[objectID]; } else { if(isID) { if(withStyle) { //alert( objectID ); theObject = document.getElementById(objectID); //alert( theObject ); return theObject.style; } else { return document.getElementById(objectID); } } else if(isAll) { if(withStyle) { return document.all[objectID].style; } else { return document.all[objectID]; } } } } function findDOMInFrame(frameID,objectID,withStyle) { if(isLayers) { //alert( "isLayers" + objectID ); return top[frameID].document.layers[objectID]; } else { if(isID) { if(withStyle) { //alert( "isID withStyle" + objectID ); theObject = top[frameID].document.getElementById( objectID ); return theObject.style; } else { return top[frameID].document.getElementById( objectID ); } } else if(isAll) { if(withStyle) { //alert( "isAll withStyle" + objectID ); return top[frameID].document.all[objectID].style; } else { return top[frameID].document.all[objectID]; } } } } function findSideMenuDOM(objectID,withStyle) { if(isLayers) { return parent.SideMenuFrame.document.layers[objectID]; } else { if(isID) { if(withStyle) { //alert( objectID ); theObject = parent.SideMenuFrame.document.getElementById(objectID); //alert( theObject ); return theObject.style; } else { return parent.SideMenuFrame.document.getElementById(objectID); } } else if(isAll) { if(withStyle) { return parent.SideMenuFrame.document.all[objectID].style; } else { return parent.SideMenuFrame.document.all[objectID]; } } } } function setFocus( target ) { findDOM( target, 0 ).focus(); } function centerThem( divID, rightThingID ) { thing1 = findDOM( divID, 0 ); thing1Style = findDOM( divID, 1 ); thing2 = findDOM( rightThingID, 0 ); thing2Style = findDOM( rightThingID, 1 ); if( window.innerWidth != null ) { center = window.innerWidth / 2; } else if( document.body.clientWidth != null ) { center = document.body.clientWidth / 2; } if( thing1Style.left ) { width = (thing2Style.left + thing2Style.clip.width) - thing1Style.left; thing1Style.left = center - ( width / 2 ); } else if( thing1Style.pixelLeft ) { width = (thing2Style.pixelLeft + thing2Style.clip.width) - thing1Style.pixelLeft; thing1Style.pixelLeft = center - ( width / 2 ); } else if( thing1.offsetLeft ) { width = (thing2.offsetLeft + thing2.offsetWidth) - thing1.offsetLeft; //alert( Math.round( center - ( width / 2 )) ); thing1Style.left = Math.round(center - ( width / 2 )); } } function centerIt( thingID ) { thing = findDOM( thingID, 0 ); thingStyle = findDOM( thingID, 1 ); if( window.innerWidth != null ) { center = window.innerWidth / 2; } else if( document.body.clientWidth != null ) { center = document.body.clientWidth / 2; } if( thing.offsetWidth ) { thingWidth = thing.offsetWidth; } else if( thing.clipWidth ) { thingWidth = thing.clipWidth; } //alert( center - ( thingWidth / 2 ) ); thingStyle.left = center - ( thingWidth / 2 ); } function centerWithOffset( thingID, offset ) { thing = findDOM( thingID, 0 ); thingStyle = findDOM( thingID, 1 ); if( window.innerWidth != null ) { center = window.innerWidth / 2; } else if( document.body.clientWidth != null ) { center = document.body.clientWidth / 2; } if( thing.offsetWidth ) { thingWidth = thing.offsetWidth; } else if( thing.clipWidth ) { thingWidth = thing.clipWidth; } //alert( center - ( thingWidth / 2 ) ); thingStyle.left = center - ( thingWidth / 2 ) + offset; } function centerWithOffsetAndPegLeft( thingID, offset, pegLeft ) { thing = findDOM( thingID, 0 ); thingStyle = findDOM( thingID, 1 ); if( window.innerWidth != null ) { center = window.innerWidth / 2; } else if( document.body.clientWidth != null ) { center = document.body.clientWidth / 2; } if( thing.offsetWidth ) { thingWidth = thing.offsetWidth; } else if( thing.clipWidth ) { thingWidth = thing.clipWidth; } //alert( center - ( thingWidth / 2 ) ); var candidate = center - ( thingWidth / 2 ) + offset; if( candidate < pegLeft ) { thingStyle.left = pegLeft; } else { thingStyle.left = candidate; } } function findRight( thingID ) { result = null; thing = findDOM( thingID, 0 ); thingStyle = findDOM( thingID, 1 ); if( thingStyle.left ) { result = thingStyle.left + thingStyle.clip.width; } if( thingStyle.pixelLeft ) { result = thingStyle.pixelLeft + thing.offsetWidth; } if( thing.offsetLeft ) { result = thing.offsetLeft + thing.offsetWidth; } return result; } function doClick( protoText, sideRoot, parent ) { top['MenuFrame'].selectMenu( parent ); top['MenuFrame'].eraseIndicators(); findDOMInFrame( 'MenuFrame', protoText + 'MenuIndicatorID', 1 ).visibility="visible"; if( sideRoot ) { top.SideMenuFrame.location = protoText + 'Side.html'; } else { top.SideMenuFrame.location = 'Blank.html'; } } /******************************************************** Pulldown Menus ********************************************************* Pulldown Menu
tags get written to each html document that will occupy the ContentFrame frame. The mouse rollover in Menus.html will show and hide the pulldown menus. ********************************************************/ function MenuItem(title,href,parent,protoText,sideRoot) { this.title = title; this.href = href; this.parent = parent; this.protoText = protoText; this.sideRoot = sideRoot; this.writeHTML = writeHTMLMenuItem; } function writeHTMLMenuItem() { accumulator = ''); document.write('