function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,true);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}function removeEvent(c,b,a){if(c.addEventListener){c.removeEventListener(b,a,true)}else{if(c.attachEvent){c.detachEvent("on"+b,a)}}}function getXCoordinate(b){var c=0;var a=b;while(a.offsetParent!=null){if(a.style.position=="absolute"||a.style.position=="relative"||a.style.overflow=="auto"){break}c+=a.offsetLeft;a=a.offsetParent}return c}function getYCoordinate(c){var b=0;var a=c;while(a.offsetParent!=null){if(a.style.position=="absolute"||a.style.position=="relative"||a.style.overflow=="auto"){break}b+=a.offsetTop;a=a.offsetParent}return b}function getXScroll(){var a=0;if(typeof(window.pageXOffset)=="number"){a=window.pageXOffset}else{if(document.body&&document.body.scrollLeft){a=document.body.scrollLeft}else{if(document.documentElement&&document.documentElement.scrollLeft){a=document.documentElement.scrollLeft}}}return a}function getYScroll(){var a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}}}return a}function getDocHeight(){var a=document.body;var b=document.documentElement;return Math.max(a.scrollHeight,b.scrollHeight,a.offsetHeight,b.offsetHeight,a.clientHeight,b.clientHeight)}var sDomain;function setCookie(b,c,a){var d=new Date();d.setDate(d.getDate()+a);if(isDev()){document.cookie=b+"="+encodeURIComponent(c)+";expires="+d.toGMTString()+";path=/"}else{document.cookie=b+"="+encodeURIComponent(c)+";expires="+d.toGMTString()+";path=/;domain="+sDomain}}function trim(c){var b=0,a=c.length-1;while(c.charCodeAt(b)<33){b++}while(c.charCodeAt(a)<33){a--}return b>a?"":c.substring(b,a+1)}function checkTextLen(c,b,a){if(typeof(c)!="string"){return false}return c.length>=b&&c.length<=a}function getElementsByClassName(g,b){var a=new Array();var d=new RegExp("(^|\\s)"+g+"(\\s|$)");var f=b.getElementsByTagName("*");for(var c=0;c<f.length;c++){var e=f[c].className;if(d.test(e)){a.push(f[c])}}return a}function getChildNodesByClassName(g,b){var a=new Array();var d=new RegExp("(^|\\s)"+g+"(\\s|$)");var f=b.childNodes;for(var c=0;c<f.length;c++){if(f[c].nodeType==1){var e=f[c].className;if(d.test(e)){a.push(f[c])}}}return a}function isIE(){return navigator.appName.indexOf("Microsoft")!=-1}function isIE6(){return(navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("msie 7")==-1)}function isOpera(){return navigator.appName.indexOf("Opera")!=-1}function htmlDecode(a){var b=document.createElement("div");b.innerHTML=b.textContent=a.replace(/&amp;/g,"&");a=b.firstChild.nodeValue;delete b;return a}function isDisplayed(a){var b=true;while(a.tagName!="BODY"){if(a.style.display!="none"){a=a.parentNode}else{b=false;break}}return b}function clearNode(objNode){with(objNode){while(hasChildNodes()){removeChild(firstChild)}}}function getParentByClassName(a,c){var b=c;while(b.tagName!="BODY"){b=b.parentNode;if(b.className){if(b.className.indexOf(a)!=-1){break}}}return b}function toggleSelectsVisibility(a,b){var d=b||document;var e=d.getElementsByTagName("SELECT");for(var c=0;c<e.length;c++){e[c].style.visibility=a?"visible":"hidden"}};