// x-libraries:
// Copyright 2006-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

// x-core.js
xLibrary={version:'4.17',license:'GNU LGPL',url:'http://cross-browser.com/'};function xCamelize(cssPropStr){var i,c,a=cssPropStr.split('-');var s=a[0];for(i=1;i<a.length;++i){c=a[i].charAt(0);s+=a[i].replace(c,c.toUpperCase());}return s;}function xClientHeight(){var v=0,d=document,w=window;if((!d.compatMode||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||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 xDef(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}return true;}function xGetComputedStyle(e,p,i){if(!(e=xGetElementById(e)))return null;var s,v='undefined',dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(e,'');if(s)v=s.getPropertyValue(p);}else if(e.currentStyle){v=e.currentStyle[xCamelize(p)];}else return null;return i?(parseInt(v)||0):v;}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 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 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 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;}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 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 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 xStr(s){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='string')return false;}return true;}function xStyle(sProp,sVal){var i,e;for(i=2;i<arguments.length;++i){e=xGetElementById(arguments[i]);if(e.style){try{e.style[sProp]=sVal;}catch(err){e.style[sProp]='';}}}}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;}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;}

// xevent.js
function xEvent(evt){var e=evt||window.event;if(!e)return ;this.type=e.type;this.target=e.target||e.srcElement;this.relatedTarget=e.relatedTarget;if(xDef(e.pageX)){this.pageX=e.pageX;this.pageY=e.pageY;}else if(xDef(e.clientX)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop();}if(xDef(e.offsetX)){this.offsetX=e.offsetX;this.offsetY=e.offsetY;}else if(xDef(e.layerX)){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;if( typeof e.type=='string'){if(e.type.indexOf('click')!=-1){this.button=0;}else if(e.type.indexOf('mouse')!=-1){this.button=e.button;}}}

// xanimation.js
function xAnimation(r){this.res=r||10;}xAnimation.prototype.init=function (e,t,or,ot,oe,a,b){var i=this;i.e=xGetElementById(e);i.t=t;i.or=or;i.ot=ot;i.oe=oe;i.a=a||0;i.v=xAnimation.vf[i.a];i.qc=1+(b||0);i.fq=1/i.t;if(i.a){i.fq*=i.qc*Math.PI;if(i.a==1||i.a==2){i.fq/=2;}}else {i.qc=1;}i.xd=i.x2-i.x1;i.yd=i.y2-i.y1;i.zd=i.z2-i.z1;};xAnimation.prototype.run=function (r){var i=this;if(!r)i.t1=new Date().getTime();if(!i.tmr)i.tmr=setInterval(function (){i.et=new Date().getTime()-i.t1;if(i.et<i.t){i.f=i.v(i.et*i.fq);i.x=i.xd*i.f+i.x1;i.y=i.yd*i.f+i.y1;i.z=i.zd*i.f+i.z1;i.or(i);}else {clearInterval(i.tmr);i.tmr=null;if(i.qc%2){i.x=i.x2;i.y=i.y2;i.z=i.z2;}else {i.x=i.x1;i.y=i.y1;i.z=i.z1;}i.ot(i);var rep=false;if( typeof i.oe=='function')rep=i.oe(i);else if( typeof i.oe=='string')rep=eval(i.oe);if(rep)i.resume(1);}},i.res);};xAnimation.vf=[function (r){return r;},function (r){return Math.abs(Math.sin(r));},function (r){return 1-Math.abs(Math.cos(r));},function (r){return (1-Math.cos(r))/2;}];xAnimation.prototype.pause=function (){clearInterval(this.tmr);this.tmr=null;};xAnimation.prototype.resume=function (fs){if( typeof this.tmr!='undefined'&&!this.tmr){this.t1=new Date().getTime();if(!fs){this.t1-=this.et;}this.run(!fs);}};

// xanimation.explode.js
xAnimation.prototype.explode=function (e,h,t,a,ot,oe){var i=this;var b=0;i.y1=xHeight(e);i.x1=xTop(e);i.y2=Math.round(h);i.x2=i.x1+(i.y2-i.y1+2)*-1;i.init(e,t,or,ot,oe,a,b);i.run();function or(i){xTop(i.e,Math.round(i.x));xHeight(i.e,Math.round(i.y));}};

// xanimation.line.js
xAnimation.prototype.line=function (e,x,y,t,a,b,oe){var i=this;i.x1=xLeft(e);i.y1=xTop(e);i.x2=Math.round(x);i.y2=Math.round(y);i.init(e,t,h,h,oe,a,b);i.run();function h(i){i.e.style.left=Math.round(i.x)+'px';i.e.style.top=Math.round(i.y)+'px';}};

// xanimation.opacity.js
xAnimation.prototype.opacity=function (e,o,t,a,b,oe){var i=this;i.x1=xOpacity(e);i.x2=o;i.init(e,t,h,h,oe,a,b);i.run();function h(i){xOpacity(i.e,i.x);}};

// xwindow.js
function xWindow(name,w,h,x,y,loc,men,res,scr,sta,too){var e='',c=',',xf='left=',yf='top=';this.n=name;if(document.layers){xf='screenX=';yf='screenY=';}this.f=(w?'width='+w+c:e)+(h?'height='+h+c:e)+(x>=0?xf+x+c:e)+(y>=0?yf+y+c:e)+'location='+loc+',menubar='+men+',resizable='+res+',scrollbars='+scr+',status='+sta+',toolbar='+too;this.opened=function (){return this.w&&!this.w.closed;};this.close=function (){if(this.opened())this.w.close();};this.focus=function (){if(this.opened())this.w.focus();};this.load=function (sUrl){if(this.opened())this.w.location.href=sUrl;else this.w=window.open(sUrl,this.n,this.f);this.focus();return false;};}

// an_core.marnixkerk.js
an_library={author:'Andries Nieuwenhuize',version:'1.10.00',license:'none',url:'none'};function an_removeChildren(ele){if(an_isExecutable(ele.hasChildNodes,ele.removeChild)){while(ele.hasChildNodes()){ele.removeChild(ele.firstChild);}}else {ele.innerHTML='';}return ;}function an_maxValue(array){for(var i=0;i<array.length;i++){if(i==0)var max=array[i];else if(parseInt(array[i])>parseInt(max))max=array[i];}return max;}function an_maxLength(array){for(var i=0;i<array.length;i++){if(i==0){var max=array[i];}else if(array[i].toString().length>max.toString().length){max=array[i];}}return max;}function an_isExecutable(arg1,arg2,etc){for(i=0;i<arguments.length;i++){var t= typeof (arguments[i]);if(!t=='function'){return false;}}return true;}function an_indexOf(obj,array){var result=-1;for(var i=0;i<array.length;i++){if(array[i]==obj){result=i;break;}}return result;}function an_contains(obj,array){return an_indexOf(obj,array)>=0;}function an_append(obj,array,noDup){if(!(noDup&&an_contains(obj,array)))array[array.length]=obj;}function an_concatArray(array1,array2,etc){var totalArray=[];for(i=0;i<arguments.length;i++){var array=arguments[i];for(ii=0;ii<array.length;ii++){an_append(array[ii],totalArray);}}return totalArray;}function an_reverseString(string){var tmpArray=string.split("");var reversedArray=tmpArray.reverse();return reversedArray.join("");}function an_stringLength(string,lengthValue,amount,fontSize,fontWeight){string=string.toString();var end="..";var chars=['a','à','á','ä','b','c','ç','d','e','è','é','ë','f','g','h','i','ì','í','ï','j','k','l','m','n','ñ','o','ò','ó','ö','p','q','r','s','t','u','ù','ú','ü','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','!','@','#','$','%','^','&','*','(',')','-','_','=','+','`','~','[',']','{','}',';',':','\'','\"','\\','|',',','<','.','>','/','?','€',' '];var pxValue=[350,350,350,350,400,350,350,400,350,350,350,350,200,350,350,150,150,150,150,200,400,150,550,350,350,400,400,400,400,400,400,250,300,200,350,350,350,350,350,550,350,350,300,550,500,550,550,450,450,550,550,250,300,600,450,700,600,600,450,600,500,450,450,550,550,750,550,550,450,400,400,400,400,400,400,400,400,400,400,250,750,400,400,650,400,600,400,250,250,300,400,450,450,250,450,250,250,350,350,200,150,150,250,100,150,200,450,200,450,200,350,400,16];var emValue=[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9,10.0];var emPxValue=[0,100,100,200,250,350,400,450,450,550,550,700,700,800,800,900,1000,1000,1100,1150,1150,1300,1350,1450,1450,1550,1650,1600,1700,1700,1850,1850,2000,2000,2050,2150,2150,2350,2350,2450,2450,2600,2600,2600,2700,2750,2850,2850,2900,3000,3050,3150,3150,3350,3350,3350,3450,3500,3600,3650,3750,3800,3800,3900,3900,4000,4050,4050,4150,4150,4350,4350,4450,4450,4500,4600,4650,4750,4800,4900,4900,5050,5050,5050,5150,5150,5300,5350,5450,5500,5500,5600,5600,5750,5800,5800,5900,5950,5060,5060,5160];var charValue=[chars.length];for(var i=0;i<chars.length;i++){charValue[i]=1;}var fwValues=["600"];if(fontSize){var correction=1;fontSize=Math.round(fontSize*10)/10;if(an_contains(fontSize,emValue)){correction=emPxValue[an_indexOf(fontSize,emValue)]/pxValue[an_indexOf("m",chars)];}else {correction=fontSize;}for(var i=0;i<pxValue.length;i++){pxValue[i]*=correction;}for(var i=0;i<fwValues.length;i++){fwValues[i]*=correction;}}if(fontWeight){var correction=1;if(fontWeight=="bold"){correction=fwValues[0]/pxValue[an_indexOf("m",chars)];}for(var i=0;i<pxValue.length;i++){pxValue[i]*=correction;}}var values=[];var reference;var defaultValue;if(lengthValue=='char'){values=charValue;ref=1;defaultValue=1;maxValue=amount;}else if(lengthValue=='em'){values=pxValue;ref=values[an_indexOf("m",chars)];defaultValue=an_indexOf("m",chars);maxValue=amount;}else if(lengthValue=='px'){values=pxValue;ref=50;defaultValue=values[an_indexOf("m",chars)]/ref;maxValue=amount;}else {return string;}var sourceString=string.split("");if(string&&lengthValue&&amount){var endValue=(values[an_indexOf(".",chars)]*2)/ref;truncatedString="";truncValue=0;if(amount<endValue){return "";}for(var i=0;i<sourceString.length;i++){if(an_contains(sourceString[i],chars)){truncValue+=(values[an_indexOf(sourceString[i],chars)])/ref;}else {truncValue+=defaultValue;}truncatedString+=sourceString[i];if(truncValue>maxValue){if(truncValue<=maxValue-endValue){truncatedString+=end;return truncatedString;}else {while(truncValue+endValue>maxValue){var lastChar=truncatedString.substr(truncatedString.length-1,1);truncValue-=values[an_indexOf(lastChar,chars)]/ref;truncatedString=truncatedString.substr(0,truncatedString.length-1);}truncatedString+=end;return truncatedString;}}}return truncatedString;}else if(string&&lengthValue){var totalLength=0;for(var i=0;i<sourceString.length;i++){totalLength+=(values[an_indexOf(sourceString[i],chars)])/ref;}return totalLength;}}function an_removeElement(element){if(element){if(element.parentNode){var p=element.parentNode;}else if(element.parentElement){var p=element.parentElement;}if(p&&p.removeChild){p.removeChild(element);}}}function an_nodeValue(xmlTag){if(xmlTag.firstChild.textContent&&xmlTag.normalize){xmlTag.normalize(xmlTag.firstChild);content=xmlTag.firstChild.textContent;}else if(xmlTag.firstChild.nodeValue){content=xmlTag.firstChild.nodeValue;}else {content=null;}return content;}function an_showArray(array,divId){var eol=(divId)?"<br />":"\n";var content="Dump of array: "+eol;for(var i in array){content+="["+i+"] "+array[i]+eol;}if(divId){var target=xGetElementById(divId);var txt=document.createTextNode(content);target.innerHTML=content;}else {alert(content);}}function an_addScrollEventToNonscrolledElement(ele,fun){if( typeof (ele.onmousewheel)!='undefined'){ele.onmousewheel=fun;}else if( typeof (ele.addEventListener)!='undefined'){ele.addEventListener("DOMMouseScroll",fun,false);}}

// an_Loader.js
var an_smartLoader=function (){this.index=0;this.urls=[];this.types=[];this.IDs=[];this.loadIndex=0;this.messages=[];this.onload=false;this.date=new Date();};an_smartLoader.prototype={setUrl:function (url,type,loadID){if(an_contains(url,this.urls)){var msg="List already contains "+url;an_append(msg,this.messages);}else {this.urls[this.index]=url;this.types[this.index]=type;this.IDs[this.index]=loadID;this.index++;}},setCallback:function (callback){this.onload=callback;},setOnload:function (onload){this.onload=onload;},loadList:function (){if(this.loadIndex<this.index){this.loadUrls();}else {if(this.onload){this.onload();}}},loadUrls:function (){this.loadingStartTime=this.date.getTime();var url=this.urls[this.loadIndex];var type=this.types[this.loadIndex].toLowerCase();if(document.createElement&&document.getElementsByTagName){h=document.getElementsByTagName('head');if(h.length&&h[0].appendChild){s=document.createElement(type);if(s){ switch (type){ case 'script':s.type='text/javascript';s.src=url;break; case 'link':s.rel='stylesheet';s.type='text/css';s.href=url;break;}h[0].appendChild(s);if(type=='link'){this.logStyleLoad();}}}}},verifyID:function (loadID){if(this.IDs[this.loadIndex]==loadID){var loadingTime=this.loadingStartTime-this.date.getTime();var msg="\n"+this.urls[this.loadIndex]+" loaded in "+loadingTime+" ms";an_append(msg,this.messages);this.loadOn();}},logStyleLoad:function (){var msg="\n"+this.urls[this.loadIndex]+" loaded.";an_append(msg,this.messages);this.loadOn();},loadOn:function (){this.loadIndex++;this.loadList();},getMessages:function (){return this.messages;},getLoadedUrls:function (){var loadedUrls=[];for(var i=0;i<this.loadIndex;i++){loadedUrls[i]=this.urls[i];}return loadedUrls;}}

// an-widgets.js
var an_Button=function (id,value,width){this.id=id;this.value=false;this.width=width;this.onclick=false;this.enabled=false;this.button=document.createElement('div');var bs=this.button.style;this.button.p=this;if(this.id){this.button.id=this.id;}if(value){this.setValue(value);}if(this.width){bs.width=this.width+'px';}this.button.className='widget_Button';this.button.onmouseover=function (){if(this.p.enabled){this.className='widget_Button_highlight';}};this.button.onmouseout=function (){if(this.p.enabled){this.className='widget_Button_active';}};this.button.onclick=function (){if(this.p.onclick&&this.p.enabled){this.p.onclick();}}};an_Button.prototype={setOnclick:function (handler){this.onclick=handler;},setValue:function (value){this.value=value;if(this.value.nodeType!=1&&this.value.nodeType!=3){var v=document.createTextNode(this.value);}else {var v=this.value;}this.button.innerHTML="";this.button.appendChild(v);},setEnabled:function (bool){this.enabled=bool;if(bool){this.button.className='widget_Button_active';}else {this.button.className='widget_Button';}},getView:function (){return this.button;}};var an_SelectAndEditOption=function (width,editable){this.buttonWidth=20;this.width=(width>20)?width:40;this.widthDiv=8;this.editable=editable;this.container=document.createElement('table');this.dropDownList=document.createElement('div');this.button=false;this.values=false;this.hiddenValues=false;this.expanded=false;this.selectedValue='';this.hiddenValue=false;this.onselect=false;this.panel=(this.editable)?this.setInput():this.setDiv();this.init();};an_SelectAndEditOption.prototype={init:function (){this.container.className='SelectAndEditOption_table';var arrow=document.createElement('span');arrow.appendChild(document.createTextNode('v'));arrow.className='arrowStyle';this.button=new an_Button(false,false,this.buttonWidth);this.changeArrow(true);var tb=document.createElement('tbody');var tr=document.createElement('tr');var td_1=document.createElement('td');var td_2=document.createElement('td');td_1.appendChild(this.panel);td_2.appendChild(this.button.getView());tr.appendChild(td_1);tr.appendChild(td_2);tb.appendChild(tr);this.container.appendChild(tb);this.dropDownList.className='SelectAndEditOption_dropDownListCol';var tr=document.createElement('tr');var td=document.createElement('td');td.colSpan=2;td.appendChild(this.dropDownList);tr.appendChild(td);tb.appendChild(tr);this.button.onclick=function (){this.button.pa.expandList();};this.button.getView().pa=this;},setInput:function (){var a=document.createElement('input');a.setAttribute('size',this.width/this.widthDiv);a.p=this;a.onchange=function (){this.p.selectedValue=this.value;};return a;},setDiv:function (){var a=document.createElement('div');var as=a.style;as.width=this.width+'px';a.className='SelectAndEditOption_panel';return a;},getView:function (){return this.container;},setOnselect:function (f){this.onselect=f;},expandList:function (){if(this.values&&!this.expanded){var l=this.values.length;for(var i=0;i<l;i++){var txt=document.createTextNode(this.values[i]);var div=document.createElement('div');div.appendChild(txt);div.value=this.values[i];div.className='SelectAndEditOption_listDiv';if(this.editable){div.style.width=this.width*0.8+'px';}else {div.style.width=this.width+'px';}div.p=this;div.index=i;div.onclick=function (){this.p.setValue(this.value,this.index);};this.dropDownList.appendChild(div);this.changeArrow(false);}if(l>10){this.dropDownList.className='SelectAndEditOption_dropDownListExpTrunc';}else {this.dropDownList.className='SelectAndEditOption_dropDownListExp';}this.expanded=true;}else if(this.expanded){this.collapseList();}},changeArrow:function (down){var arrow=document.createElement('span');var symbol=(down)?'v':'^';arrow.appendChild(document.createTextNode(symbol));arrow.className='arrowStyle';this.button.setValue(arrow);},collapseList:function (){this.dropDownList.innerHTML="";this.dropDownList.className='SelectAndEditOption_dropDownListCol';this.expanded=false;this.changeArrow(true);},getSelectedValue:function (){return this.selectedValue;},getHiddenValue:function (){return this.hiddenValue;},setValue:function (value,index){this.selectedValue=value;this.hiddenValue=(index>=0&&this.hiddenValues)?this.hiddenValues[index]:false;this.collapseList();if(this.editable){this.panel.value=this.selectedValue;}else {this.panel.innerHTML=this.selectedValue;}if(this.onselect&&value.length>0){this.onselect();}},setValues:function (values,hiddenValues){this.values=values;this.hiddenValues=hiddenValues;this.button.setEnabled(true);this.setValue("");}};var an_TabbedPane=function (height){this.height=(height)?height:false;this.headerOffset=35;this.panelNames=[];this.panelData=[];this.callBacks=[];this.view=document.createElement('div');this.headerDiv=document.createElement('div');this.bodyDiv=document.createElement('div');this.tabs=[];this.tabIDs=[];this.selectedTabID=false;};an_TabbedPane.prototype={init:function (){var table=document.createElement('table');table.className='tabMasterTable';var tbod=document.createElement('tbody');table.appendChild(tbod);var tr=document.createElement('tr');var td=document.createElement('td');tbod.appendChild(tr);tr.appendChild(td);td.appendChild(this.headerDiv);var tr=document.createElement('tr');var td=document.createElement('td');tbod.appendChild(tr);tr.appendChild(td);td.appendChild(this.bodyDiv);this.bodyDiv.className='tabbedPane_bodyDiv';if(this.height){this.bodyDiv.style.height=this.height-this.headerOffset+'px';}this.view.appendChild(table);this.setHeader();},setHeader:function (){this.headerDiv.innerHTML="";var table=document.createElement('table');table.className='tabsHeaderTable';var tbod=document.createElement('tbody');table.appendChild(tbod);var tr=document.createElement('tr');tbod.appendChild(tr);for(var i=0;i<this.panelNames.length;i++){var td=document.createElement('td');td.className='tabsSpacer';td.innerHTML="&nbsp;";tr.appendChild(td);var td=document.createElement('td');this.tabs[i]=td;td.className='tabOff';td.appendChild(document.createTextNode(this.panelNames[i]));td.obj=this;td.index=i;td.onclick=this.switchTab;tr.appendChild(td);}var td=document.createElement('td');td.className='tabEnd';td.innerHTML="&nbsp;";tr.appendChild(td);this.headerDiv.appendChild(table);if(this.panelNames.length>0){this.loadPage(0);}},switchTab:function (){var obj=eval(this.obj);obj.loadPage(this.index);obj.callBacks[this.index].call();},setTab:function (id,name,data){var index=this.tabIDs.length;this.tabIDs[index]=id;this.panelNames[index]=name;this.panelData[index]=data;this.callBacks[index]=this.foo;},addData:function (id,name,data){var index=false;for(var i=0;i<this.tabIDs.length;i++){if(this.tabIDs[i]==id){this.panelNames[i]=name||this.panelNames[i];this.panelData[i]=data||this.panelData[i];break;}}this.setHeader();},loadPage:function (index){for(var i=0;i<this.tabs.length;i++){if(i==index){this.tabs[i].className='tabOn';}else {this.tabs[i].className='tabOff';}}this.selectedTabID=this.tabIDs[index];var value=this.panelData[index];if(this.bodyDiv.hasChildNodes()){this.bodyDiv.removeChild(this.bodyDiv.firstChild);}this.bodyDiv.innerHTML="";if(value.nodeType!=1&&value.nodeType!=3){this.bodyDiv.innerHTML=value;}else {this.bodyDiv.appendChild(value);}},setCallback:function (id,callbackFunction){for(var i=0;i<this.tabIDs.length;i++){if(this.tabIDs[i]==id){this.callBacks[i]=callbackFunction;break;}}},foo:function (){},getView:function (){this.init();return this.view;},getSelectedTabID:function (){return this.selectedTabID;}};
