
function Enable(inputobjname)
{var inputobj=document.getElementById(inputobjname);if(inputobj!=null)
{inputobj.disabled=false;}}
function Disable(inputobjname)
{var inputobj=document.getElementById(inputobjname);if(inputobj!=null)
{inputobj.disabled=true;}}
function ShowDiv(divname)
{var divobj=document.getElementById(divname);if(divobj!=null)
{divobj.style.display="inline";}}
function HideDiv(divname)
{var divobj=document.getElementById(divname);if(divobj!=null)
{divobj.style.display="none";}}
function ref(elid){var xel=document.getElementById(elid);return xel;}
function SerializeCSSPair(a,b){if(a!=null&&b!=null)return a+":"+b+";"
if(a!=null)return a+":;";return"";}
function Rect(x,y,w,h){this.X=(null!=x?x:0);this.Y=(null!=y?y:0);this.W=(null!=w?w:0);this.H=(null!=h?h:0);this.Bottom=y+h;this.Right=x+w;this.Serialize=function(){return"("+this.X+","+this.Y+","+
this.W+","+this.H+")";}
this.Transform=function(dx,dy,dw,dh){this.X+=dx;this.Y+=dy;this.W+=dw;this.H+=dh;this.Bottom=this.Y+this.H;this.Right=this.X+this.W;}
this.Contains=function(pos){if(pos.X<this.X)return false;if(pos.X>this.Right)return false;if(pos.Y<this.Y)return false;if(pos.Y>this.Bottom)return false;return true;}
this.SerializeCSS=function(){return SerializeCSSPair("left",this.X+"px")+
SerializeCSSPair("top",this.Y+"px")+
SerializeCSSPair("width",this.W+"px")+
SerializeCSSPair("height",this.H+"px");}}
function Position(x,y){this.X=(null!=x?x:0);this.Y=(null!=y?y:0);this.Serialize=function(){return"("+this.X+","+this.Y+")";}
this.AddTo=function(pos){pos.X+=this.X;pos.Y+=this.Y;return pos;}}
function GetMousePosition(event){var posx=0;var posy=0;if(event.pageX||event.pageY)
{posx=event.pageX;posy=event.pageY;}
else if(event.clientX||event.clientY)
{posx=event.clientX+document.body.scrollLeft;posy=event.clientY+document.body.scrollTop;}
return new Position(posx,posy);}
function makeLink(url,text){return"<a href='"+url+"' alt=''>"+text+"</a>";}
function attachEventHandler(obj,evType,fn){if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}
else if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}
else{}}
function detachEventHandler(obj,evType,fn){if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}
else if(obj.removeEventListener){obj.removeEventListener(evType,fn,false);return true;}
else{}}
function findPosX(obj){return getRealPos(obj,"Left");}
function findPosY(obj){return getRealPos(obj,"Top");}
function getRealPos(el,which){iPos=0;while(el!=null){iPos+=el["offset"+which];el=el.offsetParent;}
return iPos;}
function getWidth(obj){return obj.offsetWidth;}
function getHeight(obj){return obj.offsetHeight;}
function getAbsoluteRect(obj){return new Rect(findPosX(obj),findPosY(obj),getWidth(obj),getHeight(obj));}
function getRelativeRect(obj){return new Rect(obj.offsetLeft,obj.offsetTop,getWidth(obj),getHeight(obj));}
function makeAbsolute(obj){var rect=getAbsoluteRect(obj);obj.style.postion="absolute";obj.style.left=rect.X+"px";obj.style.top=rect.Y+"px";obj.style.zIndex=100;}
function moveElement(obj,x,y){obj.style.left=x+"px";obj.style.top=y+"px";}
function getEventTarget(event){if(event.target)targ=event.target;else if(event.srcElement)targ=event.srcElement;if(targ.nodeType==3)
targ=targ.parentNode;return targ;}
function getEventChar(e){var code;if(!e)var e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;var character=String.fromCharCode(code);if(!character)return"";return character;}
function whichMouseButton(event){var rightclick;if(event.which)rightclick=(event.which==3);else if(event.button)rightclick=(event.button==2);if(rightclick)return"right";return"left";}
function getEventSerial(event){var trg=getEventTarget(event);var typ=event.type;var btn=whichMouseButton(event);var elRect=getAbsoluteRect(trg);var eSerial=SerializeCSSPair("targrect",elRect.Serialize())+
SerializeCSSPair("etype",typ)+
SerializeCSSPair("mbtn",btn);return eSerial;}
function getAbsoluteRectSerial(obj){return getAbsoluteRect(obj).Serialize();}
function getElementStyleFull(obj){if(obj.currentStyle){return obj.currentStyle;}
else if(window.getComputedStyle){return window.getComputedStyle(obj,null);}
return"null";}
function getInlineCSSText(obj,lineEnding){var st=obj.style["cssText"];st=st.toLowerCase();if(lineEnding){st=st.split(";").join(";"+lineEnding);}
return st;}
function getStyle(obj,lineEnding){var st=obj.style;var s="";for(i in st){if(st[i]&&st[i]!=null&&st[i]!="")
if(i!="cssText"){s+=SerializeCSSPair(i,st[i]);if(lineEnding)s+=lineEnding;}}
return s;}
function setOpacity(opacity,obj){var object=obj.style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}
function setStyle(obj,sName,val,vSuffix){obj.style[sName]=val+""+vSuffix;}
﻿
var IFrameManager={GetAllDocuments:function(){var arr=new Array();f_get_iframedocuments_recurse(window.top.document,arr);return arr;},GetAllFrames:function(){var arr=new Array();f_get_iframes_recurse(window.top.document,arr);return arr;},AttachDocumentEventGlobal:function(eType,fn){f_iframes_attach_doc_event_recurse(window.top.document,eType,fn);},DetachDocumentEventGlobal:function(eType,fn){f_iframes_detach_doc_event_recurse(window.top.document,eType,fn);},GetEventDocument:function(event){var targ=getEventTarget(event);return targ.ownerDocument;},FindFrameByTarget:function(event){var frms=IFrameManager.GetAllFrames();var pos=GetMousePosition(event);var targ=getEventTarget(event);for(i=0;i<frms.length;i++){var doc=getDoc(frms[i]);var el=doc.elementFromPoint(pos.X,pos.Y)
if(el==targ)return frms[i];}
return null;},FindTargetWindow:function(event){var frm=IFrameManager.FindFrameByTarget(event);var framewin=window.top;if(frm!=null)framewin=frm.contentWindow;return framewin;}};function getDoc(frm){if(document.attachEvent){return frm.contentWindow.document;}else if(document.getElementById&&!document.all){return frm.contentWindow;}else{return frm.contentDocument;}}
function f_get_iframedocuments_recurse(doc,resArray){resArray.push(doc);var frs=doc.getElementsByTagName("iframe");for(var i=0;i<frs.length;i++)
{var d=getDoc(frs[i]);f_get_iframedocuments_recurse(d,resArray);}}
function f_get_iframes_recurse(doc,resArray){var frs=doc.getElementsByTagName("iframe");for(var i=0;i<frs.length;i++)
{resArray.push(frs[i]);var d=getDoc(frs[i]);f_get_iframes_recurse(d,resArray);}}
function f_iframes_attach_doc_event_recurse(doc,eType,callback){if(typeof callback!='function')return;if(!doc)return;attachEventHandler(doc,eType,callback);var frs=doc.getElementsByTagName("iframe");for(var i=0;i<frs.length;i++)
{var d=getDoc(frs[i]);f_iframes_attach_doc_event_recurse(d,eType,callback);}}
function f_iframes_detach_doc_event_recurse(doc,eType,callback){if(typeof callback!='function')return;detachEventHandler(doc,eType,callback);var frs=doc.getElementsByTagName("iframe");for(var i=0;i<frs.length;i++)
{var d=getDoc(frs[i]);f_iframes_detach_doc_event_recurse(d,eType,callback);}}
﻿
var WindowEx={ClientWidth:function(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);},ClientHeight:function(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);},ScrollLeft:function(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);},ScrollTop:function(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);}};function f_filterResults(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel)))
n_result=n_docel;return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;}