var gui=window.gui||{};gui.namespace=function(ns,dns){if(!ns||!ns.length){return null;}var l=ns.split('.');var cns=(dns)?dns:gui;for(var i=((l[0]=='gui')?1:0);i<l.length;++i){cns[l[i]]=cns[l[i]]||{};cns=cns[l[i]];}return cns;};gui.conn={http:{msxml:['MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],ct:'application/x-www-form-urlencoded',asyncRequest:function(u,x,m,p,h){var self=this;this.u=u;this.x=(x)?x:false;this.m=(m)?m:'GET';this.p=(p)?p:null;this.h=h;this.conn=gui.conn.getConnObj();this.response=null;this._init=function(){if(this.conn){this.conn.onreadystatechange=this.checkStatus;this.conn.open(this.m,this.u,true);if(this.h){gui.conn.setHeader(this.conn,this.h);}if(this.p){gui.conn.setHeader(this.conn,'Content-Type:'+gui.conn.http.ct);}this.conn.send(this.p);}};this.checkStatus=function(){if(self.conn.readyState==4){if(self.conn.status==200){self.response=(self.x)?self.conn.responseXML:self.conn.responseText;self.onLoad();}else{self.response=gui.conn.getException(self.conn);self.onError();}}};this.abort=function(){this.conn.abort();};this.getAllHeaders=function(){return this.conn.getAllResponseHeaders();};this.getHeader=function(label){return this.conn.getResponseHeader(label);};this.onLoad=function(){};this.onError=function(e){};this._init();},syncRequest:function(u,xml,m,p,h){this.u=u;this.xml=(xml)?xml:false;this.m=(m)?m:'GET';this.p=(p)?p:null;this.h=h;this.conn=gui.conn.getConnObj();this.response=null;this._init=function(){if(this.conn){this.conn.open(this.m,this.u,false);if(this.p){gui.conn.setHeader(this.conn,'Content-Type:'+gui.conn.http.ct);}if(this.h){gui.conn.setHeader(this.conn,this.h);}this.conn.send(this.p);try{if(this.conn.status==200){this.response=(this.xml)?this.conn.responseXML:this.conn.responseText;}else{this.response=gui.conn.getException(this.conn);}}catch(e){this.response=gui.conn.getException(this.conn);}}};this.getAllHeaders=function(){return this.conn.getAllResponseHeaders();};this.getHeader=function(label){return this.conn.getResponseHeader(label);};this._init();}},getConnObj:function(){var http;var ax=gui.conn.http.msxml;try{http=new XMLHttpRequest();}catch(e){for(var i=0;i<ax.length;++i){try{http=new ActiveXObject(ax[i]);}catch(e){}}}finally{if(http!=='undefined'){return http;}else{return null;}}},setHeader:function(c,hdr){var h;if(hdr.constructor==Array){for(h in hdr){this.setHeader(c,hdr[h]);}}else{h=hdr.split(':');c.setRequestHeader(h[0],h[1]);}},getException:function(c){return{conn:c,status:c.status,statusText:c.statusText};}};gui.cookie={cookies:{},_init:function(){},parse:function(){if(document.cookie){var s,p=document.cookie.split(';');for(var i=0;i<p.length;++i){s=p[i].split('=');this.cookies[s[0]]=s[1];}}},get:function(n,v){if(v){var cv=this.get(n).split('&');var p;for(var i=0;i<cv.length;++i){p=cv[i].split(':');if(p[0]==v){return p[1];}}}else{if(!gui.obj.getLength(this.cookies)){this.parse();}return(this.cookies[n])?unescape(this.cookies[n]):false;}return false;},set:function(n,v,e,p,d,s){var dt=new Date();var nv=n+"="+escape(v);var str=nv+((e)?';expires='+e:'')+((p)?';path='+p:'')+((d)?';domain='+d:'')+((s)?';secure':'');if((n.length>0&&(v&&v.length>0))&&(((e)&&(e>dt))||(!e))&&(nv.length<4000)){document.cookie=str;this.cookies[n]=v;return true;}return false;},remove:function(n,p,d){if(this.cookies[n]){this.c=n+'='+((p)?';path='+p:'')+((d)?';domain='+d:'')+';expires=Thu,01-Jan-1970 00:00:01 GMT';this.cookies[n]=null;return true;}return false;}};gui.dim={getBodyDim:function(){var b=document.body;var w=Math.max(b.clientWidth,window.innerWidth)||b.offsetWidth;var h=Math.max(b.clientHeight,window.innerHeight)||b.offsetHeight;return [w,h];},getBodyWidth:function(){return this.getBodyDim()[0];},getBodyHeight:function(){return this.getBodyDim()[1];},getContentDim:function(){var b=document.body;var w=Math.max(b.offsetWidth,b.scrollWidth);var h=Math.max(b.offsetHeight,b.scrollHeight);return [w,h];},getContentWidth:function(){return this.getContentDim()[0];},getContentHeight:function(){return this.getContentDim()[1];},getDim:function(o,t){var os=(typeof(t)!='undefined')?this.getOffset(o,t):[0,0];return [o.offsetWidth-os[0],o.offsetHeight-os[1]];},getWidth:function(o,t){return this.getDim(o,t)[0];},getHeight:function(o,t){return this.getDim(o,t)[1];},setDim:function(o,w,h,t){if(o.constructor==Array){for(var i=0;i<o.length;++i){this.setDim(o[i],w,h,t);}return;}else{if(typeof(o)=='string'){o=$(o);}var offset=(typeof(t)!='undefined')?this.getOffset(o,t):[0,0];if(w!==null){gui.style.set(o,'width:'+(w-offset[0])+'px');}if(h!==null){gui.style.set(o,'height:'+(h-offset[1])+'px');}}},setWidth:function(o,w,t){this.setDim(o,w,null,t);},setHeight:function(o,h,t){this.setDim(o,null,h,t);},getCoords:function(o,t){var offset=(typeof(t)=='undefined')?[0,0]:this.getOffset(o,t);var p=gui.pos.getPos(o);var d=this.getDim(o,t);var c={top:p[1],right:p[0]+d[0],bottom:p[1]+d[1],left:p[0],width:d[0],height:d[1]};return c;},getOffset:function(o,t){var s=gui.style.get;var bh=parseInt(s(o,'border-left-width'),0)+parseInt(s(o,'border-right-width'),0);var bv=parseInt(s(o,'border-top-width'),0)+parseInt(s(o,'border-bottom-width'),0);var ph=parseInt(s(o,'padding-left'),0)+parseInt(s(o,'padding-right'),0);var pv=parseInt(s(o,'padding-top'),0)+parseInt(s(o,'padding-bottom'),0);switch(t){case 'border':return [bh,bv];case 'padding':return [ph,pv];case 'all':return [bh+ph,bv+pv];default:return [0,0];}}};gui.dom={getElementsByClassName:function(c,p){this.c=c;this.p=(typeof(p)=='undefined')?document.body:((typeof(p)=='string')?$(p):p);this.m=[];var cn;this.seach=function(n){if(n.childNodes&&n.childNodes.length){for(var i=0;i<n.childNodes.length;++i){cn=n.childNodes[i];if(cn.nodeType==1&&cn.className==this.c){this.m.push(cn);}if(cn.nodeType==1){this.seach(cn);}}}};this.seach(this.p);return this.m;},addChild:function(t,p,nc,tc){if(nc.constructor==Array){for(var i=0;i<nc.length;++i){this.addChild(t,p,nc[i],tc);}}else{p=(typeof(p)=='string')?$(p):p;tc=(typeof(tc)=='string')?$(tc):tc;nc=(nc=='gclr')?$C('div',{className:'gclr'}):nc;switch(t){case 'prepend':if(typeof(tc)=='undefined'){return p.insertBefore(nc,p.childNodes[0]);}else{return p.insertBefore(nc,tc);}break;case 'append':if(typeof(tc)=='undefined'){return p.appendChild(nc);}else{var f=false;for(i=0;i<p.childNodes.length;++i){if(f){return p.insertBefore(nc,p.childNodes[i]);}if(i==p.childNodes.length-1){return p.appendChild(nc);}if(p.childNodes[i]==tc){f=true;}}}break;}}return false;},setNodeValue:function(p,v){p=(typeof(p)=='string')?$(p):p;if(typeof(v)=='object'){p.innerHTML='';return $A(p,v);}else{return(p.innerHTML=v);}},isChild:function(o,p){while(o){if(o==p){return true;}o=o.parentNode;}return false;},resolveParent:function(o,t,a){t=t.toLowerCase();o=(typeof(o)=='string')?$(o):o;var p=o.parentNode;while(p){if(p.tagName&&p.tagName.toLowerCase()==t){if(typeof(a)=='undefined'){return p;}else{var d=[];for(var attr in a){if(a[attr]=='*'&&p[attr]){d.push(attr);}else if(p[attr]&&p[attr]===a[attr]){d.push(attr);}}if(d.length===gui.obj.getLength(a)){return p;}}}p=p.parentNode;}return false;},resolveChild:function(p,t,a){p=(typeof(p)=='string')?$(p):p;t=t.toLowerCase();var c=$T(p,t);if(c.length>0){if(typeof(a)=='undefined'){return c[0];}else{for(var i=0;i<c.length;++i){var d=[];for(var attr in a){if(a[attr]=='*'&&c[i][attr]){d.push(attr);}else if(c[i][attr]&&c[i][attr]===a[attr]){d.push(attr);}}if(d.length===gui.obj.getLength(a)){return c[i];}}}}return null;},toString:function(n,f,l){switch(n.nodeType){case 1:var noClose=['br','input','img','col'];var tag=n.tagName.toLowerCase();var closeTag='';var attr=this.getAttributes(n,f);var str='';var c=n.childNodes;if(!noClose.inArray(tag)){closeTag='</'+tag+'>';}for(var i=0;i<c.length;++i){str+=this.toString(c[i],f,l+1);}return '<'+tag+attr+'>'+str+closeTag;case 3:if(!n.nodeValue.match(/^\s+$/)){return n.nodeValue;}break;default:break;}return '';},getAttributes:function(n,f){var a=n.attributes;var attr='';for(var i=0;i<a.length;++i){if(a[i].value!='null'&&a[i].value!==''){if(!f||(f&&f.inArray(a[i].name))){attr+=' '+a[i].name.toLowerCase()+'="'+a[i].value+'"';}}}return attr;}};gui.event={loaded:false,b:[],e:[],add:function(elm,evt,fn,c){if(elm.constructor==Array){for(var i=0;i<elm.length;++i){this.add(elm[i],evt,fn,c);}return;}else{if(!this.loaded&&evt!='load'){this.b[this.b.length]={elm:elm,evt:evt,fn:fn,c:c};return;}var f=this._getFn(elm,evt,fn);if(!f){if(typeof(elm)=='string'){elm=$(elm);}switch(evt){case 'mousewheel':var b=gui.system.browser.getName();if(b=='gecko'){evt='DOMMouseScroll';}else if(b=='ie'){elm=document;}break;}var wfn=function(e){if(fn){return fn.call(elm,gui.event.getEvent(e),c);}return null;};this.e[this.e.length]={elm:elm,evt:evt,fn:fn,wfn:wfn,c:c,i:this.e.length};if(elm.addEventListener){elm.addEventListener(evt,wfn,false);}else if(elm.attachEvent){elm.attachEvent('on'+evt,wfn);}else{elm['on'+evt]=wfn;}}}},remove:function(elm,evt,fn,c){var i;if(elm.constructor==Array){for(i=0;i<elm.length;++i){this.remove(elm[i],evt,fn);}return;}else{switch(evt){case 'mousewheel':var b=gui.system.browser.getName();if(b=='gecko'){evt='DOMMouseScroll';}else if(b=='ie'){elm=document;}break;}var f=this._getFn(elm,evt,fn);if(f){this.e=this.e.remove(f.i,1);for(i=0;i<this.e.length;++i){this.e[i].i=i;}if(typeof(elm)=='string'){elm=$(elm);}if(elm){if(elm.removeEventListener){elm.removeEventListener(evt,f.wfn,c);}else if(elm.detachEvent){elm.detachEvent('on'+evt,f.wfn);}else{elm['on'+evt]=null;}}}}},getEvent:function(e){return e||window.event;},getEvents:function(){return this.e;},getElmEvents:function(elm,evt){if(elm.constructor==Array){for(var i=0;i<elm.length;++i){this.getElmEvents(elm[i]);}}else{elm=(typeof(elm)=='string')?$(elm):elm;var evts=[];if(elm){for(var e=0;e<this.e.length;++e){if(this.e[e].elm==elm){if(evt&&this.e[e].evt==evt){evts.push(this.e[e]);}else if(typeof(evt)=='undefined'){evts.push(this.e[e]);}}}}return evts;}return false;},hasEvent:function(elm,e,f){return(this._getFn(elm,e,f))?true:false;},getTarget:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;return(e.target)?e.target:((e.srcElement)?e.srcElement:null);},getMousePos:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;return [(e.clientX||0),(e.clientY||0)];},getMouseX:function(e){return this.getMousePos(e)[0];},getMouseY:function(e){return this.getMousePos(e)[1];},getScollWheelSpeed:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;var d=0;if(e.wheelDelta){d=-(e.wheelDelta/120);if(window.opera){d=-d;}}else if(e.detail){d=e.detail/3;}return d;},getRelatedTarget:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;var t=e.relatedTarget;if(!t){if(e.type=='mouseover'){t=e.fromElement;}else if(e.type=='mouseout'){t=e.toElement;}}return t;},getCharCode:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;return(e.charCode)?e.charCode:((e.keyCode)?e.keyCode:0);},stopPropagation:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;if(e.stopPropagation){e.stopPropagation();}else{if(e.cancelBubble){e.cancelBubble=true;}}},preventDefault:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}},stopEvent:function(e){e=(typeof(e)!='undefined')?this.getEvent(e):e;this.stopPropagation(e);this.preventDefault(e);},addCapture:function(t){if(t&&t.setCapture){t.setCapture();}},releaseCapture:function(t){if(t&&t.releaseCapture){t.releaseCapture();}},_getFn:function(elm,e,fn){var f=false;for(var i=0;i<this.e.length;++i){if(this.e[i].elm==elm&&this.e[i].evt==e&&this.e[i].fn==fn){f=this.e[i];}this.e[i].i=i;}return f;},_init:function(){var self=gui.event;self.loaded=true;for(var i=0;i<self.b.length;++i){self.add(self.b[i].elm,self.b[i].evt,self.b[i].fn,self.b[i].c);}self.b=[];},_unload:function(){var self=gui.event;for(var i=0;i<self.e.length;++i){self.remove(self.e[i].elm,self.e[i].evt,self.e[i].fn,self.e[i].c);}}};gui.form={obscureForms:function(){if(gui.system.browser.is('ie',6)){for(var i=0;i<document.forms.length;++i){for(var f=0;f<document.forms[i].elements.length;++f){if(document.forms[i].elements[f].tagName.toLowerCase()=='select'){gui.style.set(document.forms[i].elements[f],'visibility:hidden');}}}}},restoreForms:function(){if(gui.system.browser.is('ie',6)){for(var i=0;i<document.forms.length;++i){for(var f=0;f<document.forms[i].elements.length;++f){if(document.forms[i].elements[f].tagName.toLowerCase()=='select'){gui.style.set(document.forms[i].elements[f],'visibility:visible');}}}}},encodeObj:function(v){var s='';for(var k in v){s+=k+'='+encodeURIComponent(v[k])+'&';}if(s.lastIndexOf('&')==s.length-1){s=s.substr(0,s.length-1);}return s;},encodeForm:function(fn){var q='';var form=(typeof(fn)=='string')?document[fn]:fn;for(var x=0;x<form.elements.length;++x){var prevName;var elm=form.elements[x];var name=elm.name;var value=elm.value;switch(elm.type){case 'select-multiple':for(var i=0;i<elm.options.length;++i){if(elm.options[i].selected){q+=name+'='+encodeURIComponent(elm.options[i].value)+'&';}}break;case 'radio':if(elm.checked){q+=name+'='+encodeURIComponent(value)+'&';}break;case 'checkbox':if(name==prevName){if(q.lastIndexOf('&')==q.length-1){q+=q.substr(0,q.length-1);}q+=','+encodeURIComponent(value)+'&';}else{q+=name+'='+encodeURIComponent(value)+'&';}prevName=name;break;case 'file':break;default:q+=name+'='+encodeURIComponent(value)+'&';break;}}if(q.lastIndexOf('&')==q.length-1){q=q.substr(0,q.length-1);}return q;}};gui.obj={hasProperty:function(o,p){return(this.getProperty(o,p))?true:false;},getProperty:function(o,p){var results=[];var search=function(node){loop:for(var n in node){if(n===p){results.push(node[n]);}else{if(node[n]&&node[n].constructor==Object){search(node[n]);}}}};search(o);return(results.length)?((results.length>1)?results:results[0]):false;},isPropertyOf:function(o,p){var f=false;var check=function(node){loop:for(var n in node){if(n===p){f=true;break loop;}if(node[n]&&node[n].constructor==Object){check(node[n]);}}};check(o);return f;},deleteProperty:function(o,c,p){if(this.isPropertyOf(o,c)){if(p){var parent=this.getProperty(o,p);if(this.isPropertyOf(parent,c)){delete parent[c];}}else{if(o.hasOwnProperty(c)){delete o[c];}}return o;}return false;},getLength:function(o){var c=0;for(var i in o){++c;}return c;}};gui.pos={getPos:function(o){if(typeof(o)=='string'){o=$(o);}var b=gui.system.browser.getName();var p=o.offsetParent;var pos=[o.offsetLeft,o.offsetTop];var tmp={x:null,y:null};var ofst=[0,0];if(p!=o){while(p){switch(b){case 'ie':if(gui.style.get(p,'position')=='relative'&&gui.style.get(o,'width')=='auto'&&gui.style.get(o,'position')=='static'){return [o.offsetLeft,o.offsetTop];}else if(gui.style.get(p,'width')!='auto'||gui.style.get(o.parentNode,'position')!='static'){tmp.x=parseInt(gui.style.get(p,'border-left-width'),0);tmp.y=parseInt(gui.style.get(p,'border-top-width'),0);if(!isNaN(tmp.x)){pos[0]+=tmp.x;}if(!isNaN(tmp.y)){pos[1]+=tmp.y;}}break;case 'gecko':ofst[0]=parseInt(gui.style.get(p,'border-left-width'),0);ofst[1]=parseInt(gui.style.get(p,'border-top-width'),0);break;}pos[0]+=p.offsetLeft+((!isNaN(ofst[0]))?ofst[0]:0);pos[1]+=p.offsetTop+((!isNaN(ofst[1]))?ofst[1]:0);p=p.offsetParent;}}if(b=='ie'&&gui.style.get(o,'width')!='auto'&&gui.style.get(o.offsetParent,'width')=='auto'&&gui.style.get(o.offsetParent,'position')=='relative'){p=o.parentNode;while(p.tagName.toLowerCase()!='html'){tmp.x=parseInt(gui.style.get(p,'marginLeft'),0);tmp.y=parseInt(gui.style.get(p,'paddingLeft'),0);if(!isNaN(tmp.x)){pos[0]-=tmp.x;}if(!isNaN(tmp.y)){pos[0]-=tmp.y;}p=p.parentNode;}}return pos;},getX:function(o){return this.getPos(o)[0];},getY:function(o){return this.getPos(o)[1];},setPos:function(o,x,y){if(typeof(o)=='string'){o=$(o);}var b=gui.system.browser.getName();var cp=gui.style.get(o,'position');var offset=[0,0];var delta={x:0,y:0};var tmp=null;if(cp=='static'){gui.style.set(o,'position:relative');cp='relative';}if(o.offsetWidth){if(cp=='relative'){offset=this.getPos(o);tmp={x:gui.style.get(o,'left'),y:gui.style.get(o,'top')};delta.x=(tmp.x&&tmp.x.indexOf('px')!=-1)?parseInt(tmp.x,0):0;delta.y=(tmp.y&&tmp.y.indexOf('px')!=-1)?parseInt(tmp.y,0):0;}else{offset=this.getPos(o.offsetParent);tmp={x:gui.style.get(o,'margin-left'),y:gui.style.get(o,'margin-top')};delta.x=(tmp.x&&tmp.x.indexOf('px')!=-1)?0-parseInt(tmp.x,0):0;delta.y=(tmp.y&&tmp.y.indexOf('px')!=-1)?0-parseInt(tmp.y,0):0;}}if(b=='safari'){if(o.offsetParent&&o.offsetParent.tagName.toLowerCase()=='body'){if(gui.style.get(o,'position')=='relative'){delta.x-=document.body.offsetLeft;delta.y-=document.body.offsetTop;}else if(gui.style.get(o,'position')=='absolute'||gui.style.get(o,'position')=='fixed'){delta.x+=document.body.offsetLeft;delta.y+=document.body.offsetTop;}}}if(x!==null){gui.style.set(o,'left:'+(x-offset[0]+delta.x)+'px');}if(y!==null){gui.style.set(o,'top:'+(y-offset[1]+delta.y)+'px');}},setX:function(o,x){this.setPos(o,x,null);},setY:function(o,y){this.setPos(o,null,y);},moveBy:function(o,x,y){var p=this.getPos(o);var mt=[((x!==null)?parseInt(p[0],0)+x:parseInt(p[0],0)),((y!==null)?parseInt(p[1],0)+y:parseInt(p[1],0))];this.setPos(o,mt[0],mt[1]);},centerOnScreen:function(o,ofst,ctrOn){if(o.constructor==Array){for(var i=0;i<o.length;++i){this.centerOnScreen(o,ofst,ctrOn);}}else{if(typeof(o)=='string'){o=$(o);}ofst=(ofst)?ofst:[0,0];var bd=gui.dim.getBodyDim();var ed=gui.dim.getDim(o);var sp=this.getScrollPos();var x=((bd[0]/2)-(ed[0]/2)+ofst[0])+sp[0];var y=((bd[1]/2)-(ed[1]/2)+ofst[1])+sp[1];switch(ctrOn){case 'x':y=(ofst[1]>0)?sp[1]+ofst[1]:null;break;case 'y':x=(ofst[0]>0)?sp[0]+ofst[0]:null;break;}this.setPos(o,x,y);}},getScrollPos:function(){if(window.scrollX&&window.scrollY){return [window.scrollX,window.scrollY];}else{var d=document.body;var p=d.parentNode;var pl=(p.scrollLeft)?p.scrollLeft:0;var pt=(p.scrollTop)?p.scrollTop:0;return [Math.max(d.scrollLeft,pl),Math.max(d.scrollTop,pt)];}}};gui.style={get:function(o,p){var dv=document.defaultView;if(o){if(o.style[p]){return o.style[p];}else if(o.currentStyle){p=gui.style._getProp(p);if(o.currentStyle[p]){return o.currentStyle[p];}}else if(dv&&dv.getComputedStyle&&dv.getComputedStyle(o,p).getPropertyValue(p)){return dv.getComputedStyle(o,p).getPropertyValue(p);}}return null;},set:function(o,p){var i,r,pair;if(o.constructor==Array){for(i=0;i<o.length;++i){this.set(o[i],p);}}else{if(typeof(p)=='string'){r=/;\s+/;p=p.replace(r,';');p=p.split(';');}for(i=0;i<p.length;++i){r=/:\s+/;p[i]=p[i].replace(r,':');pair=p[i].split(':');pair[0]=this._getProp(pair[0]);switch(pair[0]){case 'opacity':if(gui.system.browser.is('ie')&&typeof(o.style.filter)=='string'){o.style.filter='alpha(opacity='+pair[1]*100+')';if(!o.currentStyle||!o.currentStyle.hasLayout){o.style.zoom=1;}}else{o.style.opacity=pair[1];o.style['-moz-opacity']=pair[1];o.style['-khtml-opacity']=pair[1];}break;case 'zIndex':o.style.zIndex=(pair[1]?pair[1]:1);break;default:o.style[pair[0]]=pair[1];break;}}}},_getProp:function(sp){if(sp.indexOf('-')!=-1){var p=sp.split('-');for(var i=1;i<p.length;++i){p[i]=p[i].toUpperCase().charAt(0)+p[i].substr(1);}sp=p.join('');}return sp;}};gui.system={browser:{getName:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return 'opera';}else if(ua.indexOf('msie')!=-1){return 'ie';}else if(ua.indexOf('safari')!=-1){return 'safari';}else if(ua.indexOf('gecko')!=-1){return 'gecko';}else{return false;}},getVersion:function(){var ua=navigator.userAgent.toLowerCase().split(';');for(var i=0;i<ua.length;++i){if(ua[i].indexOf('opera')!=-1){return parseInt(ua[i].substr(ua[i].indexOf('.')-1,1),0);}else if(ua[i].indexOf('msie')!=-1){return parseInt(ua[i].split(' ')[1],0);}else if(ua[i].indexOf('safari')!=-1){return parseInt(ua[i].substr(ua[i].lastIndexOf('/')+1,3),0);}else if(ua[i].indexOf('firefox')!=-1){return parseInt(ua[i].substr(ua[i].lastIndexOf('/')+1,1),0);}}return false;},is:function(n,v,c){if(this.getName()==n){if(typeof(v)=='number'){if(typeof(c)=='string'){if(c.indexOf('>')!=-1&&this.getVersion()>v){return true;}else if(c.indexOf('<')!=-1&&this.getVersion()<v){return true;}else if(c.indexOf('>=')!=-1&&this.getVersion()>=v){return true;}else if(c.indexOf('<=')!=-1&&this.getVersion()<=v){return true;}}if(this.getVersion()==v){return true;}}else{return true;}}return false;},flash:{base:6,b:[],mimetype:'application/x-shockwave-flash',plugin:'Shockwave Flash',parse:function(b){var bld={};bld.major=(b[0])?parseInt(b[0],0):0;bld.minor=(b[1])?parseInt(b[1],0):0;bld.rev=(b[2])?parseInt(b[2],0):0;return bld;},detect:function(ver){var p,v;var self=gui.system.browser.flash;var mt=navigator.mimeTypes;var b=(typeof(ver)=='undefined')?this.base:ver;if(mt&&mt[this.mimetype]){try{p=mt[this.mimetype].enabledPlugin;v=navigator.plugins[this.plugin].description;v=v.replace(/([a-z]|[A-Z]|\s)+/,'');v=v.replace(/(\s+r|\s+b[0-9]+)/,'.');v=v.split('.');this.b=self.parse(v);return(this.b.major>=b)?this.b:false;}catch(e){}}else{try{p=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');v=p.GetVariable('$version');v=v.split(' ')[1];v=v.split(',');this.b=self.parse(v);return(this.b.major>=b)?this.b:false;}catch(e){}}return false;}}},os:{getName:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('win')!=-1){return 'win';}else if(ua.indexOf('mac')!=-1){return 'mac';}else if(ua.indexOf('linux')!=-1){return 'linux';}else{return false;}},is:function(n,v){return(this.getName()==n)?true:false;}}};gui.xpath={eval:function(r,p){p=(p.indexOf('/')===0)?p.substr(1).split('/'):p.split('/');var tag,c,pos,attr,o;var isAll=/^\*$/;var isAttr=/^.+\[@.+\]$/;var isParent=/^\.\.$/;var isPos=/^.+\[\d+\]$/;var isEval=/^.+\[.+[=].+\]$/;for(var i=0;i<p.length;++i){var num,m;if(isAttr.test(p[i])){tag=this.getTag(p[i]);attr=this.getPredicate(p[i]).substr(1);c=$T(r,tag);if(isEval.test(p[i])){attr=attr.replace(/\s+|"|'/g,'');var pair=attr.split('=');var n=pair[0];var v=pair[1];num=0;m={};for(o=0;o<c.length;++o){if(c[o][n]===v){m[num]=c[o];++num;}}m.length=gui.obj.getLength(m);return(m.length)?m:null;}else{num=0;m={};for(o=0;o<c.length;++o){if(c[o][attr]){m[num]=c[o];++num;}}m.length=gui.obj.getLength(m);return(m.length)?m:null;}}else if(isAll.test(p[i])){return r.childNodes;}else if(isParent.test(p[i])){r=r.parentNode;}else if(isPos.test(p[i])){if(r){var cn=r.childNodes;tag=this.getTag(p[i]);c=[];for(var x=0;x<cn.length;++x){if(cn[x].tagName.toLowerCase()==tag){c.push(cn[x]);}}if(c){r=c[this.getPredicate(p[i])];}}}else{if(r){c=$T(r,p[i]);if(c){r=c[0];}}}}return(r)?r:null;},getTag:function(p){return p.substring(0,p.indexOf('['));},getPredicate:function(p){return p.substring(p.indexOf('[')+1,p.lastIndexOf(']'));},stringValue:function(r,p){var n=this.eval(r,p);if(typeof(n)=='string'){return n;}else{return(n&&n.firstChild)?n.firstChild.nodeValue:null;}},numberValue:function(r,p){var n=this.eval(r,p);if(typeof(n)=='string'){return n;}else{return(n&&n.firstChild)?parseInt(n.firstChild.nodeValue,0):null;}},booleanValue:function(r,p){var n=this.eval(r,p);return(n)?true:false;},node:function(r,p){return this.eval(r,p);}};gui._load=function(){gui.cookie._init();gui.event._init();};gui._unload=function(){gui.event._unload();};gui.event.add(window,'load',gui._load);gui.event.add(window,'unload',gui._unload);gui.namespace('html');gui.namespace('widget');gui.namespace('util');Array.prototype.purdge=function(v){var i,d=[];for(i=0;i<this.length;++i){if(this[i]!==v){d.push(this[i]);}}return d;};Array.prototype.inArray=function(v){for(var i=0;i<this.length;++i){if(this[i]==v){return true;}}return false;};Array.prototype.remove=function(o,l){l=(typeof(l)=='undefined')?this.length:l;var i,d=[];for(i=0;i<this.length;++i){if(i<o||i>=o+l){d.push(this[i]);}}return d;};Array.prototype.sum=function(){var i,s=0;for(i=0;i<this.length;++i){if(!isNaN(this[i])){s+=this[i];}}return s;};function $_(u,x,m,p,h){return new gui.conn.http.asyncRequest(u,x,m,p,h);}function $(){var e=[];var elms;for(var i=0;i<arguments.length;++i){e=arguments[i];if(typeof(e)=='string'){e=document.getElementById(e);}if(arguments.length==1){return e;}elms.push(e);}return e;}function $A(p,c,t){return gui.dom.addChild('append',p,c,t);}function $C(t,a){var elm=document.createElement(t);if(typeof(a)=='object'){for(var n in a){elm[n]=a[n];}}return elm;}function $P(p,c,t){return gui.dom.addChild('prepend',p,c,t);}function $R(elm,r){if(elm.constructor==Array){for(var i=0;i<elm.length;++i){if(!$R(elm[i])){return false;}}return true;}else{var p=elm.parentNode;if(p){if(r){return p.replaceChild((typeof(r)=='string')?$(r):r,elm);}else{return p.removeChild(elm);}}return false;}}function $T(elm,t){return elm.getElementsByTagName(t);}function $V(p,v){if(typeof(v)=='undefined'){if($(p).firstChild.nodeType===1){return $(p).firstChild;}else{return $(p).innerHTML;}}else{return gui.dom.setNodeValue(p,v);}}function $X(d,p,t){switch(t){case 'string':return gui.xpath.stringValue(d,p);case 'int':return gui.xpath.numberValue(d,p);case 'boolean':return gui.xpath.booleanValue(d,p);default:return gui.xpath.node(d,p);}}function $XB(d,p){return gui.xpath.booleanValue(d,p);}function $XN(d,p){return gui.xpath.numberValue(d,p);}function $XS(d,p){return gui.xpath.stringValue(d,p);}

gui.util.flashObj=function(id,movie,h,w,bgColor){this.id=id;this.height=h;this.width=w;this.classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';this.codebase='http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0';this.type='application\/x-shockwave-flash';this.pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash';this.params={loop:'true',menu:'false',movie:movie,quality:'high',bgcolor:((bgColor)?bgColor:'#FFF')};this.setParam=function(param){if(param.constructor==Array){for(var i=0;i<param.length;++i){this.setParam(param[i]);}}else{this.params[param.name]=param.value;}};this.setHTML=function(){var flashHTML='';flashHTML+='<object classid="'+this.classid+'" codebase="'+this.codebase+'" id="'+this.id+'" width="'+this.width+'" height="'+this.height+'">';for(p in this.params){flashHTML+='<param name="'+p+'" value="'+this.params[p]+'">';}flashHTML+='<embed width="'+this.width+'" height="'+this.height+'" type="'+this.type+'" pluginspage="'+this.pluginspage+'"';for(p in this.params){if(p=='movie'){flashHTML+=' src="'+this.params[p]+'"';}else{flashHTML+=' '+p+'="'+this.params[p]+'"';}}flashHTML+='><\/embed>';flashHTML+='<\/object>';return flashHTML;};};

gui.util.simpleFormSubmit=function(name){this.name=name;this.form=document[this.name];this.submit=function(){var field=this.form.elements[0];if(field.value===''){field.blur();}else{this.form.submit();}};};

gui.util.tabMenu=function(tabMenu){var self=this;var i;this.hasDivLines=true;this.tabTagName='li';this.contentTagName='li';this.tabSelClass='sel';this.contentSelClass='sel';this.noBdrClass='noBorder';this.tabElm=(typeof(tabMenu)=='string')?document.getElementById(tabMenu):tabMenu;this.tabs=gui.dom.getElementsByClassName('tabs',tabMenu)[0].getElementsByTagName(this.contentTagName);this.content=gui.dom.getElementsByClassName('content',tabMenu)[0].getElementsByTagName(this.contentTagName);this._init=function(){for(var i=0;i<this.tabs.length;++i){gui.event.add(this.tabs[i],'click',this.handleClick,false);}};this.setTab=function(elm){if(typeof(elm)=='number'){for(var i=0;i<this.tabs.length;++i){if(i===elm){elm=this.tabs[i];break;}}}for(i=0;i<this.tabs.length;++i){if(elm===this.tabs[i]){this.tabs[i].className=this.tabSelClass;this.content[i].className=this.contentSelClass;this.tabs[i].getElementsByTagName('a')[0].focus();this.tabs[i].getElementsByTagName('a')[0].blur();if(i-1>-1){this.tabs[i-1].className=this.noBdrClass;}}else{this.content[i].className='';if(this.hasDivLines&&i===this.tabs.length-1){this.tabs[i].className=this.noBdrClass;}else{this.tabs[i].className='';}}}};this.handleClick=function(e){self.setTab(this);};this._init();};