function xBackground(e,c,i){if(!(e=xGetElementById(e)))return'';var bg='';if(e.style){if(xStr(c)){e.style.backgroundColor=c;}if(xStr(i)){e.style.backgroundImage=(i!='')?'url('+i+')':null;}bg=e.style.backgroundColor;}return bg;}function xClientHeight(){var v=0,d=document,w=window;if(d.compatMode=='CSS1Compat'&&!w.opera&&d.documentElement&&d.documentElement.clientHeight){v=d.documentElement.clientHeight;}else if(d.body&&d.body.clientHeight){v=d.body.clientHeight;}else if(xDef(w.innerWidth,w.innerHeight,d.width)){v=w.innerHeight;if(d.width>w.innerWidth)v-=16;}return v;}function xClientWidth(){var v=0,d=document,w=window;if(d.compatMode=='CSS1Compat'&&!w.opera&&d.documentElement&&d.documentElement.clientWidth){v=d.documentElement.clientWidth;}else if(d.body&&d.body.clientWidth){v=d.body.clientWidth;}else if(xDef(w.innerWidth,w.innerHeight,d.height)){v=w.innerWidth;if(d.height>w.innerHeight)v-=16;}return v;}function xClip(e,t,r,b,l){if(!(e=xGetElementById(e)))return;if(e.style){if(xNum(l))e.style.clip='rect('+t+'px '+r+'px '+b+'px '+l+'px)';else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';}}function xColor(e,s){if(!(e=xGetElementById(e)))return'';var c='';if(e.style&&xDef(e.style.color)){if(xStr(s))e.style.color=s;c=e.style.color;}return c;}function xDef(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}return true;}function xDisplay(e,s){if((e=xGetElementById(e))&&e.style&&xDef(e.style.display)){if(xStr(s)){try{e.style.display=s;}catch(ex){e.style.display='';}}return e.style.display;}return null;}function xGetComputedStyle(oEle,sProp,bInt){var s,p='undefined';var dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(oEle,'');if(s)p=s.getPropertyValue(sProp);}else if(oEle.currentStyle){var i,c,a=sProp.split('-');sProp=a[0];for(i=1;i<a.length;++i){c=a[i].charAt(0);sProp+=a[i].replace(c,c.toUpperCase());}p=oEle.currentStyle[sProp];}else return null;return bInt?(parseInt(p)||0):p;}function xGetElementById(e){if(typeof(e)=='string'){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;}return e;}function xGetElementsByTagName(t,p){var list=null;t=t||'*';p=p||document;if(typeof p.getElementsByTagName!='undefined'){list=p.getElementsByTagName(t);if(t=='*'&&(!list||!list.length))list=p.all;}else{if(t=='*')list=p.all;else if(p.all&&p.all.tags)list=p.all.tags(t);}return list||new Array();}function xHasPoint(e,x,y,t,r,b,l){if(!xNum(t)){t=r=b=l=0;}else if(!xNum(r)){r=b=l=t;}else if(!xNum(b)){l=r;b=t;}var eX=xPageX(e),eY=xPageY(e);return(x>=eX+l&&x<=eX+xWidth(e)-r&&y>=eY+t&&y<=eY+xHeight(e)-b);}function xHeight(e,h){if(!(e=xGetElementById(e)))return 0;if(xNum(h)){if(h<0)h=0;else h=Math.round(h);}else h=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){h=xClientHeight();}else if(css&&xDef(e.offsetHeight)&&xStr(e.style.height)){if(h>=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null){pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h;}}h-=(pt+pb+bt+bb);if(isNaN(h)||h<0)return;else e.style.height=h+'px';}h=e.offsetHeight;}else if(css&&xDef(e.style.pixelHeight)){if(h>=0)e.style.pixelHeight=h;h=e.style.pixelHeight;}return h;}function xHide(e){return xVisibility(e,0);}function xLeft(e,iX){if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.left)){if(xNum(iX))e.style.left=iX+'px';else{iX=parseInt(e.style.left);if(isNaN(iX))iX=xGetComputedStyle(e,'left',1);if(isNaN(iX))iX=0;}}else if(css&&xDef(e.style.pixelLeft)){if(xNum(iX))e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}return iX;}xLibrary={version:'4.09',license:'GNU LGPL',url:'http://cross-browser.com/'};function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y);}function xNum(){for(var i=0;i<arguments.length;++i){if(isNaN(arguments[i])||typeof(arguments[i])!='number')return false;}return true;}function xOffsetLeft(e){if(!(e=xGetElementById(e)))return 0;if(xDef(e.offsetLeft))return e.offsetLeft;else return 0;}function xOffsetTop(e){if(!(e=xGetElementById(e)))return 0;if(xDef(e.offsetTop))return e.offsetTop;else return 0;}function xOpacity(e,o){var set=xDef(o);if(!(e=xGetElementById(e)))return 2;if(xStr(e.style.opacity)){if(set)e.style.opacity=o+'';else o=parseFloat(e.style.opacity);}else if(xStr(e.style.filter)){if(set)e.style.filter='alpha(opacity='+(100*o)+')';else if(e.filters&&e.filters.alpha){o=e.filters.alpha.opacity/100;}}else if(xStr(e.style.MozOpacity)){if(set)e.style.MozOpacity=o+'';else o=parseFloat(e.style.MozOpacity);}else if(xStr(e.style.KhtmlOpacity)){if(set)e.style.KhtmlOpacity=o+'';else o=parseFloat(e.style.KhtmlOpacity);}return isNaN(o)?1:o;}function xPageX(e){var x=0;e=xGetElementById(e);while(e){if(xDef(e.offsetLeft))x+=e.offsetLeft;e=xDef(e.offsetParent)?e.offsetParent:null;}return x;}function xPageY(e){var y=0;e=xGetElementById(e);while(e){if(xDef(e.offsetTop))y+=e.offsetTop;e=xDef(e.offsetParent)?e.offsetParent:null;}return y;}function xParent(e,bNode){if(!(e=xGetElementById(e)))return null;var p=null;if(!bNode&&xDef(e.offsetParent))p=e.offsetParent;else if(xDef(e.parentNode))p=e.parentNode;else if(xDef(e.parentElement))p=e.parentElement;return p;}function xResizeTo(e,w,h){xWidth(e,w);xHeight(e,h);}function xScrollLeft(e,bWin){var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollLeft)offset=w.document.documentElement.scrollLeft;else if(w.document.body&&xDef(w.document.body.scrollLeft))offset=w.document.body.scrollLeft;}else{e=xGetElementById(e);if(e&&xNum(e.scrollLeft))offset=e.scrollLeft;}return offset;}function xScrollTop(e,bWin){var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollTop)offset=w.document.documentElement.scrollTop;else if(w.document.body&&xDef(w.document.body.scrollTop))offset=w.document.body.scrollTop;}else{e=xGetElementById(e);if(e&&xNum(e.scrollTop))offset=e.scrollTop;}return offset;}function xShow(e){return xVisibility(e,1);}function xStr(s){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='string')return false;}return true;}function xTop(e,iY){if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.top)){if(xNum(iY))e.style.top=iY+'px';else{iY=parseInt(e.style.top);if(isNaN(iY))iY=xGetComputedStyle(e,'top',1);if(isNaN(iY))iY=0;}}else if(css&&xDef(e.style.pixelTop)){if(xNum(iY))e.style.pixelTop=iY;else iY=e.style.pixelTop;}return iY;}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE'&&document.all&&xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xVisibility(e,bShow){if(!(e=xGetElementById(e)))return null;if(e.style&&xDef(e.style.visibility)){if(xDef(bShow))e.style.visibility=bShow?'visible':'hidden';return e.style.visibility;}return null;}function xWidth(e,w){if(!(e=xGetElementById(e)))return 0;if(xNum(w)){if(w<0)w=0;else w=Math.round(w);}else w=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){w=xClientWidth();}else if(css&&xDef(e.offsetWidth)&&xStr(e.style.width)){if(w>=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null){pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w;}}w-=(pl+pr+bl+br);if(isNaN(w)||w<0)return;else e.style.width=w+'px';}w=e.offsetWidth;}else if(css&&xDef(e.style.pixelWidth)){if(w>=0)e.style.pixelWidth=w;w=e.style.pixelWidth;}return w;}function xZIndex(e,uZ){if(!(e=xGetElementById(e)))return 0;if(e.style&&xDef(e.style.zIndex)){if(xNum(uZ))e.style.zIndex=uZ;uZ=parseInt(e.style.zIndex);}return uZ;}
function xAppendChild(oParent,oChild){if(oParent.appendChild)return oParent.appendChild(oChild);else return null;}function xCreateElement(sTag){if(document.createElement)return document.createElement(sTag);else return null;}function xFirstChild(e,t){e=xGetElementById(e);var c=e?e.firstChild:null;while(c){if(c.nodeType==1&&(!t||c.nodeName.toLowerCase()==t.toLowerCase())){break;}c=c.nextSibling;}return c;}function xGetComputedStyle(oEle,sProp,bInt){var s,p='undefined';var dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(oEle,'');if(s)p=s.getPropertyValue(sProp);}else if(oEle.currentStyle){var i,c,a=sProp.split('-');sProp=a[0];for(i=1;i<a.length;++i){c=a[i].charAt(0);sProp+=a[i].replace(c,c.toUpperCase());}p=oEle.currentStyle[sProp];}else return null;return bInt?(parseInt(p)||0):p;}function xGetElementsByAttribute(sTag,sAtt,sRE,fn){var a,list,found=new Array(),re=new RegExp(sRE,'i');list=xGetElementsByTagName(sTag);for(var i=0;i<list.length;++i){a=list[i].getAttribute(sAtt);if(!a){a=list[i][sAtt];}if(typeof(a)=='string'&&a.search(re)!=-1){found[found.length]=list[i];if(fn)fn(list[i]);}}return found;}function xGetElementsByClassName(c,p,t,f){var r=new Array();var re=new RegExp("(^|\\s)"+c+"(\\s|$)");var e=xGetElementsByTagName(t,p);for(var i=0;i<e.length;++i){if(re.test(e[i].className)){r[r.length]=e[i];if(f)f(e[i]);}}return r;}function xGetElementsByTagName(t,p){var list=null;t=t||'*';p=p||document;if(typeof p.getElementsByTagName!='undefined'){list=p.getElementsByTagName(t);if(t=='*'&&(!list||!list.length))list=p.all;}else{if(t=='*')list=p.all;else if(p.all&&p.all.tags)list=p.all.tags(t);}return list||new Array();}function xInnerHtml(e,h){if(!(e=xGetElementById(e))||!xStr(e.innerHTML))return null;var s=e.innerHTML;if(xStr(h)){e.innerHTML=h;}return s;}xLibrary={version:'4.09',license:'GNU LGPL',url:'http://cross-browser.com/'};function xNextSib(e,t){e=xGetElementById(e);var s=e?e.nextSibling:null;while(s){if(s.nodeType==1&&(!t||s.nodeName.toLowerCase()==t.toLowerCase())){break;}s=s.nextSibling;}return s;}function xParentNode(ele,n){while(ele&&n--){ele=ele.parentNode;}return ele;}function xPrevSib(e,t){e=xGetElementById(e);var s=e?e.previousSibling:null;while(s){if(s.nodeType==1&&(!t||s.nodeName.toLowerCase()==t.toLowerCase())){break;}s=s.previousSibling;}return s;}function xWalkTree(n,f){f(n);for(var c=n.firstChild;c;c=c.nextSibling){if(c.nodeType==1)xWalkTree(c,f);}}
function xDisableDrag(id,last){if(!window._xDrgMgr)return;var ele=xGetElementById(id);ele.xDraggable=false;ele.xODS=null;ele.xOD=null;ele.xODE=null;xRemoveEventListener(ele,'mousedown',_xOMD,false);if(_xDrgMgr.mm&&last){_xDrgMgr.mm=false;xRemoveEventListener(document,'mousemove',_xOMM,false);}}function xDisableDrop(id){if(!window._xDrgMgr)return;var e=xGetElementById(id);if(e&&e.xODp){e.xODp=null;for(i=0;i<_xDrgMgr.drops.length;++i){if(e==_xDrgMgr.drops[i]){_xDrgMgr.drops.splice(i,1);}}}}var _xDrgMgr={ele:null,mm:false};function xEnableDrag(id,fS,fD,fE,x1,y1,x2,y2){var el=xGetElementById(id);if(el){el.xDraggable=true;el.xODS=fS;el.xOD=fD;el.xODE=fE;el.xREC=null;if(xDef(x1,y1,x2,y2)){el.xREC={x1:x1,y1:y1,x2:x2,y2:y2};}xAddEventListener(el,'mousedown',_xOMD,false);if(!_xDrgMgr.mm){_xDrgMgr.mm=true;xAddEventListener(document,'mousemove',_xOMM,false);}}}function _xOMD(e){var ev=new xEvent(e);if(ev.button!=0)return;var t=ev.target;while(t&&!t.xDraggable){t=xParent(t);}if(t){xPreventDefault(e);t.xDPX=ev.pageX;t.xDPY=ev.pageY;_xDrgMgr.ele=t;xAddEventListener(document,'mouseup',_xOMU,false);if(t.xODS){t.xODS(t,ev.pageX,ev.pageY);}}}function _xOMM(e){var ev=new xEvent(e);if(_xDrgMgr.ele){xPreventDefault(e);var b=true,el=_xDrgMgr.ele;var dx=ev.pageX-el.xDPX;var dy=ev.pageY-el.xDPY;el.xDPX=ev.pageX;el.xDPY=ev.pageY;if(el.xREC){var r=el.xREC,x=xPageX(el)+dx,y=xPageY(el)+dy;var b=(x>=r.x1&&x+xWidth(el)<=r.x2&&y>=r.y1&&y+xHeight(el)<=r.y2);}if(el.xOD){el.xOD(el,dx,dy,b);}else if(b){xMoveTo(el,xLeft(el)+dx,xTop(el)+dy);}}}function _xOMU(e){if(_xDrgMgr.ele){xPreventDefault(e);xRemoveEventListener(document,'mouseup',_xOMU,false);if(_xDrgMgr.ele.xODE){var ev=new xEvent(e);_xDrgMgr.ele.xODE(_xDrgMgr.ele,ev.pageX,ev.pageY);}_xDrgMgr.ele=null;}}function xEnableDrop(id,fD){var e=xGetElementById(id);if(e){e.xODp=fD;if(!_xDrgMgr.drops){_xDrgMgr.drops=new Array();}_xDrgMgr.drops[_xDrgMgr.drops.length]=e;if(!_xDrgMgr.omu){_xDrgMgr.omu=_xOMU;_xOMU=_xOMU2;}}}function _xOMU2(e){var i,z,hz=0,he=null;e=new xEvent(e);for(i=0;i<_xDrgMgr.drops.length;++i){if(xHasPoint(_xDrgMgr.drops[i],e.pageX,e.pageY)){z=xZIndex(_xDrgMgr.drops[i])||0;if(z>=hz){hz=z;he=_xDrgMgr.drops[i];}}}var ele=_xDrgMgr.ele;_xDrgMgr.omu(e);if(he&&he.xODp){he.xODp(ele,e.pageX,e.pageY);}}xLibrary={version:'4.09',license:'GNU LGPL',url:'http://cross-browser.com/'}; function xAddEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if(e.addEventListener)e.addEventListener(eT,eL,cap||false);else if(e.attachEvent)e.attachEvent('on'+eT,eL);else e['on'+eT]=eL;}function xEvent(evt){var e=evt||window.event;if(!e)return;if(e.type)this.type=e.type;if(e.target)this.target=e.target;else if(e.srcElement)this.target=e.srcElement;if(e.relatedTarget)this.relatedTarget=e.relatedTarget;else if(e.type=='mouseover'&&e.fromElement)this.relatedTarget=e.fromElement;else if(e.type=='mouseout')this.relatedTarget=e.toElement;if(xDef(e.pageX,e.pageY)){this.pageX=e.pageX;this.pageY=e.pageY;}else if(xDef(e.clientX,e.clientY)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop();}if(xDef(e.offsetX,e.offsetY)){this.offsetX=e.offsetX;this.offsetY=e.offsetY;}else if(xDef(e.layerX,e.layerY)){this.offsetX=e.layerX;this.offsetY=e.layerY;}else{this.offsetX=this.pageX-xPageX(this.target);this.offsetY=this.pageY-xPageY(this.target);}this.keyCode=e.keyCode||e.which||0;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey;this.altKey=e.altKey;this.button=3;if(e.type.indexOf('click')!=-1){this.button=0;}else if(e.type.indexOf('mouse')!=-1){this.button=e.button;}}xLibrary={version:'4.09',license:'GNU LGPL',url:'http://cross-browser.com/'};function xPreventDefault(e){if(e&&e.preventDefault)e.preventDefault();else if(window.event)window.event.returnValue=false;}function xRemoveEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if(e.removeEventListener)e.removeEventListener(eT,eL,cap||false);else if(e.detachEvent)e.detachEvent('on'+eT,eL);else e['on'+eT]=null;}function xStopPropagation(evt){if(evt&&evt.stopPropagation)evt.stopPropagation();else if(window.event)window.event.cancelBubble=true;}
var agt=navigator.userAgent.toLowerCase(); var appVer = navigator.appVersion.toLowerCase(); var is_minor = parseFloat(appVer); var is_major = parseInt(is_minor); var is_opera = (agt.indexOf("opera") != -1); var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); var is_opera8 = (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1); var is_opera9 = (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1); var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); var is_opera8up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7); var is_opera9up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7 &&!is_opera8); var is_mac = (agt.indexOf("mac")!=-1); var iePos = appVer.indexOf('msie'); if (iePos !=-1) { if(is_mac) { var iePos = agt.indexOf('msie'); is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));}
else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos))); is_major = parseInt(is_minor);}
var is_konq = false; var kqPos = agt.indexOf('konqueror'); if (kqPos !=-1) { is_konq = true; is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos))); is_major = parseInt(is_minor);}
var is_getElementById = (document.getElementById) ? "true" : "false"; var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; var is_documentElement = (document.documentElement) ? "true" : "false"; var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false; var is_khtml = (is_safari || is_konq); var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false; var is_gver = 0; if (is_gecko) is_gver=navigator.productSub; var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) &&
(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) &&
(is_gecko) && (navigator.vendor=="Firebird")); var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) &&
(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) &&
(is_gecko) && ((navigator.vendor=="Firefox")||(agt.indexOf('firefox')!=-1))); var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) &&
(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) &&
(is_gecko) && (!is_fb) && (!is_fx) &&
((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian"))); if ((is_moz)||(is_fb)||(is_fx)) { var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0; if(is_fx&&!is_moz_ver) { is_moz_ver = agt.indexOf('firefox/'); is_moz_ver = agt.substring(is_moz_ver+8); is_moz_ver = parseFloat(is_moz_ver);}
if(!(is_moz_ver)) { is_moz_ver = agt.indexOf('rv:'); is_moz_ver = agt.substring(is_moz_ver+3); is_paren = is_moz_ver.indexOf(')'); is_moz_ver = is_moz_ver.substring(0,is_paren);}
is_minor = is_moz_ver; is_major = parseInt(is_moz_ver);}
var is_fb_ver = is_moz_ver; var is_fx_ver = is_moz_ver; var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
&& (!is_khtml) && (!(is_moz)) && (!is_fb) && (!is_fx)); if ((navigator.vendor)&&
((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
(is_nav)) { is_major = parseInt(navigator.vendorSub); is_minor = parseFloat(navigator.vendorSub);}
var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav4up = (is_nav && is_minor >= 4); var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); var is_nav6 = (is_nav && is_major==6); var is_nav6up = (is_nav && is_minor >= 6); var is_nav5 = (is_nav && is_major == 5 && !is_nav6); var is_nav5up = (is_nav && is_minor >= 5); var is_nav7 = (is_nav && is_major == 7); var is_nav7up = (is_nav && is_minor >= 7); var is_nav8 = (is_nav && is_major == 8); var is_nav8up = (is_nav && is_minor >= 8); var is_ie = ((iePos!=-1) && (!is_opera) && (!is_khtml)); var is_ie3 = (is_ie && (is_major < 4)); var is_ie4 = (is_ie && is_major == 4); var is_ie4up = (is_ie && is_minor >= 4); var is_ie5 = (is_ie && is_major == 5); var is_ie5up = (is_ie && is_minor >= 5); var is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") !=-1)); var is_ie5_5up =(is_ie && is_minor >= 5.5); var is_ie6 = (is_ie && is_major == 6); var is_ie6up = (is_ie && is_minor >= 6); var is_ie7 = (is_ie && is_major == 7); var is_ie7up = (is_ie && is_minor >= 7); var is_aol = (agt.indexOf("aol") != -1); var is_aol3 = (is_aol && is_ie3); var is_aol4 = (is_aol && is_ie4); var is_aol5 = (agt.indexOf("aol 5") != -1); var is_aol6 = (agt.indexOf("aol 6") != -1); var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1)); var is_aol8 = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1)); var is_webtv = (agt.indexOf("webtv") != -1); var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); var is_AOLTV = is_TVNavigator; var is_hotjava = (agt.indexOf("hotjava") != -1); var is_hotjava3 = (is_hotjava && (is_major == 3)); var is_hotjava3up = (is_hotjava && (is_major >= 3)); var wos1_WebOS_Window_count = 0 ; var wos1_WebOS_Window_list = [null] ; function wos1win( unique_integer_id ) { return wos1_WebOS_Window_list[ unique_integer_id ] ;}
var wos1_element_names_list = [ 'container' , 'layout_table' , 'title_bar' , 'title_table_holder' , 'title_table' , 'outer_nw' , 'nw' , 'inner_nw' , 'main_title_area' , 'inner_ne' , 'ne' , 'outer_ne' , 'body_row' , 'left' , 'body' , 'right' , 'fixed_header' , 'iframe' , 'fixed_footer' , 'status_bar' , 'status_table_holder' , 'status_table' , 'outer_sw' , 'sw' , 'inner_sw' , 'main_status_area' , 'inner_se' , 'se' , 'outer_se'
]
function wos1__question_webos_element_name( candidate_element_name ) { if ( typeof( candidate_element_name ) !== 'string' ) { alert( "Bad 'candidate_element_name' (not a string)!" + wos1__software_bug__get_detected_in( "install_button_group" , "webos/wos1/javascript/windowing/buttons_general.js"
) ) ; return false ;}
return wos1_element_names_list.raber_inArray( candidate_element_name ) ;}
function wos1__getElementObject( target_element_id ) { var element_object = document.getElementById( target_element_id ) ; if ( element_object ) { return element_object ;} else { alert( 'ID Not Found!\n\nThe missing ID is:  ' + target_element_id + wos1__software_bug__get_detected_in( "wos1__getElementObject" , "webos/wos1/javascript/windowing/main_1.js"
) ) ; return null ;}
}
function wos1__get_element_object__for_id( target_element_id ) { return wos1__getElementObject( target_element_id ) ;}
function wos1__get_webos_window_iframe_document_elements__webos_window_object( element_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__get_webos_window_iframe_document_elements__webos_window_object" , "webos/wos1/javascript/windowing/main_1.js" ) ; var target_document = element_object.ownerDocument ; var list_of_candidate_window_objects = [] ; var i , j , this_window_object ; for ( i=0 , j=wos1_WebOS_Window_list.length ; i<j ; i++ ) { this_window_object = wos1_WebOS_Window_list[i] ; if ( this_window_object ) { if ( get_iframe_document( this_window_object.iframe_element ) === target_document ) { list_of_candidate_window_objects.push( this_window_object ) ;}
}
}
var candidate_count = list_of_candidate_window_objects.length ; if ( candidate_count == 1 ) { return list_of_candidate_window_objects[0] ;} else if ( candidate_count != 0 ) { alert( "Too many candidate WebOS windows!" + software_bug__detected_in ) ; return undefined ;}
return null ;}
function wos1__get_webos_window_elements__webos_window_object( element_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__get_webos_window_elements__webos_window_object" , "webos/wos1/javascript/windowing/main_1.js" ) ; var target_container_id = undefined ; var current_element_object = element_object ; while ( current_element_object ) { if ( current_element_object.className === 'ww1_container' ) { target_container_id = current_element_object.id
break ;}
current_element_object = current_element_object.parentNode ;}
if ( !target_container_id ) { alert( "Can't find element's WebOS Window!" + "\n\nThe element whoose WebOS Window we can't find has the following properties:-" + "\n\t  Tag Name:  " + element_object.tagName + "\n\tID        :  " + element_object.id + "\n\tClass Name:  " + element_object.className + software_bug__detected_in ) ; return undefined ;}
var i , j , this_window_object ; for ( i=0 , j=wos1_WebOS_Window_list.length ; i<j ; i++ ) { this_window_object = wos1_WebOS_Window_list[i] ; if ( this_window_object ) { if ( this_window_object.container_id === target_container_id ) { return this_window_object ;}
}
}
return null ;}
function webos__element_id_to_webos_window_objects_array( target_element_id ) { var list_of_candidate_window_objects = [] ; if ( document.getElementById( target_element_id ) ) { list_of_candidate_window_objects.push( null ) ;}
var i , j , this_window_object ; for ( i=0 , j=wos1_WebOS_Window_list.length ; i<j ; i++ ) { this_window_object = wos1_WebOS_Window_list[i] ; if ( this_window_object ) { if ( get_iframe_document( this_window_object.iframe_element ).getElementById( target_element_id ) ) { list_of_candidate_window_objects.push( this_window_object ) ;}
}
}
return list_of_candidate_window_objects ;}
function webos__element_id_to_webos_window_object( target_element_id ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "webos__element_id_to_webos_window_object" , "webos/wos1/javascript/windowing/main_1.js" ) ; var list = webos__element_id_to_webos_window_objects_array( target_element_id ) ; var candidate_count = list.length ; if ( candidate_count == 1 ) { return list[0] ;} else if ( candidate_count == 0 ) { alert( 'Element ID Not Found!' + "\n\nThe missing element ID is:  " + target_element_id + "\n\n\This was found neither in the background web page, nor in any active Webos window.)" + software_bug__detected_in ) ;} else { alert( 'Duplicate Element ID!' + "\n\nSearching through BOTH the background web page - AND all the active Webos windows -" + ' reveals that MORE THAN ONE element with element ID "' + target_element_id + '" exists.' + software_bug__detected_in ) ;}
return undefined ;}
function wos1__question_webos_window_object( target_window_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__question_webos_window_object" , "webos/wos1/javascript/windowing/main_1.js" ) ; function question_show_error_message() { if ( arguments.length > 1 ) { return arguments[1] ;} else { return true ;}
}
if ( crockford_typeof( target_window_object ) !== 'object' ) { if ( question_show_error_message() ) { alert( "Bad 'owner_window_object' (not an object)!" + software_bug__detected_in ) ;}
return false ;}
if ( !( target_window_object instanceof wos1_WebOS_Window ) ) { if ( question_show_error_message() ) { alert( "Bad 'owner_window_object' (not a 'wos1_WebOS_Window')!" + software_bug__detected_in ) ;}
return false ;}
return true ;}
function wos1__question_webos_window__thats_still_open( target_window_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__question_webos_window__thats_still_open" , "webos/wos1/javascript/windowing/main_1.js" ) ; function question_show_error_message() { if ( arguments.length > 1 ) { return arguments[1] ;} else { return true ;}
}
var i , j , current_entry ; for ( i=0 , j=wos1_WebOS_Window_list.length ; i<j ; i++ ) { current_entry = wos1_WebOS_Window_list[i] ; if ( current_entry === undefined || current_entry === null ) { continue ;}
if ( wos1_WebOS_Window_list[i] === target_window_object ) { return true ;}
}
if ( question_show_error_message() ) { alert( "Bad 'target_window_object' (this window has been closed)!" + software_bug__detected_in ) ;}
return false ;}
function wos1__question_useable_webos_window( target_window_object ) { if ( arguments.length > 1 ) { return wos1__question_webos_window_object( arguments[0] , arguments[1] )
&&
wos1__question_webos_window__thats_still_open( arguments[0] , arguments[1] ) ;} else { return wos1__question_webos_window_object( arguments[0] )
&&
wos1__question_webos_window__thats_still_open( arguments[0] ) ;}
}
function wos1__show( target_window_object ) { target_window_object.container_element.style.display = 'block' ;}
function wos1__hide( target_window_object ) { target_window_object.container_element.style.display = 'none' ;}
function wos1__iframe_onload( target_window_object ) { if ( target_window_object.question_iframe_loaded ) { return ;}
if ( target_window_object.iframe_onload_script__pre_behaviour ) { eval( target_window_object.iframe_onload_script__pre_behaviour ) ;}
if ( target_window_object.iframe_behaviour_rules_list ) { wos1__install_behaviour( target_window_object , target_window_object.iframe_behaviour_rules_list
)
}
if ( target_window_object.iframe_onload_script__post_behaviour ) { eval( target_window_object.iframe_onload_script__post_behaviour ) ;}
target_window_object.question_iframe_loaded = true ;}
function wos1__close( target_window_object ) { wos1__hide( target_window_object ) ; if ( is_opera ) { setTimeout( function ( target_window_object ) { wos1__close__part2( target_window_object ) ;} , 100 ) ;} else { wos1__close__part2( target_window_object ) ;}
}
function wos1__close__part2( target_window_object ) { wos1__apply_function_to_all_elements_of_list( target_window_object.miniwin_groups_list , function( miniwin_groups_list_element ) { if ( miniwin_groups_list_element ) { miniwin_groups_list_element.delete_myself() ;}
}
)
target_window_object.container_element.parentNode.removeChild( target_window_object.container_element ) ; wos1_WebOS_Window_list[ target_window_object.unique_integer_id ] = null ; delete target_window_object ;}
function wos1__refresh( target_window_object ) { if ( webos_message_object.hasOwnProperty('document_url') ) { var element_object = getElementObject( iframe_name_slash_id ) ; if ( element_object ) { element_object.setAttribute( "src" , webos_message_object.document_url ) ;}
}
if ( webos_message_object.hasOwnProperty('ajax_url') ) { _request_ajax_content( webos_message_object.ajax_url ) ;}
}
function webos__get_document_object( target_window_object ) { if ( target_window_object === null ) { return document ;} else { return get_iframe_document( target_window_object.iframe_element ) ;}
}
document.write( '<div id="WebOS_Window_Holder"></div>' )
function wos1_WebOS_Window( webos_message_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( 'wos1_WebOS_Window' , 'webos/wos1/javascript/windowing/main.js' ) ; if ( crockford_typeof_2( webos_message_object ) !== 'null'
&&
crockford_typeof_2( webos_message_object ) !== 'object' ) { alert( "Invalid 'webos_message_object' (it's neither a javascript object, nor null)!" + software_bug__detected_in ) ; return null ;}
wos1_WebOS_Window_count++ ; wos1_WebOS_Window_list[ wos1_WebOS_Window_count ] = this ; var temp ; var i , j ; this.unique_integer_id = wos1_WebOS_Window_count ; this.unique_name = 'WebOS_1_Window_' + this.unique_integer_id ; this.group_name = '' ; this.parent_window_object = null ; this.miniwin_groups_list = [] ; this.iframe_onload_script__pre_behaviour = undefined ; this.iframe_onload_script__post_behaviour = undefined ; this.iframe_behaviour_rules_list = undefined ; this.question_iframe_loaded = false ; this.id_prefix = 'ww1_win' + this.unique_integer_id + '_' ; this.element_name_to_id = function( element_name ) { return this.id_prefix + element_name ;}
this.element_name_to_element_object = function( element_name ) { return document.getElementById( this.id_prefix + element_name ) ;}
temp = '' ; var that = this ; for ( i=0 , j=wos1_element_names_list.length ; i<j ; i++ ) { temp += "that." + wos1_element_names_list[i] + "_id = \"" + this.id_prefix + wos1_element_names_list[i] + '\";' ;}
eval( temp ) ; if ( document.getElementById( this.container_id ) ) { alert( "Can't create popup window!" + "\n\nBecause it's container ID - " + container_id + ' - already exists.' + software_bug__detected_in ) ; wos1_WebOS_Window_list[ wos1_WebOS_Window_count ] = null ; delete this ; return null ;}
this.iframe_name_slash_id = this.id_prefix + 'iframe' ; var start_position = "absolute" ; if ( is_opera6up || is_moz || is_fx || is_fb || is_nav6up || is_konq || is_safari ) { start_position = "fixed" ;}
var no_iframes_message = 'Sorry - but to see this window\'s content, you\'ll have to use (upgrade to) a browser that supports iframes.' ; var new_window = document.createElement('div') ; new_window.id = this.container_id ; new_window.className = "ww1_container" ; new_window.style.position = start_position ; temp = ( this.unique_integer_id - 1 ) * 10 ; new_window.style.top = temp + "px" ; new_window.style.left = temp + "px" ; new_window.style.backgroundColor = "#888888" ; var output = '' ; output += '<table id="' + this.layout_table_id + '" class="ww1_layout_table">' ; output += '<tr id="' + this.title_bar_id + '" class="ww1_title_bar">' ; output += '<td id="' + this.outer_nw_id + '" class="ww1_outer_nw"></td>' ; output += '<td id="' + this.title_table_holder_id + '" class="ww1_title_table_holder">' ; output += '<table id="' + this.title_table_id + '" class="ww1_title_table"><tr>' ; output += '<td id="' + this.nw_id + '" class="ww1_nw"></td>' ; output += '<td id="' + this.inner_nw_id + '" class="ww1_inner_nw"></td>' ; output += '<td id="' + this.main_title_area_id + '" class="ww1_main_title_area"></td>' ; output += '<td id="' + this.inner_ne_id + '" class="ww1_inner_ne"></td>' ; output += '<td id="' + this.ne_id + '" class="ww1_ne"></td>' ; output += '</tr></table>' ; output += '</td>' ; output += '<td id="' + this.outer_ne_id + '" class="ww1_outer_ne"></td>' ; output += '</tr>' ; output += '<tr id="' + this.body_row_id + '" class="ww1_body_row">' ; output += '<td id="' + this.left_id + '" class="ww1_left"></td>' ; output += '<td id="' + this.body_id + '" class="ww1_body">' ; output += '<table width="100%" height="100%"><tr><td id="' + this.fixed_header_id + '" class="ww1_fixed_header"></td></tr>' ; output += '<tr><td height="100%"><iframe id="' + this.iframe_name_slash_id + '" name="' + this.iframe_name_slash_id + '" class="ww1_iframe" frameborder="0" onload="javascript: wos1__iframe_onload( wos1_WebOS_Window_list[' + this.unique_integer_id + '] )" src="' + wos1_dummy_page_url + '">' ; output += no_iframes_message ; output += '</iframe></td></tr>' ; output += '<tr><td id="' + this.fixed_footer_id + '" class="ww1_fixed_footer"></td></tr></table>' ; output += '</td>' ; output += '<td id="' + this.right_id + '" class="ww1_right"></td>' ; output += '</tr>' ; output += '<tr id="' + this.status_bar_id + '" class="ww1_status_bar">' ; output += '<td id="' + this.outer_sw_id + '" class="ww1_outer_sw"></td>' ; output += '<td id="' + this.status_table_holder_id + '" class="ww1_status_table_holder">' ; output += '<table id="' + this.status_table_id + '" class="ww1_status_table"><tr>' ; output += '<td id="' + this.sw_id + '" class="ww1_sw"></td>' ; output += '<td id="' + this.inner_sw_id + '" class="ww1_inner_sw"></td>' ; output += '<td id="' + this.main_status_area_id + '" class="ww1_main_status_area"></td>' ; output += '<td id="' + this.inner_se_id + '" class="ww1_inner_se"></td>' ; output += '<td id="' + this.se_id + '" class="ww1_se"></td>' ; output += '</tr></table>' ; output += '</td>' ; output += '<td id="' + this.outer_se_id + '" class="ww1_outer_se"></td>' ; output += '</tr>' ; output += '</table>' ; new_window.innerHTML = output ; document.getElementById( "WebOS_Window_Holder" ).appendChild( new_window ) ; temp = '' ; for ( i=0 , j=wos1_element_names_list.length ; i<j ; i++ ) { temp += 'that.' + wos1_element_names_list[i] + '_element = wos1__getElementObject("' + that.element_name_to_id(wos1_element_names_list[i]) + '");' ;}
eval( temp ) ; wos1__hide( this ) ; var data_store = new Object() ; if ( webos_message_object ) { wos1__process_webos_message( webos_message_object , this , true ) ;}
wos1__show(this) ;}
function wos1__must_get_width__in_pixels ( target_window_object ) { var width = wos1__CSS_to_integer_pixels( target_window_object.container_element.offsetWidth , -1 ) ; if ( width <= 0 ) { if ( target_window_object.hasOwnProperty( "last_requested_integer_width" ) ) { width = target_window_object.last_requested_integer_width ; width += wos1__CSS_to_integer_pixels( target_window_object.container_element.paddingLeft , 0 ) ; width += wos1__CSS_to_integer_pixels( target_window_object.container_element.paddingRight , 0 ) ; width += wos1__CSS_to_integer_pixels( target_window_object.container_element.borderLeftWidth , 0 ) ; width += wos1__CSS_to_integer_pixels( target_window_object.container_element.borderRightWidth , 0 ) ;} else { alert( "WebOS window 'width' not yet available!" + "\n\nNote To The PROGRAMMER!  If you're configuring this window from a WebOS Message object," + " please make sure that you set the 'width' BEFORE you try to use it." + "  For example; you should always set a WebOS Window's 'width' (and/or 'height')," + " BEFORE you set it's 'left' (and/or 'top')." + wos1__software_bug__get_detected_in( "wos1__must_get_width__in_pixels" , "webos/wos1/javascript/windowing/size.js"
) ) ;}
}
return width ;}
function wos1__set_width( target_window_object , new_webos_width ) { var new_integer_width = wos1__width_slash_height__webos_to_integer_pixels( new_webos_width , wos1__get_viewport_width() ) ; if ( new_integer_width === undefined ) { return true ;}
target_window_object.last_requested_integer_width = new_integer_width ; target_window_object.container_element.style.width = wos1__integer_pixels_to_CSS( new_integer_width ) ; return false ;}
function wos1__must_get_height__in_pixels ( target_window_object ) { var height = wos1__CSS_to_integer_pixels( target_window_object.container_element.offsetHeight , -1 ) ; if ( height <= 0 ) { if ( target_window_object.hasOwnProperty( "last_requested_integer_height" ) ) { height = target_window_object.last_requested_integer_height ; height += wos1__CSS_to_integer_pixels( target_window_object.container_element.paddingTop , 0 ) ; height += wos1__CSS_to_integer_pixels( target_window_object.container_element.paddingBottom , 0 ) ; height += wos1__CSS_to_integer_pixels( target_window_object.container_element.borderTopWidth , 0 ) ; height += wos1__CSS_to_integer_pixels( target_window_object.container_element.borderBottomWidth , 0 ) ;} else { alert( "WebOS window 'height' not yet available!" + "\n\nNote To The PROGRAMMER!  If you're configuring this window from a WebOS Message object," + " please make sure that you set the 'height' BEFORE you try to use it." + "  For example; you should always set a WebOS Window's 'height' (and/or 'width')," + " BEFORE you set it's 'top' (and/or 'left')." + wos1__software_bug__get_detected_in( "wos1__must_get_height__in_pixels" , "webos/wos1/javascript/windowing/size.js"
) ) ;}
}
return height ;}
function wos1__set_height( target_window_object , new_webos_height ) { var new_integer_height = wos1__width_slash_height__webos_to_integer_pixels( new_webos_height , wos1__get_viewport_height() ) ; if ( new_integer_height === undefined ) { return true ;}
target_window_object.last_requested_integer_height = new_integer_height ; target_window_object.container_element.style.height = wos1__integer_pixels_to_CSS( new_integer_height ) ; return false ;}
function wos1__width_slash_height__webos_to_integer_pixels( webos_width_slash_height , viewport_width_slash_height ) { var integer_width_slash_height__in_pixels ; if ( webos_width_slash_height === null || webos_width_slash_height === undefined || webos_width_slash_height === "" ) { integer_width_slash_height__in_pixels = Math.round( viewport_width_slash_height * 0.66 ) ;} else { var matches = /^(\d+)%$/.exec( webos_width_slash_height ) ; if ( matches ) { integer_width_slash_height__in_pixels = Math.round( viewport_width_slash_height * matches[1] / 100 ) ;} else { matches = /^(\d+)$/.exec( webos_width_slash_height ) ; if ( matches ) { integer_width_slash_height__in_pixels = matches[1] ;} else { alert( "Unrecognised/unsupported 'webos_width_slash_height'!" + wos1__software_bug__get_detected_in( "wos1__width_slash_height__webos_to_CSS" , "webos/wos1/javascript/windowing/size.js"
) ) ; return undefined ;}
if ( integer_width_slash_height__in_pixels > viewport_width_slash_height ) { integer_width_slash_height__in_pixels = viewport_width_slash_height ;}
}
}
return integer_width_slash_height__in_pixels ;}
function wos1__get_positioning( window_object ) { return window_object.container_element.style.position ;}
function wos1__set_positioning( window_object , new_positioning ) { if ( typeof( new_positioning ) != 'string' || !["fixed","absolute"," relative","static"].raber_inArray( new_positioning ) ) { alert( 'Bad Window Positioning!' + "\n\n'new_positioning' must be one of:-\n\tstatic\n\trelative\n\tabsolute\n\tfixed" + "\n\nThe value supplied - " + new_positioning + " - ISN'T valid." + wos1__software_bug + wos1__get_software_bug( "wos1__set_positioning" , "wos1/javascript/position.js" ) ) ; return false ;}
window_object.container_element.style.position = new_positioning ;}
function wos1__get_top( target_window_object ) { return target_window_object.container_element.style.top ;}
function wos1__set_top( target_window_object , new_webos_top ) { var new_CSS_top = wos1__top_slash_left__webos_to_CSS( new_webos_top , wos1__get_viewport_height() , wos1__must_get_height__in_pixels( target_window_object ) ) ; if ( new_CSS_top == undefined ) { return true ;}
target_window_object.container_element.style.top = new_CSS_top ; return false ;}
function wos1__get_left( target_window_object ) { return target_window_object.container_element.style.left ;}
function wos1__set_left( target_window_object , new_webos_left ) { var new_CSS_left = wos1__top_slash_left__webos_to_CSS( new_webos_left , wos1__get_viewport_width() , wos1__must_get_width__in_pixels( target_window_object ) ) ; if ( new_CSS_left == undefined ) { return true ;}
target_window_object.container_element.style.left = new_CSS_left ; return false ;}
function wos1__top_slash_left__webos_to_CSS( webos_top_slash_left , viewport_height_slash_width , target_window_height_slash_width ) { var CSS_top_slash_left ; if ( !webos_top_slash_left ) { CSS_top_slash_left = Math.round( ( viewport_height_slash_width - target_window_height_slash_width ) / 2 ) ;} else { var matches = /^(\d+)px$/i.exec( webos_top_slash_left ) ; if ( matches ) { CSS_top_slash_left = matches[1] ;} else { alert( "Unrecognised/unsupported 'webos_top_slash_left'!" + "\n\nThe unrecognised/unsupported value is:  " + webos_top_slash_left + wos1__software_bug + wos1__get_detected_in( "wos1__top_slash_left__webos_to_CSS" , "webos/wos1/javascript/windowing/position.js"
) ) ; return undefined ;}
}
if ( CSS_top_slash_left < 0 ) { CSS_top_slash_left = 0 ;}
return wos1__integer_pixels_to_CSS( CSS_top_slash_left ) ;}
function wos1__get_window_object__for_unique_name( target_unique_name ) { var i , j ; var temp ; for ( i=0 , j=wos1_WebOS_Window_list.length ; i<j ; i++ ) { temp = wos1_WebOS_Window_list[i] ; if ( temp
&&
temp instanceof wos1_WebOS_Window
&&
temp.hasOwnProperty( unique_name )
&&
temp.unique_name == target_unique_name ) { return temp ;}
}
return null ;}
function wos1__install_control_buttons__from_control_button_details_string_or_array( target_window_object , control_button_details ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( 'wos1__install_control_buttons__from_control_button_details_array' , 'webos/wos1/javascript/windowing/buttons_control.js' ) ; var error_extras = '\n\nThe popup window under this alert box (or that should appear once this alert box is closed,)' + ' will probably be missing some or all of it\'s control buttons (maximise and close, etc).' + software_bug__detected_in ; if ( typeof( control_button_details ) !== 'string'
&&
crockford_typeof( control_button_details ) !== 'array' ) { alert( "Bad 'control_button_details' (it's neither a string, nor an array)!" + "\n\n'control_button_details' (" + control_button_details + ') is a:  ' + crockford_typeof( control_button_details ) + error_extras ) ; return ;}
var control_buttons_specifier_string ; var target_element_object ; if ( typeof( control_button_details ) === 'string' ) { control_buttons_specifier_string = control_button_details ; target_element_object = target_window_object.inner_ne_element ;} else { if ( control_button_details_array.length !== 2 ) { alert( "Bad 'control_button_details_array' (not exactly 2 elements long)!" + error_extras ) ; return ;}
control_buttons_specifier_string = control_button_details_array[0] ; var target_element_name = control_button_details_array[1] ; if ( typeof( target_element_name ) != 'string' ) { alert( "Invalid 'target_element_id' (not a string)!" + error_extras ) ; return ;}
target_element_object = wos1__getElementObject( target_window_object.element_name_to_id ) ;}
if ( target_element_object ) { wos1__install_control_buttons( control_buttons_specifier_string , target_element_object ) ;}
}
function wos1__install_control_buttons( control_buttons_specifier_string , target_element_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( 'wos1__install_control_buttons' , 'webos/wos1/javascript/windowing/buttons_control.js' ) ; var error_extras = '\n\nThe popup window under this alert box (or that should appear once this alert box is closed,)' + ' will probably be missing some or all of it\'s control buttons (maximise and close, etc).' + software_bug__detected_in ; if ( typeof( control_buttons_specifier_string ) != 'string' ) { alert( "Invalid 'control_buttons_specifier_string' (not a string)!" + error_extras ) ; return ;}
var button_html = '' ; var this_button ; for ( i=0 , j=control_buttons_specifier_string.length ; i<j ; i++ ) { this_button = control_buttons_specifier_string.charAt(i).toLowerCase() ; if ( this_button == "#" ) { button_html += '<span class="ww1_control_button ww1_maximise_restore_button">maximise</span>' ;} else if ( this_button == "x" ) { button_html += '<span class="ww1_control_button ww1_close_button">close</span>' ;} else if ( this_button == "h" ) { button_html += '<span class="ww1_control_button ww1_hide_button">hide</span>' ;} else if ( this_button == "o" ) { button_html += '<span class="ww1_control_button ww1_other_button">other</span>' ;} else { alert( 'Bad control button ("' + this_button + '")' + '\n\nThis button should be one of:  "h", "#", "X" or "o" ("s" and "_" not yet supported)' + software_bug__detected_in ) ;}
}
target_element_object.innerHTML = button_html ;}
function wos1__install_control_button_click_handlers( target_window_object ) { target_window_object.array_of__maximise_restore_button__element_objects = xGetElementsByClassName( 'ww1_maximise_restore_button' , target_window_object.container_element , null , function(element) { element.owner_window_object = target_window_object ; element.onclick = wos1__maximise_or_restore_me ; if ( element.captureEvents ) { element.captureEvents( Event.ONCLICK ) ;}
} ) ; xGetElementsByClassName( 'ww1_close_button' , target_window_object.container_element , null , function(element) { element.onclick = wos1__close( target_window_object ) ; if ( element.captureEvents ) { element.captureEvents( Event.ONCLICK ) ;}
} ) ; xGetElementsByClassName( 'ww1_hide_button' , target_window_object.container_element , null , function(element) { element.onclick = wos1__hide( target_window_object ) ; if ( element.captureEvents ) { element.captureEvents( Event.ONCLICK ) ;}
} ) ; xGetElementsByClassName( 'ww1_other_button' , target_window_object.container_element , null , function(element) { element.onclick = wos1__other_button ; if ( element.captureEvents ) { element.captureEvents( Event.ONCLICK ) ;}
} ) ;}
function wos1__other_button(e) { if (!e) var e = window.event; var targ; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3)
targ = targ.parentNode; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); var target_window_object = wos1__get_webos_window_elements__webos_window_object( targ ) ; var my_group = new wos1__MiniwinGroup( { owner_element_object : targ , owner_location_type : 'webos_window' , owner_location_object : target_window_object
} ) ; if ( my_group.constructor_result ) { return ;}
var my_content = '<strong>Window Details</strong>' + '<table>' + '<tr><td align="right" bgcolor="#EEEEEE">WebOS Version:</td><td>&nbsp;&nbsp;1</td></tr>' + '<tr><td align="right" bgcolor="#EEEEEE">Unique Integer ID:</td><td>&nbsp;&nbsp;' + target_window_object.unique_integer_id + '</td></tr>' + '<tr><td align="right" bgcolor="#EEEEEE">Unique Name:</td><td>&nbsp;&nbsp;' + target_window_object.unique_name + '</td></tr>' + '</table>' + '<p><a target="_blank" href="' + get_iframe_document( target_window_object.iframe_element ).location.href + '">Open document in new tab/window</a></p>' ; var my_type_specific_details = { content_type : 'inline' , content_source : my_content
} ; new wos1__Miniwin( { owner_element_object : null , owner_miniwin_object : null , owner_miniwin_group_object : my_group , type : 'dhtmlwindow_1_03' , type_specific_details : my_type_specific_details
} ) ; my_group = undefined ;}
function wos1__maximise_or_restore_me( event_object ) { if (!event_object) var event_object = window.event ; var clicked_element_object; if (event_object.target) clicked_element_object = event_object.target; else if (event_object.srcElement) clicked_element_object = event_object.srcElement; if (clicked_element_object.nodeType == 3)
clicked_element_object = clicked_element_object.parentNode; var target_window_object = clicked_element_object.owner_window_object ; if ( target_window_object.hasOwnProperty("question_maximised")
&&
target_window_object.question_maximised ) { target_window_object.container_element.style.top = target_window_object.old_top ; target_window_object.container_element.style.left = target_window_object.old_left ; target_window_object.container_element.style.width = target_window_object.old_width ; target_window_object.container_element.style.height = target_window_object.old_height ; target_window_object.array_of__maximise_restore_button__element_objects.map( function( element_object ) { xInnerHtml( element_object , "maximise" ) ;} ) ; target_window_object.question_maximised = false ;} else { target_window_object.old_top = target_window_object.container_element.style.top ; target_window_object.old_left = target_window_object.container_element.style.left ; target_window_object.old_width = target_window_object.container_element.style.width ; target_window_object.old_height = target_window_object.container_element.style.height ; var new_width = wos1__get_viewport_width() ; var new_height = wos1__get_viewport_height() ; var hscrollwidth = 0 , vscrollwidth = 0 ; if ( wos1__question_horizontal_scrollbar() ) { hscrollwidth = wos1__get_horizontal_scrollbar_width() ;}
if ( wos1__question_vertical_scrollbar() ) { vscrollwidth = wos1__get_vertical_scrollbar_width() ;}
if ( is_ie ) { new_width -= ( vscrollwidth + 10 ) ; new_height -= ( hscrollwidth + 86 ) ;} else if ( is_opera ) { new_width -= ( vscrollwidth + 6 ) ; new_height -= ( hscrollwidth + 6 ) ;} else if ( is_fb || is_fx || is_moz ) { new_width -= ( vscrollwidth - 10 ) ; new_height -= ( hscrollwidth + 7 ) ;}
target_window_object.container_element.style.top = "0px" ; target_window_object.container_element.style.left = "0px" ; target_window_object.container_element.style.width = new_width + "px" ; target_window_object.container_element.style.height = new_height + "px" ; target_window_object.array_of__maximise_restore_button__element_objects.map( function( element_object ) { xInnerHtml( element_object , "restore" ) ;} ) ; target_window_object.question_maximised = true ;}
}
function wos1__install_button_group( target_window_object , target_element_name , buttons_list ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "install_button_group" , "webos/wos1/javascript/windowing/buttons_general.js" ) ; var error_extras = '\n\nThe popup window under this alert box will probably be missing some buttons.' + software_bug__detected_in ; var software_bug__detected_in__single_button = wos1__software_bug__get_detected_in( "install_button_group --> install_single_button" , "webos/wos1/javascript/windowing/buttons_general.js" ) ; var error_extras__single_button = '\n\nThe popup window under this alert box will probably be missing some buttons.' + software_bug__detected_in__single_button ; var software_bug__detected_in__action_function = wos1__software_bug__get_detected_in( "install_button_group --> button_property_names_and_action_functions" , "webos/wos1/javascript/windowing/buttons_general.js" ) ; var error_extras__action_function = '\n\nThe popup window under this alert box will probably be missing some buttons.' + software_bug__detected_in__action_function ; if ( crockford_typeof( target_window_object ) !== 'object' ) { alert( "Bad 'target_window_object' (not an object)!" + error_extras ) ; return ;}
if ( !(target_window_object instanceof wos1_WebOS_Window) ) { alert( "Bad 'target_window_object' (not a 'wos1_WebOS_Window')!" + error_extras ) ; return ;}
if ( typeof( target_element_name ) !== 'string' ) { alert( "Bad 'target_element_name' (not a string)!" + error_extras ) ; return ;}
if ( !wos1__question_webos_element_name( target_element_name ) ) { alert( "Bad 'target_element_name' (not a recognised/supported WebOS 1 window element name)!" + error_extras ) ; return ;}
var target_element_id = target_window_object.element_name_to_id( target_element_name ) ; var target_element_object = target_window_object.element_name_to_element_object( target_element_name ) ; if ( !target_element_object ) { alert( "Target element not found!" + "\n\nThe missing element is:  " + target_element_name + "  (from WebOS Window #" + target_window_object.unique_integer_id + " - " + target_window_object.unique_name + ")" + error_extras ) ; return ;}
if ( crockford_typeof( buttons_list ) !== 'array' ) { alert( "Bad 'buttons_list' (not an array)!" + error_extras ) ; return ;}
var button_property_names_and_action_functions = { id : function( property_value ) { if ( typeof( property_value) !== 'string' ) { alert( "Bad button 'id' (not a string)!" + error_extras__action_function ) ; return true ;}
button_id = wos1__trim( property_value ) ; if ( button_id == "" ) { alert( "Bad button 'id' (blank string)!" + error_extras__action_function ) ; return true ;}
return false ;} , classnames : function( property_value ) { if ( typeof( property_value) !== 'string' ) { alert( "Bad button 'classnames' (not a string)!" + error_extras__action_function ) ; return true ;}
temp = wos1__trim( property_value ) ; if ( temp == "" ) { alert( "Bad button 'classnames' (blank string)!" + error_extras__action_function ) ; return true ;}
button_classnames += " " + temp ; return false ;} , title : function( property_value ) { if ( typeof( property_value) !== 'string' ) { alert( "Bad button 'title' (not a string)!" + error_extras__action_function ) ; return true ;}
button_title = wos1__trim( property_value ) ; return false ;} , onclick : function( property_value ) { if ( typeof( property_value ) === 'string' ) { temp = target_element_object.onclick ; eval( "target_element_object.onclick=" + property_value ) ; property_value = target_element_object.onclick ; target_element_object.onclick = temp ;}
if ( crockford_typeof( property_value ) !== 'function' ) { alert( "Bad 'onclick' parameter (not a Javascript function object)!" + error_extras__action_function ) ; return true ;}
button_onclick_function_object = property_value ; return false ;} , onmouseover : function( property_value ) { if ( typeof( property_value ) === 'string' ) { temp = target_element_object.onmouseover ; eval( "target_element_object.onmouseover=" + property_value ) ; property_value = target_element_object.onmouseover ; target_element_object.onmouseover = temp ;}
if ( crockford_typeof( property_value ) !== 'function' ) { alert( "Bad 'onmouseover' parameter (not a Javascript function object)!" + error_extras__action_function ) ; return true ;}
button_onmouseover_function_object = property_value ; return false ;} , onmouseout : function( property_value ) { if ( typeof( property_value ) === 'string' ) { temp = target_element_object.onmouseout ; eval( "target_element_object.onmouseout=" + property_value ) ; property_value = target_element_object.onmouseout ; target_element_object.onmouseout = temp ;}
if ( crockford_typeof( property_value ) !== 'function' ) { alert( "Bad 'onmouseout' parameter (not a Javascript function object)!" + error_extras__action_function ) ; return true ;}
button_onmouseout_function_object = property_value ; return false ;} , onclick_close : function( property_value ) { button_onclick_function_object = function () { wos1__close(target_window_object) ;}
return false ;} , onclick_question_close : function( property_value ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad 'onclick_question_close' parameter (not a string)!" + error_extras__action_function ) ; return true ;}
button_onclick_function_object = function () { if ( confirm( property_value ) ) { wos1__close(target_window_object) ;}
}
return false ;} , onclick_new_window : function( property_value ) { button_onclick_function_object = function () { new wos1_WebOS_Window( property_value )
}
return false ;} , onclick_submit_to : function( property_value ) { button_onclick_function_object = function () { wos1__submit( target_window_object , property_value ) ;}
return false ;}
}
var button_id , button_classnames , button_title , button_onclick_function_object ; var button_onmouseover_function_object , button_onmouseout_function_object ;; var required_button_onclick_event_handlers_array = new Array ; var required_button_onmouseover_event_handlers_array = new Array ; var required_button_onmouseout_event_handlers_array = new Array ; var button_html = '<div class="ww1_button_group">' ; var temp ; for ( i=0 , j=buttons_list.length ; i<j ; i++ ) { install_single_button( buttons_list[i] , i+1 ) ;}
button_html += '</div>' ; target_element_object.innerHTML = button_html ; for ( i=0 , j=required_button_onclick_event_handlers_array.length ; i<j ; i++ ) { button_id = required_button_onclick_event_handlers_array[i][0] ; button_onclick_function_object = required_button_onclick_event_handlers_array[i][1] ; wos1__add_event__to_element( button_id , 'onclick' , button_onclick_function_object
)
}
for ( i=0 , j=required_button_onmouseover_event_handlers_array.length ; i<j ; i++ ) { button_id = required_button_onmouseover_event_handlers_array[i][0] ; button_onmouseover_function_object = required_button_onmouseover_event_handlers_array[i][1] ; wos1__add_event__to_element( button_id , 'onmouseover' , button_onmouseover_function_object
)
}
for ( i=0 , j=required_button_onmouseout_event_handlers_array.length ; i<j ; i++ ) { button_id = required_button_onmouseout_event_handlers_array[i][0] ; button_onmouseout_function_object = required_button_onmouseout_event_handlers_array[i][1] ; wos1__add_event__to_element( button_id , 'onmouseout' , button_onmouseout_function_object
)
}
function install_single_button( button_details_object , button_number ) { if ( crockford_typeof( button_details_object ) !== 'object' ) { alert( "Bad 'button_details_object' (not an object)!" + error_extras__single_button ) ; return ;}
button_id = target_window_object.id_prefix + 'button' + button_number ; button_classnames = 'ww1_button_group_button' ; button_title = "???" ; button_onclick_function_object = undefined ; button_onmouseover_function_object = undefined ; button_onmouseout_function_object = undefined ; for ( property_name in button_details_object ) { if ( property_name === 'toJSONString' ) { continue ;}
if ( button_property_names_and_action_functions.hasOwnProperty( property_name ) ) { if ( button_property_names_and_action_functions[property_name]( button_details_object[property_name]
) ) { continue ;}
} else { alert( "Unrecognised/unsupported button property (" + property_name + ")!" + error_extras__single_button ) ; continue ;}
}
button_html += '<span id="' + button_id + '" class="' + button_classnames + '">' + button_title + '</span>' ; if ( button_onclick_function_object ) { required_button_onclick_event_handlers_array.push( [ button_id , button_onclick_function_object
] ) ;}
if ( button_onmouseover_function_object ) { required_button_onmouseover_event_handlers_array.push( [ button_id , button_onmouseover_function_object
] ) ;}
if ( button_onmouseout_function_object ) { required_button_onmouseout_event_handlers_array.push( [ button_id , button_onmouseout_function_object
] ) ;}
}
}
var wos1__software_bug = "\n\nThis is a SOFTWARE BUG!  Please COMPLAIN!" ; function wos1__get_detected_in( function_name , file_name ) { if ( !wos1__endsWith( function_name , ")" ) ) { function_name += "()" ;}
return "\n\nThis error was detected in:-" + "\n\tFunction:  " + function_name + "\n\tFile:      " + file_name ;}
function wos1__software_bug__get_detected_in( function_name , file_name ) { return wos1__software_bug + wos1__get_detected_in( function_name , file_name ) ;}
function wos1__apply_function_to_all_elements_of_list( input_list , function_to_apply ) { var i , j ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { function_to_apply( input_list[i] ) ;}
}
function wos1__apply_function_to_all_elements_of_list__aborting_on_demand( input_list , function_to_apply ) { var i , j ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { if ( function_to_apply( input_list[i] ) ) { return true ;}
}
return false ;}
function wos1__transform_all_elements_of_list( input_list , additional_parameters , function_to_apply ) { var i , j ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { function_to_apply( input_list , i ) ;}
}
function wos1__transform_all_elements_of_list__aborting_on_demand( input_list , additional_parameters , function_to_apply ) { var i , j ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { if ( function_to_apply( input_list , i , additional_parameters ) ) { return true ;}
}
return false ;}
function wos1__create_new_list__by_transforming_each_element_of_old( input_list , function_to_apply ) { var output_list = [] ; var i , j ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { output_list.push( function_to_apply( input_list[i] ) ) ;}
return output_list ;}
String.prototype.wos1__trim = function() { return this.replace(/^\s+|\s+$/g,"");}
String.prototype.wos1__ltrim = function() { return this.replace(/^\s+/,"");}
String.prototype.wos1__rtrim = function() { return this.replace(/\s+$/,"");}
function wos1__trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,"");}
function wos1__ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,"");}
function wos1__rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,"");}
function wos1__strStart( input_string , number_characters ) { if ( typeof( input_string) != 'string' ) { alert( "Bad 'input_string' (not a string)!" + "\n\nThe bad 'input_string' value is/was:  " + input_string + "\n\nwhich is of type:  " + crockford_typeof( input_string ) + wos1__software_bug__get_detected_in( 'wos1__strStart' , 'webos/wos1/javascript/utilities/strings.js'
) ) ; return '' ;}
if ( number_characters < 0 ) { number_characters = input_string.length + number_characters ;}
return input_string.substr( 0 , number_characters ) ;}
function wos1__strEnd( input_string , number_characters ) { if ( typeof( input_string) != 'string' ) { alert( "Bad 'input_string' (not a string)!" + "\n\nThe bad 'input_string' value is/was:  " + input_string + "\n\nwhich is of type:  " + crockford_typeof( input_string ) + wos1__software_bug__get_detected_in( 'wos1__strEnd' , 'webos/wos1/javascript/utilities/strings.js'
) ) ; return '' ;}
var start ; if ( number_characters > 0 ) { start = input_string.length - number_characters ;} else if ( number_characters < 0 ) { start = input_string.length + number_characters ;} else { return "" ;}
if ( start < 0 ) { return input_string ;}
return input_string.substr( start ) ;}
function wos1__startsWith( string_to_test , compare_string ) { return wos1__strStart( string_to_test , compare_string.length ) == compare_string ;}
function wos1__startsWith__casenocare( string_to_test , compare_string ) { return wos1__strStart( string_to_test , compare_string.length ).toLowerCase() == compare_string.toLowerCase() ;}
function wos1__endsWith( string_to_test , compare_string ) { return wos1__strEnd( string_to_test , compare_string.length ) == compare_string ;}
function wos1__endsWith__casenocare( string_to_test , compare_string ) { return wos1__strEnd( string_to_test , compare_string.length ).toLowerCase() == compare_string.toLowerCase() ;}
function wos1__object_to_query_string_fragment( target_object ) { var output_string = '' ; var comma = '' ; for ( property_name in target_object ) { if ( property_name === 'toJSONString' ) { continue ;}
output_string += comma + property_name + "=" + target_object[property_name] ; comma = "&" ;}
return output_string ;}
function wos1__object_to_query_string( target_object ) { var query_string_fragment = wos1__trim( wos1__object_to_query_string_fragment( target_object
) ) ; if ( query_string_fragment ) { return "?" + query_string_fragment ;} else { return '' ;}
}
var wos1__combine_objects__name_clash_action__OVERWRITE = 0 ; var wos1__combine_objects__name_clash_action__DISCARD = 1 ; var wos1__combine_objects__name_clash_action__LIST = 2 ; var wos1__combine_objects__name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT = 4 ; var wos1__combine_objects__name_clash_action__ENUMERATE = 8 ; var wos1__combine_objects__name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT = 16 ; var wos1__combine_objects__name_clash_action__PREFIX = 32 ; var wos1__combine_objects__name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT = 64 ; var wos1__combine_objects__name_clash_action__POSTFIX = 128 ; var wos1__combine_objects__name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT = 256 ; var wos1__combine_objects__name_clash_message__NONE = 512 ; var wos1__combine_objects__name_clash_message__NON_FATAL_WARNING = 1024 ; var wos1__combine_objects__name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT = 2048 ; var wos1__combine_objects__name_clash_message__FATAL_ERROR = 4096 ; var wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT = 8192 ; function wos1__combine_objects( objects_list ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__combine_objects" , "webos/wos1/javascript/utilities/objects.js" ) ; var value_to_return_on_error = undefined ; if ( crockford_typeof( objects_list ) !== 'array' ) { alert( "Bad 'objects_list' (not an array)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
var name_clash_handling ; if ( arguments.length > 1 ) { name_clash_handling = arguments[1] ;} else { name_clash_handling = wos1__combine_objects__name_clash_message__FATAL_ERROR
}
var name_clash_action__DISCARD ; var name_clash_action__LIST ; var name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT ; var name_clash_action__ENUMERATE ; var name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT ; var name_clash_action__PREFIX ; var name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT
var name_clash_action__POSTFIX ; var name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT ; wos1__combine_objects__set_action_flags() ; if ( question_more_than_1_element_true( [ name_clash_action__DISCARD , name_clash_action__LIST , name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT , name_clash_action__ENUMERATE , name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT , name_clash_action__PREFIX , name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT , name_clash_action__POSTFIX , name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT ] , "action" ) ) { return value_to_return_on_error ;}
var name_clash_message__NON_FATAL_WARNING ; var name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT ; var name_clash_message__FATAL_ERROR ; var name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT ; wos1__combine_objects__set_message_flags() ; if ( question_more_than_1_element_true( [ name_clash_message__NON_FATAL_WARNING , name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT , name_clash_message__FATAL_ERROR , name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT ] , "message" ) ) { return value_to_return_on_error ;}
var output_object = new Object() ; var this_object ; for ( i=0 , j=objects_list.length ; i<j ; i++ ) { this_object = objects_list[i] ; if ( this_object ) { if ( crockford_typeof( this_object ) !== 'object' ) { alert( "Bad 'objects_list' element (not an object)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
for ( property_name in this_object ) { if ( property_name === "toJSONString" ) { continue ;}
if ( output_object.hasOwnProperty( property_name ) ) { if ( wos1__combine_objects__issue_name_clash_error_message() ) { return value_to_return_on_error ;}
if ( wos1__combine_objects__do_name_clash_action() ) { return value_to_return_on_error ;}
} else { output_object[ property_name ] = this_object[ property_name ] ;}
}
}
}
return output_object ; function wos1__combine_objects__issue_name_clash_error_message() { if ( name_clash_message__NON_FATAL_WARNING ) { alert( "Name clash!" + "\n\nThe property name '" + property_name + "'occurs in more than one of the input objects." + software_bug__detected_in ) ; return false ;} else if ( name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash!" + "\n\nThe property name '" + property_name + "'occurs in more than one of the input objects." + software_bug__detected_in ) ; return false ;} else if ( name_clash_message__FATAL_ERROR ) { alert( "Name clash!" + "\n\nThe property name '" + property_name + "'occurs in more than one of the input objects." + software_bug__detected_in ) ; return true ;} else if ( name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash!" + "\n\nThe property name '" + property_name + "'occurs in more than one of the input objects." + software_bug__detected_in ) ; return true ;}
return false ;}
function wos1__combine_objects__do_name_clash_action() { if ( name_clash_action__DISCARD ) { return false ;} else if ( name_clash_action__LIST ) { alert( "Name clash action LIST not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash action LIST__BUT_ONLY_IF_VALUE_DIFFERENT not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__ENUMERATE ) { alert( "Name clash action ENUMERATE not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash action ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__PREFIX ) { alert( "Name clash action PREFIX not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash action PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__POSTFIX ) { alert( "Name clash action POSTFIX not yet implemented!" + software_bug__detected_in ) ; return true ;} else if ( name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT
&&
this_object[ property_name ] !== output_object[ property_name ] ) { alert( "Name clash action POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT not yet implemented!" + software_bug__detected_in ) ; return true ;}
output_object[ property_name ] = this_object[ property_name ] ; return false ;}
function question_more_than_1_element_true( input_list , thing ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__combine_objects --> question_more_than_1_element_true" , "webos/wos1/javascript/utilities/objects.js" ) ; var number_true = 0 ; var i , j , this_element ; for ( i=0 , j=input_list.length ; i<j ; i++ ) { this_element = input_list[i] ; if ( typeof( this_element ) !== "boolean" ) { if ( typeof( this_element ) !== "object" || !( this_element instanceof Boolean ) ) { alert( "Bad 'input_list' element (not a boolean)" + software_bug__detected_in ) ; return true ;}
}
if ( this_element == true ) { number_true++ ; if ( number_true > 1 ) { alert( "Bad 'name_clash_handling' (no more than ONE " + thing + " may be specified)" + software_bug__detected_in ) ; return true ;}
}
}
return false ;}
function question_bit_set( bit_value ) { return new Boolean ( name_clash_handling & bit_value ) ;}
function wos1__combine_objects__set_action_flags() { name_clash_action__DISCARD = question_bit_set( wos1__combine_objects__name_clash_action__DISCARD ) ; name_clash_action__LIST = question_bit_set( wos1__combine_objects__name_clash_action__LIST ) ; name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_action__LIST__BUT_ONLY_IF_VALUE_DIFFERENT ) ; name_clash_action__ENUMERATE = question_bit_set( wos1__combine_objects__name_clash_action__ENUMERATE ) ; name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_action__ENUMERATE__BUT_ONLY_IF_VALUE_DIFFERENT ) ; name_clash_action__PREFIX = question_bit_set( wos1__combine_objects__name_clash_action__PREFIX ) ; name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_action__PREFIX__BUT_ONLY_IF_VALUE_DIFFERENT ) ; name_clash_action__POSTFIX = question_bit_set( wos1__combine_objects__name_clash_action__POSTFIX ) ; name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_action__POSTFIX__BUT_ONLY_IF_VALUE_DIFFERENT ) ;}
function wos1__combine_objects__set_message_flags() { name_clash_message__NON_FATAL_WARNING = question_bit_set( wos1__combine_objects__name_clash_message__NON_FATAL_WARNING ) ; name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_message__NON_FATAL_WARNING__BUT_ONLY_IF_VALUE_DIFFERENT ) ; name_clash_message__FATAL_ERROR = question_bit_set( wos1__combine_objects__name_clash_message__FATAL_ERROR ) ; name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT = question_bit_set( wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT ) ;}
}
function wos1__validate_object( target_object , target_object_description_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__validate_object" , "webos/wos1/javascript/misc/objects.js" ) ; if ( crockford_typeof( target_object ) !== 'object' ) { alert( "Bad 'target_object' (not an object)!" + software_bug__detected_in ) ; return true ;}
if ( crockford_typeof( target_object_description_object ) !== 'object' ) { alert( "Bad 'target_object_description_object' (not an object)!" + software_bug__detected_in ) ; return true ;}
var global_error_checking_function = undefined ; if ( target_object_description_object.hasOwnProperty( '__global_error_checking_function__' ) ) { global_error_checking_function = target_object_description_object.__global_error_checking_function__ ; if ( typeof( global_error_checking_function ) !== 'function' ) { alert( "Bad 'target_object_description_object.__global_error_checking_function__' (not a function)!" + software_bug__detected_in ) ; return true ;}
}
var target_object__property_name ; var target_object__property_value ; var property_description_list ; var required_or_optional ; var required_crockford_typeof ; var property_specific_error_checking_function ; var property_names_found = [] ; var i , j , this_crockford_typeof , question_crockford_typeof_error ; var typeof_strings = [ 'array' , 'boolean' , 'function' , 'null' , 'number' , 'object' , 'string' , 'undefined' ] ; for ( target_object__property_name in target_object ) { if ( target_object__property_name === 'toJSONString' ) { continue ;}
if ( !target_object_description_object.hasOwnProperty( target_object__property_name
) ) { alert( "Bad 'target_object' (the '" + target_object__property_name + "' property is NOT recognised/supported)!" + software_bug__detected_in ) ; return true ;}
property_description_list = target_object_description_object[target_object__property_name] ; if ( crockford_typeof( property_description_list ) !== 'array' ) { alert( "Bad 'target_object_description_object' ('" + target_object__property_name + "'s value isn't an array)!" + software_bug__detected_in ) ; return true ;}
if ( property_description_list.length !== 3 ) { alert( "Bad 'target_object_description_object' ('" + target_object__property_name + "'s value should be 3 elements long (not " + property_description_list.length + ")!" + software_bug__detected_in ) ; return true ;}
required_or_optional = property_description_list[0] ; if ( required_or_optional !== 'required'
&&
required_or_optional !== 'optional' ) { alert( "Bad 'target_object_description_object' (The value of '" + target_object__property_name + "'s 1st element must be one of:-" + "\n\t'required'" + "\n\t'optional'" + "\n\n(The value specified was;  " + required_or_optional + ".)" + software_bug__detected_in ) ; return true ;}
required_crockford_typeof = property_description_list[1] ; question_crockford_typeof_error = false ; if ( typeof( required_crockford_typeof ) === 'string' ) { question_crockford_typeof_error = !typeof_strings.raber_inArray( required_crockford_typeof ) ;} else if ( crockford_typeof( required_crockford_typeof ) === 'array' ) { if ( required_crockford_typeof.length < 1 ) { question_crockford_typeof_error = true ;} else { for ( i=0 , j=required_crockford_typeof.length ; i<j ; i++ ) { this_crockford_typeof = required_crockford_typeof[i] ; if ( !typeof_strings.raber_inArray( this_crockford_typeof ) ) { question_crockford_typeof_error = true ; break ;}
}
}
} else { question_crockford_typeof_error = true ;}
if ( question_crockford_typeof_error ) { alert( "Bad 'target_object_description_object' ('" + target_object__property_name + "'s 2nd element must be one of:-" + "\n\t'array'" + "\n\t'boolean'" + "\n\t'function'" + "\n\t'null'" + "\n\t'number'" + "\n\t'object'" + "\n\t'string'" + "\n\t'undefined'" + "\n(or a non_empty list of the same)!" + "\n\n(The value specified was;  '" + required_crockford_typeof + "'.)" + software_bug__detected_in ) ; return true ;}
property_specific_error_checking_function = property_description_list[2] ; if ( crockford_typeof( property_specific_error_checking_function ) !== 'undefined'
&&
crockford_typeof( property_specific_error_checking_function ) !== 'function' ) { alert( "Bad 'target_object_description_object' (The value of '" + target_object__property_name + "'s 3rd element must be either undefined" + " or a function." + "\n\n(The value specified was;  " + property_specific_error_checking_function + ".)" + software_bug__detected_in ) ; return true ;}
target_object__property_value = target_object[target_object__property_name] ; if ( crockford_typeof( required_crockford_typeof ) === 'array' ) { question_crockford_typeof_error = !required_crockford_typeof.raber_inArray( crockford_typeof( target_object__property_value ) ) ;} else { question_crockford_typeof_error = crockford_typeof( target_object__property_value ) !== required_crockford_typeof ;}
if ( question_crockford_typeof_error ) { alert( "Bad 'target_object' (the '" + target_object__property_name + "' property is of the wrong type)!" + software_bug__detected_in ) ; return true ;}
if ( property_specific_error_checking_function ) { if ( property_specific_error_checking_function( target_object__property_name , target_object__property_value , software_bug__detected_in
) ) { return true ;}
}
property_names_found.push( target_object__property_name ) ;}
var target_object_description_object__property_name ; for ( target_object_description_object__property_name in
target_object_description_object ) { if ( !property_names_found.raber_inArray( target_object_description_object__property_name
)
&&
target_object_description_object[target_object_description_object__property_name][0] === 'required' ) { alert( "Bad 'target_object_description_object' (the required property - '" + target_object_description_object__property_name + " - wasn't specified)!" + software_bug__detected_in ) ; return true ;}
}
if ( global_error_checking_function ) { if ( global_error_checking_function( target_object , software_bug__detected_in
) ) { return true ;}
}
return false ;}
function wos1__combine_query_string_fragments( fragments_list ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__combine_query_string_fragments" , "webos/wos1/javascript/utilities/url.js" ) ; var value_to_return_on_error = undefined ; if ( crockford_typeof( fragments_list ) !== 'array' ) { alert( "Bad 'fragments_list' (not an array)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
var output_string = "" ; var i , j ; var this_list_element ; var comma = "" ; for ( i=0 , j=fragments_list.length ; i<j ; i++ ) { this_list_element = fragments_list[i] ; if ( this_list_element ) { if ( typeof( this_list_element ) !== 'string' ) { alert( "Bad 'fragments_list' entry (not a string)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
this_list_element = wos1__trim( this_list_element ) ; if ( this_list_element ) { output_string += comma + this_list_element ; comma = "&" ;}
}
}
return output_string ;}
function wos1__create_query_string__from_query_string_fragments( fragments_list ) { var query_string = wos1__combine_query_string_fragments( fragments_list ) ; if ( query_string ) { return "?" + query_string ;}
return query_string ;}
function quirksmode_createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString();}
else var expires = ""; document.cookie = name+"="+value+expires+"; path=/";}
function quirksmode_readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}
return null;}
function quirksmode_eraseCookie(name) { createCookie(name,"",-1);}
function hunlock_cookiesAllowed() { hunlock_setCookie('checkCookie', 'test', 1); if (hunlock_getCookie('checkCookie')) { hunlock_deleteCookie('checkCookie'); return true;}
return false;}
function hunlock_setCookie(name,value,expires, options) { if (options===undefined) { options = {};}
if ( expires ) { var expires_date = new Date(); expires_date.setDate(expires_date.getDate() + expires)
}
document.cookie = name+'='+escape( value ) + ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + ( ( options.path ) ? ';path=' + options.path : '' ) + ( ( options.domain ) ? ';domain=' + options.domain : '' ) + ( ( options.secure ) ? ';secure' : '' );}
function hunlock_getCookie( name ) { var start = document.cookie.indexOf( name + "=" ); var len = start + name.length + 1; if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { return null;}
if ( start == -1 ) return null; var end = document.cookie.indexOf( ';', len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring( len, end ) );}
function hunlock_deleteCookie( name, path, domain ) { if ( getCookie( name ) ) document.cookie = name + '=' + ( ( path ) ? ';path=' + path : '') + ( ( domain ) ? ';domain=' + domain : '' ) + ';expires=Thu, 01-Jan-1970 00:00:01 GMT';}
function fleegix_getScrollerWidth() { var scr = null; var inn = null; var wNoScroll = 0; var wScroll = 0; scr = document.createElement('div'); scr.style.position = 'absolute'; scr.style.top = '-1000px'; scr.style.left = '-1000px'; scr.style.width = '100px'; scr.style.height = '50px'; scr.style.overflow = 'hidden'; inn = document.createElement('div'); inn.style.width = '100%'; inn.style.height = '200px'; scr.appendChild(inn); document.body.appendChild(scr); wNoScroll = inn.offsetWidth; scr.style.overflow = 'auto'; wScroll = inn.offsetWidth; document.body.removeChild( document.body.lastChild); return (wNoScroll - wScroll);}
function wos1__get_horizontal_scrollbar_width() { var sw = fleegix_getScrollerWidth() ; if ( sw ) { return sw ;} else { return 17 ;}
}
function wos1__get_vertical_scrollbar_width() { return wos1__get_horizontal_scrollbar_width() ;}
function wos1__question_horizontal_scrollbar() { if ( document.body.scrollLeft ) { return true ;} else { return document.body.scrollWidth >= wos1__get_viewport_width() ;}
}
function wos1__question_vertical_scrollbar() { if ( document.body.scrollTop ) { return true ;} else { return document.body.scrollHeight >= wos1__get_viewport_height() ;}
}
function wos1__integer_pixels_to_CSS( integer_pixel_value ) { if ( /^\d+$/.test( integer_pixel_value ) ) { return integer_pixel_value + "px" ;}
alert( "Bad/unsupported webos pixel value (must be one or more numeric digits)!" + "\n\nThe bad/unsupported value is:  " + integer_pixel_value + wos1__software_bug__get_detected_in( "wos1__integer_pixels_to_CSS" , "webos/wos1/javascript/utilities/css_integer_pixels.js"
) ) ; return integer_pixel_value ;}
function wos1__CSS_to_integer_pixels( CSS_pixel_value ) { var error_output_value = undefined ; if ( arguments.length > 1 ) { error_output_value = arguments[1] ;}
function my_error_handler() { alert( "Bad/unsupported CSS pixel value (must be one or more numeric digits" + " - with optional leading '-' sign, and/or optional trailing 'px')!" + "\n\nThe bad/unsupported value is:  " + CSS_pixel_value + wos1__software_bug__get_detected_in( "wos1__CSS_to_integer_pixels" , "webos/wos1/javascript/utilities/css_integer_pixels.js"
) ) ; return error_output_value ;}
if ( CSS_pixel_value === undefined ) { return 0 ;} else if ( CSS_pixel_value === null || CSS_pixel_value === "" ) { return my_error_handler() ;}
var matches = /^[+]?(\d+)(px)?$/i.exec( CSS_pixel_value ) ; if ( matches ) { return matches[1] ;}
return my_error_handler() ;}
function wos1__get_viewport_width__approx() { var temp ; if (self.innerWidth) { temp = self.innerWidth ;} else if (document.documentElement && document.documentElement.clientWidth) { temp = document.documentElement.clientWidth ;} else if (document.body) { temp = document.body.clientWidth ;}
if ( temp == undefined || temp <= 0 ) { alert( "ERROR: Can't Get Viewport (Window) Width!" + "\n\nWe'll continue with a value of 600 pixels.  But this is probably too small" + " on most desktops - and too big on most handhelds.  You might need to UPGRADE YOUR BROWSER." + "\n\nThis error ocurred in:-\n\tcore_cross_browser_javascript/viewport_width_height.js" ) ; return 600 ;}
return temp ;}
function wos1__get_viewport_height__approx() { if ( is_ie6 ) { return document.documentElement.clientHeight - 75 ;}
var temp ; if (self.innerHeight) { temp = self.innerHeight ;} else if (document.documentElement && document.documentElement.clientHeight) { temp = document.documentElement.clientHeight ;} else if (document.body) { temp = document.body.clientHeight ;}
if ( temp == undefined || temp <= 0 ) { alert( "ERROR: Can't Get Viewport (Window) Height!" + "\n\nWe'll continue with a value of 300 pixels.  But this is probably too small" + " on most desktops - and too big on most handhelds.  You might need to UPGRADE YOUR BROWSER." + "\n\nThis error ocurred in:-\n\tcore_cross_browser_javascript/viewport_width_height.js" ) ; return 300 ;}
return temp ;}
function wos1__get_last_saved_viewport_height__approx() { return quirksmode_readCookie("vha") ;}
function wos1__get_last_saved_viewport_width__approx() { return quirksmode_readCookie("vwa") ;}
function wos1__get_viewport_height__exact() { return quirksmode_readCookie("vhe") ;}
function wos1__get_viewport_width__exact() { return quirksmode_readCookie("vwe") ;}
function wos1__update_viewport_height_and_width() { if ( wos1__get_viewport_height__approx() == wos1__get_last_saved_viewport_height__approx()
&&
wos1__get_viewport_width__approx() == wos1__get_last_saved_viewport_width__approx() ) { return ;}
quirksmode_createCookie( "vha" , wos1__get_viewport_height__approx() , 1 ) ; quirksmode_createCookie( "vwa" , wos1__get_viewport_width__approx() , 1 ) ; quirksmode_createCookie( "olh" , location.href , 1 ) ; location.href = webos_root_dir_url + "/wos1/javascript/misc/viewport/viewport_height_slash_width.html" ;}
var wos1__webos_message_queue = [] ; function wos1__process_webos_message( webos_message_object , target_window_object , question_window_is_being_created ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__process_webos_message" , "webos/wos1/javascript/messaging/main.js" ) ; if ( crockford_typeof( webos_message_object ) != 'object' ) { alert( "Bad 'webos_message_object' (not an object)!" + software_bug__detected_in ) ; return ;}
if ( crockford_typeof( target_window_object ) != 'null'
&&
( crockford_typeof( target_window_object ) != 'object' || !( target_window_object instanceof wos1_WebOS_Window )
) ) { alert( "Bad 'target_window_object' (it's neither null; nor a 'wos1_WebOS_Window' object)!" + software_bug__detected_in ) ; return ;}
if ( crockford_typeof( target_window_object ) !== 'null'
&&
typeof( question_window_is_being_created ) !== 'boolean' ) { alert( "Bad 'question_window_is_being_created' (not a boolean)!" + software_bug__detected_in ) ; return ;}
wos1__webos_message_queue.push( [ webos_message_object , target_window_object , question_window_is_being_created ] ) ; if ( wos1__webos_message_queue.length == 1 ) { wos1__process_next_webos_message_queue_entry() ;}
}
function wos1__process_next_webos_message_queue_entry() { wos1__process_first_webos_message_queue_entry() ; wos1__webos_message_queue.shift() ; if ( wos1__webos_message_queue.length ) { setTimeout( "wos1__process_next_webos_message_queue_entry()" , 50 ) ;}
}
function wos1__process_first_webos_message_queue_entry() { webos_message_object = wos1__webos_message_queue[0][0] ; target_window_object = wos1__webos_message_queue[0][1] ; question_window_is_being_created = wos1__webos_message_queue[0][2] ; var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__process_first_webos_message_queue_entry" , "webos/wos1/javascript/messaging/main.js" ) ; var software_bug__detected_in__functions_table = wos1__software_bug__get_detected_in( "wos1_webos_message_functions" , "webos/wos1/javascript/messaging/main.js" ) ; function questionHasProperty_beforeWindowSwitch( target_webos_message_object , target_property_name ) { for ( property_name in target_webos_message_object ) { if ( [ "open_new_window" , "close_window" ].raber_inArray( property_name ) ) { return false ;}
if ( property_name === target_property_name ) { return true ;}
}
}
if ( questionHasProperty_beforeWindowSwitch( webos_message_object , "width" ) ) { if ( target_window_object ) { wos1__set_width( target_window_object , webos_message_object.width ) ;} else { alert( "'width' not allowed (you can't set the width of the background web page)!" + software_bug__detected_in ) ;}
} else if ( target_window_object && question_window_is_being_created ) { wos1__set_width( target_window_object , null ) ;}
if ( questionHasProperty_beforeWindowSwitch( webos_message_object , "height" ) ) { if ( target_window_object ) { wos1__set_height( target_window_object , webos_message_object.height ) ;} else { alert( "'height' not allowed (you can't set the height of the background web page)!" + software_bug__detected_in ) ;}
} else if ( target_window_object && question_window_is_being_created ) { wos1__set_height( target_window_object , null ) ;}
if ( questionHasProperty_beforeWindowSwitch( webos_message_object , "top" ) ) { if ( target_window_object ) { wos1__set_top( target_window_object , webos_message_object.top ) ;} else { alert( "'top' not allowed (you can't set the top of the background web page)!" + software_bug__detected_in ) ;}
} else if ( target_window_object && question_window_is_being_created ) { wos1__set_top( target_window_object , null ) ;}
if ( questionHasProperty_beforeWindowSwitch( webos_message_object , "left" ) ) { if ( target_window_object ) { wos1__set_left( target_window_object , webos_message_object.left ) ;} else { alert( "'left' not allowed (you can't set the left of the background web page)!" + software_bug__detected_in ) ;}
} else if ( target_window_object && question_window_is_being_created ) { wos1__set_left( target_window_object , null ) ;}
for ( property_name in webos_message_object ) { if ( property_name === 'toJSONString' ) { continue ;}
if ( wos1_webos_message_functions.hasOwnProperty(property_name) ) { if ( wos1_webos_message_functions[property_name]( webos_message_object , target_window_object , question_window_is_being_created , property_name , webos_message_object[property_name] , software_bug__detected_in__functions_table
) ) { break ;}
} else { alert( "Unrecognised/unsupported WebOS message!" + "\n\nThe unrecognised/unsupported message is:  " + property_name + "\n\nThis message will be ignored." + software_bug__detected_in ) ;}
}
if ( target_window_object ) { wos1__install_control_button_click_handlers( target_window_object ) ;}
}
var wos1_webos_message_functions = { title : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { target_window_object.main_title_area_element.innerHTML = property_value ; return false ;} , ajax_request : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__send_ajax_request__from_window( property_value , target_window_object ) ; return false ;} , responder_configures : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__send_ajax_request__from_window( property_value , target_window_object ) ; return false ;} , open_new_window : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { var new_webos_message_object = new Object ; var question_keep = false ; for ( new_property_name in webos_message_object ) { if ( question_keep ) { new_webos_message_object[new_property_name] = webos_message_object[new_property_name] ;} else { if ( new_property_name == property_name ) { question_keep = true ;}
}
}
new wos1_WebOS_Window( new_webos_message_object ) ; return true ;} , document_url : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { target_window_object.question_iframe_loaded = false ; var current_src = target_window_object.iframe_element.getAttribute( "src" ) ; if ( current_src
&&
current_src !== wos1_dummy_page_url ) { get_iframe_document( target_window_object.iframe_element ).location.href = property_value ;} else { target_window_object.iframe_element.setAttribute( "src" , property_value ) ;}
return false ;} , js_files : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__install_js_files( property_value ) ; return false ;} , control_buttons : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__install_control_buttons__from_control_button_details_string_or_array( target_window_object , property_value ) ; return false ;} , fixed_header : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { target_window_object.fixed_header_element.innerHTML = property_value ; return false ;} , fixed_footer_buttons : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__install_button_group( target_window_object , 'fixed_footer' , property_value ) ; return false ;} , status_bar_buttons : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { wos1__install_button_group( target_window_object , 'main_status_area' , property_value ) ; return false ;} , iframe_onload_script__pre_behaviour : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad '" + property_name + "' (not a string)!" + software_bug__detected_in ) ; return false ;}
if ( wos1__trim( property_value ) == "" ) { alert( "Bad '" + property_name + "' (blank string)!" + software_bug__detected_in ) ; return false ;}
target_window_object.iframe_onload_script__pre_behaviour = property_value ; return false ;} , iframe_onload_script__post_behaviour : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad '" + property_name + "' (not a string)!" + software_bug__detected_in ) ; return false ;}
if ( wos1__trim( property_value ) == "" ) { alert( "Bad '" + property_name + "' (blank string)!" + software_bug__detected_in ) ; return false ;}
target_window_object.iframe_onload_script__post_behaviour = property_value ; return false ;} , iframe_behaviour : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { target_window_object.iframe_behaviour_rules_list = property_value ; return false ;} , width : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { return false ;} , height : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { return false ;} , top : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { return false ;} , left : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { return false ;} , innerHTML : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { innerHTML_insert_slash_replace( target_window_object , property_value ) ; return false ;} , select_tab : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad '" + property_name + "' (not a string)!" + software_bug__detected_in ) ; return false ;}
if ( wos1__trim( property_value ) == "" ) { alert( "Bad '" + property_name + "' (blank string)!" + software_bug__detected_in ) ; return false ;}
TAB_select( target_window_object , property_value ) ; return false ;} , evalgf : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { webos_eval_item( property_value , software_bug__detected_in ) ; return false ;} , evalgfl : function( webos_message_object , target_window_object , question_window_is_being_created , property_name , property_value , software_bug__detected_in ) { if ( crockford_typeof( property_value ) === 'array' ) { var i , j ; for ( i=0 , j=property_value.length ; i<j ; i++ ) { webos_eval_item( property_value[i] , software_bug__detected_in ) ;}
} else { alert( "Bad '" + property_name + "' (must be an array)!" + software_bug__detected_in ) ;}
return false ;}
}
function webos_eval_item( item_to_eval , software_bug__detected_in ) { if ( typeof( item_to_eval ) === 'string' ) { if ( ! /[^a-zA-Z0-9_]/.test( item_to_eval ) ) { eval( item_to_eval + '()' ) ;}
} else if ( crockford_typeof( item_to_eval ) === 'array' ) { var js = item_to_eval[0] + '(' ; var comma = '' ; var i , j ; for ( i=1 , j=item_to_eval.length ; i<j ; i++ ) { js += comma + "'" + item_to_eval[i].replace( /'/g , "\\'" ) + "'" ;

            comma = ',' ;

            }

        // -----------------------------------------------------------------------

        webos_evalgf( js + ')' ) ;

        // -----------------------------------------------------------------------

    } else {

        // -------------------------------------------------------------------

        alert( "Bad '" + property_name + "' (must be string or array)!" + software_bug__detected_in ) ;

        // -------------------------------------------------------------------

        }

    // -----------------------------------------------------------------------

    }

// ===========================================================================
// webos_evalgf
// ===========================================================================

function webos_evalgf( script ) {
    eval( script ) ;
    }

// ***************************************************************************
// WOS1/JAVASCRIPT/BEHAVIOUR/BEHAVIOUR.JS
// (C) Peter Newman 2007
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Behaviours for  WebOS Windows...
// ***************************************************************************

// ===========================================================================
// event_listener_count
// ===========================================================================

//var event_listener_count = 0 ;

// ===========================================================================
// add_event_handler__to_single_element
// ===========================================================================

//  alert( "OUTER:  " + target_window_object.unique_name + " --- " + element_object.tagName + " --- " + event_data + " --- " + js_function_name )
//      alert( "INNER:  " + target_window_object.unique_name + " --- " + element_object.tagName + " --- " + event_data + " --- " + js_function_name )

function event_handler_container__for_function_name( target_window_object , element_object , event_data , js_function_name ) {
    return function (e) {
        eval(js_function_name)(e,element_object,event_data)
        }
    }

// ---------------------------------------------------------------------------

function add_event_handler__to_single_element(
    target_window_object    ,
    element_object          ,
    event_type              ,
    js_function_name        ,
    js_script               ,
    event_data
    ) {

    // -----------------------------------------------------------------------
    //  We assume that this routine is called from:-
    //      install_behaviour
    //
    //  - which has checked that one and only one of:-
    //      js_function_name
    //      js_script
    //
    //  is defined.
    // -----------------------------------------------------------------------

    // =======================================================================
    // WEBOS BEHAVIOUR EVENT HANDLERS
    // ==============================
    //
    // Overview
    // - - - -
    // A STANDARD JAVASCRIPT EVENT HANDLER:-
    //      o   Is called (by the browser) when the specified event occurs,
    //          and;
    //      o   Has a SINGLE INPUT PARAMETER (the browser-specific event
    //          object that gives the event details).
    //
    // The WEBOS BEHAVIOUR EVENT HANDLER is similar - but has THREE ADDITIONAL
    // INPUT PARAMETERS:-
    //
    //      o   'target_window_object'
    //              The WebOS window in which the event occured.
    //
    //      o   'element_object'
    //              The element to which the beaviour was attached - and on
    //              which the event occured.
    //
    //      o   'event_data'
    //              Any additional data you want to pass to the event handler.
    //
    //              More specifically, this can be any PHP or Javascript
    //              value, other than a function.  For example, it might be
    //              --  a string,
    //              --  an integer,
    //              --  a boolean,
    //              --  an array/list, or;
    //              --  an object/associative array (of 'name=value' pairs -
    //                  and nested to any depth).
    //
    //              The 'event data' you want to pass is specified in the
    //              WebOS behaviour 'rules list' you created, when
    //              defining/installing the behaviour.
    //
    // Standard Javascript Event Handler
    // - - - - - - - - - - - - - - - - -
    // A standard Javascript event handler has a single input parameter -
    // the browser specific event object that provides the event details.
    //
    // And generally will look something like:-
    //
    //      function my_standard_javascript_event_handler(e) {
    //
    //          // -------------------------------------------------------------------
    //          //  Make sure we have the event object (no matter what the browser)...
    //          //  See;    "Introduction to Events"
    //          //          Peter-Paul Koch
    //          //          http://www.quirksmode.org/js/introevents.html
    //          // -------------------------------------------------------------------
    //
    //          if (!e) var e = window.event;
    //
    //          // -------------------------------------------------------------------
    //          // Get the element the event occurred on...
    //          //  See;    "Introduction to Events"
    //          //          Peter-Paul Koch
    //          //          http://www.quirksmode.org/js/introevents.html
    //          // -------------------------------------------------------------------
    //
    //          var targ;
    //          if (e.target) targ = e.target;
    //          else if (e.srcElement) targ = e.srcElement;
    //          if (targ.nodeType == 3) // defeat Safari bug
    //              targ = targ.parentNode;
    //
    //          // -------------------------------------------------------------------
    //          //  Stop the event bubbling up...
    //          //  See;    "Introduction to Events"
    //          //          Peter-Paul Koch
    //          //          http://www.quirksmode.org/js/introevents.html
    //          // -------------------------------------------------------------------
    //
    //          e.cancelBubble = true;
    //          if (e.stopPropagation) e.stopPropagation();
    //
    //          // -------------------------------------------------------------------
    //          // Get the WebOS window the event occurred in...
    //          // -------------------------------------------------------------------
    //
    //          // -------------------------------------------------------------------
    //          // wos1__get_elements__webos_window_object(
    //          //      element_object
    //          //      )
    //          // - - - - - - - - - - - - - - - - - - - -
    //          // Returns either:-
    //          //
    //          //      o   The WebOS Window object of the WebOS Window in which
    //          //          the specified 'element_object' lives,
    //          //
    //          //      o   null, if no such WebOS Window object can be found.  (In
    //          //          which case, the element object presumably lives in the
    //          //          background web page.), or;
    //          //
    //          //      o   undefined, if an error occurred (error message issued).
    //          // -------------------------------------------------------------------
    //
    //          var target_window_object =
    //              wos1__get_elements__webos_window_object( targ ) ;
    //
    //          // -------------------------------------------------------------------
    //          // Your event handling code proper here...
    //          // -------------------------------------------------------------------
    //
    //          ...
    //
    //          // -------------------------------------------------------------------
    //          // That's that!
if ( js_function_name ) { element_object[event_type] = event_handler_container__for_function_name( target_window_object , element_object , event_data , js_function_name ) ;} else { function event_handler_container( target_window_object , element_object , event_data ) { return function (e) { eval( js_script )
}
}
element_object[event_type] = event_handler_container( target_window_object , element_object , event_data ) ;}
}
function add_event_handler__to_multiple_elements( target_window_object , array_of_element_objects , event_type , js_function_name , js_script , event_data ) { var i , j ; for ( i=0 , j=array_of_element_objects.length ; i<j ; i++ ) { add_event_handler__to_single_element( target_window_object , array_of_element_objects[i] , event_type , js_function_name , js_script , event_data ) ;}
}
var tgo_count = 0 ; function install_behaviour_c( tgo_number ) { var tgo = eval("window.tgo_" + tgo_number) ; if ( tgo.attempts_left == 0 ) { if ( !is_ie ) { eval("delete window.tgo_" + tgo_number) ;}
return 0 ;}
var list = xGetElementsByClassName( tgo.target_class_name , tgo.target_document , null , null ) ; if ( list.length > 0 ) { add_event_handler__to_multiple_elements( tgo.target_window_object , list , tgo.event_type , tgo.js_function_name , tgo.js_script , tgo.event_data ) ; if ( !is_ie ) { eval("delete window.tgo_" + tgo_number) ;}
return list.length ;}
tgo.attempts_left-- ; tgo.delay_ms = tgo.delay_ms * 2 ; setTimeout( "install_behaviour_c(" + tgo_number + ")" , ( tgo.delay_ms / 2 ) ) ;}
function wos1__install_behaviour( target_window_object , rules_list ) { var error_extras = wos1__software_bug__get_detected_in( "wos1__install_behaviour" , "webos/wos1/javascript/behaviour/behaviour.js" ) ; if ( crockford_typeof_2( rules_list ) !== 'array' ) { alert( "Bad 'rules list' (not an array)!" + error_extras ) ; return ;}
var target_iframe_element = window.frames[target_window_object.iframe_name_slash_id] ; function install_behaviour_xGetElementById( target_iframe_element , target_id ) { if ( document.getElementById ) { return target_iframe_element.document.getElementById( target_id ) ;}
if ( document.all ) { return target_iframe_element.document.all[target_id] ;}
return null ;}
var i , j , k , L ; var current_rule_object , current_selector_type , current_event_type , current_required ; var current_js_function_name , current_js_script , current_event_data ; var element_object , element_object_list ; var error_extras_for_rule ; var attempts_count ; for ( i=0 , j=rules_list.length ; i<j ; i++ ) { current_rule_object = rules_list[i] ; error_extras_for_rule = "\n\nThis rule will be skipped." + "\n\nNOTE!  The offending rule is rule# " + ( i + 1 ) + " (where the FIRST rule is rule# 1...)." + error_extras ; if ( crockford_typeof_2( current_rule_object ) !== 'object' ) { alert( "Bad rule (not an object)!" + error_extras_for_rule ) ; continue ;}
if ( current_rule_object.hasOwnProperty('event_type') ) { current_event_type = current_rule_object.event_type ; if ( typeof( current_event_type ) != 'string' ) { alert( "Bad rule ('event_type' not a string)!" + error_extras_for_rule ) ; continue ;}
current_event_type = wos1__trim( current_event_type ) ; if ( current_event_type == '' ) { alert( "Bad rule ('event_type' empty)!" + error_extras_for_rule ) ; continue ;}
} else { alert( "Bad rule ('event_type' not specified)!" + error_extras_for_rule ) ; continue ;}
if ( current_rule_object.hasOwnProperty('js_function_name') ) { current_js_function_name = current_rule_object.js_function_name ; if ( typeof( current_js_function_name ) !== 'string' ) { alert( "Bad rule ('js_function_name' not a string)!" + error_extras_for_rule ) ; continue ;}
if ( wos1__trim( current_js_function_name ) === '' ) { alert( "Bad rule ('js_function_name' blank)!" + error_extras_for_rule ) ; continue ;}
}
if ( current_rule_object.hasOwnProperty('js_script') ) { current_js_script = current_rule_object.js_script ; if ( typeof( current_js_script ) !== 'string' ) { alert( "Bad rule ('js_script' not a string)!" + error_extras_for_rule ) ; continue ;}
if ( wos1__trim( current_js_script ) === '' ) { alert( "Bad rule ('js_script' blank)!" + error_extras_for_rule ) ; continue ;}
}
if ( !current_js_function_name && !current_js_script ) { alert( "Bad rule (neither 'js_function_name' nor 'js_script' has been specified)!" + error_extras_for_rule ) ; continue ;}
if ( current_js_function_name && current_js_script ) { alert( "Bad rule (only one of 'js_function_name' and 'js_script' may be specified)!" + error_extras_for_rule ) ; continue ;}
if ( current_rule_object.hasOwnProperty('event_data') ) { current_event_data = current_rule_object.event_data ;}
current_required = false ; if ( current_rule_object.hasOwnProperty('required') ) { if ( typeof( current_rule_object.required ) != 'string' ) { alert( "Bad rule ('required' not a string)!" + error_extras_for_rule ) ; continue ;}
current_required = true ;}
current_selector_type = '' ; if ( current_rule_object.hasOwnProperty('s_id') ) { current_selector_type += 'i' ;}
if ( current_rule_object.hasOwnProperty('s_class') ) { current_selector_type += 'c' ;}
if ( current_rule_object.hasOwnProperty('s_tag') ) { current_selector_type += 't' ;}
if ( current_rule_object.hasOwnProperty('s_attribute') ) { current_selector_type += 'a' ;}
if ( current_rule_object.hasOwnProperty('s_property') ) { current_selector_type += 'p' ;}
if ( current_rule_object.hasOwnProperty('s_regex') ) { current_selector_type += 'r' ;}
if ( current_selector_type == 'i' ) { element_object = install_behaviour_xGetElementById( target_iframe_element , current_rule_object.s_id ) ; if ( element_object ) { add_event_handler__to_single_element( target_window_object , element_object , current_event_type , current_js_function_name , current_js_script , current_event_data ) ;} else { if ( current_required ) { alert( "Bad rule (selector 's_id = " + current_rule_object.s_id + "' not found)!" + error_extras_for_rule ) ;}
}
} else if ( current_selector_type == 'c' ) { tgo_count++ ; var tgo_name = "tgo_" + tgo_count ; eval( "window." + tgo_name + " = {" + "target_window_object   : target_window_object          ," + "target_class_name      : current_rule_object.s_class   ," + "target_document        : target_iframe_element.document," + "event_type             : current_event_type            ," + "js_function_name       : current_js_function_name      ," + "js_script              : current_js_script             ," + "event_data             : current_event_data            ," + "delay_ms               : 100                           ," + "attempts_left          : 5                             }" ) ; if ( install_behaviour_c(tgo_count) == 0 ) { if ( current_required ) { alert( "Bad rule (selector 's_class = " + current_rule_object.s_class + "' not found)!" + error_extras_for_rule ) ;}
}
} else if ( current_selector_type == 't' ) { element_objects_list = xGetElementsByTagName( current_rule_object.s_tag , target_iframe_element.document ) ; if ( element_objects_list.length > 0 ) { add_event_handler__to_multiple_elements( target_window_object , element_objects_list , current_event_type , current_js_function_name , current_js_script , current_event_data ) ;} else { if ( current_required ) { alert( "Bad rule (selector 's_tag = " + current_rule_object.s_tag + "' not found)!" + error_extras_for_rule ) ;}
}
} else { alert( "Bad rule (selector invalid or not supported)!" + error_extras_for_rule ) ; continue ;}
}
}
function wos1__install_js_files( js_file_details_objects_list ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__install_js_files" , "webos/wos1/javascript/dynamic_js/main.js" ) ; if ( crockford_typeof( js_file_details_objects_list ) !== 'array' ) { alert( "Bad 'js_file_details_objects_list' (not an array)!" + software_bug__detected_in
)
return ;}
var i , j ; for ( i=0 , j=js_file_details_objects_list.length ; i<j ; i++ ) { wos1__install_single_js_file( js_file_details_objects_list[i] ) ;}
}
function wos1__install_single_js_file( js_file_details_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__install_js_file" , "webos/wos1/javascript/dynamic_js/main.js" ) ; var script_element ; if ( crockford_typeof( js_file_details_object ) !== 'object' ) { alert( "Bad 'js_file_details_object' (not an object)!" + software_bug__detected_in
)
return ;}
if ( !js_file_details_object.hasOwnProperty( "url" ) ) { alert( "Bad 'js_file_details_object.url' property (not specified)!" + software_bug__detected_in
)
return ;}
var url = js_file_details_object.url ; if ( typeof( url ) !== 'string' ) { alert( "Bad 'js_file_details_object.url' property (not a string)!" + software_bug__detected_in
)
return ;}
url = wos1__trim( url ) ; if ( url == '' ) { alert( "Bad 'js_file_details_object.url' property (blank)!" + software_bug__detected_in
)
return ;}
var id = '' ; if ( js_file_details_object.hasOwnProperty( "id" ) ) { id = js_file_details_object.id ; if ( typeof( id ) !== 'string' ) { alert( "Bad 'js_file_details_object.id' property (not a string)!" + software_bug__detected_in
)
return ;}
id = wos1__trim( id ) ;}
if ( id ) { script_element = document.getElementById( id ) ; if ( script_element ) { if ( script_element.tagName !== 'SCRIPT' ) { alert( "Bad 'js_file_details_object.id' property (the specified ID is already in use)!" + "\n\nThe offending ID is:  " + id + software_bug__detected_in ) ; return ;}
return ;}
}
var head_element = document.getElementsByTagName("head")[0] ; script_element = document.createElement('script') ; script_element.type = 'text/javascript' ; script_element.src = url ; if ( id ) { script_element.id = id ;}
head_element.appendChild(script_element) ;}
var wos1__list_of__commonly_supported_events = [ 'onabort' , 'onblur' , 'onclick' , 'onchange' , 'ondblclick' , 'onerror' , 'onfocus' , 'onkeydown' , 'onkeypress' , 'onkeyup' , 'onload' , 'onmousedown' , 'onmousemove' , 'onmouseout' , 'onmouseover' , 'onmouseup' , 'onreset' , 'onresize' , 'onselect' , 'onsubmit' , 'onunload'
]
function wos1__add_event__to_element( element_id , event_type , handler_function ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__add_event__to_element" , "webos/wos1/javascript/events/event.js" ) ; var error_extras = "\n\nThis event will be ignored!" + software_bug__detected_in ; if ( typeof( element_id ) !== 'string' ) { alert( "Bad 'element_id' (not a string)!" + "\n\nThe event details are:-" + "\n             Element_id:  " + element_id + "\ntypeof(element_id):  " + crockford_typeof( element_id ) + "\n             Event type:  " + event_type + error_extras ) ; return ;}
if ( typeof( event_type ) !== 'string' ) { alert( "Bad 'event_type' (not a string)!" + error_extras ) ; return ;}
var normalised_event_type = wos1__trim( event_type ) ; if ( normalised_event_type.substr(0,1) === "*" ) { normalised_event_type = normalised_event_type.substr(1) ;} else { normalised_event_type = normalised_event_type.toLowerCase() ; if ( normalised_event_type.substr(0,2) !== "on" ) { normalised_event_type = "on" + normalised_event_type ;}
if ( !wos1__list_of__commonly_supported_events.raber_inArray( normalised_event_type ) ) { alert( "Unrecognised/unsupported 'event_type'!" + "\n\nThe unrecognised/unsupported 'event_type' is:  " + event_type + error_extras ) ; return ;}
}
var element_object = document.getElementById( element_id )
if ( !element_object ) { alert( "'element_id' (" + element_id + ") not found!" + software_bug__detected_in ) ; return ;}
if ( crockford_typeof( handler_function ) !== 'function' ) { alert( "Bad 'handler_function' (not a Javascript function object)!" + "\n\nElement Tag Name.......:    " + element_object.tagName + "\nElement ID................:    " + element_object.id + "\nElement Class Name.....:    " + element_object.className + "\nEvent Type...............:    " + event_type + "\nEvent Type (normalised):    " + normalised_event_type + error_extras ) ; return ;}
var owner_webos_window_object = wos1__get_webos_window_iframe_document_elements__webos_window_object( element_object ) ; if ( owner_webos_window_object === 'try_again_later' ) { function try_again_later( _element_id , _event_type , _handler_function ) { return function () { wos1__add_event__to_element( _element_id , _event_type , _handler_function ) ;}
}
setTimeout( try_again_later( element_id , event_type , handler_function ) , 100 ) ; return ;} else if ( owner_webos_window_object === undefined ) { return ;}
if ( element_object.webos_event_handlers
&&
element_object.webos_event_handlers[normalised_event_type] ) { element_object.webos_event_handlers[normalised_event_type].push(handler_function) ; element_object[normalised_event_type] = wos1__get_event_handler_functions_list_executioner( element_object , normalised_event_type
)
} else { if ( !element_object.webos_event_handlers ) { element_object.webos_event_handlers = new Object() ;}
element_object.webos_event_handlers[normalised_event_type] = [handler_function] ; element_object[normalised_event_type] = handler_function ; if (element_object.captureEvents) { if ( normalised_event_type.substr(1,2) === "on" ) { element_object.captureEvents( Event[ normalised_event_type.substr(2).toUpperCase() ] ) ;} else { element_object.captureEvents( Event[ normalised_event_type.toUpperCase() ] ) ;}
}
}
}
function wos1__get_event_handler_functions_list_executioner( element_object , event_type ) { return function(e) { handler_functions_list = element_object.webos_event_handlers[event_type] ; var i , j ; for ( i=0 , j=handler_functions_list.length ; i<j ; i++ ) { handler_functions_list[i](e) ;}
}
}
function wos1__submit() { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__submit" , "webos/wos1/javascript/forms/submit.js" ) ; var argc = arguments.length ; if ( argc < 1 ) { alert( "Insufficient arguments!" + "\n\nAt least one of:-" + "\n\ttarget_window_object" + "\n\ttarget_url" + "\n\trequired_fields_list" + "\n\tadditional_parameters" + "\n\tsubmission_details" + "\nmust be specified." + software_bug__detected_in ) ; return ;}
if ( argc > 5 ) { alert( "Too many arguments!" + "\n\nThis function accepts max. 5 input parameters:-" + "\n\ttarget_window_object" + "\n\ttarget_url" + "\n\trequired_fields_list" + "\n\tadditional_parameters" + "\n\tsubmission_details" + "\nmust be specified." + software_bug__detected_in ) ; return ;}
var target_window_object = undefined ; var target_url = undefined ; var required_fields_list = undefined ; var additional_parameters = undefined ; var submission_details = undefined ; var i ; for ( i=0 ; i<argc ; i++ ) { if ( wos1__submit__question_bad_arg( arguments[i] ) ) { return ;}
}
if ( submission_details ) { wos1__submit__complicated() ;} else { wos1__submit__simple() ;}
function wos1__submit__question_bad_arg( argv ) { if ( crockford_typeof( argv ) === 'object' ) { if ( argv instanceof wos1_WebOS_Window ) { if ( target_window_object === undefined ) { target_window_object = argv ; return false ;} else { alert( "Bad 'target_window_object' (already specified)!" + software_bug__detected_in ) ; return true ;}
} else { if ( additional_parameters === undefined ) { additional_parameters = argv ; return false ;} else { alert( "Bad 'additional_parameters' (already specified)!" + software_bug__detected_in ) ; return true ;}
}
} else if ( typeof( argv ) === 'string' ) { if ( target_url === undefined ) { target_url = argv ; return false ;} else { alert( "Bad 'target_url' (already specified)!" + software_bug__detected_in ) ; return true ;}
} else if ( crockford_typeof( argv ) === 'array' ) { if ( submission_details === undefined ) { submission_details = argv ; return false ;} else { alert( "Bad 'submission_details' (already specified)!" + software_bug__detected_in ) ; return true ;}
} else { alert( "Bad input parameter (not recognised)!" + software_bug__detected_in ) ; return true ;}
}
function wos1__submit__simple() { if ( !target_window_object ) { alert( "No form specified!" + "\n\nNeither 'target_window_object' nor 'submission_details' was specified." + "  So we don't know which form to submit." + software_bug__detected_in ) ; return ;}
if ( !target_url ) { alert( "Bad 'target_url' (not specified)!" + "\n\nSo we don't know where to submit the form." + software_bug__detected_in ) ; return ;}
if ( get_iframe_document( target_window_object.iframe_element ).forms.length < 1 ) { alert( "Bad 'target_window_object' (this window has NO FORMS)!" + software_bug__detected_in ) ; return ;}
var target_form = target_window_object.iframe_element.contentDocument.forms[0] ; var form_field_data = wos1__load_field_names_and_values__into_object( target_form ) ; wos1__send_ajax_request( { method : "POST" , url : target_url , parameters1 : form_field_data , window_object : target_window_object
} ) ;}
function wos1__submit__complicated() { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__submit__complicated" , "webos/wos1/javascript/forms/submit.js" ) ; alert( "Not yet implemented!" + software_bug__detected_in ) ;}
}
function wos1__load_field_names_and_values__into_object( target_form_element ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__load_field_names_and_values__into_object" , "webos/wos1/javascript/forms/get_fields.js" ) ; var field_names_and_values = new Object() ; var form_field_elements = target_form_element.elements ; var i , j ; var this_form_field_element_object ; var this_name , this_value ; var unnamed_fields_count = 0 ; for ( i=0 , j=form_field_elements.length ; i<j ; i++ ) { this_form_field_element_object = form_field_elements[i] ; if ( ![ "INPUT" , "TEXTAREA" , "SELECT" , "BUTTON" ].raber_inArray( this_form_field_element_object.tagName
) ) { continue ;}
this_name = this_form_field_element_object.name ; if ( !this_name ) { alert( "Unnamed field!" + software_bug__detected_in ) ; unnamed_fields_count++ ; this_name = "unnamed" + unnamed_fields_count ;}
this_value = wos1__get_form_field__element_value( this_form_field_element_object , undefined
)
field_names_and_values[this_name] = this_value ;}
return field_names_and_values ;}
function wos1__get_form_field__element_value( target_form_field_element_object ) { var value_to_return_on_error = undefined ; if ( arguments.length > 1 ) { value_to_return_on_error = arguments[1] ;}
var this_tagName = target_form_field_element_object.tagName ; if ( this_tagName === 'INPUT' ) { return wos1__get_INPUT_value() ;} else if ( this_tagName === 'TEXTAREA' ) { return wos1__get_TEXTAREA_value() ;} else if ( this_tagName === 'SELECT' ) { return wos1__get_SELECT_value() ;} else if ( this_tagName === 'BUTTON' ) { return wos1__get_BUTTON_value() ;}
return value_to_return_on_error ; function wos1__get_INPUT_value() { var this_type = target_form_field_element_object.type.toLowerCase() ; if ( this_type === 'text' ) { return target_form_field_element_object.value ;} else if ( this_type === 'password' ) { return target_form_field_element_object.value ;} else if ( this_type === 'hidden' ) { return target_form_field_element_object.value ;} else { alert( "Get '" + this_type + "' INPUT not yet supported!" ) ; return value_to_return_on_error ;}
}
function wos1__get_TEXTAREA_value() { return target_form_field_element_object.value ;}
function wos1__get_SELECT_value() { alert( "Get SELECT value not yet supported!" ) ; return value_to_return_on_error ;}
function wos1__get_BUTTON_value() { alert( "Get BUTTON value not yet supported!" ) ; return value_to_return_on_error ;}
}
var dhtmlwindow_1_03__count = 0 ; function wos1__Miniwin() { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__Miniwin" , "webos/wos1/javascript/miniwin/mw.js" ) ; var value_to_return_on_error = null ; var myself = this ; if ( arguments.length > 1 ) { alert( "Too many input arguments!" + "\n\nThis routine must have ZERO or ONE input arguments (not " + arguments.length + ")." + software_bug__detected_in ) ; return value_to_return_on_error ;}
var miniwin_details_object = undefined ; if ( arguments.length ) { miniwin_details_object = arguments[0] ; if ( crockford_typeof( miniwin_details_object ) !== 'object' ) { alert( "Bad 'miniwin_details_object' (not an object)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
}
var miniwin__property_setting_functions = { owner_element_object : function( target_miniwin_object , property_name , property_value , software_bug__detected_in ) { var this_typeof = crockford_typeof( property_value ) ; if ( this_typeof !== 'object'
&&
this_typeof !== 'null' ) { alert( "Bad 'owner_element_object' (neither an object nor null)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_object.owner_element_object = property_value ; return false ;} , owner_miniwin_object : function( target_miniwin_object , property_name , property_value , software_bug__detected_in ) { var this_typeof = crockford_typeof( property_value ) ; if ( this_typeof !== 'object'
&&
this_typeof !== 'null' ) { alert( "Bad 'owner_miniwin_object' (neither an object nor null)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_object.owner_miniwin_object = property_value ; return false ;} , owner_miniwin_group_object : function( target_miniwin_object , property_name , property_value , software_bug__detected_in ) { if ( crockford_typeof( property_value ) !== 'object' ) { alert( "Bad 'owner_miniwin_group_object' (not an object)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_object.owner_miniwin_group_object = property_value ; return false ;} , type : function( target_miniwin_object , property_name , property_value , software_bug__detected_in ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad 'type' (not a string)!" + software_bug__detected_in ) ; return true ;}
if ( [ 'alert' , 'confirm' , 'prompt' , 'window.open' , 'dhtmlwindow_1_03' , 'webos_model_1' ].raber_inArray( property_value ) ) { target_miniwin_object.type = property_value ; return false ;}
alert( "Unrecognised/unsupported Miniwin 'type'!" + "\n\nThe unrecognised/unsupported value is:  " + property_value + software_bug__detected_in ) ; return true ;} , type_specific_details : function( target_miniwin_object , property_name , property_value , software_bug__detected_in ) { if ( crockford_typeof( property_value ) !== 'object' ) { alert( "Bad 'type_specific_details' (not an object)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_object.type_specific_details_object = property_value ; return false ;}
}
this.owner_element_object = undefined ; this.owner_miniwin_object = undefined ; this.owner_miniwin_group_object = undefined ; this.type = undefined ; this.type_specific_details_object = undefined ; this.dhtmlwindow_1_03 = undefined ; this.dhtmlwindow_1_03__uniqueID = undefined ; if ( miniwin_details_object ) { if ( parse_miniwin_details_object( this ) ) { return value_to_return_on_error ;}
}
if ( !this.owner_miniwin_group_object ) { alert( "Bad 'owner_miniwin_group_object' (not specified)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
if ( !this.type ) { alert( "Bad 'type' (not specified)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
if ( !this.type_specific_details_object ) { alert( "Bad 'type_specific_details_object' (not specified)!" + software_bug__detected_in ) ; return value_to_return_on_error ;}
if ( __display( this ) ) { return value_to_return_on_error ;}
if ( [ 'alert' , 'confirm' , 'prompt' ].raber_inArray( this.type ) ) { return ;}
this.unique_integer_id = this.owner_miniwin_group_object.miniwins_list.length ; this.owner_miniwin_group_object.miniwins_list.push( this ) ; function parse_miniwin_details_object( target_miniwin_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__Miniwin --> parse_miniwin_details_object" , "webos/wos1/javascript/miniwin/mw.js" ) ; for ( property_name in miniwin_details_object ) { if ( property_name === 'toJSONString' ) { continue ;}
if ( miniwin__property_setting_functions.hasOwnProperty( property_name ) ) { if( miniwin__property_setting_functions[property_name]( target_miniwin_object , property_name , miniwin_details_object[property_name] , wos1__software_bug__get_detected_in( "wos1__Miniwin --> parse_miniwin_details_object --> miniwin__property_setting_functions" , "/WebOS/wos1/javascript/miniwin/mw.js"
)
) ) { return true ;}
} else { alert( "Bad 'miniwin' ('" + property_name + "' isn't recognised or supported property)!" + software_bug__detected_in ) ; return true ;}
}
return false ;}
this.show = function () { alert( "'Show' isn't yet implemented!" )
}
this.hide = function () { alert( "'Hide' isn't yet implemented!" )
}
this.close = function () { myself.owner_miniwin_group_object.delete_miniwin( myself ) ;}
this.delete_just_myself = function() { switch ( myself.type ) { case 'dhtmlwindow_1_03' :
if ( myself.dhtmlwindow_1_03 ) { myself.dhtmlwindow_1_03.onclose = function() { return true ;}
myself.dhtmlwindow_1_03.hide() ;}
break ;}
wos1__transform_all_elements_of_list__aborting_on_demand( myself.owner_miniwin_group_object.miniwins_list , myself , function( input_list , element_index , target_miniwin_object ) { if ( input_list[element_index]
&&
input_list[element_index] === target_miniwin_object ) { input_list[element_index] = undefined ; return true ;}
return false ;}
)
}
function __display( target_miniwin_object ) { switch ( target_miniwin_object.type ) { case 'alert' :
return display_alert( target_miniwin_object ) ; case 'confirm' :
return display_confirm( target_miniwin_object ) ; case 'prompt' :
return display_prompt( target_miniwin_object ) ; case 'window.open' :
return display_window_dot_open( target_miniwin_object ) ; case 'dhtmlwindow_1_03' :
return display_dynamic_drive_dhtmlwindow_1_03( target_miniwin_object ) ; case 'webos_model_1' :
return display_webos_model_1( target_miniwin_object ) ; default :
alert( "Bad Miniwin 'type' (not recognised/supported')!" + "\n\nThe unrecognised/unsupported 'type' is:  " + target_miniwin_object.type + software_bug__detected_in ) ; return true ;}
}
function display_alert( target_miniwin_object ) { if ( wos1__validate_object( target_miniwin_object.type_specific_details_object , { message : [ 'required' , 'string' , undefined
]
}
) ) { return true ;}
alert( target_miniwin_object.type_specific_details_object.message )
return false ;}
function display_confirm( target_miniwin_object ) { if ( wos1__validate_object( target_miniwin_object.type_specific_details_object , { message : [ 'required' , 'string' , undefined ] , result_processing_function : [ 'required' , 'function' , undefined
]
}
) ) { return true ;}
return target_miniwin_object.type_specific_details_object.result_processing_function( target_miniwin_object , confirm( target_miniwin_object.type_specific_details_object.message ) ) ;}
function display_prompt( target_miniwin_object ) { if ( wos1__validate_object( target_miniwin_object.type_specific_details_object , { message : [ 'required' , 'string' , undefined ] , start_value : [ 'optional' , [ 'string' , 'number' , 'null' , 'undefined' ] , undefined ] , result_processing_function : [ 'required' , 'function' , undefined
]
}
) ) { return true ;}
if ( target_miniwin_object.type_specific_details_object.start_value ) { return target_miniwin_object.type_specific_details_object.result_processing_function( target_miniwin_object , prompt( target_miniwin_object.type_specific_details_object.message , target_miniwin_object.type_specific_details_object.start_value
) ) ;} else { return target_miniwin_object.type_specific_details_object.result_processing_function( target_miniwin_object , prompt( target_miniwin_object.type_specific_details_object.message ) ) ;}
}
function display_dynamic_drive_dhtmlwindow_1_03( target_miniwin_object ) { if ( wos1__validate_object( target_miniwin_object.type_specific_details_object , { unique_id : [ 'optional' , 'string' , undefined ] , content_type : [ 'required' , 'string' , function( property_name , property_value , software_bug__detected_in ) { if ( ![ "iframe" , "inline" , "ajax" , "div" ].raber_inArray( property_value
) ) { alert( "Bad dhtmlwindow 'contenttype' (must be 'iframe', 'inline', 'ajax', or 'div')!" + "\n\n(The value specified was;  '" + property_value + "'.)" + software_bug__detected_in ) ; return true ;}
return false ;} ] , content_source : [ 'required' , 'string' , undefined ] , title : [ 'optional' , 'string' , undefined ] , width : [ 'optional' , [ 'number' , 'string' ] , function( property_name , property_value , software_bug__detected_in ) { if ( !wos1__question_one_or_more_digits_only( property_value
) || property_value < 1 ) { alert( "Bad dhtmlwindow 'width' (must be an integer; 1, 2, 3...)!" + "\n\n(The value specified was;  '" + property_value + "'.)" + software_bug__detected_in ) ; return true ;}
return false ;} ] , height : [ 'optional' , [ 'number' , 'string' ] , function( property_name , property_value , software_bug__detected_in ) { if ( !wos1__question_one_or_more_digits_only( property_value
) || property_value < 1 ) { alert( "Bad dhtmlwindow 'height' (must be an integer; 1, 2, 3...)!" + "\n\n(The value specified was;  '" + property_value + "'.)" + software_bug__detected_in ) ; return true ;}
return false ;} ] , resize : [ 'optional' , 'boolean' , undefined ] , scrolling : [ 'optional' , 'boolean' , undefined ] , recalonload : [ 'optional' , 'any' , undefined
]
}
) ) { return true ;}
dhtmlwindow_1_03__count++ ; target_miniwin_object.uniqueID = target_miniwin_object.type_specific_details_object.unique_id ; if ( !target_miniwin_object.uniqueID ) { target_miniwin_object.uniqueID = "dhtmlwindow_1_03_" + dhtmlwindow_1_03__count ;}
var title = target_miniwin_object.type_specific_details_object.title ; if ( !title ) { title = "<untitled>" ;}
var width = target_miniwin_object.type_specific_details_object.width ; if ( !width ) { width = 320 ;}
var height = target_miniwin_object.type_specific_details_object.height ; if ( !height ) { height = 200 ;}
var top ; if ( target_miniwin_object.owner_miniwin_group_object.vertical_direction === 'down' ) { top = target_miniwin_object.owner_miniwin_group_object.baseY ;} else if ( target_miniwin_object.owner_miniwin_group_object.vertical_direction === 'up' ) { top = target_miniwin_object.owner_miniwin_group_object.baseY - height ;} else { top = 0 ;}
var left ; if ( target_miniwin_object.owner_miniwin_group_object.horizontal_direction === 'right' ) { left = target_miniwin_object.owner_miniwin_group_object.baseX + ( width / 2 );} else if ( target_miniwin_object.owner_miniwin_group_object.horizontal_direction === 'left' ) { left = target_miniwin_object.owner_miniwin_group_object.baseX - ( width / 2 ) ;} else { left = 0 ;}
var attributes = "width=" + width + "px," + "height=" + height + "px," + "top=" + top + "px," + "left=" + left + "px" ; if ( target_miniwin_object.type_specific_details_object.resize ) { attributes += ",resize=1" ;}
if ( target_miniwin_object.type_specific_details_object.scrolling ) { attributes += ",scrolling=1" ;}
var recalonload = target_miniwin_object.type_specific_details_object.recalonload ; target_miniwin_object.dhtmlwindow_1_03 = dhtmlwindow.open( target_miniwin_object.dhtmlwindow_1_03__uniqueID , target_miniwin_object.type_specific_details_object.content_type , target_miniwin_object.type_specific_details_object.content_source , title , attributes , recalonload ) ; target_miniwin_object.dhtmlwindow_1_03.onclose = function() { myself.close() ; return true ;}
return false ;}
}
function wos1__get_element_box__wrt_PAGE( element_object ) { var element_box = new Object() ; element_box.top = xPageY( element_object ) ; element_box.left = xPageX( element_object ) ; element_box.width = xWidth( element_object ) ; element_box.height = xHeight( element_object ) ; element_box.bottom = element_box.top + element_box.height - 1 ; element_box.right = element_box.left + element_box.width - 1 ; return element_box ;}
function wos1__get_element_box__wrt_VIEWPORT( element_object ) { var element_box = new Object() ; element_box.top = xPageY( element_object ) - xScrollTop( element_object , false ) ; element_box.left = xPageX( element_object ) - xScrollLeft( element_object , false ) ; element_box.width = xWidth( element_object ) ; element_box.height = xHeight( element_object ) ; element_box.bottom = element_box.top + element_box.height - 1 ; element_box.right = element_box.left + element_box.width - 1 ; return element_box ;}
function wos1__question_one_or_more_digits_only( value_to_test ) { return /^\d+$/.test( value_to_test ) ;}
function wos1__question_zero_or_more_digits_only( value_to_test ) { return /^\d*$/.test( value_to_test ) ;}
var wos1__miniwin_groups_list__for_background_web_page = [] ; function wos1__MiniwinGroup() { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__MiniwinGroup" , "webos/wos1/javascript/miniwin/mwg.js" ) ; var constructor_result_on_error = 'error' ; var constructor_result_on_already_open = 'already_open' ; var constructor_result_on_OK = '' ; this.constructor_result = constructor_result_on_OK ; var myself = this ; if ( arguments.length > 1 ) { alert( "Too many input arguments!" + "\n\nThis routine must have ZERO or ONE input arguments (not " + arguments.length + ")." + software_bug__detected_in ) ; this.constructor_result = constructor_result_on_error ; return ;}
var miniwin_group_details_object = undefined ; if ( arguments.length ) { miniwin_group_details_object = arguments[0] ; if ( crockford_typeof( miniwin_group_details_object ) !== 'object' ) { alert( "Bad 'miniwin_group_details_object' (not an object)!" + software_bug__detected_in ) ; this.constructor_result = constructor_result_on_error ; return ;}
}
var miniwin_group__property_setting_functions = { owner_element_object : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( crockford_typeof( property_value ) !== 'object' ) { alert( "Bad 'owner_element_object' (not an object)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_group_object.owner_element_object = property_value ; return false ;} , owner_location_object : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( crockford_typeof( property_value ) !== 'object' ) { alert( "Bad 'owner_location_object' (not an object)!" + software_bug__detected_in ) ; return true ;}
target_miniwin_group_object.owner_location_object = property_value ; return false ;} , owner_location_type : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( typeof( property_value ) !== 'string' ) { alert( "Bad 'owner_location_type' (not a string)!" + software_bug__detected_in ) ; return true ;}
if ( [ 'null' , 'webos_window' , 'webos_document' , 'miniwin' , 'miniwin_document' ].raber_inArray( property_value ) ) { target_miniwin_group_object.owner_location_type = property_value ; return false ;}
alert( "Unrecognised/unsupported 'owner_location_type'!" + "\n\nThe unrecognised/unsupported value is:  " + property_value + software_bug__detected_in ) ; return true ;} , baseX : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( wos1__questione_or_more_digits_only( property_value ) ) { target_miniwin_group_object.baseX = property_value ; return false ;}
alert( "Bad 'baseX' (not an integer; 0, 1, 2...)!" + software_bug__detected_in ) ; return true ;} , baseY : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( wos1__questione_or_more_digits_only( property_value ) ) { target_miniwin_group_object.baseY = property_value ; return false ;}
alert( "Bad 'baseY' (not an integer; 0, 1, 2...)!" + software_bug__detected_in ) ; return true ;} , gapX : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( wos1__questione_or_more_digits_only( property_value ) ) { target_miniwin_group_object.gapX = property_value ; return false ;}
alert( "Bad 'gapX' (not an integer; 0, 1, 2...)!" + software_bug__detected_in ) ; return true ;} , gapY : function( target_miniwin_group_object , property_name , property_value , software_bug__detected_in ) { if ( wos1__questione_or_more_digits_only( property_value ) ) { target_miniwin_group_object.gapY = property_value ; return false ;}
alert( "Bad 'gapY' (not an integer; 0, 1, 2...)!" + software_bug__detected_in ) ; return true ;}
}
this.owner_element_object = undefined ; this.owner_location_object = undefined ; this.owner_location_type = undefined ; this.baseX = undefined ; this.baseY = undefined ; if ( miniwin_group_details_object ) { if ( parse_miniwin_group_details_object( this ) ) { this.constructor_result = constructor_result_on_error ; return ;}
}
if ( !this.owner_element_object ) { alert( "Bad 'owner_element_object' (not specified)!" + software_bug__detected_in ) ; this.constructor_result = constructor_result_on_error ; return ;}
function question_group_owned_by_element_in_list( target_list , target_owner_element_object ) { var i , j ; for ( i=0 , j=target_list.length ; i<j ; i++ ) { if ( target_list[i]
&&
target_list[i].owner_element_object === target_owner_element_object ) { return true ;}
}
return false ;}
if ( this.owner_location_type === 'null' ) { if ( question_group_owned_by_element_in_list( wos1__miniwin_groups_list__for_background_web_page , this.owner_element_object
) ) { this.constructor_result = constructor_result_on_already_open ; return ;}
} else if ( this.owner_location_type === 'webos_window' ) { if ( question_group_owned_by_element_in_list( this.owner_location_object.miniwin_groups_list , this.owner_element_object
) ) { this.constructor_result = constructor_result_on_already_open ; return ;}
} else { alert( "Owner Location Type Not Yet Supported!" + "\n\nThe unsupported owner location type is;  " + this.owner_location_type + software_bug__detected_in ) ; this.constructor_result = constructor_result_on_error ; return ;}
var element_box = wos1__get_element_box__wrt_VIEWPORT( this.owner_element_object ) ; if ( element_box.top < ( wos1__get_viewport_height() / 2 ) ) { this.vertical_direction = "down" ;} else { this.vertical_direction = "up" ;}
if ( element_box.left < ( wos1__get_viewport_width() / 2 ) ) { this.horizontal_direction = "right" ;} else { this.horizontal_direction = "left" ;}
if ( !this.gapX ) { this.gapX = 0 ;}
if ( !this.gapY ) { this.gapY = 5 ;}
if ( !this.baseX ) { this.baseX = element_box.left + ( element_box.width / 2 ) ;}
if ( !this.baseY ) { if ( this.vertical_direction === "up" ) { this.baseY = element_box.top - this.gapY ;} else { this.baseY = element_box.bottom + this.gapY ;}
}
this.miniwins_list = [] ; switch ( this.owner_location_type ) { case 'null' :
wos1__miniwin_groups_list__for_background_web_page.push( this ) ; break ; case 'webos_window' :
this.owner_location_object.miniwin_groups_list.push( this ) ; break ; default :
alert( "Owner Location Type Not Yet Supported!" + "\n\nThe unsupported owner location type is;  " + this.owner_location_type + software_bug__detected_in ) ; this.constructor_result = constructor_result_on_error ; return ;}
function parse_miniwin_group_details_object( target_miniwin_group_object ) { var software_bug__detected_in = wos1__software_bug__get_detected_in( "wos1__MiniwinGroup --> parse_miniwin_group_details_object" , "webos/wos1/javascript/miniwin/mwg.js" ) ; for ( property_name in miniwin_group_details_object ) { if ( property_name === 'toJSONString' ) { continue ;}
if ( miniwin_group__property_setting_functions.hasOwnProperty( property_name ) ) { if( miniwin_group__property_setting_functions[property_name]( target_miniwin_group_object , property_name , miniwin_group_details_object[property_name] , wos1__software_bug__get_detected_in( "wos1__MiniwinGroup --> parse_miniwin_group_details_object --> miniwin_group__property_setting_functions" , "/WebOS/wos1/javascript/miniwin/mwg.js"
)
) ) { return true ;}
} else { alert( "Bad 'miniwin group details object' ('" + property_name + "' isn't recognised or supported property)!" + software_bug__detected_in ) ; return true ;}
}
return false ;}
function find_group_object_in_list( target_list , target_group_object ) { var i , j ; for ( i=0 , j=target_list.length ; i<j ; i++ ) { if ( target_list[i]
&&
target_list[i] === target_group_object ) { return i ;}
}
return -1 ;}
this.delete_myself = function() { wos1__apply_function_to_all_elements_of_list( myself.miniwins_list , function( miniwins_list_element ) { if ( miniwins_list_element ) { miniwins_list_element.delete_just_myself() ;}
}
)
if ( myself.owner_location_type === 'null' ) { var temp = find_group_object_in_list( wos1__miniwin_groups_list__for_background_web_page , myself ) ; if ( temp < 0 ) { alert( "Group already deleted!" + software_bug__detected_in ) ; return ;}
wos1__miniwin_groups_list__for_background_web_page[temp] = undefined ;} else if ( myself.owner_location_type === 'webos_window' ) { var temp = find_group_object_in_list( myself.owner_location_object.miniwin_groups_list , myself ) ; if ( temp < 0 ) { alert( "Group already deleted!" + software_bug__detected_in ) ; return ;}
myself.owner_location_object.miniwin_groups_list[temp] = undefined ;} else { alert( "Owner Location Type Not Yet Supported!" + "\n\nThe unsupported owner location type is;  " + myself.owner_location_type + software_bug__detected_in ) ; return ;}
}
function find_miniwin_in_groups_miniwins_list( target_list , target_miniwin_object ) { var i , j ; for ( i=0 , j=target_list.length ; i<j ; i++ ) { if ( target_list[i] === target_miniwin_object ) { return i ;}
}
return -1 ;}
this.delete_miniwin = function( target_miniwin_object ) { var temp = find_miniwin_in_groups_miniwins_list( myself.miniwins_list , target_miniwin_object ) ; if ( temp >= 0 ) { myself.miniwins_list[temp] = undefined ; delete target_miniwin_object ;}
if ( temp == 0 ) { myself.delete_myself() ;}
}
}
function webos__send_ajax_request__from_window( request_details_array , target_window_object ) { if ( !request_details_array.hasOwnProperty('window_object')
&&
!request_details_array.hasOwnProperty('group_name') ) { request_details_array["window_object"] = target_window_object ;}
if ( request_details_array.hasOwnProperty('window_object')
&&
!request_details_array.hasOwnProperty('group_name') ) { request_details_array["window_object"] = target_window_object ;}
webos__send_ajax_request( request_details_array ) ;}
function webos__send_ajax_request( request_details_array ) { var detected_in = wos1__get_detected_in( "webos__send_ajax_request" , "webos/wos1/javascript/ajax/ajax.js" ) ; var software_bug__detected_in = wos1__software_bug + detected_in ; if ( crockford_typeof( request_details_array ) != 'object' ) { alert( "Invalid 'request details array'!" + software_bug__detected_in ) ; return true ;}
var method = undefined ; if ( request_details_array.hasOwnProperty('method') ) { method = request_details_array.method ; if ( typeof( method ) != 'string' ) { alert( "Bad 'method' (not a string)!" + software_bug__detected_in ) ; return true ;}
method = wos1__trim( method ).toUpperCase() ; if ( method != 'GET' && method != 'POST' ) { alert( "Bad 'method' (must be \"GET\" or \"POST\")!" + software_bug__detected_in ) ; return true ;}
}
var url ; if ( request_details_array.hasOwnProperty('url') ) { url = request_details_array.url ; if ( typeof( url ) != 'string' ) { alert( "Bad 'url' (not a string)!" + software_bug__detected_in ) ; return true ;}
url = wos1__trim( url ) ; if ( url == '' ) { alert( "Bad 'url' (must be non-blank)!" + software_bug__detected_in ) ; return true ;}
} else { alert( "URL not specified!" + software_bug__detected_in ) ; return true ;}
var GET_parameters = undefined ; if ( request_details_array.hasOwnProperty('GET_parameters') ) { GET_parameters = request_details_array.GET_parameters ; if ( crockford_typeof( GET_parameters ) != 'object' ) { alert( "Bad 'GET_parameters' (not an object)!" + software_bug__detected_in ) ; return true ;}
}
var i , j ; var GET_parameters_collection = undefined ; if ( request_details_array.hasOwnProperty('GET_parameters_collection') ) { GET_parameters_collection = request_details_array.GET_parameters_collection ; if ( crockford_typeof( GET_parameters_collection ) != 'array' ) { alert( "Bad 'GET_parameters_collection' (not an array)!" + software_bug__detected_in ) ; return true ;}
for ( i=0 , j=GET_parameters_collection.length ; i<j ; i++ ) { if ( crockford_typeof( GET_parameters_collection[i] ) != 'object' ) { alert( "Bad 'GET_parameters_collection' member (not an object)!" + software_bug__detected_in ) ; return true ;}
}
}
var POST_parameters = undefined ; if ( request_details_array.hasOwnProperty('POST_parameters') ) { POST_parameters = request_details_array.POST_parameters ; if ( crockford_typeof( POST_parameters ) != 'object' ) { alert( "Bad 'POST_parameters' (not an object)!" + software_bug__detected_in ) ; return true ;}
}
var POST_parameters_collection = undefined ; if ( request_details_array.hasOwnProperty('POST_parameters_collection') ) { POST_parameters_collection = request_details_array.POST_parameters_collection ; if ( crockford_typeof( POST_parameters_collection ) != 'array' ) { alert( "Bad 'POST_parameters_collection' (not an array)!" + software_bug__detected_in ) ; return true ;}
for ( i=0 , j=POST_parameters_collection.length ; i<j ; i++ ) { if ( crockford_typeof( POST_parameters_collection[i] ) != 'object' ) { alert( "Bad 'POST_parameters_collection' member (not an object)!" + software_bug__detected_in ) ; return true ;}
}
}
if ( method ) { if ( ( POST_parameters || POST_parameters_collection )
&&
method != 'POST' ) { alert( "Bad 'method' (must be \"POST\" if 'POST_parameters' or 'POST_parameters_collection' is specified)!" + software_bug__detected_in ) ; return true ;}
} else { if ( POST_parameters || POST_parameters_collection ) { method = 'POST' ;} else { method = 'GET' ;}
}
if ( request_details_array.hasOwnProperty('window_object')
&&
request_details_array.hasOwnProperty('group_name') ) { alert( "Too many target windows\n\nOnly ONE of:-" + "\n\twindow_object" + "\n\tgroup_name" + "\may be specified." + software_bug__detected_in ) ; return true ;}
if ( request_details_array.hasOwnProperty('group_name') ) { alert( "'group_name' not yet supported!" + software_bug__detected_in ) ; return true ;}
var window_object ; if ( request_details_array.hasOwnProperty('window_object') ) { window_object = request_details_array.window_object ; if ( window_object !== null ) { if ( crockford_typeof( window_object ) !== 'object' ) { alert( "Bad 'window_object' (not an WebOS 1 Window object, or null)!" + software_bug__detected_in ) ; return true ;}
if ( !(window_object instanceof wos1_WebOS_Window) ) { alert( "Bad 'window_object' (not a WebOS 1 Window)!" + software_bug__detected_in ) ; return true ;}
}
} else { window_object = null ;}
var question_bust_caching = true ; if ( request_details_array.hasOwnProperty('nobustcache') ) { question_bust_caching = false ;}
var question_response_required = true ; if ( request_details_array.hasOwnProperty('noresponse') ) { question_response_required = false ;}
var page_request_object ; if ( window.XMLHttpRequest ) { page_request_object = new XMLHttpRequest() ;} else if ( window.ActiveXObject ) { try { page_request_object = new ActiveXObject( "Msxml2.XMLHTTP" ) ;}
catch (e){ try{ page_request_object = new ActiveXObject( "Microsoft.XMLHTTP" ) ;}
catch (e){}
}
} else { alert( "Can't send Ajax request!\n\n(Because this browser doesn't support Ajax.)" + detected_in ) ; return true ;}
if ( !is_ie ) { page_request_object.target_url = url ;}
if ( question_response_required ) { page_request_object.onreadystatechange = function() { wos1__ajax_response_handler( page_request_object , window_object
)
} ;}
var query_string = '' ; var window_parameters = undefined ; if ( method == 'GET' ) { if ( question_bust_caching ) { query_string = new Date().getTime() + '' ;}
if ( window_object ) { window_parameters = { wosver : 1 , winuii : window_object.unique_integer_id
} ;}
if ( GET_parameters_collection ) { GET_parameters_collection = GET_parameters_collection.concat( [ window_parameters , GET_parameters ] ) ;} else { GET_parameters_collection = [ window_parameters , GET_parameters ] ;}
var GET_parameters_object = wos1__combine_objects( GET_parameters_collection , wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
)
if ( !GET_parameters_object ) { return true ;}
var GET_parameters_string = wos1__object_to_query_string_fragment( GET_parameters_object ) ; query_string = wos1__create_query_string__from_query_string_fragments( [ query_string , GET_parameters_string ] ) ; page_request_object.open( 'GET' , url + query_string , true ) ; page_request_object.send( null ) ;} else { alert( 'POSTING...' ) ; if ( question_bust_caching ) { query_string = new Date().getTime() + '' ;}
if ( window_object ) { window_parameters = { wosver : 1 , winuii : window_object.unique_integer_id
} ;}
if ( GET_parameters_collection ) { GET_parameters_collection = GET_parameters_collection.concat( [ window_parameters , GET_parameters ] ) ;} else { GET_parameters_collection = [ window_parameters , GET_parameters ] ;}
var GET_parameters_object = wos1__combine_objects( GET_parameters_collection , wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
)
if ( !GET_parameters_object ) { return true ;}
var GET_parameters_string = wos1__object_to_query_string_fragment( GET_parameters_object ) ; query_string = wos1__create_query_string__from_query_string_fragments( [ query_string , GET_parameters_string ] ) ; if ( POST_parameters_collection ) { POST_parameters_collection = POST_parameters_collection.concat( [ POST_parameters ] ) ;} else { POST_parameters_collection = [ POST_parameters ] ;}
var POST_parameters_object = wos1__combine_objects( POST_parameters_collection , wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
)
if ( !POST_parameters_object ) { return true ;}
var POST_parameters_string = wos1__object_to_query_string_fragment( POST_parameters_object ) ; page_request_object.open( "POST" , url + query_string , true ) ; alert( POST_parameters_string ) ; alert( POST_parameters_string.length ) ; POST_parameters_string = escape( POST_parameters_string ) ; alert( POST_parameters_string ) ; alert( POST_parameters_string.length ) ; page_request_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); page_request_object.send( POST_parameters_string ) ;}
return false ;}
function wos1__ajax_response_handler( page_request_object , target_window_object ) { var readyState = page_request_object.readyState ; if ( readyState != 4 ) { return ;}
var status = page_request_object.status ; var statusText = page_request_object.statusText ; if ( status == 200 ) { wos1__process_webos_message( page_request_object.responseText.parseJSON() , target_window_object , target_window_object === false ) ;} else { var extras = '' ; if ( status == 404 ) { if ( is_ie ) { extras = '' ;} else { extras = "\n\n\tThe missing page is: " + page_request_object.target_url ;}
}
alert( "HTTP ERROR " + status + "\n\n\t" + statusText + extras + wos1__get_detected_in( "wos1__ajax_response_handler" , "webos/wos1/javascript/ajax/ajax.js"
) ) ;}
}
function wos1__send_ajax_request__from_window( request_details_array , target_window_object ) { if ( !request_details_array.hasOwnProperty('window_object')
&&
!request_details_array.hasOwnProperty('group_name') ) { request_details_array["window_object"] = target_window_object ;}
if ( request_details_array.hasOwnProperty('window_object')
&&
!request_details_array.hasOwnProperty('group_name') ) { request_details_array["window_object"] = target_window_object ;}
wos1__send_ajax_request( request_details_array ) ;}
function wos1__send_ajax_request( request_details_array ) { var detected_in = wos1__get_detected_in( "wos1__send_ajax_request" , "webos/wos1/javascript/ajax/ajax.js" ) ; var software_bug__detected_in = wos1__software_bug + detected_in ; if ( crockford_typeof( request_details_array ) != 'object' ) { alert( "Invalid 'request details array'!" + software_bug__detected_in ) ; return true ;}
var method = 'GET' ; if ( request_details_array.hasOwnProperty('method') ) { method = request_details_array.method ; if ( typeof( method ) != 'string' ) { alert( "Bad 'method' (not a string)!" + software_bug__detected_in ) ; return true ;}
method = wos1__trim( method ).toUpperCase() ; if ( method != 'GET' && method != 'POST' ) { alert( "Bad 'method' (must be \"GET\" or \"POST\")!" + software_bug__detected_in ) ; return true ;}
}
var url ; if ( request_details_array.hasOwnProperty('url') ) { url = request_details_array.url ; if ( typeof( url ) != 'string' ) { alert( "Bad 'url' (not a string)!" + software_bug__detected_in ) ; return true ;}
url = wos1__trim( url ) ; if ( url == '' ) { alert( "Bad 'url' (must be non-blank)!" + software_bug__detected_in ) ; return true ;}
} else { alert( "URL not specified!" + software_bug__detected_in ) ; return true ;}
var parameters1 ; if ( request_details_array.hasOwnProperty('parameters1') ) { parameters1 = request_details_array.parameters1 ; if ( crockford_typeof( parameters1 ) != 'object' ) { alert( "Bad 'parameters1' (not an object)!" + software_bug__detected_in ) ; return true ;}
}
var parameters2 ; if ( request_details_array.hasOwnProperty('parameters2') ) { parameters2 = request_details_array.parameters2 ; if ( crockford_typeof( parameters2 ) != 'object' ) { alert( "Bad 'parameters2' (not an object)!" + software_bug__detected_in ) ; return true ;}
}
if ( request_details_array.hasOwnProperty('window_object')
&&
request_details_array.hasOwnProperty('group_name') ) { alert( "Too many target windows\n\nOnly ONE of:-" + "\n\twindow_object" + "\n\tgroup_name" + "\may be specified." + software_bug__detected_in ) ; return true ;}
if ( request_details_array.hasOwnProperty('group_name') ) { alert( "'group_name' not yet supported!" + software_bug__detected_in ) ; return true ;}
var window_object ; if ( request_details_array.hasOwnProperty('window_object') ) { window_object = request_details_array.window_object ; if ( window_object !== null ) { if ( crockford_typeof( window_object ) !== 'object' ) { alert( "Bad 'window_object' (not an WebOS 1 Window object, or null)!" + software_bug__detected_in ) ; return true ;}
if ( !(window_object instanceof wos1_WebOS_Window) ) { alert( "Bad 'window_object' (not a WebOS 1 Window)!" + software_bug__detected_in ) ; return true ;}
}
} else { window_object = null ;}
var question_bust_caching = true ; if ( request_details_array.hasOwnProperty('nobustcache') ) { question_bust_caching = false ;}
var question_response_required = true ; if ( request_details_array.hasOwnProperty('noresponse') ) { question_response_required = false ;}
var page_request_object ; if ( window.XMLHttpRequest ) { page_request_object = new XMLHttpRequest() ;} else if ( window.ActiveXObject ) { try { page_request_object = new ActiveXObject( "Msxml2.XMLHTTP" ) ;}
catch (e){ try{ page_request_object = new ActiveXObject( "Microsoft.XMLHTTP" ) ;}
catch (e){}
}
} else { alert( "Can't send Ajax request!\n\n(Because this browser doesn't support Ajax.)" + detected_in ) ; return true ;}
if ( !is_ie ) { page_request_object.target_url = url ;}
if ( question_response_required ) { page_request_object.onreadystatechange = function() { wos1__ajax_response_handler( page_request_object , window_object
)
} ;}
var query_string ; var window_parameters ; if ( method == 'GET' ) { if ( question_bust_caching ) { query_string = new Date().getTime() + "" ;}
if ( window_object ) { window_parameters = { wosver : 1 , winuii : window_object.unique_integer_id
} ;}
var parameters_object = wos1__combine_objects( [ window_parameters , parameters1 , parameters2 ] , wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
)
if ( !parameters_object ) { return true ;}
var parameters_string = wos1__object_to_query_string_fragment( parameters_object ) ; query_string = wos1__create_query_string__from_query_string_fragments( [ query_string , parameters_string ] ) ; page_request_object.open( 'GET' , url + query_string , true ) ; page_request_object.send( null ) ;} else if ( method == 'POST' ) { if ( question_bust_caching ) { query_string = "?" + new Date().getTime() ;} else { query_string = "" ;}
if ( window_object ) { window_parameters = { wosver : 1 , winuii : window_object.unique_integer_id
} ;}
var parameters_object = wos1__combine_objects( [ window_parameters , parameters1 , parameters2 ] , wos1__combine_objects__name_clash_message__FATAL_ERROR__BUT_ONLY_IF_VALUE_DIFFERENT
)
if ( !parameters_object ) { return true ;}
var parameters_string = wos1__object_to_query_string_fragment( parameters_object ) ; page_request_object.open( 'POST' , url + query_string , true ) ; page_request_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); page_request_object.setRequestHeader("Content-length", parameters_string.length); page_request_object.setRequestHeader("Connection", "close"); page_request_object.send( parameters_string ) ;}
return false ;}
var dhtmlwindow={ imagefiles:imagefiles_list, ajaxbustcache: true, minimizeorder: 0, tobjects: [], init:function(t){ var domwindow=document.createElement("div")
domwindow.id=t
domwindow.className="dhtmlwindow"
var domwindowdata=''
domwindowdata='<div class="drag-handle">'
domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>'
domwindowdata+='</div>'
domwindowdata+='<div class="drag-contentarea"></div>'
domwindowdata+='<div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;">&nbsp;</div></div>'
domwindowdata+='</div>'
domwindow.innerHTML=domwindowdata
document.getElementById("dhtmlwindowholder").appendChild(domwindow)
this.zIndexvalue=(this.zIndexvalue)? this.zIndexvalue+1 : 100
var t=document.getElementById(t)
var divs=t.getElementsByTagName("div")
for (var i=0; i<divs.length; i++){ if (/drag-/.test(divs[i].className))
t[divs[i].className.replace(/drag-/, "")]=divs[i]
}
t.style.zIndex=this.zIndexvalue
t.handle._parent=t
t.resizearea._parent=t
t.controls._parent=t
t.onclose=function(){return true}
t.onmousedown=function(){dhtmlwindow.zIndexvalue++; this.style.zIndex=dhtmlwindow.zIndexvalue}
t.handle.onmousedown=dhtmlwindow.setupdrag
t.resizearea.onmousedown=dhtmlwindow.setupdrag
t.controls.onclick=dhtmlwindow.enablecontrols
t.show=function(){dhtmlwindow.show(this)}
t.hide=function(){dhtmlwindow.close(this)}
t.setSize=function(w, h){dhtmlwindow.setSize(this, w, h)}
t.moveTo=function(x, y){dhtmlwindow.moveTo(this, x, y)}
t.isResize=function(bol){dhtmlwindow.isResize(this, bol)}
t.isScrolling=function(bol){dhtmlwindow.isScrolling(this, bol)}
t.load=function(contenttype, contentsource, title){dhtmlwindow.load(this, contenttype, contentsource, title)}
this.tobjects[this.tobjects.length]=t
return t
}, open:function(t, contenttype, contentsource, title, attr, recalonload){ var d=dhtmlwindow
function getValue(Name){ var config=new RegExp(Name+"=([^,]+)", "i")
return (config.test(attr))? parseInt(RegExp.$1) : 0
}
if (document.getElementById(t)==null)
t=this.init(t)
else
t=document.getElementById(t)
t.setSize(getValue(("width")), (getValue("height")))
var xpos=getValue("center")? "middle" : getValue("left")
var ypos=getValue("center")? "middle" : getValue("top")
if (typeof recalonload!="undefined" && recalonload=="recal" && this.scroll_top==0){ if (window.attachEvent && !window.opera)
this.addEvent(window, function(){setTimeout(function(){t.moveTo(xpos, ypos)}, 400)}, "load")
else
this.addEvent(window, function(){t.moveTo(xpos, ypos)}, "load")
}
t.isResize(getValue("resize"))
t.isScrolling(getValue("scrolling"))
t.style.visibility="visible"
t.style.display="block"
t.contentarea.style.display="block"
t.moveTo(xpos, ypos)
t.load(contenttype, contentsource, title)
if (t.state=="minimized" && t.controls.firstChild.title=="Restore"){ t.controls.firstChild.setAttribute("src", dhtmlwindow.imagefiles[0])
t.controls.firstChild.setAttribute("title", "Minimize")
t.state="fullview"
}
return t
}, setSize:function(t, w, h){ t.style.width=Math.max(parseInt(w), 150)+"px"
t.contentarea.style.height=Math.max(parseInt(h), 100)+"px"
}, moveTo:function(t, x, y){ this.getviewpoint()
t.style.left=(x=="middle")? this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px" : this.scroll_left+parseInt(x)+"px"
t.style.top=(y=="middle")? this.scroll_top+(this.docheight-t.offsetHeight)/2+"px" : this.scroll_top+parseInt(y)+"px"
}, isResize:function(t, bol){ t.statusarea.style.display=(bol)? "block" : "none"
t.resizeBool=(bol)? 1 : 0
}, isScrolling:function(t, bol){ t.contentarea.style.overflow=(bol)? "auto" : "hidden"
}, load:function(t, contenttype, contentsource, title){ var contenttype=contenttype.toLowerCase()
if (typeof title!="undefined")
t.handle.firstChild.nodeValue=title
if (contenttype=="inline")
t.contentarea.innerHTML=contentsource
else if (contenttype=="div"){ t.contentarea.innerHTML=document.getElementById(contentsource).innerHTML
document.getElementById(contentsource).style.display="none"
}
else if (contenttype=="iframe"){ t.contentarea.style.overflow="hidden"
if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME")
t.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+t.id+'"></iframe>'
window.frames["_iframe-"+t.id].location.replace(contentsource)
}
else if (contenttype=="ajax"){ this.ajax_connect(contentsource, t)
}
t.contentarea.datatype=contenttype
}, setupdrag:function(e){ var d=dhtmlwindow
var t=this._parent
d.etarget=this
var e=window.event || e
d.initmousex=e.clientX
d.initmousey=e.clientY
d.initx=parseInt(t.offsetLeft)
d.inity=parseInt(t.offsetTop)
d.width=parseInt(t.offsetWidth)
d.contentheight=parseInt(t.contentarea.offsetHeight)
if (t.contentarea.datatype=="iframe"){ t.style.backgroundColor="#F8F8F8"
t.contentarea.style.visibility="hidden"
}
document.onmousemove=d.getdistance
document.onmouseup=function(){ if (t.contentarea.datatype=="iframe"){ t.contentarea.style.backgroundColor="white"
t.contentarea.style.visibility="visible"
}
d.stop()
}
return false
}, getdistance:function(e){ var d=dhtmlwindow
var etarget=d.etarget
var e=window.event || e
d.distancex=e.clientX-d.initmousex
d.distancey=e.clientY-d.initmousey
if (etarget.className=="drag-handle")
d.move(etarget._parent, e)
else if (etarget.className=="drag-resizearea")
d.resize(etarget._parent, e)
return false
}, getviewpoint:function(){ var ie=document.all && !window.opera
var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
}, rememberattrs:function(t){ this.getviewpoint()
t.lastx=parseInt((t.style.left || t.offsetLeft))-dhtmlwindow.scroll_left
t.lasty=parseInt((t.style.top || t.offsetTop))-dhtmlwindow.scroll_top
t.lastwidth=parseInt(t.style.width)
}, move:function(t, e){ t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px"
t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"
}, resize:function(t, e){ t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex, 150)+"px"
t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey, 100)+"px"
}, enablecontrols:function(e){ var d=dhtmlwindow
var sourceobj=window.event? window.event.srcElement : e.target
if (/Minimize/i.test(sourceobj.getAttribute("title")))
d.minimize(sourceobj, this._parent)
else if (/Restore/i.test(sourceobj.getAttribute("title")))
d.restore(sourceobj, this._parent)
else if (/Close/i.test(sourceobj.getAttribute("title")))
d.close(this._parent)
return false
}, minimize:function(button, t){ dhtmlwindow.rememberattrs(t)
button.setAttribute("src", dhtmlwindow.imagefiles[2])
button.setAttribute("title", "Restore")
t.state="minimized"
t.contentarea.style.display="none"
t.statusarea.style.display="none"
if (typeof t.minimizeorder=="undefined"){ dhtmlwindow.minimizeorder++ ; t.minimizeorder=dhtmlwindow.minimizeorder
}
t.style.left="10px"
t.style.width="200px"
var windowspacing=t.minimizeorder*10
t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
}, restore:function(button, t){ dhtmlwindow.getviewpoint()
button.setAttribute("src", dhtmlwindow.imagefiles[0])
button.setAttribute("title", "Minimize")
t.state="fullview"
t.style.display="block"
t.contentarea.style.display="block"
if (t.resizeBool)
t.statusarea.style.display="block"
t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px"
t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
t.style.width=parseInt(t.lastwidth)+"px"
}, close:function(t){ try{ var closewinbol=t.onclose()
}
catch(err){ var closewinbol=true
}
finally{ if (typeof closewinbol=="undefined"){ alert("An error has occured somwhere inside your \"onclose\" event handler")
var closewinbol=true
}
}
if (closewinbol){ if (t.state!="minimized")
dhtmlwindow.rememberattrs(t)
t.style.display="none"
}
return closewinbol
}, show:function(t){ if (t.lastx)
dhtmlwindow.restore(t.controls.firstChild, t)
else
t.style.display="block"
t.state="fullview"
}, ajax_connect:function(url, t){ var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest)
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ try { page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(page_request, t)}
if (this.ajaxbustcache)
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}, ajax_loadpage:function(page_request, t){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){ t.contentarea.innerHTML=page_request.responseText
}
}, stop:function(){ dhtmlwindow.etarget=null
document.onmousemove=null
document.onmouseup=null
}, addEvent:function(target, functionref, tasktype){ var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}, cleanup:function(){ for (var i=0; i<dhtmlwindow.tobjects.length; i++){ dhtmlwindow.tobjects[i].handle._parent=dhtmlwindow.tobjects[i].resizearea._parent=dhtmlwindow.tobjects[i].controls._parent=null
}
window.onload=null
}
}
document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>')
window.onunload=dhtmlwindow.cleanup
if (!Object.prototype.toJSONString) { Array.prototype.toJSONString = function () { var a = ['['], b, i, l = this.length, v; function p(s) { if (b) { a.push(',');}
a.push(s); b = true;}
for (i = 0; i < l; i += 1) { v = this[i]; switch (typeof v) { case 'object':
if (v) { if (typeof v.toJSONString === 'function') { p(v.toJSONString());}
} else { p("null");}
break; case 'string':
case 'number':
case 'boolean':
p(v.toJSONString());}
}
a.push(']'); return a.join('');}; Boolean.prototype.toJSONString = function () { return String(this);}; Date.prototype.toJSONString = function () { function f(n) { return n < 10 ? '0' + n : n;}
return '"' + this.getFullYear() + '-' + f(this.getMonth() + 1) + '-' + f(this.getDate()) + 'T' + f(this.getHours()) + ':' + f(this.getMinutes()) + ':' + f(this.getSeconds()) + '"';}; Number.prototype.toJSONString = function () { return isFinite(this) ? String(this) : "null";}; Object.prototype.toJSONString = function () { var a = ['{'], b, k, v; function p(s) { if (b) { a.push(',');}
a.push(k.toJSONString(), ':', s); b = true;}
for (k in this) { if (this.hasOwnProperty(k)) { v = this[k]; switch (typeof v) { case 'object':
if (v) { if (typeof v.toJSONString === 'function') { p(v.toJSONString());}
} else { p("null");}
break; case 'string':
case 'number':
case 'boolean':
p(v.toJSONString());}
}
}
a.push('}'); return a.join('');}; (function (s) { var m = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'
}; s.parseJSON = function (filter) { try { if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
                        test(this)) {

// In the second stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                    var j = eval('(' + this + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.

                    if (typeof filter === 'function') {

                        function walk(k, v) {
                            if (v && typeof v === 'object') {
                                for (var i in v) {
                                    if (v.hasOwnProperty(i)) {
                                        v[i] = walk(i, v[i]);
                                    }
                                }
                            }
                            return filter(k, v);
                        }

                        j = walk('', j);
                    }
                    return j;
                }
            } catch (e) {

// Fall through if the regexp test fails.

            }
            throw new SyntaxError("parseJSON");
        };


        s.toJSONString = function () {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can simply slap some quotes around it.
// Otherwise we must also replace the offending characters with safe
// sequences.

            if (/["\\\x00-\x1f]/.test(this)) { return '"' + this.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                    var c = m[b];
                    if (c) {
                        return c;
                    }
                    c = b.charCodeAt();
                    return '\\u00' +
                        Math.floor(c / 16).toString(16) +
                        (c % 16).toString(16);
                }) + '"';
            }
            return '"' + this + '"';
        };
    })(String.prototype);
}

/*  --------------------------------------------------------------------------
    crockford_typeof_1
    ------------------
    Javascript's typeof produces:- Standard Javascript typeof crockford_typeof_1 -------------------------- ------------------ Object 'object' 'object'
Array 'object' -----------------> 'array'
Function 'function' 'function'
String 'string' 'string'
Number 'number' 'number'
Boolean 'boolean' 'boolean'
null 'object' -----------------> 'null'
undefined 'undefined' 'undefined'
There are two main problems:- o typeof [] produces 'object' instead of 'array'. That isn't totally
        wrong since arrays in JavaScript inherit from objects, but it isn't
very useful.
o typeof null produces 'object' instead of 'null'. That is totally wrong. --------------------------------------------------------------------------- */
function crockford_typeof_1(value) { var s = typeof value; if (s === 'object') { if (value) { if (value instanceof Array) { s = 'array';}
} else { s = 'null';}
}
return s;}
function crockford_typeof(value) { var s = typeof value; if (s === 'object') { if (value) { if (typeof value.length === 'number' &&
!(value.propertyIsEnumerable('length')) &&
typeof value.splice === 'function') { s = 'array';}
} else { s = 'null';}
}
return s;}
function crockford_typeof_2(value) { return crockford_typeof(value) ;}
function crockford_isEmpty(o) { var i, v; if (crockford_typeof(o) === 'object') { for (i in o) { v = o[i]; if (v !== undefined && crockford_typeof(v) !== 'function') { return false;}
}
}
return true;}
String.prototype.crockford_entityify = function () { return this.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");}; String.prototype.crockford_quote = function () { var c, i, l = this.length, o = '"'; for (i = 0; i < l; i += 1) { c = this.charAt(i); if (c >= ' ') { if (c === '\\' || c === '"') { o += '\\';}
o += c;} else { switch (c) { case '\b':
o += '\\b'; break; case '\f':
o += '\\f'; break; case '\n':
o += '\\n'; break; case '\r':
o += '\\r'; break; case '\t':
o += '\\t'; break; default:
c = c.charCodeAt(); o += '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);}
}
}
return o + '"';}; String.prototype.crockford_supplant = function (o) { var i, j, s = this, v; for (;;) { i = s.lastIndexOf('{'); if (i < 0) { break;}
j = s.indexOf('}', i); if (i + 1 >= j) { break;}
v = o[s.substring(i + 1, j)]; if (typeOf(v) !== 'string' && typeOf(v) !== 'number') { break;}
s = s.substring(0, i) + v + s.substring(j + 1);}
return s;}; String.prototype.crockford_trim = function () { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");}; Array.prototype.raber_arrayUnique = function()
{ var uniqueArr = new Array(); for (var origKey in this)
{ valueExists = false; for(var uniqueKey in uniqueArr)
{ if(uniqueArr[uniqueKey] == this[origKey])
{ valueExists = true;}
}
if(!valueExists)
{ uniqueArr[origKey] = this[origKey];}
}
return uniqueArr;}
Array.prototype.raber_inArray = function(needle)
{ for(var key in this)
{ if(this[key] === needle)
{ return true;}
}
return false;}
var config = new Object(); var Debug = true
var TagsToTip = true
config. Above = false
config. BgColor = '#E0E4FF'
config. BgImg = ''
config. BorderColor = '#002299'
config. BorderStyle = 'solid'
config. BorderWidth = 1
config. CenterMouse = false
config. ClickClose = false
config. CloseBtn = false
config. CloseBtnColors = ['#990000', '#FFFFFF', '#DD3333', '#FFFFFF']
config. CloseBtnText = 'Close'
config. Delay = 400
config. Duration = 0
config. FadeIn = 0
config. FadeOut = 0
config. FadeInterval = 30
config. Fix = null
config. FollowMouse = true
config. FontColor = '#000044'
config. FontFace = 'Verdana,Geneva,sans-serif'
config. FontSize = '8pt'
config. FontWeight = 'normal'
config. Left = false
config. OffsetX = 14
config. OffsetY = 8
config. Opacity = 100
config. Padding = 3
config. Shadow = false
config. ShadowColor = '#C0C0C0'
config. ShadowWidth = 5
config. Sticky = false
config. TextAlign = 'left'
config. Title = ''
config. TitleAlign = 'left'
config. TitleBgColor = ''
config. TitleFontColor = '#ffffff'
config. TitleFontFace = ''
config. TitleFontSize = ''
config. Width = 0
function Tip()
{ tt_Tip(arguments, null);}
function TagToTip()
{ if(TagsToTip)
{ var a = arguments, el = tt_GetElt(a[0]); if(el)
{ a[0] = el.innerHTML; tt_Tip(a, el);}
}
}
var tt_aElt = new Array(10), tt_aV = new Array(), tt_sContent, tt_elToTip, tt_x, tt_y, tt_w, tt_h; function tt_Extension()
{ tt_ExtCmdEnum(); tt_aExt[tt_aExt.length] = this; return this;}
function tt_SetTipPos(x, y)
{ var css = tt_aElt[0].style; tt_x = x; tt_y = y; css.left = x + "px"; css.top = y + "px"; if(tt_ie56)
{ var ifrm = tt_aElt[tt_aElt.length - 1]; if(ifrm)
{ ifrm.style.left = css.left; ifrm.style.top = css.top;}
}
}
function tt_HideTip()
{ if(tt_db)
{ if(tt_iState & 2)
{ tt_aElt[0].style.visibility = "hidden"; tt_ExtCallFncs(0, "Hide");}
tt_tShow.EndTimer(); tt_tHide.EndTimer(); tt_tDurt.EndTimer(); tt_tFade.EndTimer(); if(!tt_op && !tt_ie)
{ tt_tWaitMov.EndTimer(); tt_bWait = false;}
if(tt_aV[CLICKCLOSE])
tt_RemEvtFnc(document, "mouseup", tt_HideInit); tt_AddRemEvtFncEx(1, false); tt_AddRemEvtFncEx(0, false); tt_ExtCallFncs(0, "Kill"); tt_iState = 0; tt_Move.over = null; tt_ResetMainDiv(); if(tt_aElt[tt_aElt.length - 1])
tt_aElt[tt_aElt.length - 1].style.display = "none";}
}
function tt_GetElt(id)
{ return(document.getElementById ? document.getElementById(id)
: document.all ? document.all[id]
: null);}
function tt_GetDivW(el)
{ if(el)
return(el.offsetWidth || el.style.pixelWidth || 0); return 0;}
function tt_GetDivH(el)
{ if(el)
return(el.offsetHeight || el.style.pixelHeight || 0); return 0;}
function tt_GetScrollX()
{ return((typeof(window.pageXOffset) != tt_u) ? window.pageXOffset
: tt_db ? (tt_db.scrollLeft || 0)
: 0);}
function tt_GetScrollY()
{ return((typeof(window.pageYOffset) != tt_u) ? window.pageYOffset
: tt_db ? (tt_db.scrollTop || 0)
: 0);}
function tt_GetClientW()
{ return(document.body && (typeof(document.body.clientWidth) != tt_u) ? document.body.clientWidth
: (typeof(window.innerWidth) != tt_u) ? window.innerWidth
: tt_db ? (tt_db.clientWidth || 0)
: 0);}
function tt_GetClientH()
{ return(document.body && (typeof(document.body.clientHeight) != tt_u) ? document.body.clientHeight
: (typeof(window.innerHeight) != tt_u) ? window.innerHeight
: tt_db ? (tt_db.clientHeight || 0)
: 0);}
function tt_AddEvtFnc(el, sEvt, PFnc)
{ if(el)
{ if(el.addEventListener)
el.addEventListener(sEvt, PFnc, false); else
el.attachEvent("on" + sEvt, PFnc);}
}
function tt_RemEvtFnc(el, sEvt, PFnc)
{ if(el)
{ if(el.removeEventListener)
el.removeEventListener(sEvt, PFnc, false); else
el.detachEvent("on" + sEvt, PFnc);}
}
var tt_aExt = new Array(), tt_db, tt_op, tt_op78, tt_ie, tt_ie56, tt_bBoxOld, tt_body, tt_flagOpa, tt_scrlX, tt_scrlY, tt_maxPosX, tt_maxPosY, tt_iState = 0, tt_opa, tt_bJmpVert, tt_elDeHref, tt_tShow = new Number(0), tt_tHide = new Number(0), tt_tDurt = new Number(0), tt_tFade = new Number(0), tt_tWaitMov = new Number(0), tt_bMovFnc, tt_bOutFnc, tt_bWait = false, tt_u = "undefined"; function tt_Init()
{ tt_MkCmdEnum(); if(!tt_Browser() || !tt_MkMainDiv())
return; tt_IsW3cBox(); tt_OpaSupport(); if(TagsToTip || Debug)
tt_SetOnloadFnc(); tt_AddEvtFnc(window, "scroll", tt_HideOnScrl); tt_AddEvtFnc(window, "unload", tt_HideTip); tt_HideTip();}
function tt_MkCmdEnum()
{ var n = 0; for(var i in config)
eval("window." + i.toString().toUpperCase() + " = " + n++); tt_aV.length = n;}
function tt_Browser()
{ var n, nv, n6, w3c; n = navigator.userAgent.toLowerCase(), nv = navigator.appVersion; tt_op = (document.defaultView && typeof(eval("w" + "indow" + "." + "o" + "p" + "er" + "a")) != tt_u); tt_op78 = (tt_op && !window.getSelection); tt_ie = n.indexOf("msie") != -1 && document.all && !tt_op; if(tt_ie)
{ var ieOld = (!document.compatMode || document.compatMode == "BackCompat"); tt_db = !ieOld ? document.documentElement : (document.body || null); if(tt_db)
tt_ie56 = parseFloat(nv.substring(nv.indexOf("MSIE") + 5)) >= 5.5
&& typeof document.body.style.maxHeight == tt_u;}
else
{ tt_db = document.documentElement || document.body || (document.getElementsByTagName ? document.getElementsByTagName("body")[0]
: null); if(!tt_op)
{ n6 = document.defaultView && typeof document.defaultView.getComputedStyle != tt_u; w3c = !n6 && document.getElementById;}
}
tt_body = (document.getElementsByTagName ? document.getElementsByTagName("body")[0]
: (document.body || null)); if(tt_ie || n6 || tt_op || w3c)
{ if(tt_body && tt_db)
{ if(document.attachEvent || document.addEventListener)
return true;}
else
tt_Err("wz_tooltip.js must be included INSIDE the body section," + " immediately after the opening <body> tag.");}
tt_db = null; return false;}
function tt_MkMainDiv()
{ if(tt_body.insertAdjacentHTML)
tt_body.insertAdjacentHTML("afterBegin", tt_MkMainDivHtm()); else if(typeof tt_body.innerHTML != tt_u && document.createElement && tt_body.appendChild)
tt_body.appendChild(tt_MkMainDivDom()); if(window.tt_GetMainDivRefs && tt_GetMainDivRefs())
return true; tt_db = null; return false;}
function tt_MkMainDivHtm()
{ return('<div id="WzTtDiV"></div>' + (tt_ie56 ? ('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>')
: ''));}
function tt_MkMainDivDom()
{ var el = document.createElement("div"); if(el)
el.id = "WzTtDiV"; return el;}
function tt_GetMainDivRefs()
{ tt_aElt[0] = tt_GetElt("WzTtDiV"); if(tt_ie56 && tt_aElt[0])
{ tt_aElt[tt_aElt.length - 1] = tt_GetElt("WzTtIfRm"); if(!tt_aElt[tt_aElt.length - 1])
tt_aElt[0] = null;}
if(tt_aElt[0])
{ var css = tt_aElt[0].style; css.visibility = "hidden"; css.position = "absolute"; css.overflow = "hidden"; return true;}
return false;}
function tt_ResetMainDiv()
{ var w = screen.width; tt_SetTipPos(-w, 0); tt_aElt[0].innerHTML = ""; tt_aElt[0].style.width = (w - 1) + "px";}
function tt_IsW3cBox()
{ var css = tt_aElt[0].style; css.padding = "10px"; css.width = "40px"; tt_bBoxOld = (tt_GetDivW(tt_aElt[0]) == 40); css.padding = "0px"; tt_ResetMainDiv();}
function tt_OpaSupport()
{ var css = tt_body.style; tt_flagOpa = (typeof(css.filter) != tt_u) ? 1
: (typeof(css.KhtmlOpacity) != tt_u) ? 2
: (typeof(css.KHTMLOpacity) != tt_u) ? 3
: (typeof(css.MozOpacity) != tt_u) ? 4
: (typeof(css.opacity) != tt_u) ? 5
: 0;}
function tt_SetOnloadFnc()
{ tt_AddEvtFnc(document, "DOMContentLoaded", tt_HideSrcTags); tt_AddEvtFnc(window, "load", tt_HideSrcTags); if(/WebKit|KHTML/i.test(navigator.userAgent))
{ var t = setInterval(function() { if(/loaded|complete/.test(document.readyState))
{ clearInterval(t); tt_HideSrcTags();}
}, 10);}
}
function tt_HideSrcTags()
{ if(!window.tt_HideSrcTags || window.tt_HideSrcTags.done)
return; window.tt_HideSrcTags.done = true; if(!tt_HideSrcTagsRecurs(tt_body))
tt_Err("To enable the capability to convert HTML elements to tooltips," + " you must set TagsToTip in the global tooltip configuration" + " to true.");}
function tt_HideSrcTagsRecurs(dad)
{ var a, ovr, asT2t; a = dad.childNodes || dad.children || null; for(var i = a ? a.length : 0; i;)
{--i; if(!tt_HideSrcTagsRecurs(a[i]))
return false; ovr = a[i].getAttribute ? a[i].getAttribute("onmouseover")
: (typeof a[i].onmouseover == "function") ? a[i].onmouseover
: null; if(ovr)
{ asT2t = ovr.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/);
			if(asT2t && asT2t.length)
			{
				if(!tt_HideSrcTag(asT2t[0]))
					return false;
			}
		}
	}
	return true;
}
function tt_HideSrcTag(sT2t)
{
	var id, el;

	// The ID passed to the found TagToTip() call identifies an HTML element
	// to be converted to a tooltip, so hide that element
	id = sT2t.replace(/.+'([^'.]+)'.+/, "$1"); el = tt_GetElt(id); if(el)
{ if(Debug && !TagsToTip)
return false; else
el.style.display = "none";}
else
tt_Err("Invalid ID\n'" + id + "'\npassed to TagToTip()." + " There exists no HTML element with that ID."); return true;}
function tt_Tip(arg, el)
{ if(!tt_db)
return; if(tt_iState)
tt_HideTip(); tt_elToTip = el; tt_sContent = arg[0]; if(!tt_ReadCmds(arg))
return; tt_iState = 1; tt_AdaptConfig1(); tt_MkTipSubDivs(); tt_FormatTip(); tt_AddRemEvtFncEx(0, true); tt_bJmpVert = false; tt_scrlX = tt_GetScrollX(); tt_scrlY = tt_GetScrollY(); tt_maxPosX = tt_GetClientW() + tt_scrlX - tt_w - 1; tt_maxPosY = tt_GetClientH() + tt_scrlY - tt_h - 1; tt_AdaptConfig2(); if(window.event)
tt_Move(window.event);}
function tt_ReadCmds(a)
{ var i; i = 0; for(var j in config)
tt_aV[i++] = config[j]; if(a.length & 1)
{ for(i = a.length - 1; i > 0; i -= 2)
tt_aV[a[i - 1]] = a[i]; return true;}
tt_Err("Incorrect call of Tip() or TagToTip().\n" + "Each command must be followed by a value."); return false;}
function tt_AdaptConfig1()
{ tt_ExtCallFncs(0, "LoadConfig"); if(!tt_aV[TITLEBGCOLOR].length)
tt_aV[TITLEBGCOLOR] = tt_aV[BORDERCOLOR]; if(!tt_aV[TITLEFONTCOLOR].length)
tt_aV[TITLEFONTCOLOR] = tt_aV[BGCOLOR]; if(!tt_aV[TITLEFONTFACE].length)
tt_aV[TITLEFONTFACE] = tt_aV[FONTFACE]; if(!tt_aV[TITLEFONTSIZE].length)
tt_aV[TITLEFONTSIZE] = tt_aV[FONTSIZE]; if(tt_aV[CLOSEBTN])
{ if(!tt_aV[CLOSEBTNCOLORS])
tt_aV[CLOSEBTNCOLORS] = new Array("", "", "", ""); for(var i = 4; i;)
{--i; if(!tt_aV[CLOSEBTNCOLORS][i].length)
tt_aV[CLOSEBTNCOLORS][i] = (i & 1) ? tt_aV[TITLEFONTCOLOR] : tt_aV[TITLEBGCOLOR];}
if(!tt_aV[TITLE].length)
tt_aV[TITLE] = " ";}
if(tt_aV[OPACITY] == 100 && typeof tt_aElt[0].style.MozOpacity != tt_u && !Array.every)
tt_aV[OPACITY] = 99; if(tt_aV[FADEIN] && tt_flagOpa && tt_aV[DELAY] > 100)
tt_aV[DELAY] = Math.max(tt_aV[DELAY] - tt_aV[FADEIN], 100)
}
function tt_AdaptConfig2()
{ if(tt_aV[CENTERMOUSE])
tt_aV[OFFSETX] = -((tt_w - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0)) >> 1);}
function tt_MkTipSubDivs()
{ var sTbTr = ' cellpadding="0" cellspacing="0" border="0" style="position:relative;margin:0px;border-width:0px;"><tr>', sTdCss = 'position:relative;margin:0px;padding:0px;border-width:0px;'; tt_ExtCallFncs(0, "CreateContentString"); tt_aElt[0].innerHTML = ('' + (tt_aV[TITLE].length ?
('<div id="WzTiTl" style="position:relative;z-index:1;">' + '<table id="WzTiTlTb"' + sTbTr + '<td id="WzTiTlI" style="' + sTdCss + '">' + tt_aV[TITLE] + '</td>' + (tt_aV[CLOSEBTN] ?
('<td align="right" style="' + sTdCss + ';text-align:right;">' + '<span id="WzClOsE" style="padding-left:2px;padding-right:2px;' + 'cursor:' + (tt_ie ? 'hand' : 'pointer') + ';" onmouseover="tt_OnCloseBtnOver(1)" onmouseout="tt_OnCloseBtnOver(0)" onclick="tt_HideInit()">' + tt_aV[CLOSEBTNTEXT] + '</span></td>')
: '') + '</tr></table></div>')
: '') + '<div id="WzBoDy" style="position:relative;z-index:0;">' + '<table' + sTbTr + '<td id="WzBoDyI" style="' + sTdCss + '">' + tt_sContent + '</td></tr></table>' + '</div>' + (tt_aV[SHADOW]
? ('<div id="WzTtShDwR" style="position:absolute;overflow:hidden;"></div>' + '<div id="WzTtShDwB" style="position:relative;overflow:hidden;"></div>')
: '') ); tt_GetSubDivRefs(); tt_ExtCallFncs(0, "SubDivsCreated");}
function tt_GetSubDivRefs()
{ var aId = new Array("WzTiTl", "WzTiTlTb", "WzTiTlI", "WzClOsE", "WzBoDy", "WzBoDyI", "WzTtShDwB", "WzTtShDwR"); for(var i = aId.length; i; --i)
tt_aElt[i] = tt_GetElt(aId[i - 1]);}
function tt_FormatTip()
{ var css, dy, w; if(tt_aV[TITLE].length)
{ css = tt_aElt[1].style; css.background = tt_aV[TITLEBGCOLOR]; css.paddingTop = (tt_aV[CLOSEBTN] ? 2 : 0) + "px"; css.paddingBottom = "1px"; css.paddingLeft = css.paddingRight = tt_aV[PADDING] + "px"; css = tt_aElt[3].style; css.color = tt_aV[TITLEFONTCOLOR]; css.fontFamily = tt_aV[TITLEFONTFACE]; css.fontSize = tt_aV[TITLEFONTSIZE]; css.fontWeight = "bold"; css.textAlign = tt_aV[TITLEALIGN]; if(tt_aElt[4])
{ css.paddingRight = (tt_aV[PADDING] << 1) + "px"; css = tt_aElt[4].style; css.background = tt_aV[CLOSEBTNCOLORS][0]; css.color = tt_aV[CLOSEBTNCOLORS][1]; css.fontFamily = tt_aV[TITLEFONTFACE]; css.fontSize = tt_aV[TITLEFONTSIZE]; css.fontWeight = "bold";}
if(tt_aV[WIDTH] > 0)
tt_w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); else
{ tt_w = tt_GetDivW(tt_aElt[3]) + tt_GetDivW(tt_aElt[4]); if(tt_aElt[4])
tt_w += tt_aV[PADDING];}
dy = -tt_aV[BORDERWIDTH];}
else
{ tt_w = 0; dy = 0;}
css = tt_aElt[5].style; css.top = dy + "px"; if(tt_aV[BORDERWIDTH])
{ css.borderColor = tt_aV[BORDERCOLOR]; css.borderStyle = tt_aV[BORDERSTYLE]; css.borderWidth = tt_aV[BORDERWIDTH] + "px";}
if(tt_aV[BGCOLOR].length)
css.background = tt_aV[BGCOLOR]; if(tt_aV[BGIMG].length)
css.backgroundImage = "url(" + tt_aV[BGIMG] + ")"; css.padding = tt_aV[PADDING] + "px"; css.textAlign = tt_aV[TEXTALIGN]; css = tt_aElt[6].style; css.color = tt_aV[FONTCOLOR]; css.fontFamily = tt_aV[FONTFACE]; css.fontSize = tt_aV[FONTSIZE]; css.fontWeight = tt_aV[FONTWEIGHT]; css.background = ""; css.textAlign = tt_aV[TEXTALIGN]; if(tt_aV[WIDTH] > 0)
w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); else
w = tt_GetDivW(tt_aElt[6]) + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); if(w > tt_w)
tt_w = w; if(tt_aV[SHADOW])
{ var off; tt_w += tt_aV[SHADOWWIDTH]; off = tt_CalcShadowOffset(); css = tt_aElt[7].style; css.top = dy + "px"; css.left = off + "px"; css.width = (tt_w - off - tt_aV[SHADOWWIDTH]) + "px"; css.height = tt_aV[SHADOWWIDTH] + "px"; css.background = tt_aV[SHADOWCOLOR]; css = tt_aElt[8].style; css.top = off + "px"; css.left = (tt_w - tt_aV[SHADOWWIDTH]) + "px"; css.width = tt_aV[SHADOWWIDTH] + "px"; css.background = tt_aV[SHADOWCOLOR];}
tt_SetTipOpa(tt_aV[FADEIN] ? 0 : tt_aV[OPACITY]); tt_FixSize(dy);}
function tt_FixSize(offY)
{ var wIn, wOut, i; tt_aElt[0].style.width = tt_w + "px"; tt_aElt[0].style.pixelWidth = tt_w; wOut = tt_w - ((tt_aV[SHADOW]) ? tt_aV[SHADOWWIDTH] : 0); wIn = wOut; if(!tt_bBoxOld)
wIn -= ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); tt_aElt[5].style.width = wIn + "px"; if(tt_aElt[1])
{ wIn = wOut - (tt_aV[PADDING] << 1); if(!tt_bBoxOld)
wOut = wIn; tt_aElt[1].style.width = wOut + "px"; tt_aElt[2].style.width = wIn + "px";}
tt_h = tt_GetDivH(tt_aElt[0]) + offY; if(tt_aElt[8])
tt_aElt[8].style.height = (tt_h - tt_CalcShadowOffset()) + "px"; i = tt_aElt.length - 1; if(tt_aElt[i])
{ tt_aElt[i].style.width = tt_w + "px"; tt_aElt[i].style.height = tt_h + "px";}
}
function tt_CalcShadowOffset()
{ return(Math.floor((tt_aV[SHADOWWIDTH] * 4) / 3));}
function tt_StartMov()
{ tt_DeAlt(tt_Move.over); tt_OpDeHref(tt_Move.over); tt_tShow.Timer("tt_ShowTip()", tt_aV[DELAY], true); tt_AddRemEvtFncEx(1, true); if(tt_aV[CLICKCLOSE])
tt_AddEvtFnc(document, "mouseup", tt_HideInit);}
function tt_DeAlt(el)
{ var aKid; if(el.alt)
el.alt = ""; if(el.title)
el.title = ""; aKid = el.childNodes || el.children || null; if(aKid)
{ for(var i = aKid.length; i;)
tt_DeAlt(aKid[--i]);}
}
function tt_OpDeHref(el)
{ if(!tt_op78)
return; if(tt_elDeHref)
tt_OpReHref(); while(el)
{ if(el.hasAttribute("href"))
{ el.t_href = el.getAttribute("href"); el.t_stats = window.status; el.removeAttribute("href"); el.style.cursor = "hand"; tt_AddEvtFnc(el, "mousedown", tt_OpReHref); window.status = el.t_href; tt_elDeHref = el; break;}
el = el.parentElement;}
}
function tt_ShowTip()
{ var css = tt_aElt[0].style; css.zIndex = Math.max((window.dd && dd.z) ? (dd.z + 2) : 0, 1010); if(tt_aV[STICKY] || !tt_aV[FOLLOWMOUSE])
tt_AddRemEvtFncEx(0, false); if(tt_aV[DURATION] > 0)
tt_tDurt.Timer("tt_HideInit()", tt_aV[DURATION], true); tt_ExtCallFncs(0, "Show")
css.visibility = "visible"; tt_iState = 2; if(tt_aV[FADEIN])
tt_Fade(0, 0, tt_aV[OPACITY], Math.round(tt_aV[FADEIN] / tt_aV[FADEINTERVAL])); tt_ShowIfrm();}
function tt_ShowIfrm()
{ if(tt_ie56)
{ var ifrm = tt_aElt[tt_aElt.length - 1]; if(ifrm)
{ var css = ifrm.style; css.zIndex = tt_aElt[0].style.zIndex - 1; css.width = tt_w + "px"; css.height = tt_h + "px"; css.display = "block";}
}
}
function tt_Move(e)
{ if(!tt_op && !tt_ie)
{ if(tt_bWait)
return; tt_bWait = true; tt_tWaitMov.Timer("tt_bWait = false;", 1, true);}
e = e || window.event || null; if(tt_aV[FIX])
{ tt_AddRemEvtFncEx(0, false); tt_SetTipPos(tt_aV[FIX][0], tt_aV[FIX][1]);}
else if(!tt_ExtCallFncs(e, "MouseMove"))
tt_SetTipPos(tt_PosX(e), tt_PosY(e)); if(!tt_Move.over)
{ tt_Move.over = e.target || e.srcElement; if(tt_Move.over)
tt_StartMov();}
}
function tt_PosX(e)
{ var x; x = (typeof(e.pageX) != tt_u) ? e.pageX : (e.clientX + tt_scrlX); if(tt_aV[LEFT])
x -= tt_w + tt_aV[OFFSETX] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); else
x += tt_aV[OFFSETX]; if(x > tt_maxPosX)
x = tt_maxPosX; return((x < tt_scrlX) ? tt_scrlX : x);}
function tt_PosY(e)
{ var yMus, y; yMus = (typeof(e.pageY) != tt_u) ? e.pageY : (e.clientY + tt_scrlY); if(tt_aV[ABOVE] && (!tt_bJmpVert || tt_CalcPosYAbove(yMus) >= tt_scrlY + 16))
y = tt_DoPosYAbove(yMus); else if(!tt_aV[ABOVE] && tt_bJmpVert && tt_CalcPosYBelow(yMus) > tt_maxPosY - 16)
y = tt_DoPosYAbove(yMus); else
y = tt_DoPosYBelow(yMus); if(y > tt_maxPosY)
y = tt_DoPosYAbove(yMus); if(y < tt_scrlY)
y = tt_DoPosYBelow(yMus); return y;}
function tt_DoPosYBelow(yMus)
{ tt_bJmpVert = tt_aV[ABOVE]; return tt_CalcPosYBelow(yMus);}
function tt_DoPosYAbove(yMus)
{ tt_bJmpVert = !tt_aV[ABOVE]; return tt_CalcPosYAbove(yMus);}
function tt_CalcPosYBelow(yMus)
{ return(yMus + tt_aV[OFFSETY]);}
function tt_CalcPosYAbove(yMus)
{ var dy = tt_aV[OFFSETY] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); if(tt_aV[OFFSETY] > 0 && dy <= 0)
dy = 1; return(yMus - tt_h - dy);}
function tt_OnOut()
{ tt_AddRemEvtFncEx(1, false); if(!(tt_aV[STICKY] && (tt_iState & 2)))
tt_HideInit();}
function tt_HideOnScrl()
{ if(tt_iState && !(tt_aV[STICKY] && (tt_iState & 2)))
tt_HideInit();}
function tt_HideInit()
{ tt_ExtCallFncs(0, "HideInit"); tt_AddRemEvtFncEx(0, false); if(tt_flagOpa && tt_aV[FADEOUT])
{ tt_tFade.EndTimer(); if(tt_opa)
{ var n = Math.round(tt_aV[FADEOUT] / (tt_aV[FADEINTERVAL] * (tt_aV[OPACITY] / tt_opa))); tt_Fade(tt_opa, tt_opa, 0, n); return;}
}
tt_tHide.Timer("tt_HideTip();", 1, false);}
function tt_OpReHref()
{ if(tt_elDeHref)
{ tt_elDeHref.setAttribute("href", tt_elDeHref.t_href); tt_RemEvtFnc(tt_elDeHref, "mousedown", tt_OpReHref); window.status = tt_elDeHref.t_stats; tt_elDeHref = null;}
}
function tt_Fade(a, now, z, n)
{ if(n)
{ now += Math.round((z - now) / n); if((z > a) ? (now >= z) : (now <= z))
now = z; else
tt_tFade.Timer("tt_Fade(" + a + "," + now + "," + z + "," + (n - 1) + ")", tt_aV[FADEINTERVAL], true);}
now ? tt_SetTipOpa(now) : tt_HideTip();}
function tt_SetTipOpa(opa)
{ tt_SetOpa(tt_aElt[5].style, opa); if(tt_aElt[1])
tt_SetOpa(tt_aElt[1].style, opa); if(tt_aV[SHADOW])
{ opa = Math.round(opa * 0.8); tt_SetOpa(tt_aElt[7].style, opa); tt_SetOpa(tt_aElt[8].style, opa);}
}
function tt_OnCloseBtnOver(iOver)
{ var css = tt_aElt[4].style; iOver <<= 1; css.background = tt_aV[CLOSEBTNCOLORS][iOver]; css.color = tt_aV[CLOSEBTNCOLORS][iOver + 1];}
function tt_Int(x)
{ var y; return(isNaN(y = parseInt(x)) ? 0 : y);}
function tt_AddRemEvtFncEx(iTyp, bAdd)
{ var PSet = bAdd ? tt_AddEvtFnc : tt_RemEvtFnc; if(iTyp)
{ if(bAdd != tt_bOutFnc)
{ PSet(tt_Move.over, "mouseout", tt_OnOut); tt_bOutFnc = bAdd; if(!bAdd)
tt_OpReHref();}
}
else
{ if(bAdd != tt_bMovFnc)
{ PSet(document, "mousemove", tt_Move); tt_bMovFnc = bAdd;}
}
}
Number.prototype.Timer = function(s, iT, bUrge)
{ if(!this.value || bUrge)
this.value = window.setTimeout(s, iT);}
Number.prototype.EndTimer = function()
{ if(this.value)
{ window.clearTimeout(this.value); this.value = 0;}
}
function tt_SetOpa(css, opa)
{ tt_opa = opa; if(tt_flagOpa == 1)
{ if(opa < 100)
{ var bVis = css.visibility != "hidden"; css.zoom = "100%"; if(!bVis)
css.visibility = "visible"; css.filter = "alpha(opacity=" + opa + ")"; if(!bVis)
css.visibility = "hidden";}
else
css.filter = "";}
else
{ opa /= 100.0; switch(tt_flagOpa)
{ case 2:
css.KhtmlOpacity = opa; break; case 3:
css.KHTMLOpacity = opa; break; case 4:
css.MozOpacity = opa; break; case 5:
css.opacity = opa; break;}
}
}
function tt_Err(sErr)
{ if(Debug)
alert("Tooltip Script Error Message:\n\n" + sErr);}
function tt_ExtCmdEnum()
{ var s; for(var i in config)
{ s = "window." + i.toString().toUpperCase(); if(eval("typeof(" + s + ") == tt_u"))
{ eval(s + " = " + tt_aV.length); tt_aV[tt_aV.length] = null;}
}
}
function tt_ExtCallFncs(arg, sFnc)
{ var b = false; for(var i = tt_aExt.length; i;)
{--i; var fnc = tt_aExt[i]["On" + sFnc]; if(fnc && fnc(arg))
b = true;}
return b;}
tt_Init();
