var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i minX && posX < maxX && posY > minY && posY < maxY){} else{document.getElementById(current_menu).style.visibility = 'hidden'; document.getElementById("people").style.visibility = 'hidden'; document.getElementById("contact").style.visibility = 'hidden';}; } } current_menu = ""; minX = 0; maxX = 0; minY = 0; maxY = 0; function show_menu(n,offset) { current_menu = n; document.getElementById(n).style.visibility = 'visible'; if(current_menu == "contact") { offset = offset - 26; } nObj = document.getElementById(n); if(nObj.currentStyle) { //shitty internet explorer code document.getElementById(n).style.left = ((document.body.offsetWidth - 800)/2) + 152 + offset; //document.getElementById(n).style.height = nObj.currentStyle['height']; //document.getElementById(n).style.width = nObj.currentStyle['width']; var oHeight = nObj.getBoundingClientRect(); var iHeight = oHeight.bottom - oHeight.top; var oWidth = nObj.getBoundingClientRect(); var iWidth = oWidth.bottom - oWidth.top; minX = eval(document.getElementById(n).style.left.split('px')[0]); maxX = eval(document.getElementById(n).style.left.split('px')[0]) + eval(iWidth); minY = eval(document.getElementById(n).style.top.split('px')[0]); maxY = eval(document.getElementById(n).style.top.split('px')[0]) + eval(iHeight); } else if(document.defaultView.getComputedStyle) { //good mozilla code document.getElementById(n).style.left = ((document.body.offsetWidth - 800)/2) + 158 + offset; document.getElementById(n).style.height = document.defaultView.getComputedStyle(nObj,'').getPropertyValue('height'); document.getElementById(n).style.width = document.defaultView.getComputedStyle(nObj,'').getPropertyValue('width'); minX = eval(document.getElementById(n).style.left.split('px')[0]); maxX = eval(document.getElementById(n).style.left.split('px')[0]) + eval(document.getElementById(n).style.width.split('px')[0]); minY = eval(document.getElementById(n).style.top.split('px')[0]); maxY = eval(document.getElementById(n).style.top.split('px')[0]) + eval(document.getElementById(n).style.height.split('px')[0]); } //alert(current_menu + ", " + minX + ", " + maxX + ", " + minY + ", " + maxY); //alert(eval(document.getElementById(n).style.width.split('px')[0])); //alert(offset); } //function thumbnail_width(n) //{alert(n); // if(document.getElementByID(n).width > 120) // { // return "100px"; // } //}