if(typeof(Module)!='undefined'){Module.createNamespace('com.wjstc.Common');com.wjstc.Common.NAME='com.wjstc.Common';com.wjstc.Common.VERSION=1.1;}else{if(typeof(com)=='undefined'){var com={};}if(typeof(com.wjstc)=='undefined')com.wjstc={};if(typeof(com.wjstc.Common)=='undefined')com.wjstc.Common={};}Number.prototype.NaN0=function(){return isNaN(this)?0:this;};com.wjstc.Common.strToInt=function(s,radix){if(typeof(radix)=='undefined'){radix=10;}return parseInt(s+'',radix).NaN0();};com.wjstc.Common.toFloat=function(s,m){if(typeof(m)=='undefined'){m=0;}return parseFloat(s+'').NaN0().toFixed(m);};com.wjstc.Common.getObjById=function(Id,doc){if(typeof(doc)=='undefined'){doc=document;}if(typeof(Id)=='string'||typeof(Id)=='number'){return doc.getElementById(Id+'');}return Id;};com.wjstc.Common.getPageScrollX=function(doc){if(typeof(doc)=='undefined'){doc=document;}if(typeof(window.innerWidth)=='number'){return window.pageXOffset-0;}else if(doc.documentElement&&document.documentElement.clientWidth){return(doc.documentElement.scrollLeft-0)/com.wjstc.Common.ZoomSensor.getZoom();}return doc.body.scrollLeft-0;};com.wjstc.Common.getPageScrollY=function(doc){if(typeof(doc)=='undefined'){doc=document;}if(typeof(window.innerWidth)=='number'){return window.pageYOffset-0;}else if(doc.documentElement&&document.documentElement.clientWidth){return(doc.documentElement.scrollTop-0)/com.wjstc.Common.ZoomSensor.getZoom();}return doc.body.scrollTop-0;};com.wjstc.Common.getObjScrollX=function(el,include){if(typeof(include)=='undefined'){include='no';}var o=com.wjstc.Common.getObjById(el);var l=0;if(include!='include'){if(o){if(typeof(o.offsetParent)=='unknown'){return l;}o=o.offsetParent;}}while(o){if(o.scrollLeft){l+=o.scrollLeft-0;}if(typeof(o.offsetParent)=='unknown'){return l;}o=o.offsetParent;}return l;};com.wjstc.Common.getObjScrollY=function(el,include){if(typeof(include)=='undefined'){include='no';}var o=com.wjstc.Common.getObjById(el);var l=0;if(include!='include'){if(o){if(typeof(o.offsetParent)=='unknown'){return l;}o=o.offsetParent;}}while(o){if(o.scrollTop){l+=o.scrollTop-0;}if(typeof(o.offsetParent)=='unknown'){return l;}o=o.offsetParent;}return l;};com.wjstc.Common.getMouseX=function(e){e=(e)?e:window.event;return(e.clientX-0)/com.wjstc.Common.ZoomSensor.getZoom();};com.wjstc.Common.getMouseY=function(e){e=(e)?e:window.event;return(e.clientY-0)/com.wjstc.Common.ZoomSensor.getZoom();};com.wjstc.Common.getMouseScrollX=function(e,doc){if(typeof(doc)=='undefined'){doc=document;}e=(e)?e:window.event;return com.wjstc.Common.getMouseX(e,doc)+com.wjstc.Common.getPageScrollX(doc);};com.wjstc.Common.getMouseScrollY=function(e,doc){if(typeof(doc)=='undefined'){doc=document;}e=(e)?e:window.event;return com.wjstc.Common.getMouseY(e,doc)+com.wjstc.Common.getPageScrollY(doc);};com.wjstc.Common.getX=function(el){var z=com.wjstc.Common.ZoomSensor.getZoom();var o=com.wjstc.Common.getObjById(el);var l=0;while(o){if(!o.style|| !o.style.position){l+=o.offsetLeft-0;}else{l+=((o.style.position=='absolute'||o.style.position=='relative'||o.style.position=='fixed')?(o.offsetLeft/z):o.offsetLeft)-0;}if(typeof(o.offsetParent)=='unknown'){break;}o=o.offsetParent;}return l;};com.wjstc.Common.getY=function(el){var z=com.wjstc.Common.ZoomSensor.getZoom();var o=com.wjstc.Common.getObjById(el);var t=0;while(o){if(!o.style|| !o.style.position){t+=o.offsetTop-0;}else{t+=((o.style.position=='absolute'||o.style.position=='relative'||o.style.position=='fixed')?(o.offsetTop/z):o.offsetTop)-0;}if(typeof(o.offsetParent)=='unknown'){break;}o=o.offsetParent;}return t;};com.wjstc.Common.getW=function(el,doc){if(typeof(doc)=='undefined'){doc=document;}var o=com.wjstc.Common.getObjById(el,doc);if(o){if(o.offsetWidth){return o.offsetWidth-0;}else if(o.clientWidth){return o.clientWidth-0;}}return 0;};com.wjstc.Common.getH=function(el,doc){if(typeof(doc)=='undefined'){doc=document;}var o=com.wjstc.Common.getObjById(el,doc);if(o){if(o.offsetHeight){return o.offsetHeight-0;}else if(o.clientHeight){return o.clientHeight-0;}}return 0;};com.wjstc.Common.moveToXY=function(el,x,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return;}var p=null;if(o.style&&o.style.position){p=o.style.position;}if(p&&p=='relative'){o.style.left=x*com.wjstc.Common.ZoomSensor.getZoom()+'px';o.style.top=y*com.wjstc.Common.ZoomSensor.getZoom()+'px';}else{o.style.left=x+'px';o.style.top=y+'px';}};com.wjstc.Common.moveAbsolutrToXY=function(el,x,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return;}o.style.left=x;o.style.top=y;};com.wjstc.Common.moveToLeft=function(el,x){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return 0;}var p=o.style.position;if(p=='relative'){x=x*com.wjstc.Common.ZoomSensor.getZoom();}o.style.left=x+'px';return x;};com.wjstc.Common.moveToTop=function(el,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return 0;}var p=o.style.position;if(p=='relative'){y=y*com.wjstc.Common.ZoomSensor.getZoom();}o.style.top=y+'px';return y;};com.wjstc.Common.moveToRight=function(el,x){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return 0;}var p=o.style.position;if(p=='relative'){x=x*com.wjstc.Common.ZoomSensor.getZoom();}o.style.right=x+'px';return x;};com.wjstc.Common.moveToBottom=function(el,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return 0;}var p=o.style.position;if(p=='relative'){y=y*com.wjstc.Common.ZoomSensor.getZoom();}o.style.bottom=y+'px';return y;};com.wjstc.Common.moveToPageXY=function(el,x,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return;}var p=o.style.position;if(p=='relative'){o.style.left=(x*com.wjstc.Common.ZoomSensor.getZoom()+com.wjstc.Common.getPageScrollX())+'px';o.style.top=(y*com.wjstc.Common.ZoomSensor.getZoom()+com.wjstc.Common.getPageScrollY())+'px';}else{o.style.left=(x+com.wjstc.Common.getPageScrollX())+'px';o.style.top=(y+com.wjstc.Common.getPageScrollY())+'px';}};com.wjstc.Common.moveToPageLeft=function(el,x){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return;}var p=o.style.position;if(p=='relative'){o.style.left=(x*com.wjstc.Common.ZoomSensor.getZoom()+com.wjstc.Common.getPageScrollX())+'px';}else{o.style.left=(x+com.wjstc.Common.getPageScrollX())+'px';}};com.wjstc.Common.moveToPageTop=function(el,y){var o=com.wjstc.Common.getObjById(el);if(o==null|| !o.style){return;}var p=o.style.position;if(p=='relative'){o.style.top=(y*com.wjstc.Common.ZoomSensor.getZoom()+com.wjstc.Common.getPageScrollY())+'px';}else{o.style.top=(y+com.wjstc.Common.getPageScrollY())+'px';}};com.wjstc.Common.pxTOem=function(d,size){if(typeof(size)=='undefined'){size=null;}return d/com.wjstc.Common.ZoomSensor.getFontSize(size);};com.wjstc.Common.emTOpx=function(d,size){if(typeof(size)=='undefined'){size=null;}return d*com.wjstc.Common.ZoomSensor.getFontSize(size);};com.wjstc.Common.onLoadCall=function(func){if(com.wjstc.Common.onLoadCall.started){func();}else{com.wjstc.Common.onLoadCall.fList.push(func);}};com.wjstc.Common.onLoadCall.started=false;com.wjstc.Common.onLoadCall.fList=[];com.wjstc.Common.onLoadCall.go=function(){if(!com.wjstc.Common.onLoadCall.started){var fl=com.wjstc.Common.onLoadCall.fList.length;for(var i=0;i<fl;i++){try{com.wjstc.Common.onLoadCall.fList[i]();}catch(e){}}delete com.wjstc.Common.onLoadCall.fList;delete com.wjstc.Common.onLoadCall.go;com.wjstc.Common.onLoadCall.started=true;}};if(window.addEventListener){window.addEventListener("load",com.wjstc.Common.onLoadCall.go,false);}else if(window.attachEvent){window.attachEvent("onload",com.wjstc.Common.onLoadCall.go);}else{window.onload=com.wjstc.Common.onLoadCall.go;}com.wjstc.Common.ZoomSensor=function(){var delay=250;var intervalId=null;var listeners=[];var currSize=16;var baseSize=16;var currZoom=1.0;var baseZoom=1.0;var currScrollX=0;var baseScrollX=0;var currScrollY=0;var baseScrollY=0;var createSensor=function(){var el=document.createElement('span');el.id='com_wjstc_ZoomSensor_cliche';el.style.fontFamily='Arial,Verdana,Helvetica,sans-serif;';el.style.fontStretch='condensed;';el.style.fontSize='small';el.style.width='1em';el.style.height='1em';el.innerHTML='&nbsp;';el.style.position="absolute";el.style.top="500px";el.style.left="0px";el.style.border='0';el.style.backgroundColor='transparent';el.style.zIndex= -1000;el.style.visibility='hidden';document.body.insertBefore(el,document.body.firstChild);};var g=function(){if(typeof(com)!='undefined'&&com){if(!com.wjstc.Common.ZoomSensor.c){com.wjstc.Common.ZoomSensor.c=1;}if(document.body){com.wjstc.Common.ZoomSensor.c=null;com.wjstc.Common.ZoomSensor.init();}else{if(com.wjstc.Common.ZoomSensor.c<40){com.wjstc.Common.ZoomSensor.c++;setTimeout(g,250)}}}};function j(){var eventFlags=0;var eventTypes='|';var listener;var newScrollX=com.wjstc.Common.getPageScrollX();if(newScrollX!=currScrollX){baseScrollX=currScrollX;currScrollX=newScrollX;eventFlags|=4;eventTypes+='scrollX|';}var newScrollY=com.wjstc.Common.getPageScrollY();if(newScrollY!=currScrollY){baseScrollY=currScrollY;currScrollY=newScrollY;eventFlags|=8;eventTypes+='scrollY|';}var newSize=com.wjstc.Common.getH('com_wjstc_ZoomSensor_cliche');if(newSize!=currSize){baseSize=currSize;currSize=newSize;eventFlags|=1;eventTypes+='fontSize|';}if(typeof(document.body.style.zoom)!='undefined'){var newZoom=com.wjstc.Common.strToInt(com.wjstc.Common.getObjById('com_wjstc_ZoomSensor_cliche').offsetTop+'')/500;if(currZoom!=newZoom){baseZoom=currZoom;currZoom=newZoom;eventFlags|=2;eventTypes+='zoom|';}}if(eventFlags){for(var i=0;i<listeners.length;i++){listener=listeners[i];if((listener.enf&eventFlags)>0){listener.fn.call(listener.obj,eventTypes);}}}};function k(){return(intervalId!=null);};function f(){if(!intervalId){intervalId=window.setInterval('com.wjstc.Common.ZoomSensor.compute()',delay);}};function r(){if(intervalId){window.clearInterval(intervalId);intervalId=null;}currZoom=1.0;baseZoom=1.0;};return{init:function(){createSensor();baseSize=currSize=com.wjstc.Common.getH('com_wjstc_ZoomSensor_cliche');baseScrollX=currScrollX=com.wjstc.Common.getPageScrollX();baseScrollY=currScrollY=com.wjstc.Common.getPageScrollY();baseZoom=currZoom=com.wjstc.Common.strToInt(com.wjstc.Common.getObjById('com_wjstc_ZoomSensor_cliche').offsetTop+'')/500;f();},addEventListener:function(eventTypes,eventHandler,scopeObj){var obj=null;if(typeof(scopeObj)!='undefined'&&scopeObj!=null){obj=com.wjstc.Common.getObjById(scopeObj);}var en='|'+eventTypes+'|';var enf=0;if(en.indexOf('|fontSize|')>=0){enf|=1;}if(en.indexOf('|zoom|')>=0){enf|=2;}if(en.indexOf('|scrollX|')>=0){enf|=4;}if(en.indexOf('|scrollY|')>=0){enf|=8;}if(en.indexOf('|scroll|')>=0){enf|=12;}if(en.indexOf('all|')>=0){enf|=15;}if(en<1){return false;}var ls=listeners.length;for(var i=0;i<ls;++i){if(eventHandler==listeners[i].fn&&enf==listeners[i].enf&&obj==listeners[i].obj){return false;}}listeners.push({enf:enf,fn:eventHandler,obj:obj});return true;},removeEventListener:function(eventTypes,eventHandler,scopeObj){var allTypes=false;var allHandlers=false;var obj=null;if(typeof(scopeObj)!='undefined'&&scopeObj!=null){obj=com.wjstc.Common.getObjById(scopeObj);}if(typeof(eventHandler)=='undefined'||eventHandler==null){allHandlers=true;}if(typeof(eventTypes)=='undefined'||eventTypes==null){allTypes=true;}var en='|'+eventTypes+'|';var enf=0;if(en.indexOf('|fontSize|')>=0){enf|=1;}if(en.indexOf('|zoom|')>=0){enf|=2;}if(en.indexOf('|scrollX|')>=0){enf|=4;}if(en.indexOf('|scrollY|')>=0){enf|=8;}if(en.indexOf('|scroll|')>=0){enf|=12;}if(en.indexOf('|all|')>=0){enf|=15;}if(en<1){return false;}var flag=false;var ls=listeners.length;for(var i=0;i<ls;++i){if((allTypes||enf==listeners[i].enf)&&(allHandlers||eventHandler==listeners[i].fn)&&(obj==null||obj==listeners[i].obj)){listeners.splice(i,1);--i;--ls;flag=true;}}return flag;},compute:function(){j();},getZoom:function(){return currZoom;},getBaseZoom:function(){return baseZoom;},getFontSize:function(size){if(typeof(size)=='undefined'||size==null||size=='small'){return currSize;}var o=com.wjstc.Common.getObjById('com_wjstc_ZoomSensor_cliche');if(o){o.style.fontSize=size;var cS=com.wjstc.Common.getH(o);o.style.fontSize='small';return cS;}else{return currSize;}},getBaseFontSize:function(){return baseSize;},isOn:function(){return k();},stop:function(){return r();},start:function(){return f();}}}();com.wjstc.Common.onLoadCall(com.wjstc.Common.ZoomSensor.init);