
var JSLIB=window.JSLIB||{};JSLIB.namespace=function(name){var names=name.split("."),o=JSLIB,i;if(names[0]!="JSLIB"){return;}
for(i=1;i<names.length;i++){if(typeof o[names[i]]=="undefined"){o[names[i]]={};}
o=o[names[i]];}}
JSLIB.callParentConstructor=function(parent,obj){if(arguments.length>2){parent.apply(obj,Array.prototype.slice.call(arguments,2));}
else{parent.call(obj);}}
JSLIB.inherits=function(parent,child){child.prototype=new parent();child.prototype.constructor=child;}
JSLIB.namespace("JSLIB.simpleObject");JSLIB.simpleObj=function(){}
JSLIB.simpleObj.prototype.constructor=JSLIB.simpleObj;JSLIB.object=function(){JSLIB.callParentConstructor(JSLIB.simpleObj,this);this.properties={};}
JSLIB.inherits(JSLIB.simpleObj,JSLIB.object);JSLIB.object.prototype.getProperty=function(name){return this.properties[name];}
JSLIB.object.prototype.setProperty=function(name,value){this.properties[name]=value;}
JSLIB.namespace("JSLIB.browser");function JSLibGetBrowser(){var o={"browser":"","version":"","os":"","gecko":false,"geckoVersion":0,"dom1":false},agt=navigator.userAgent.toLowerCase();if(agt.indexOf("opera")!=-1){o.browser="opera";/opera( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2}
else if(agt.indexOf("konqueror")!=-1){o.browser="konqueror";/konqueror( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2;}
else if(agt.indexOf("safari")!=-1){o.browser="safari";/safari( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2;}
else{o.gecko=agt.indexOf('gecko')!=-1;o.geckoVersion=agt.indexOf('gecko');if(o.geckoVersion>0)o.geckoVersion=parseInt(agt.substr(o.geckoVersion+6,8));if(agt.indexOf("msie")!=-1){o.browser="msie";/msie( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2;}
else if(agt.indexOf("netscape")!=-1){o.browser="netscape";/netscape( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2;}
else if(agt.indexOf("firefox")!=-1){o.browser="firefox";/firefox( |\/)([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$2;}
else if(agt.indexOf("mozilla")!=-1){o.browser="mozilla";/rv:([0-9]+\.[0-9])/.exec(agt);o.version=RegExp.$1;}
else{o.browser="other";}}
if(agt.indexOf("win")>=0){if((agt.indexOf("win16")!=-1)||(agt.indexOf("16bit")!=-1)||(agt.indexOf("windows 3.1")!=-1)||(agt.indexOf("windows 16-bit")!=-1)){o.os="win16";}
else{o.os="win32";}}
else if(agt.indexOf("linux")>=0){o.os="linux";}
else{o.os="other";}
o.dom1=((document.getElementById)?true:false);return o;}
JSLIB.browser=JSLibGetBrowser();JSLIB.namespace("JSLIB.util");JSLIB.util={lTrim:function(str){var s=new String(str);return s.replace(/^\s*/,"");},rTrim:function(str){var s=new String(str);return s.replace(/\s*$/,"");},trim:function(str){return this.lTrim(this.rTrim(str));},dirName:function(str){var m=new String(str),arr=m.match(/(.*)\/([^\/]*)$/);return(arr==null||typeof(arr)=="undefined"||typeof(arr[1])=="undefined")?".":arr[1];},baseName:function(str){var m=new String(str),arr=m.match(/(.*)\/([^\/]*)$/);return(arr==null||typeof(arr)=="undefined"||typeof(arr[2])=="undefined")?"":arr[2];},absUrl:function(str,win){var loc,re;str=new String(str);if(typeof(win)=="undefined"||!win||!win.location){win=window;}
loc=win.location;re=/^(http|https|ftp):\/\//i;if(re.test(str)){return str;}
else{if(str.charAt(0)=="/"){return
loc.protocol+"//"
+loc.hostname
+(loc.protocol!="http:"&&loc.port!=80?":"+loc.port:"")
+str;}
else{return loc.href.substr(0,loc.href.lastIndexOf("/"))+"/"+str;}}},htmlSpecialChars:function(str,flag){var m=new String(str),re;if(typeof(flag)=="undefined"){flag=0;}
m=m.replace(/&/g,"&amp;");if(flag!=1){m=m.replace(/\"/g,"&quot;");}
if(flag==2){m=m.replace(/\'/g,"&#039;");}
m=m.replace(/</g,"&lt;");m=m.replace(/>/g,"&gt;");re=new RegExp(String.fromCharCode(160),"g")
m=m.replace(re,"&nbsp;");return m;},plainTextToHtml:function(str){var m=this.htmlSpecialChars(str);m=m.replace(/\r\n/g,"<br />");m=m.replace(/\n/g,"<br />");m=m.replace(/\r/g,"<br />");m=m.replace(/  /g," &nbsp;");m=m.replace(/\t/g," &nbsp; &nbsp;");return m;},addSlashes:function(str){var m=new String(str);m=m.replace(/\"/g,"\\\"");m=m.replace(/\'/g,"\\\'");m=m.replace(/\t/g,"\\t");m=m.replace(/\r/g,"\\r");m=m.replace(/\n/g,"\\n");return m;},isHtml:function(str){var m=new String(str),re;re=/<(p|h1|h2|h3|h4|h5|h6|table|td|tr|ul|ol|li|b|i|u|strong|em|strike|super|sup|big|small|body|html|br|hr|font|blockquote|pre|tt|script|object|embed)/i;if(re.test(m)){return true;}
re=/(&[a-zA-Z]{2,5};|&#[0-9]{1,5};)/i;return(re.test(m))?true:false;},getArrayIndexByValue:function(a,v){if(this.isArray(a)){for(var i=0;i<a.length;i++){if(a[i]==v){return i;}}}
return-1;},inArray:function(v,a){var r=false;for(var i=0;i<a.length;i++){if(v==a[i]){r=true;break;}}
return r;},mergeArray:function(a,b){var i,j;o:for(j=0;j<b.length;j++){for(i=0;i<a.length;i++){if(a[i]==b[j]){continue o;}}
a.push(b[j]);}
return a;},isArray:function(a){return this.isObject(a)&&a.constructor==Array;},isBoolean:function(a){return typeof a=='boolean';},isEmpty:function(a){if(!this.isString(a)){return true;}
return a.length==0;},isEmptyObj:function(o){var i,v;if(this.isObject(o)){for(i in o){v=o[i];if(v!==undefined&&!this.isFunction(v)){return false;}}}
return true;},isFunction:function(a){return typeof a=='function';},isNull:function(a){return a===null;},isNumber:function(a){return typeof a=='number'&&isFinite(a);},isObject:function(a){return(a&&typeof a=='object')||this.isFunction(a);},isString:function(a){return typeof a=='string';},objToString:function(a){var str,key;if(this.isObject(a)){str="";for(key in a){if(str.length>0){str+=", ";}
if(!this.isFunction(a[key])){str+=key+":"+a[key];}
else{str+=key+":FUNCTION";}}
return"{"+str+"}";}
else{return a;}},cloneObj:function(obj){var o,prop;if(typeof(obj)!='object'){return null;}
if(obj.constructor==Array){o=obj.concat();}
else{o={};for(prop in obj){o[prop]=typeof(obj[prop])=='object'?this.cloneObj(obj[prop]):obj[prop];}}
return o;},mysqlDateToJsDate:function(str){var re=/^([0-9]{4})\-([0-9]{2})\-([0-9]{2})[ ]+([0-9]{2}):([0-9]{2}):([0-9]{2})$/,m;m=str.match(re);return m?new Date(m[1],m[2]-1,m[3],m[4],m[5],m[6]):null;},number2hex:function(num){var a=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'],r="",n=num,i;for(i=0;i<4;i++){r=a[(n>>4)&15]+a[n&15]+r;n=n>>8;}
return r;},getHash:function(s){var ms="libmagicstr",hash1,hash2,i,s1=ms+s+ms,s2=ms+s+ms;hash2=hash1=1315423911;for(i=0;i<s1.length;i++){hash1^=(hash1<<5)+s1.charCodeAt(i)+(hash1>>2);}
for(i=s2.length-1;i>=0;i--){hash2^=(hash2<<5)+s2.charCodeAt(i)+(hash2>>2);}
return this.number2hex(hash1)+this.number2hex(hash2);},wordwrap:function(pStr,pWidth,pBreak,pCut){var out="",tmp=new String(pStr);do{if(out.length>0){out+=pBreak;}
if(tmp.length>pWidth){out+=tmp.substring(0,pWidth);tmp=tmp.substring(pWidth);}
else{out+=tmp;tmp="";}}while(tmp.length>0);return out;}};JSLIB.namespace("JSLIB.dom");JS$$=function(selector,anchor){var idCheck=/^#([\w\d\-\_]+)$/,classCheck=/^(\w*)\.([\w\-]+)$/,tagCheck=/^([A-Za-z_]{1}\w*)$/,attrCheck=/^(\w*)\[([\w]+)(\=|\^\=|\$\=|\*\=)([\w\_\-]+)\]$/,parts=selector.split(" "),item,matches,tmp,nodes=null,newNodes,i,j,P=JSLIB,D=document,e,A=typeof anchor=="undefined"||!anchor?D:anchor;if(A.querySelectorAll){try{return A.querySelectorAll(selector);}
catch(e){return[];}}
for(i=0;i<parts.length;i++){item=parts[i];if(item.length>0){matches=item.match(idCheck);if(matches){if(!anchor&&i==0){tmp=D.getElementById(parts[i].replace(/^#/,""));if(tmp){nodes=[tmp];}}}
else{if(i==0){nodes=[A];}
newNodes=[];matches=item.match(classCheck);if(matches){for(j=0;j<nodes.length;j++){tmp=P.dom.getElementsByClassName(matches[2],matches[1],nodes[j]);if(tmp){newNodes=P.util.mergeArray(newNodes,tmp);}}
nodes=newNodes;}
else{matches=item.match(tagCheck);if(matches){for(j=0;j<nodes.length;j++){tmp=nodes[j].getElementsByTagName(matches[1]);if(tmp){newNodes=P.util.mergeArray(newNodes,tmp);}}
nodes=newNodes;}
else{matches=item.match(attrCheck);if(matches){for(j=0;j<nodes.length;j++){tmp=P.dom.getElementsByAttribute(matches[2],matches[3],matches[4],matches[1],nodes[j]);if(tmp){newNodes=P.util.mergeArray(newNodes,tmp);}}
nodes=newNodes;}
else{return[];}}}}}
if(!nodes){return[];}
if(nodes.length==0){return[];}}
return nodes;};JSLIB.attr=function(dom_obj,attr_name,attr_value){var UD="undefined",i;if(typeof attr_value==UD){if(attr_name=="selectedIndex"){return dom_obj.selectedIndex;}
else if(attr_name=="textContent"||attr_name=="innerText"){return dom_obj.innerText||dom_obj.textContent;}
else if(typeof dom_obj[attr_name]!=UD){return dom_obj[attr_name];}
else if(typeof(dom_obj.getAttribute)!=UD){return dom_obj.getAttribute(attr_name);}}
else{if(attr_name=="style"&&typeof(attr_value)=="object"){for(i in attr_value){JSLIB.dom.setStyle(dom_obj,i,attr_value[i]);}}
else if(attr_name=="textContent"||attr_name=="innerText"){if(typeof dom_obj.textContent!="undefined"){dom_obj.textContent=attr_value;}
else if(typeof dom_obj.innerText!="undefined"){dom_obj.innerText=attr_value;}}
else if(attr_name=="innerFBML"){var div=document.createElement("DIV"),node;div.innerHTML=attr_value;while(div.firstChild){node=div.firstChild;div.removeChild(div.firstChild);dom_obj.appendChild(node);}}
else if(attr_name=="selectedIndex"){dom_obj.selectedIndex=attr_value;}
else if(attr_name=="src"){dom_obj.src=attr_value;}
else if(typeof dom_obj.setAttribute!=UD&&attr_name!="checked"&&typeof dom_obj[attr_name]!="string"){dom_obj.setAttribute(attr_name,attr_value);}
else if(typeof dom_obj[attr_name]!=UD){dom_obj[attr_name]=attr_value;}}
return false;};JSLIB.dom=function(){var
ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isIE=(window.ActiveXObject),id_counter=0,util=JSLIB.util;return{get:function(em){var o,arr,i,D=document,N=null,UD="undefined";if(!em){return N;}
if(JSLIB.util.isString(em)){return D.all?D.all[em]:D.getElementById(em);}
else if(JSLIB.util.isArray(em)||(typeof em.tagName==UD&&typeof em.document==UD&&typeof em.item!=UD&&typeof em.length!=UD)){arr=[];for(i=0;i<em.length;i++){o=JS$(em[i]);if(o){arr.push(o);}}
return arr;}
else{return em;}
return N;},getElementsBy:function(testfunc,tag,root){var result=[],elements,i;if(tag&&root&&root.getElementsByTagName){elements=root.getElementsByTagName(tag);}
else if(tag){elements=document.getElementsByTagName(tag);}
else{elements=document.getElementsByTagName("*");}
for(i=0;i<elements.length;i++){if(testfunc(elements[i])){result[result.length]=elements[i];}}
return result;},getElementsByClassName:function(className,tag,root){if(document.getElementsByClassName&&!tag){return root?root.getElementsByClassName(className):document.getElementsByClassName(className);}
else{var re=new RegExp("(^|\\s)"+className+"(\\s|$)"),tag=tag||"*",elm=root||document,elms=(tag=="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),ret=[],o,len=elms.length,i;for(i=0;i<len;i++){o=elms[i];if(re.test(o.className)){ret.push(o);}}
return ret;}},getElementsByAttribute:function(attrname,op,attrvalue,tag,root){var tag=tag||"*",elm=root||document,elms=(tag=="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),ret=[],o,i,opfunc;switch(op){case"=":opfunc=function(val1,val2){return val1==val2};break;case"^=":opfunc=function(val1,val2){var re=new RegExp("^"+val1);return re.test(val2)};break;case"$=":opfunc=function(val1,val2){var re=new RegExp(val1+"$");return re.test(val2)};break;case"*=":opfunc=function(val1,val2){var re=new RegExp(val1);return re.test(val2)};break;default:return ret;}
for(i=0;i<elms.length;i++){o=elms[i];if(opfunc(attrvalue,JSLIB.attr(o,attrname))){ret.push(o);}}
return ret;},getAncestor:function(className,tagName,child){var node=JS$(child);node=node.parentNode;while(node){var nodeTagName=new String(node.tagName);if(className&&JSLIB.dom.hasClass(node,className)&&tagName==nodeTagName.toLowerCase()||!className&&tagName==nodeTagName.toLowerCase()){return node;}
node=node.parentNode;}
return node;},getStyle:function(elem,property){var obj=this.get(elem);if(!obj){return null;}
return obj.style[property];},getComputedStyle:function(elem,property){var dv=document.defaultView,obj=this.get(elem),value,computed;if(!obj){return null;}
if(isIE&&obj.currentStyle&&obj.currentStyle[property]){value=obj.currentStyle[property];}
else if(dv&&dv.getComputedStyle){computed=dv.getComputedStyle(obj,'');if(computed&&computed[property]){value=computed[property];}}
else if(obj.style[property]){value=obj.style[property];}
return value;},setStyle:function(elem,property,val){var o=JS$(elem),objS,i;if(JSLIB.util.isArray(o)){for(i=0;i<o.length;i++){this.setStyle(o[i],property,val);}}
else if(JSLIB.util.isObject(property)){for(i in property){this.setStyle(elem,i,property[i]);}}
else{objS=o.style;switch(property){case'opacity':if(typeof objS.filter!="undefined"&&typeof objS.opacity=="undefined"){if(JSLIB.util.isNull(val)||val==1){objS.filter="";}
else{objS.filter='alpha(opacity='+val*100+')';if(!o.currentStyle||!o.currentStyle.hasLayout){objS.zoom=1;}}}
else{objS.opacity=val;objS['-moz-opacity']=val;objS['-khtml-opacity']=val;}
break;default:objS[property]=val;break;}}},getXY:function(elem){var elm=this.get(elem),mOL,mOT,mOP;if(!elm){return null;}
mOL=elm.offsetLeft;mOT=elm.offsetTop;mOP=elm.offsetParent;while(mOP){mOL+=mOP.offsetLeft
mOT+=mOP.offsetTop;mOP=mOP.offsetParent}
return[mOL,mOT];},getX:function(el){return this.getXY(el)[0];},getY:function(el){return this.getXY(el)[1];},setXY:function(elem,pos){var elm=this.get(elem);if(!elm){return null;}
if(!util.isNull(pos[0])){this.setStyle(elm,"left",pos[0]+"px");}
if(!util.isNull(pos[1])){this.setStyle(elm,"top",pos[1]+"px");}},setX:function(el,x){this.setXY(el,[x,null]);},setY:function(el,y){this.setXY(el,[null,y]);},hasClass:function(elem,className){var obj=JS$(elem),re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)'),result=false;if(JSLIB.util.isArray(obj)){for(i in obj){result=result||this.hasClass(obj[i],className);}
return result;}
else if(!obj){return false;}
return re.test(JSLIB.attr(obj,'className'));},addClass:function(em,className){var obj=JS$(em),cls,i;if(JSLIB.util.isArray(obj)){for(i in obj){this.addClass(obj[i],className);}}
else{if(!obj||this.hasClass(em,className)){return;}
cls=""+JSLIB.attr(obj,"className");JSLIB.attr(obj,"className",(cls.length>0)?cls+" "+className:className);}},removeClass:function(em,className){var o=JS$(em),reg=new RegExp('(\\s|^)'+className+'(\\s|$)'),i;if(JSLIB.util.isArray(o)){for(i in o){this.removeClass(o[i],className);}}
else{if(this.hasClass(em,className)){JSLIB.attr(o,"className",JSLIB.util.trim(JSLIB.attr(o,"className").replace(reg,' ')));}}},toggleClass:function(em,className){if(JSLIB.dom.hasClass(em,className)){JSLIB.dom.removeClass(em,className);}else{JSLIB.dom.addClass(em,className);}},replaceClass:function(em,oldClassName,newClassName){this.removeClass(em,oldClassName);this.addClass(em,newClassName);},generateId:function(elem,prefix){prefix=prefix||'JSLIB-gen-';var obj=this.get(elem);if(obj){if(!obj.id){obj.id=prefix+this.id_counter;this.id_counter++;}
return obj.id}
return null;},isAncestor:function(haystack,needle){haystack=this.get(haystack);needle=this.get(needle);if(!haystack||!needle){return false;}
if(this.isIE&&haystack.contains){return haystack.contains(needle);}
else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}
parent=parent.parentNode;}
return false;}},inDocument:function(elem){return this.isAncestor(document.documentElement,elem);},getDocumentHeight:function(){var D=document,scrollHeight=-1,windowHeight=-1,bodyHeight=-1,mode=D.compatMode,marginTop=parseInt(JSLIB.dom.getStyle(D.body,'marginTop'),10),marginBottom,h;if(isNaN(marginTop)){marginTop=0;}
marginBottom=parseInt(JSLIB.dom.getStyle(D.body,'marginBottom'),10);if(isNaN(marginBottom)){marginBottom=0;}
if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':scrollHeight=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[D.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return(a-b);})[1];bodyHeight=D.body.offsetHeight+marginTop+marginBottom;break;default:scrollHeight=D.body.scrollHeight;bodyHeight=D.body.clientHeight;}}
else{scrollHeight=D.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=D.documentElement.clientHeight;}
h=[scrollHeight,windowHeight,bodyHeight].sort(function(a,b){return(a-b);});return h[2];},getDocumentWidth:function(){var D=document,docWidth=-1,bodyWidth=-1,winWidth=-1,mode=D.compatMode,marginRight=parseInt(JSLIB.dom.getStyle(D.body,'marginRight'),10),marginLeft,w;if(isNaN(marginRight)){marginRight=0;}
marginLeft=parseInt(JSLIB.dom.getStyle(D.body,'marginLeft'),10);if(isNaN(marginLeft)){marginLeft=0;}
if(mode||isIE){switch(mode){case'CSS1Compat':docWidth=D.documentElement.clientWidth;bodyWidth=D.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth||-1;break;default:bodyWidth=D.body.clientWidth;winWidth=D.body.scrollWidth;break;}}
else{docWidth=D.documentElement.clientWidth;bodyWidth=D.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth;}
w=[docWidth,bodyWidth,winWidth].sort(function(a,b){return(a-b);});return w[2];},getViewportHeight:function(){var height=-1,mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':height=document.documentElement.clientHeight;break;default:height=document.body.clientHeight;}}
else{height=self.innerHeight;}
return height;},getViewportWidth:function(){var width=-1,mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':width=document.documentElement.clientWidth;break;default:width=document.body.clientWidth;}}
else{width=self.innerWidth;}
return width;},getScrollXY:function(){var sx=0,sy=0,D=document,W=window;if(typeof(W.pageYOffset)=='number'){sy=W.pageYOffset;sx=W.pageXOffset;}
else if(D.body&&(D.body.scrollLeft||D.body.scrollTop)){sy=D.body.scrollTop;sx=D.body.scrollLeft;}
else if(D.documentElement&&(D.documentElement.scrollLeft||D.documentElement.scrollTop)){sy=D.documentElement.scrollTop;sx=D.documentElement.scrollLeft;}
return[sx,sy];},createInvisibleDiv:function(id){var em;if(id){em=document.getElementById(id);if(em){return em;}}
em=document.createElement("div");if(id){em.id=id;}
em.style.position="absolute";em.style.visibility="hidden";em.style.top="-5000px";em.style.left="0px";em.style.width="50px";em.style.height="50px";em.style.overflow="hidden";document.body.appendChild(em);return em;},preloadImage:function(url){var em=document.getElementById("JSLIB_preload_div"),img;if(!em){em=JSLIB.dom.createInvisibleDiv("JSLIB_preload_div");}
img=document.createElement("img");img.src=url;em.appendChild(img);},createScriptTag:function(src,id,charset,callback){var D=document,elem,pN;if(id){if(D.getElementById(id)){return;}}
elem=D.createElement("script");elem.src=src;if(id){elem.id=id;}
if(charset){elem.setAttribute("charset",charset);}
if(typeof callback!="undefined"){var loaded=false,func=function(){if(!loaded){loaded=true;setTimeout(callback,1);}};elem.onload=function(){func();};elem.onreadystatechange=function(){if((this.readyState=="loaded")||(this.readyState=="complete")){func();}};}
pN=D.getElementsByTagName("head")[0];if(!pN){pN=document.body;}
pN.appendChild(elem);},createStyleSheet:function(fileName,id){var D=document,em,h;if(id){if(D.getElementById(id)){return;}}
if(D.createStyleSheet){D.createStyleSheet(fileName);}
else{em=D.createElement("link");em.href=fileName;em.rel="stylesheet";em.type="text/css";if(id){em.id=id;}
h=D.getElementsByTagName("head")[0];if(!h){h=document.documentElement;}
if(h){h.appendChild(em);}}}};}();var JS$=function(id){return JSLIB.dom.get(id);};if(!JSLIB.eventData){JSLIB.namespace("JSLIB.eventData");JSLIB.eventData=function(registeredTarget,dE){this.domEvent=dE;this.registeredTarget=registeredTarget;if(dE){this.target=(dE.target)?dE.target:dE.srcElement;this.type=dE.type;this.clientX=dE.clientX;this.clientY=dE.clientY;this.button=dE.button;if(dE.which==null){this.ch=String.fromCharCode(dE.keyCode);}
else if(dE.which!=0&&dE.charCode!=0){this.ch=String.fromCharCode(dE.which);}
else{this.ch=null;}
this.keyCode=dE.keyCode;this.altKey=dE.altKey;this.ctrlKey=dE.ctrlKey;this.shiftKey=dE.shiftKey;}
else{this.target=registeredTarget;}}}
if(!JSLIB.event){JSLIB.namespace("JSLIB.event");JSLIB.event=new function(){return{_domReadyDone:false,_domReadyTimer:null,_domReadyCallback:[],_domReadySetup:false,_eventCache:[],cacheEvent:function(elem,eventName,callbackFunc){this._eventCache[this._eventCache.length]=[elem,eventName,callbackFunc];},flushEvents:function(){var i,eC=this._eventCache,obj;for(i=eC.length-1;i>=0;i--){obj=JS$(eC[i][0]);if(!obj){continue;}
if(eC[i][0]==window&&eC[i][1]=="unload"){eC[i][2]();}
else{if(eC[i][2]){this.removeListener(eC[i][0],eC[i][1],eC[i][2]);}
else{obj.setAttribute(eC[i][1],null);}}}},_domReadyHandler:function(evtData){if(!JSLIB.event._domReadyDone){JSLIB.event._domReadyDone=true;for(var i=0;i<JSLIB.event._domReadyCallback.length;i++){JSLIB.event.callHandler(JSLIB.event._domReadyCallback[i],evtData);}}},addListener:function(elem,eventName,callbackFunc){var obj=JS$(elem),i,r;if(JSLIB.util.isArray(obj)){r=true;for(i=0;i<obj.length;i++){if(!this.addListener(obj[i],eventName,callbackFunc)){r=false;}}
return r;}
else if(JSLIB.util.isNull(elem)){return false;}
else if(JSLIB.util.isObject(eventName)){r=true;for(i in eventName){if(!this.addListener(elem,i,eventName[i])){r=false;}}
return false;}
else if(eventName.toLowerCase()=="domready"){this._domReadyCallback.push(callbackFunc);if(!this._domReadySetup){this._domReadySetup=true;var func=function(evt){JSLIB.event.callHandler(JSLIB.event._domReadyHandler,new JSLIB.eventData(obj,evt));};if(obj.addEventListener){obj.addEventListener("DOMContentLoaded",func,false);this.cacheEvent(obj,"DOMContentLoaded",func);}
else if(obj.attachEvent){document.write('<script type="text/javascript" id="JSLIB_contentloadtag" defer="defer" src="//javascript:void(0)"><\/script>');var contentloadtag=document.getElementById("JSLIB_contentloadtag");contentloadtag.onreadystatechange=function(evt){if(this.readyState=="complete"){JSLIB.event.callHandler(JSLIB.event._domReadyHandler,new JSLIB.eventData(obj,window.event));}}
this.cacheEvent(contentloadtag,"onreadystatechange",null);}
this.__addListenerSub(obj,"load",func);}}
else{return this.__addListenerSub(elem,eventName,callbackFunc,true);}},__addListenerSub:function(elem,eventName,callbackFunc,cacheWindowUnloads){var obj=JS$(elem);if(!obj){return false;}
var wrapfunc=function(evt){var realEvent=evt||window.event;return JSLIB.event.callHandler(callbackFunc,new JSLIB.eventData(obj,realEvent));};if(obj.addEventListener){if(obj==window&&eventName=="unload"){if(cacheWindowUnloads){this.cacheEvent(obj,eventName,wrapfunc);}
else{obj.addEventListener(eventName,wrapfunc,false);}}
else{obj.addEventListener(eventName,wrapfunc,false);this.cacheEvent(obj,eventName,wrapfunc);}
return true;}
else if(obj.attachEvent){if(obj==window&&eventName=="unload"){if(cacheWindowUnloads){this.cacheEvent(obj,eventName,wrapfunc);}
else{obj.attachEvent("on"+eventName,wrapfunc);}}
else{obj.attachEvent("on"+eventName,wrapfunc);this.cacheEvent(obj,eventName,wrapfunc);}
return true;}
return false;},bind:function(elem,eventName,callbackFunc){return this.addListener(elem,eventName,callbackFunc);},ready:function(callbackFunc){return this.addListener(window,"domready",callbackFunc);},click:function(elem,callbackFunc){return this.addListener(elem,"click",callbackFunc);},removeListener:function(elem,eventName,callbackFunc){var o=JS$(elem);if(!o){return false;}
if(o.removeEventListener){o.removeEventListener(eventName,callbackFunc,false);}
else if(o.detachEvent){o.detachEvent("on"+eventName,callbackFunc);};},relatedTarget:function(ed){if(ed.domEvent){return(ed.domEvent.relatedTarget?ed.domEvent.relatedTarget:ed.domEvent.toElement);}},preventDefault:function(ed){if(JSLIB.browser.browser=="msie"){ed.domEvent.returnValue=false;}
else if(ed.domEvent.preventDefault){ed.domEvent.preventDefault();}},stopPropagation:function(ed){if(JSLIB.browser.browser=="msie"){ed.domEvent.cancelBubble=true;}
else if(ed.domEvent.stopPropagation){ed.domEvent.stopPropagation();}},callHandler:function(callback,handlerData){if(JSLIB.util.isFunction(callback)){return callback(handlerData);}
else if(JSLIB.util.isObject(callback)){if(callback.callback){var scope=callback.scope?callback.scope:(callback.context?callback.context:(callback.obj?callback.obj:null));if(JSLIB.util.isNull(handlerData)){handlerData=typeof callback.data=="undefined"?null:callback.data;}
else{if(typeof handlerData=="undefined"){handlerData={};}
if(JSLIB.util.isObject(handlerData)&&callback.data){handlerData.data=callback.data;}}
if(scope){return callback.callback.call(scope,handlerData);}
else{return callback.callback(handlerData);}}}
return false;}}}
JSLIB.event.__addListenerSub(window,"unload",function(){JSLIB.event.flushEvents();},false);}
if(!JSLIB.customEvent){JSLIB.namespace("JSLIB.customEvent");JSLIB.customEvent=function(p){JSLIB.callParentConstructor(JSLIB.object,this);this.chained=false;this._listeners=[];if(p){if(p.chained){this.chained=true;}}}
JSLIB.inherits(JSLIB.object,JSLIB.customEvent);JSLIB.customEvent.prototype.numberOfSubscribers=function(){var count=0;for(var i in this._listeners){count++;}
return count;}
JSLIB.customEvent.prototype.subscribe=function(listener){if(JSLIB.util.isObject(listener)){var id=this._listeners.length;this._listeners[id]=listener;return id;}
else{return-1;}}
JSLIB.customEvent.prototype.unsubscribe=function(id){var arr=this._listeners;if(arr[id]){delete arr[id];arr[id]=null;}}
JSLIB.customEvent.prototype.fireEvent=function(handlerData){var arr=this._listeners,i;if(this.chained){if(arr.length>0){JSLIB.event.callHandler(arr[0],{event:this,data:(typeof handlerData=="undefined"?null:handlerData),index:0});}}
else{for(i=0;i<arr.length;i++){JSLIB.event.callHandler(arr[i],typeof handlerData=="undefined"?null:handlerData);}}}
JSLIB.customEvent.prototype.callNextHandler=function(data){var arr=this._listeners;data.index++;if(data.index<arr.length){JSLIB.event.callHandler(arr[data.index],data);}}}
JSLIB.namespace("JSLIB.connection");JSLIB.connection={debug:false,pendingResponseCount:0,get:function(method,url,callback,postdata){if(method!="GET"&&method!="POST"){this._debug("sendRequest(): unknown method '"+method+"'");return false;}
if(typeof callback!="object"||typeof callback.successFunc=="undefined"||typeof callback.failureFunc=="undefined"||typeof callback.context=="undefined"){this._debug("sendRequest(): invalid callback object");return false;}
var req=this._createRequest();if(!req){this._debug("sendRequest(): unable to create request object");return false;}
var handle={req:req,url:url,method:method,callback:callback};req.open(method,url,true);req.onreadystatechange=function(){JSLIB.connection._onResponseStateChange(handle);}
if(method=="GET"){req.send(null);}
else{var body="";if(JSLIB.util.isObject(postdata)){var key;for(key in postdata){var value=postdata[key];if(body.length>0){body+="&";}
body+=encodeURI(key)+"="+encodeURI(value);}}
req.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');req.send(body);}
this.pendingResponseCount++;return handle;},abort:function(handle){if(handle&&handle.req&&handle.req.abort){handle.req.abort();handle.req=null;}},_onResponseStateChange:function(handle){var req=handle.req;if(req.readyState<4){return;}
var response={responseText:req.responseText,responseXML:req.responseXML,status:req.status,statusText:req.statusText,headersText:req.getAllResponseHeaders(),headers:this._createHeaderMap(req.getAllResponseHeaders()),context:handle.callback.context,getText:function(){return this.responseText;},getXML:function(){return this.responseXML;},getJSON:function(){var tmpFunc=new Function("return "+this.responseText);return tmpFunc();}};if(req.status==200){if(handle.callback.successFunc){handle.callback.successFunc(response);}}
else{if(handle.callback.failureFunc){handle.callback.failureFunc(response);}}
this.pendingResponseCount--;handle=null;},_createHeaderMap:function(headersText){extractedHeaders=headersText.split("\n");delete extractedHeaders[extractedHeaders.length];headerMap={};for(i=0;i<extractedHeaders.length-2;i++){head=extractedHeaders[i];fieldNameEnding=head.indexOf(":");field=head.substring(0,fieldNameEnding);value=head.substring(fieldNameEnding+2,head.length);value=value.replace(/\s$/,"");headerMap[field]=value;}
return headerMap;},_createRequest:function(){var req=null,e;try{req=new XMLHttpRequest();}
catch(e){};if(!req){try{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){};}
if(!req){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){};}
return req;},_debug:function(msg){if(this.debug){alert(msg);}}};JSLIB.namespace("JSLIB.namedQueue");JSLIB.namedQueue=function(){JSLIB.callParentConstructor(JSLIB.object);this._queue=[];this._storage={};this._uniqId=1;}
JSLIB.inherits(JSLIB.object,JSLIB.namedQueue);JSLIB.namedQueue.prototype.isEmpty=function(){return this._queue.length==0;}
JSLIB.namedQueue.prototype.getLength=function(){return this._queue.length;}
JSLIB.namedQueue.prototype._addElementSub=function(name){var myname="";if(JSLIB.util.isString(name)){if(name.length>0){myname=name;}}
if(myname.length==0){myname=JSLIB.util.getHash("NamedQueue_"+this._uniqId);this._uniqId++;}
return(typeof this._storage[myname]=="undefined")?myname:null;}
JSLIB.namedQueue.prototype.addToHead=function(name,value){var myname=this._addElementSub(name);if(myname){this._storage[myname]=value;this._queue.unshift(myname);return true;}
return false;}
JSLIB.namedQueue.prototype.addToTail=function(name,value){var myname=this._addElementSub(name);if(myname){this._storage[myname]=value;this._queue.push(myname);return true;}
return false;}
JSLIB.namedQueue.prototype.getHead=function(){return this.getAt(0);}
JSLIB.namedQueue.prototype.getTail=function(){return this.getAt(this._queue.length-1);}
JSLIB.namedQueue.prototype.getByName=function(name){var i=JSLIB.util.getArrayIndexByValue(this._queue,name);return this.getAt(i);}
JSLIB.namedQueue.prototype.getAt=function(i){if(i<0||i>=this._queue.length){return null;}
else{return{name:this._queue[i],index:i,value:this._storage[this._queue[i]]};}}
JSLIB.namedQueue.prototype.removeAt=function(i){if(i<0||i>=this._queue.length){return false;}
delete this._storage[this._queue[i]];this._queue.splice(i,1);return true;}
JSLIB.namedQueue.prototype.removeHead=function(){return this.removeAt(0);}
JSLIB.namedQueue.prototype.removeTail=function(){return this.removeAt(this._queue.length-1);}
JSLIB.namedQueue.prototype.removeByName=function(name){var i=JSLIB.util.getArrayIndexByValue(this._queue,name);return this.removeAt(i);}
JSLIB.namedQueue.prototype.removeAll=function(){this._queue=[];this._storage={};}
JSLIB.namespace("JSLIB.animation");JSLIB.animation=function(properties){JSLIB.callParentConstructor(JSLIB.object,this);if(properties){this.properties["numRun"]=(typeof properties["numRun"]=="undefined")?10:properties["numRun"];this.properties["durationPerRun"]=(typeof properties["durationPerRun"]=="undefined")?200:properties["durationPerRun"];this.properties["animation"]=(typeof properties["animation"]=="undefined")?[]:properties["animation"];this.properties["curRun"]=0;this.properties["completionCallback"]=(typeof properties["completionCallback"]=="undefined")?null:properties["completionCallback"];this.getProgressValue=function(progress,easing){switch(easing){case"easein":return(1-Math.sin(Math.PI/2*(1-progress)));case"easeout":return Math.sin(Math.PI/2*progress);case"easeboth":if(progress<0.5){return(1-Math.sin(Math.PI/2*(1-progress*2)))*0.5;}
else{return 0.5+Math.sin(Math.PI/2*(progress-0.5)*2)*0.5;}
default:return progress;}}
this._element=null;this._timerId=-1;this._startTime=null;this.completionEvent=new JSLIB.customEvent({});}}
JSLIB.inherits(JSLIB.object,JSLIB.animation);JSLIB.animation.prototype.start=function(elem){this.stop();this._element=elem;var dateObj=new Date();this._startTime=dateObj.getTime();this.properties["curRun"]=0;this.animate();}
JSLIB.animation.prototype.stop=function(elem){this.properties["curRun"]=this.properties["numRun"]+1;if(this._timerId>=0){window.clearTimeout(this._timerId);this._timerId=-1;}}
JSLIB.animation.prototype.animate=function(){if(this.properties["curRun"]>this.properties["numRun"]){return;}
this._timerId=-1;var animation=this.properties["animation"];for(var i=0;i<animation.length;i++){var value=this.getProgressValue(this.properties["curRun"]/this.properties["numRun"],animation[i].easing);value=value*parseFloat(animation[i].end-animation[i].start)+animation[i].start;switch(animation[i].type){case"x":this._element.style.left=parseInt(value)+"px";break;case"y":this._element.style.top=parseInt(value)+"px";break;case"width":this._element.style.width=parseInt(value)+"px";break;case"height":this._element.style.height=parseInt(value)+"px";break;case"alpha":JSLIB.dom.setStyle(this._element,"opacity",value);break;}}
this.properties["curRun"]++;if(this.properties["curRun"]<=this.properties["numRun"]){var targetTime=this.properties["curRun"]*this.properties["durationPerRun"];var dateObj=new Date();var timeElapsed=dateObj.getTime()-timeElapsed;var duration=Math.max(1,targetTime-timeElapsed);var obj=this;this._timerId=window.setTimeout(function(){obj.animate();},this.properties["durationPerRun"]);}
else{this.completionEvent.fireEvent();}}
JSLIB.animation.prototype.isPlaying=function(){return(this._timerId>=0);}
JSLIB.namespace("JSLIB.cache");JSLIB.cache=function(properties){JSLIB.callParentConstructor(JSLIB.object);this._queue=new JSLIB.namedQueue();this.properties["max_items"]=500;if(typeof properties!="undefined"){if(typeof properties["max_items"]!="undefined"){this.properties["max_items"]=properties["max_items"];}}}
JSLIB.inherits(JSLIB.object,JSLIB.cache);JSLIB.cache.prototype.getItem=function(name){var obj=this._queue.getByName(name);if(obj){this._queue.removeAt(obj.index);this._queue.addToTail(name,obj.value);return obj.value;}
else{return null;}}
JSLIB.cache.prototype.addItem=function(name,data){this.removeItem(name);this._queue.addToTail(name,data);if(this._queue.getLength()>this.getProperty("max_items")){this._queue.removeHead();}}
JSLIB.cache.prototype.removeItem=function(name){this._queue.removeByName(name);}
JSLIB.cache.prototype.removeAll=function(name){this._queue.removeAll();}
JSLIB.namespace("JSLIB.widget.cssTab");JSLIB.widget.cssTab=function(tabBarId,properties){JSLIB.callParentConstructor(JSLIB.object,this);if(properties){this.properties["id"]=tabBarId;this.properties["tabClass"]=(typeof properties["tabClass"]=="undefined")?"CssTabBar":properties["tabClass"];this.properties["animateExpandCollapse"]=(typeof properties["animateExpandCollapse"]=="undefined")?false:properties["animateExpandCollapse"];this.properties["cacheDiv"]=(typeof properties["cacheDiv"]=="undefined")?true:properties["cacheDiv"];this._tabs={};this._divLoaded=false;if(typeof properties["tabs"]!="undefined"){this._tabs=JSLIB.util.cloneObj(properties["tabs"]);}
this.animation=null;if(this.properties["animateExpandCollapse"]){this.animation=new JSLIB.animation({numRun:4,durationPerRun:125});this._divAnimating=null;this._expandCollapse="";this._removeTabClass="";this._animationCallback=function(){if(this._divAnimating){if(this._expandCollapse=="expand"){this._divAnimating.style.overflow="";this._divAnimating.style.height="";}
else if(this._expandCollapse=="collapse"){this._divAnimating.style.overflow="";this._divAnimating.style.height="";this._divAnimating.style.display="none";JSLIB.dom.removeClass(JS$(this.properties["id"]),this._removeTabClass);}}}
this.animation.completionEvent.subscribe({callback:this._animationCallback,obj:this,data:null});}}}
JSLIB.inherits(JSLIB.object,JSLIB.widget.cssTab);JSLIB.widget.cssTab.prototype.setProperty=function(name,value){switch(name){case"currentTab":if(this.animation){if(this.animation.isPlaying()){return false;}}
if(typeof this._tabs[value]=="undefined"){return false;}
var tabName=value;var tabBarId=this.properties["id"];if(tabName=="none"){var obj=JS$(this.properties["id"]);if(obj){JSLIB.dom.removeClass(obj,"cssTabBarShowTopTab");JSLIB.dom.removeClass(obj,"cssTabBarShowBottomTab");for(var i in this._tabs){var tabPaneDiv=this._getTabPaneElem(i);if(tabPaneDiv){tabPaneDiv.style.display="none";}
var tabDiv=this._getTabElem(i);if(tabDiv){JSLIB.dom.removeClass(tabDiv,"current");}}}}
else{var tabDivId=this._tabs[value]["divId"];var tabType=this._tabs[value]["type"];var obj=JS$(this.properties["id"]);var bShow=false;if(obj){for(var i in this._tabs){if(this._tabs[i]["type"]==tabType){var tabPaneDiv=this._getTabPaneElem(i);if(tabPaneDiv){var tabClass=tabType=="top"?"cssTabBarShowTopTab":"cssTabBarShowBottomTab";if(this._tabs[i]["divId"]==tabDivId){if(tabPaneDiv.style.display!="block"){if(this.properties["animateExpandCollapse"]&&!JSLIB.dom.hasClass(obj,tabClass)){tabPaneDiv.style.position="absolute";tabPaneDiv.style.left="-1000px";tabPaneDiv.style.top="-5000px";tabPaneDiv.style.display="block";var height=tabPaneDiv.offsetHeight-2;tabPaneDiv.style.height="1px";tabPaneDiv.style.overflow="hidden";tabPaneDiv.style.position="";this.animation.setProperty("animation",[{type:"height",start:1,end:height,easing:"linear"}]);this.animation.start(tabPaneDiv);this._divAnimating=tabPaneDiv;this._expandCollapse="expand";}
else{tabPaneDiv.style.display="block";}
JSLIB.dom.replaceClass(obj,tabClass,tabClass);bShow=true;}
else{if(this.properties["animateExpandCollapse"]){var height=tabPaneDiv.offsetHeight-2;tabPaneDiv.style.overflow="hidden";this.animation.setProperty("animation",[{type:"height",start:height,end:1,easing:"linear"}]);this.animation.start(tabPaneDiv);this._divAnimating=tabPaneDiv;this._expandCollapse="collapse";this._removeTabClass=tabClass;}
else{tabPaneDiv.style.display="none";JSLIB.dom.removeClass(obj,tabClass);}}}
else{tabPaneDiv.style.display="none";}}}}
for(var i in this._tabs){var tabDiv=this._getTabElem(i);if(this._tabs[i]["type"]==tabType&&tabDiv){if(!bShow||i!=tabName){JSLIB.dom.removeClass(tabDiv,"current");}
else{JSLIB.dom.replaceClass(tabDiv,"current","current");}}}}}
break;default:JSLIB.object.prototype.setProperty.call(this,name,value);return true;}}
JSLIB.widget.cssTab.prototype._getTabPaneElem=function(tabname){if(typeof this._tabs[tabname]!="undefined"){return this.properties["cacheDiv"]?this._tabs[tabname].divElem:JS$(this._tabs[tabname]["divId"]);}
return null;}
JSLIB.widget.cssTab.prototype._getTabElem=function(tabname){if(typeof this._tabs[tabname]!="undefined"){if(false&&this.properties["cacheDiv"]){return this._tabs[tabname].linkElem;}
else{var obj=JS$(this.properties["id"]);var node=obj.firstChild;while(node){var tagName=new String(node.tagName);var firstChild=node.firstChild;while(firstChild){if(firstChild.nodeType==1){break;}
firstChild=firstChild.nextSibling;}
tagName.toUpperCase();if(tagName=="LI"&&firstChild){if(JSLIB.dom.hasClass(node,tabname)){return firstChild;}}
node=node.nextSibling;}}}
return null;}
JSLIB.widget.cssTab.prototype.render=function(){if(!this._divLoaded&&this.properties["cacheDiv"]){for(var i in this._tabs){if(this._tabs[i]["divId"]!="none"){this._tabs[i].divElem=JS$(this._tabs[i]["divId"]);}}
var obj=JS$(this.properties["id"]);var node=obj.firstChild;while(node){var tagName=new String(node.tagName);var firstChild=node.firstChild;while(firstChild){if(firstChild.nodeType==1){break;}
firstChild=firstChild.nextSibling;}
tagName.toUpperCase();if(tagName=="LI"&&firstChild){for(var tabName in this._tabs){if(JSLIB.dom.hasClass(node,tabName)){this._tabs[tabName].linkElem=firstChild;break;}}}
node=node.nextSibling;}
this._divLoaded=true;}}
JSLIB.namespace("JSLIB.form");JSLIB.form={DISPLAYERR_ALERTSINGLE:0,DISPLAYERR_ALERTGROUP:1,DISPLAYERR_DISPLAYBLOCK:2,parentObj:null,elements:null,handleError:function(elem,msg,parts){var name=null;if(elem&&elem.getAttribute){name=elem.getAttribute("alt_name");if(!name){name=elem.getAttribute("name");}}
if(typeof(parts)!="object"||parts==null){parts={};}
parts['fieldname']=name;var key;var str=new String(msg);for(key in parts){str=str.replace("%"+key+"%",parts[key]);}
return{code:false,emsg:str,focusElement:arguments[3]};},fetchElements:function(parentObj){if(!parentObj||!parentObj.getElementsByTagName){return null;}
var elements={};var parts,parts1,parts2,parts3;var i;parts1=parentObj.getElementsByTagName("input");parts2=parentObj.getElementsByTagName("select");parts3=parentObj.getElementsByTagName("textarea");parts=[];for(i=0;i<parts1.length;i++)parts[parts.length]=parts1[i];for(i=0;i<parts2.length;i++)parts[parts.length]=parts2[i];for(i=0;i<parts3.length;i++)parts[parts.length]=parts3[i];for(i=0;i<parts.length;i++){if(parts[i].name){if(typeof(elements[parts[i].name])=="undefined"){elements[parts[i].name]=parts[i];}
else if(!JSLIB.util.isArray(elements[parts[i].name])){elements[parts[i].name]=[elements[parts[i].name],parts[i]];}
else{elements[parts[i].name][elements[parts[i].name].length]=parts[i];}}
else{if(typeof elements["_no_name_"]=="undefined"){elements["_no_name_"]=[];}
elements["_no_name_"][elements["_no_name_"].length]=parts[i];}}
return elements;},validate:function(parentObj,displayErrorStyle){if(!parentObj){return;}
var elements=this.fetchElements(parentObj);this.parentObj=parentObj;this.elements=elements;var msg="";var allTestOk=true;var firstErrObj=null;var elements2=[];for(var key in elements){var elem=elements[key];if(JSLIB.util.isFunction(elem)){continue;}
if(key=="_no_name_"){continue;}
elements2[elements2.length]=elem;}
if(typeof elements["_no_name_"]!="undefined"){for(var i=0;i<elements["_no_name_"].length;i++){elements2[elements2.length]=elements["_no_name_"][i];}}
for(var i=0;i<elements2.length;i++){var elem=elements2[i];var realElem=JSLIB.util.isArray(elem)?elem[0]:elem;var attr=realElem.getAttribute("alt");if(!attr)continue;var params=attr.split("|");var validationType=params[0];if(JSLIB.util.isArray(elem)&&validationType!="radio"&&validationType!="checkbox"){continue;}
var bok=(params[params.length-1]=="bok");var result={success:true};switch(validationType){case"blank":result=this.validateBlank(elem);break;case"email":result=this.validateEmail(elem,bok);break;case"checkbox":result=this.validateCheckbox(elem,params[1],params[2]);break;case"radio":result=this.validateRadio(elem);break;case"select":result=this.validateSelect(elem);break;case"length":result=this.validateLength(elem,params[1],params[2]);break;case"allornone":result=this.validateAllOrNone(elem,params[1],params[2]);break;}
if(!result.success){allTestOk=false;var emsg=realElem.getAttribute("emsg");if(!emsg&&result.emsg){emsg=result.emsg;}
if(!emsg){emsg="Error in field '"+realElem.name+"'.";}
if(msg.length>0){msg+="\n";}
msg+=emsg;switch(displayErrorStyle){case this.DISPLAYERR_ALERTSINGLE:alert(msg);realElem.focus();if(realElem.select){realElem.select();}
return false;case this.DISPLAYERR_DISPLAYBLOCK:if(realElem.getAttribute("emsgid")){var obj=document.getElementById(realElem.getAttribute("emsgid"));if(obj){obj.style.display="block";}}
case this.DISPLAYERR_ALERTGROUP:default:if(!firstErrObj){firstErrObj=realElem;}
break;}}
else{switch(displayErrorStyle){case this.DISPLAYERR_DISPLAYBLOCK:if(realElem.getAttribute("emsgid")){var obj=document.getElementById(realElem.getAttribute("emsgid"));if(obj){obj.style.display="none";}}
break;}}}
if(!allTestOk){switch(displayErrorStyle){case this.DISPLAYERR_ALERTGROUP:case this.DISPLAYERR_ALERTSINGLE:alert(msg);firstErrObj.focus();if(firstErrObj.select)firstErrObj.select();break;}}
return allTestOk;},validateBlank:function(elem){if(typeof(elem.value)!="undefined"){if(elem.value.length==0){return this.handleError(elem,JSLIB.formMsg.MSG_FILLINBLANK,null);}
else{return{success:true};}}
else{return{success:true};}},validateEmail:function(elem,bok){if(typeof(elem.value)!="undefined"){var s=JSLIB.util.trim(elem.value);if(s.length==0&&bok){return{success:true};}
var emailStr=elem.value;var emailReg1=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var emailReg2=/^[a-zA-Z0-9\_\-\.]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/;if(!(!emailReg1.test(emailStr)&&emailReg2.test(emailStr))){return this.handleError(elem,JSLIB.formMsg.MSG_CORRECTEMAIL,null);}}
return{success:true};},validateRadio:function(elem){if(!JSLIB.util.isArray(elem)){if(elem.checked){return{success:true};}
return this.handleError(elem,JSLIB.formMsg.MSG_RADIO,null);}
else{for(var i=0;i<elem.length;i++){if(elem[i].checked){return{success:true};}}
return this.handleError(elem[0],JSLIB.formMsg.MSG_RADIO,null);}},validateCheckbox:function(elem,min,max){if(!JSLIB.util.isArray(elem)){if(!elem.checked){return this.handleError(elem,JSLIB.formMsg.MSG_CHECKBOX,null);}}
else{var numChecked=0;for(var i=0;i<elem.length;i++){if(elem[i].checked)numChecked++;}
if(typeof(min)!="undefined"){if(numChecked<min){if(typeof(max)=="undefined"){return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMIN,{min:min});}
else if(min==max){return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMINMAXSAME,{min:min,max:max});}
else{return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMINMAX,{min:min,max:max});}}}
if(typeof(max)!="undefined"){if(numChecked>max){if(typeof(min)=="undefined"||min==0){return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMAX,{max:max});}
else if(min==max){return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMINMAXSAME,{min:min,max:max});}
else{return this.handleError(elem[0],JSLIB.formMsg.MSG_CHECKBOXMINMAX,{min:min,max:max});}}}}
return{success:true};},validateSelect:function(elem){if(elem.selectedIndex<1){return this.handleError(elem,JSLIB.formMsg.MSG_RADIO,null);}
return{success:true};},validateLength:function(elem,minLength,maxLength){if(typeof elem.value!="undefined"){if(typeof minLength!="undefined"&&typeof maxLength!="undefined"&&minLength!=""&&maxLength!=""){if(elem.value.length<minLength||elem.value.length>maxLength){return this.handleError(elem,JSLIB.formUtilsMsg.MSG_LENGTHMINMAX,{min:minLength,max:maxLength});}}
if(typeof minLength!="undefined"){if(elem.value.length<minLength){return this.handleError(elem,JSLIB.formUtilsMsg.MSG_LENGTHMIN,{min:minLength});}}
if(typeof maxLength!="undefined"){if(elem.value.length>maxLength){return this.handleError(elem,JSLIB.formUtilsMsg.MSG_LENGTHMAX,{max:maxLength});}}}
return{success:true};},validateAllOrNone:function(elem,delimiter,fieldnames){var fields=fieldnames.split(delimiter);if(fields.length==0){return{success:true};}
var hasValue=this.elements[fields[0]].value.length>0;for(var i=1;i<fields.length;i++){if((this.elements[fields[i]].value.length>0)!==hasValue){return this.handleError(elem,JSLIB.formUtilsMsg.MSG_ALLORNONE,{},this.elements[fields[0]]);}}
return{success:true};},xsRequest:function(url,args){if(typeof(args)=="undefined"||args==null){args={};}
var now=new Date()
var str="cb="+encodeURIComponent(now.getTime());var key;for(key in args){if(key=="_no_name_"){continue;}
if(JSLIB.util.isArray(args[key])){for(var i=0;i<args[key].length;i++){if(args[key][i].type=="radio"||args[key][i].type=="checkbox"){if(args[key][i].checked){value=args[key][i].value;if(!value)value="on";str+="&"+encodeURIComponent(key)+"="+encodeURIComponent(value);}}
else{str+="&"+encodeURIComponent(key)+"="+encodeURIComponent(args[key][i].value);}}}
else{if(args[key].type=="radio"||args[key].type=="checkbox"){if(args[key].checked){value=args[key].value;if(!value)value="on";str+="&"+encodeURIComponent(key)+"="+encodeURIComponent(value);}}
else{str+="&"+encodeURIComponent(key)+"="+encodeURIComponent(args[key].value);}}}
url=url+"?"+str;var newScriptTag=document.createElement("script");newScriptTag.src=url;document.body.appendChild(newScriptTag);},xsSubmit:function(url,parentObj){var elements=this.fetchElements(parentObj);this.xsRequest(url,elements);}};JSLIB.namespace("JSLIB.widget.layer");JSLIB.widget.layer=function(id,props){JSLIB.callParentConstructor(JSLIB.object,this);var tp=this.properties;tp["id"]=id;tp["x"]=0;tp["y"]=0;tp["width"]=250;tp["height"]=null;tp["visible"]=true;tp["zIndex"]=100;if(props){tp["id"]=id;tp["x"]=(typeof props["x"]=="undefined")?tp["x"]:props["x"];tp["y"]=(typeof props["y"]=="undefined")?tp["y"]:props["y"];tp["width"]=(typeof props["width"]=="undefined")?tp["width"]:props["width"];tp["height"]=(typeof props["height"]=="undefined")?tp["height"]:props["height"];tp["visible"]=(typeof props["visible"]=="undefined")?tp["visible"]:props["visible"];tp["zIndex"]=(typeof props["zIndex"]=="undefined")?tp["zIndex"]:props["zIndex"];}
this.element=null;this._iframe=null;}
JSLIB.inherits(JSLIB.object,JSLIB.widget.layer);JSLIB.widget.layer.prototype.setProperty=function(name,value){var done=true,elem=this.element,dom=JSLIB.dom;if(!elem){return false;}
switch(name){case"visible":value=value?true:false;dom.setStyle(elem,"display",value?"block":"none");this.setProperty("height",this.properties["height"]);break;case"x":dom.setStyle(elem,"left",value+"px");break;case"y":dom.setStyle(elem,"top",value+"px");break;case"zIndex":dom.setStyle(elem,"zIndex",value);break;case"width":dom.setStyle(elem,"width",value+"px");break;case"height":if(this.properties["height"]!=null){var bodys=dom.getElementsByClassName("jsBody","div",elem),headers=dom.getElementsByClassName("jsHeader","div",elem),footers=dom.getElementsByClassName("jsFooter","div",elem);if(bodys.length>0){var height=value;if(headers.length>0){height-=headers[0].offsetHeight;}
if(footers.length>0){height-=footers[0].offsetHeight;}
var bodyHeight=0;if(JSLIB.dom.getStyle(bodys[0],"height")){bodyHeight=parseInt(dom.getStyle(bodys[0],"height"));}
height-=(bodys[0].offsetHeight-bodyHeight);dom.setStyle(bodys[0],"height",height+"px");}}
break;default:done=false;break;}
if(done){JSLIB.object.prototype.setProperty.call(this,name,value);this._updateIframe();return true;}
else{return false;}}
JSLIB.widget.layer.prototype._updateLayer=function(elem,xOffset,yOffset,zIndexOffset){var dom=JSLIB.dom,xy=dom.getXY(this.element);dom.setXY(elem,[xy[0]+xOffset,xy[1]+yOffset]);dom.setStyle(elem,"zIndex",parseInt(dom.getStyle(this.element,"zIndex"))+zIndexOffset);dom.setStyle(elem,"width",this.element.offsetWidth+"px");dom.setStyle(elem,"height",this.element.offsetHeight+"px");dom.setStyle(elem,"display",this.getProperty("visible")?"block":"none");}
JSLIB.widget.layer.prototype._updateIframe=function(){if(this._iframe){this._updateLayer(this._iframe,0,0,-1);}}
JSLIB.widget.layer.prototype.render=function(){this.element=JS$(this.getProperty("id"));if(!this.element){return false;}
this.element.parentNode.removeChild(this.element);JSLIB.dom.setStyle(this.element,"display","none");JSLIB.dom.setStyle(this.element,"position","absolute");var bodys=JSLIB.dom.getElementsByClassName("jsBody","div",this.element);if(bodys[0]&&(this.properties["height"]!=null)){JSLIB.dom.setStyle(bodys[0],"height","100px");}
document.body.appendChild(this.element);this.setProperty("x",this.properties["x"]);this.setProperty("y",this.properties["y"]);this.setProperty("width",this.properties["width"]);this.setProperty("zIndex",this.properties["zIndex"]);this.setProperty("visible",this.properties["visible"]);if(JSLIB.browser.browser=="msie"&&JSLIB.browser.version<=6){this._iframe=document.createElement("iframe");this._iframe.src="about:blank";JSLIB.dom.setStyle(this._iframe,"position","absolute");JSLIB.dom.setStyle(this._iframe,"border-width","0px");document.body.appendChild(this._iframe);this._updateIframe();}
return true;}
JSLIB.widget.layer.prototype.getElement=function(){return this.element;}
JSLIB.namespace("scriptEngine");JSLIB.scriptEngine=function(properties){JSLIB.callParentConstructor(JSLIB.object,this);this.properties["leftDelimiter"]="[%";this.properties["rightDelimiter"]="%]";this.properties["template"]="[[ ERROR: property 'template Not Defined' ]]";if(properties){if(typeof properties["leftDelimiter"]!="undefined"){this.properties["leftDelimiter"]=properties["leftDelimiter"];}
if(typeof properties["rightDelimiter"]!="undefined"){this.properties["rightDelimiter"]=properties["rightDelimiter"];}
if(typeof properties["template"]!="undefined"){this.properties["template"]=properties["template"];}}
this._parseTemplate(this.properties["template"]);}
JSLIB.inherits(JSLIB.object,JSLIB.scriptEngine);JSLIB.scriptEngine.prototype.fetch=function(jst){var e,output;try{return this._fetch(jst);}
catch(e){return"[[ ERROR: template execution failed - "+e.message+" ]]";}}
JSLIB.scriptEngine.prototype._parseTemplate=function(str){var pos=0;var output="this._fetch = function (jst) {\n"
+"var _output = \"\";\n";do{var nextPos=str.indexOf(this.properties["leftDelimiter"],pos);if(nextPos<0){if(str.length>pos){output+="_output += \""+JSLIB.util.addSlashes(str.substring(pos))+"\";\n";}
break;}
else if(nextPos>pos){output+="_output += \""+JSLIB.util.addSlashes(str.substring(pos,nextPos))+"\";\n";}
pos=nextPos;nextPos=str.indexOf(this.properties["rightDelimiter"],pos);if(nextPos<0){this._fetch=function(jpt){return"[[ ERROR: template compilation failed - missing tag closing delimiter ]]";}
return false;}
var tag=str.substring(pos,nextPos+2);if(tag.charAt(2)=="="){output+="_output += "+tag.substring(3,tag.length-3)+"\n";}
else{output+=tag.substring(2,tag.length-2)+"\n";}
pos=nextPos+2;}while(pos<str.length);output+="return _output;\n}";var e;try{eval(output);}
catch(e){this._fetch=function(jpt){return"[[ ERROR: template compilation failed - "+e.message+" ]]";}}
return true;}
JSLIB.scriptEngine.prototype.setProperty=function(name,value){var result=JSLIB.object.prototype.setProperty.call(this,name,value);if(name=="template"){return this._parseTemplate(this.properties["template"]);}
return result;}
JSLIB.namespace("JSLIB.widget.panel");JSLIB.namespace("JSLIB._global.widget.panel");JSLIB._global.widget.panel.objects={};JSLIB._global.widget.panel.constant={panelZIndex:210,lightBoxZIndex:100,lightBoxBackgroundColor:"white",lightBoxOpacity:0.7,shadowOffsetX:3,shadowOffsetY:3,shadowZIndexOffset:-1,shadowOpacity:0.7,shadowColor:"#7f7f7f"};JSLIB._global.widget.panel.numModalPanel=0;JSLIB._global.widget.panel.lightBoxDiv=null;JSLIB._global.widget.panel.updateLightBoxDiv=function(){var dom=JSLIB.dom,obj,pConst=JSLIB._global.widget.panel.constant;if(!JSLIB._global.widget.panel.lightBoxDiv){JSLIB._global.widget.panel.lightBoxDiv=document.createElement("DIV");obj=JSLIB._global.widget.panel.lightBoxDiv;dom.setStyle(obj,"position","absolute");dom.setStyle(obj,"backgroundColor",pConst.lightBoxBackgroundColor);dom.setStyle(obj,"opacity",pConst.lightBoxOpacity);dom.setStyle(obj,"zIndex",pConst.lightBoxZIndex);document.body.appendChild(obj);JSLIB.event.addListener(window,"resize",JSLIB._global.widget.panel.updateLightBoxDiv);JSLIB.event.addListener(window,"scroll",JSLIB._global.widget.panel.updateLightBoxDiv);}
obj=JSLIB._global.widget.panel.lightBoxDiv;if(JSLIB._global.widget.panel.numModalPanel>0){var vpW,vpH,scrollXY;vpW=dom.getViewportWidth();vpH=dom.getViewportHeight();scrollXY=dom.getScrollXY();dom.setStyle(obj,"width",vpW+"px");dom.setStyle(obj,"height",vpH+"px");dom.setStyle(obj,"left",scrollXY[0]+"px");dom.setStyle(obj,"top",scrollXY[1]+"px");vpW=dom.getViewportWidth();vpH=dom.getViewportHeight();scrollXY=dom.getScrollXY();dom.setStyle(obj,"width",vpW+"px");dom.setStyle(obj,"height",vpH+"px");dom.setStyle(obj,"left",scrollXY[0]+"px");dom.setStyle(obj,"top",scrollXY[1]+"px");dom.setStyle(obj,"display","block");}
else{dom.setStyle(obj,"width","1px");dom.setStyle(obj,"height","1px");dom.setStyle(obj,"left","0px");dom.setStyle(obj,"top","0px");dom.setStyle(obj,"display","none");}}
JSLIB._global.widget.panel.updatePanels=function(){for(var id in JSLIB._global.widget.panel.objects){if(JSLIB._global.widget.panel.objects[id].getProperty){if(JSLIB._global.widget.panel.objects[id].getProperty("centerOnViewport")){JSLIB._global.widget.panel.objects[id].center();}}}}
JSLIB.event.addListener(window,"resize",JSLIB._global.widget.panel.updatePanels);JSLIB.event.addListener(window,"scroll",JSLIB._global.widget.panel.updatePanels);JSLIB.widget.panel=function(id,properties){properties["zIndex"]=(typeof properties["zIndex"]!="undefined")?properties["zIndex"]:JSLIB._global.widget.panel.constant.panelZIndex;this._shadowDiv=null;JSLIB.callParentConstructor(JSLIB.widget.layer,this,id,properties);this.properties["centerOnViewport"]=false;this.properties["modal"]=false;this.properties["showShadow"]=false;this.properties["showCloseBtn"]=false;if(properties){this.properties["centerOnViewport"]=(typeof properties["centerOnViewport"]!="undefined")?properties["centerOnViewport"]:false;this.properties["modal"]=(typeof properties["modal"]!="undefined")?properties["modal"]:false;this.properties["showShadow"]=(typeof properties["showShadow"]!="undefined")?properties["showShadow"]:false;this.properties["showCloseBtn"]=(typeof properties["showCloseBtn"]!="undefined")?properties["showCloseBtn"]:false;}}
JSLIB.inherits(JSLIB.widget.layer,JSLIB.widget.panel);JSLIB.widget.panel.prototype.setProperty=function(name,value){if(!this.element){return false;}
var done=true;switch(name){default:done=false;break;}
if(done){JSLIB.object.prototype.setProperty.call(this,name,value);}
else{var visible=JSLIB.dom.getStyle(this.element,"display")=="block";JSLIB.widget.layer.prototype.setProperty.call(this,name,value);if(name=="visible"&&this.getProperty("modal")&&visible!=this.getProperty("visible")){if(this.getProperty("visible")){JSLIB._global.widget.panel.numModalPanel++;if(this.getProperty("centerOnViewport")){this.center();}}
else{JSLIB._global.widget.panel.numModalPanel--;}
JSLIB._global.widget.panel.updateLightBoxDiv();}
this._updateShadowLayer();}}
JSLIB.widget.panel.prototype._updateShadowLayer=function(){if(this._shadowDiv){this._updateLayer(this._shadowDiv,JSLIB._global.widget.panel.constant.shadowOffsetX,JSLIB._global.widget.panel.constant.shadowOffsetY,JSLIB._global.widget.panel.constant.shadowZIndexOffset);}}
JSLIB.widget.panel.prototype.center=function(){var vpW=JSLIB.dom.getViewportWidth();var vpH=JSLIB.dom.getViewportHeight();var scrollXY=JSLIB.dom.getScrollXY();var divW=this.element.offsetWidth;var divH=this.element.offsetHeight;this.setProperty("x",(vpW-divW)/2+scrollXY[0]);this.setProperty("y",(vpH-divH)/2+scrollXY[1]);}
JSLIB.widget.panel.prototype.render=function(){JSLIB.widget.layer.prototype.render.call(this);if(!this.element){return false;}
JSLIB._global.widget.panel.objects[this.getProperty("id")]=this;var headers=JSLIB.dom.getElementsByClassName("jsHeader","div",this.element);if(this.getProperty("showCloseBtn")){if(headers.length>0){var elem=document.createElement("DIV");elem.className="jsCloseBtn";elem.onclick=new Function("JSLIB._global.widget.panel.objects['"+this.getProperty("id")+"'].setProperty('visible', false);");if(headers[0].firstChild){headers[0].insertBefore(elem,headers[0].firstChild);}
else{headers[0].appendChild(elem);}}}
if(this.getProperty("showShadow")){this._shadowDiv=document.createElement("DIV");JSLIB.dom.setStyle(this._shadowDiv,"position","absolute");JSLIB.dom.setStyle(this._shadowDiv,"opacity",JSLIB._global.widget.panel.constant.shadowOpacity);JSLIB.dom.setStyle(this._shadowDiv,"backgroundColor",JSLIB._global.widget.panel.constant.shadowColor);document.body.appendChild(this._shadowDiv);this._updateShadowLayer();}}
