DOMhelp={debugWindowId:"DOMhelpdebug",init:function(){if(!document.getElementById||!document.createTextNode){return}},lastSibling:function(b){var a=b.parentNode.lastChild;while(a.nodeType!=1&&a.previousSibling!=null){a=a.previousSibling}return(a.nodeType==1)?a:false},firstSibling:function(b){var a=b.parentNode.firstChild;while(a.nodeType!=1&&a.nextSibling!=null){a=a.nextSibling}return(a.nodeType==1)?a:false},getText:function(c){if(!c.hasChildNodes()){return false}var b=/^\s+$/;var a=c.firstChild;while(a.nodeType!=3&&a.nextSibling!=null||b.test(a.nodeValue)){a=a.nextSibling}return a.nodeType==3?a.nodeValue:false},setText:function(d,c){if(!d.hasChildNodes()){return false}var b=/^\s+$/;var a=d.firstChild;while(a.nodeType!=3&&a.nextSibling!=null||b.test(a.nodeValue)){a=a.nextSibling}if(a.nodeType==3){a.nodeValue=c}else{return false}},createLink:function(b,c){var a=document.createElement("a");a.appendChild(document.createTextNode(c));a.setAttribute("href",b);return a},createTextElm:function(b,c){var a=document.createElement(b);a.appendChild(document.createTextNode(c));return a},closestSibling:function(c,b){var a;if(b==-1&&c.previousSibling!=null){a=c.previousSibling;while(a.nodeType!=1&&a.previousSibling!=null){a=a.previousSibling}}else{if(b==1&&c.nextSibling!=null){a=c.nextSibling;while(a.nodeType!=1&&a.nextSibling!=null){a=a.nextSibling}}}return a.nodeType==1?a:false},initDebug:function(){if(DOMhelp.debug){DOMhelp.stopDebug()}DOMhelp.debug=document.createElement("div");DOMhelp.debug.setAttribute("id",DOMhelp.debugWindowId);document.body.insertBefore(DOMhelp.debug,document.body.firstChild)},setDebug:function(a){if(!DOMhelp.debug){DOMhelp.initDebug()}DOMhelp.debug.innerHTML+=a+"\n"},stopDebug:function(){if(DOMhelp.debug){DOMhelp.debug.parentNode.removeChild(DOMhelp.debug);DOMhelp.debug=null}},getKey:function(b){if(window.event){var a=window.event.keyCode}else{if(b){var a=b.keyCode}}return a},getTarget:function(b){var a=window.event?window.event.srcElement:b?b.target:null;if(!a){return false}while(a.nodeType!=1&&a.nodeName.toLowerCase()!="body"){a=a.parentNode}return a},stopBubble:function(a){if(window.event&&window.event.cancelBubble){window.event.cancelBubble=true}if(a&&a.stopPropagation){a.stopPropagation()}},stopDefault:function(a){if(window.event&&window.event.returnValue){window.event.returnValue=false}if(a&&a.preventDefault){a.preventDefault()}},cancelClick:function(a){if(window.event&&window.event.cancelBubble&&window.event.returnValue){window.event.cancelBubble=true;window.event.returnValue=false;return}if(a&&a.stopPropagation&&a.preventDefault){a.stopPropagation();a.preventDefault()}},addEvent:function(b,e,a,c){if(b.addEventListener){b.addEventListener(e,a,c);return true}else{if(b.attachEvent){var d=b.attachEvent("on"+e,a);return d}else{b["on"+e]=a}}},cssjs:function(f,e,c,h){switch(f){case"swap":e.className=!DOMhelp.cssjs("check",e,c)?e.className.replace(h,c):e.className.replace(c,h);break;case"add":if(!DOMhelp.cssjs("check",e,c)){e.className+=e.className?" "+c:c}break;case"remove":var g=e.className.match(" "+c)?" "+c:c;e.className=e.className.replace(g,"");break;case"check":var j=false;var d=e.className.split(" ");for(var b=0;b<d.length;b++){if(d[b]==c){j=true}}return j;break}},safariClickFix:function(){return false},getScrollPosition:function(a){var b;var c;switch(a){case ("x"):if(window.scrollX){b=window.scrollX}else{b=document.body.scrollLeft}return b;break;case ("y"):if(window.scrollY){c=window.scrollY}else{c=document.body.scrollTop}return c;break}}};DOMhelp.addEvent(window,"load",DOMhelp.init,false);
