// JavaScript Document function redirect(url) { url = sid(url); var prefix = index(); if (url.indexOf(prefix)>-1) window.location.href = url; else window.location.href = prefix+'/App/page/'+url; } function request() { var s = ""; var c = document.forms[0].elements; for(var i=0; i 0){ // Ugly NS4 Bug Fix if(mac){ if(document.height < window.innerHeight){ offset -= 8; } }else{ offset -= 8; } } return offset; } function fixNetscape() { var ns4 = document.layers ? true : false; if (ns4) { origWidth = window.innerWidth; origHeight = window.innerHeight; //window.onresize = fixNetscape; } if (origWidth != window.innerWidth || origHeight != window.innerHeight) { window.location.reload(); } }*/ function styleObject(name, nest) { var w3c = document.getElementById ? true : false; var iex = document.all ? true : false; var ns4 = document.layers ? true : false; nest = nest ? 'document.'+nest+'.' : ''; return w3c ? document.getElementById(name).style : iex ? document.all[name].style : ns4 ? eval(nest+'document.'+name) : false; } PageInfo = { px : function () { return document.childNodes ? 'px' : 0; }, getResolutionWidth : function() { return self.screen.width; }, getResolutionHeight : function() { return self.screen.height; }, getColorDepth : function() { return self.screen.colorDepth; }, getScrollLeft : function() { var scrollLeft = 0; if (document.documentElement && document.documentElement.scrollLeft && document.documentElement.scrollLeft != 0) { scrollLeft = document.documentElement.scrollLeft; } if (document.body && document.body.scrollLeft && document.body.scrollLeft != 0) { scrollLeft = document.body.scrollLeft; } if (window.pageXOffset && window.pageXOffset != 0) { scrollLeft = window.pageXOffset; } return scrollLeft; }, getScrollTop : function() { var scrollTop = 0; if (document.documentElement && document.documentElement.scrollTop && document.documentElement.scrollTop != 0) { scrollTop = document.documentElement.scrollTop; } if (document.body && document.body.scrollTop && document.body.scrollTop != 0) { scrollTop = document.body.scrollTop; } if (window.pageYOffset && window.pageYOffset != 0) { scrollTop = window.pageYOffset; } return scrollTop; }, getDocumentWidth : function() { var documentWidth = 0; var w1 = document.body.scrollWidth; var w2 = document.body.offsetWidth; if (w1 > w2) { documentWidth = document.body.scrollWidth; } else { documentWidth = document.body.offsetWidth; } return documentWidth; }, getDocumentHeight : function() { var documentHeight = 0; var h1 = document.body.scrollHeight; var h2 = document.body.offsetHeight; if (h1 > h2) { documentHeight = document.body.scrollHeight; } else { documentHeight = document.body.offsetHeight; } return documentHeight; }, getVisibleWidth : function() { var visibleWidth = 0; if (self.innerWidth) { visibleWidth = self.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { visibleWidth = document.documentElement.clientWidth; } else if (document.body) { visibleWidth = document.body.clientWidth; } return visibleWidth; }, getVisibleHeight : function() { var visibleHeight = 0; if (self.innerHeight) { visibleHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { visibleHeight = document.documentElement.clientHeight; } else if (document.body) { visibleHeight = document.body.clientHeight; } return visibleHeight; }, windowSize : function() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [myWidth, myHeight]; }, getElementLeft : function(element) { var element = (typeof element == "string") ? elementObject(element) : element; var left = element.offsetLeft; var oParent = element.offsetParent; while (oParent != null) { left += oParent.offsetLeft; oParent = oParent.offsetParent; } return left; }, getElementTop : function(element) { var element = (typeof element == "string") ? elementObject(element) : element; var top = element.offsetTop; var oParent = element.offsetParent; while (oParent != null) { top += oParent.offsetTop; oParent = oParent.offsetParent; } return top; }, getElementWidth : function(element) { var element = (typeof element == "string") ? elementObject(element) : element; return element.offsetWidth; }, getElementHeight : function(element) { var element = (typeof element == "string") ? elementObject(element) : element; return element.offsetHeight; }, addFrag : function(str) { var frag = document.createDocumentFragment(); frag.appendChild(document.createTextNode(str)); document.body.appendChild(frag); }, addStr : function(str) { if( document.layers && window.Layer && document.classes ) { //create a layer 350px wide document.layers['newName'] = new Layer( 350 ); //write its content document.layers['newName'].document.open(); document.layers['newName'].document.write(str); document.layers['newName'].document.close(); //style it document.layers['newName'].left = 0; document.layers['newName'].top = 0; document.layers['newName'].visibility = 'show'; } else if( document.body ) { var theString = '
'+str+'
'; if( document.body.insertAdjacentHTML ) { document.body.insertAdjacentHTML( 'beforeEnd', theString ); } else if( typeof( document.body.innerHTML ) != 'undefined' ) { document.body.innerHTML += theString; } else { //FAILURE, nothing works } } else { //FAILURE, nothing works } }, onEnter : function (evt) { var e = eventObject(evt); if ((e.which && e.which == 13) || (e.keyChar && e.keyChar == 13) || (e.keyCode && e.keyCode == 13)) return true; else return false; }, evalScript : function (data) { var head = document.getElementsByTagName("head")[0] || document.documentElement; var script = document.createElement("script"); script.type = "text/javascript"; try{ script.setAttribute('text', data); } catch(e) {} try{ script.appendChild(document.createTextNode(data)); } catch(e) {} head.insertBefore(script, head.firstChild); head.removeChild(script); }, getMouseX : function() { return PageInfo.mouseX; }, getMouseY : function() { return PageInfo.mouseY; }, // HELPER CODE FOR TRACKING MOUSE POSITION mouseX: 0, mouseY: 0, onMouseMove: function(e) { e = eventObject(e); PageInfo.mouseX = e.clientX + PageInfo.getScrollLeft(); PageInfo.mouseY = e.clientY + PageInfo.getScrollTop(); } }; // HELPER CODE FOR TRACKING MOUSE POSITION registerEvent(document, "mousemove", PageInfo.onMouseMove);