// Global variables var isCSS, isW3C, isIE4, isNN4, isIE6CSS; // Initialize upon load to let all browsers establish content objects function initDHTMLAPI( ) { if (document.images) { isCSS = (document.body && document.body.style) ? true : false; isW3C = (isCSS && document.getElementById) ? true : false; isIE4 = (isCSS && document.all) ? true : false; isNN4 = (document.layers) ? true : false; isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false; } } // Return the available content width space in browser window function getInsideWindowWidth( ) { if (window.innerWidth) { return window.innerWidth; } else if (isIE6CSS) { // measure the html element's clientWidth return document.body.parentElement.clientWidth; } else if (document.body && document.body.clientWidth) { return document.body.clientWidth; } return 0; } // Return the available content height space in browser window function getInsideWindowHeight( ) { if (window.innerHeight) { return window.innerHeight; } else if (isIE6CSS) { // measure the html element's clientHeight return document.body.parentElement.clientHeight; } else if (document.body && document.body.clientHeight) { return document.body.clientHeight; } return 0; } function findPos(coord, obj) { var curleft = 0; if (obj.offsetParent){ while (obj.offsetParent){ if (coord == 'x') {curleft += obj.offsetLeft} else {curleft += obj.offsetTop} obj = obj.offsetParent; } } else if (obj.coord) curleft += obj.coord; return curleft; } function getElementStyle(elem, IEStyleProp, CSSStyleProp) { if (elem.currentStyle) { return elem.currentStyle[IEStyleProp]; } else if (window.getComputedStyle) { var compStyle = window.getComputedStyle(elem, ""); return compStyle.getPropertyValue(CSSStyleProp); } return ""; } function playSound(id) { if (document.getElementById(id)) if (document.all && document.getElementById(id).FileName) { try { document.getElementById(id).Play(); }catch (e){}; } } function setDivClass(div, className){ try { if (div.attributes['collapsed'].value != "false") div.className = className;} catch (e) {div.className = className; } } function setParentMenuVisibility(allowHide, menuID){ var menus = document.getElementsByTagName('menu'); for(var j=0; j'; }else{return ''}; } function initMenu(nvideo){ video(nvideo); initDHTMLAPI( ); var zIndex = 0; menus = document.getElementsByTagName('menu'); for(var i=0; i 0) {aHrefs[0].click();} } } if (spans[i].attributes['menu']) { var atr = parentMenu(spans[i]).attributes['close']; if (atr) if ((atr.value == 'onclick') || (atr.value == 'onclickout')){ document.getElementById(spans[i].attributes['menu'].value).onmouseout = function(){ this.setAttribute('allowHide', false); hideAll(); }; } } spans[i].onmouseover = function(){ try { playSound(this.attributes['sound'].value);} catch(e){ if (parentMenu(this).attributes['sound']) playSound(parentMenu(this).attributes['sound'].value); }; setDivClass(this,'HOVER'); if (this.attributes['menu']) { var menu = document.getElementById(this.attributes['menu'].value); // menu.style.display = 'none'; menu.setAttribute('allowHide', false); // menu.style.display = ''; setDivClass(this,'EXPANDABLEHOVER'); if (getElementStyle(this, 'display', 'display') == 'inline') { x = findPos('x',this); if (x+menu.clientWidth > getInsideWindowWidth()){ x = x + this.offsetWidth - menu.clientWidth; } if (x < 0 ) x = findPos('x',this); y = findPos('y',this) + this.offsetHeight; if (y+menu.clientHeight > getInsideWindowHeight()){ y = y - this.offsetHeight - menu.clientHeight; } if (y < 0) y = findPos('y',this) + this.offsetHeight; }else { x = findPos('x',this) + this.offsetWidth; if (x+menu.clientWidth > getInsideWindowWidth()){ x = x - this.offsetWidth - menu.clientWidth; } if (x < 0 ) x = findPos('x',this) + this.offsetWidth; y = findPos('y',this); if (y+menu.clientHeight > getInsideWindowHeight()){ y = y + this.offsetHeight - menu.clientHeight; } if (y < 0) y = findPos('y',this); } var style = menu.style; style.top = y; style.left = x; if (!parentMenu(this).attributes['open']){ setSRC(this); show(menu); }else{ if (parentMenu(this).attributes['open'].value != 'onclick'){ setSRC(this); show(menu); } } } }; if (parentMenu(spans[i]).attributes['open']) if (parentMenu(spans[i]).attributes['open'].value == 'onclick') if (spans[i].attributes['menu']) spans[i].onclick = function(){ var menu = document.getElementById(this.attributes['menu'].value); if (!this.attributes['collapsed']){ setSRC(this); zIndex++; this.style.zIndex = zIndex; show(menu); }else{ if (this.attributes['collapsed'].value == "true"){ if (parentMenu(this).attributes['close']) if (parentMenu(this).attributes['close'].value == "onclickout"){ var spans = parentMenu(this).getElementsByTagName('SPAN'); if (spans.length == 0) spans = parentMenu(this).getElementsByTagName('DIV'); for (var s=0;s