if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return undefined}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}if(data.indexOf("{")<0){data="{"+data+"}"}data=eval("("+data+")");$.data(elem,settings.single,data);return data}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)};jQuery.extend(jQuery.expr.pseudos,{meta:function(elem,i,m,a){var p=m[3].split("=");var elMeta=jQuery(elem).metadata();return !m[3]||(p&&(p.length>1?elMeta[p[0]]==p[1]:elMeta[p[0]]))}})})(jQuery);
(function($){$.fn.toFmtString=function(val,options){var dataformat=null;var defaults={dataformat:null};if(typeof(options)=="string"){var opts=$.extend({},defaults);dataformat=options}else{if(typeof(options)=="function"){dataformat=options();var opts=$.extend({},defaults,options)}else{var opts=$.extend({},defaults,options)}}if(this.length==1){obj=$(this);processFormat(obj,val,opts,dataformat)}else{this.each(function(){obj=$(this);processFormat(obj,val,opts,dataformat)})}};function processFormat(obj,val,opts,dataformat){var data=$.metadata.get(obj);var o=$.metadata?$.extend({},opts,data):opts;var constructor=val.constructor;var withDecimal="#,##0.00";var noDecimal="#,##0";var date="MM/dd/yyyy";var hasDataformat=$(obj).metadata().dataFormat!=undefined;if(new RegExp("function BigDecimal").test(constructor)){if(dataformat!=null){o.dataformat=dataformat}else{if(o.dataformat==null&&hasDataformat){o.dataformat=$(obj).metadata().dataFormat}else{if(o.dataformat==null&&!hasDataformat){o.dataformat=withDecimal}}}obj.val(bQxsD(val,o.dataformat))}else{if(new RegExp("function Boolean").test(constructor)){obj.val(val)}else{if(new RegExp("function Date").test(constructor)){if(dataformat!=null){o.dataformat=dataformat}else{if(o.dataformat==null&&hasDataformat){o.dataformat=$(obj).metadata().dataFormat}else{if(o.dataformat==null&&!hasDataformat){o.dataformat=date}}}obj.val(DuppZ(val,o.dataformat))}else{if(new RegExp("function Number").test(constructor)){if(new RegExp("[.]").test(constructor)){if(dataformat!=null){o.dataformat=dataformat}else{if(o.dataformat==null&&hasDataformat){o.dataformat=$(obj).metadata().dataFormat}else{if(o.dataformat==null&&!hasDataformat){o.dataformat=withDecimal}}}}else{if(dataformat!=null){o.dataformat=dataformat}else{if(o.dataformat==null&&hasDataformat){o.dataformat=$(obj).metadata().dataFormat}else{if(o.dataformat==null&&!hasDataformat){o.dataformat=noDecimal}}}}obj.val(uMkrl(val,o.dataformat))}}}}}function DuppZ(date,format){var SNXUf=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var fvgZc="";var gdWuL=0;var NdQTT="";var fdLug="";var y=date.getFullYear()+"";var SlNNT=date.getMonth()+1;var MQQjA=date.getDate();var fsaEj=date.getHours();var EnLLG=date.getMinutes();var jncwT=date.getSeconds();var NfItQ=date.getTime()%1000;var KViMG,mKhIk,NKmQC,lLfcX,ZXTrG,aBvsJ,lZPDl,JRHjB,lrUWh,IXqtq,ecdhe,jgGTr,fsaEj,elfrO,MjjuD,Wkigp,BVYYT;if(y.length<4){y=y-0+1900}y=""+y;KViMG=y;mKhIk=y.substring(2,4);if(SlNNT<10){ZXTrG="0"+SlNNT}else{ZXTrG=SlNNT}NKmQC=SNXUf[SlNNT-1];lLfcX=SNXUf[SlNNT-1+12];if(MQQjA<10){aBvsJ="0"+MQQjA}else{aBvsJ=MQQjA}JRHjB=fsaEj;MjjuD=fsaEj;BVYYT=fsaEj+1;if(JRHjB>12){JRHjB-=12}if(JRHjB==0){JRHjB=12}if(JRHjB<10){lZPDl="0"+JRHjB}else{lZPDl=JRHjB}if(fsaEj<10){jgGTr="0"+MjjuD}else{jgGTr=fsaEj}if(MjjuD>11){MjjuD-=12}if(MjjuD<10){elfrO="0"+MjjuD}else{elfrO=MjjuD}if(BVYYT<10){Wkigp="0"+BVYYT}else{Wkigp=BVYYT}if(fsaEj>11){ecdhe="PM"}else{ecdhe="AM"}if(EnLLG<10){lrUWh="0"+EnLLG}else{lrUWh=EnLLG}if(jncwT<10){IXqtq="0"+jncwT}else{IXqtq=jncwT}ucZtw=NfItQ;whxMu=NfItQ;if(NfItQ<100){ucZtw="0"+NfItQ;whxMu=NfItQ}if(NfItQ<10){ucZtw="00"+NfItQ;whxMu="0"+NfItQ}var value=new Object();value.yyyy=KViMG;value.yy=mKhIk;value.y=y;value.MMMM=NKmQC;value.MMM=lLfcX;value.MM=ZXTrG;value.M=SlNNT;value.dd=aBvsJ;value.d=MQQjA;value.hh=lZPDl;value.h=JRHjB;value.HH=jgGTr;value.H=fsaEj;value.KK=elfrO;value.K=MjjuD;value.kk=Wkigp;value.k=BVYYT;value.mm=lrUWh;value.m=EnLLG;value.ss=IXqtq;value.s=jncwT;value.a=ecdhe;value.SSS=ucZtw;value.SS=whxMu;value.S=NfItQ;while(gdWuL<format.length){NdQTT=format.charAt(gdWuL);fdLug="";while((format.charAt(gdWuL)==NdQTT)&&(gdWuL<format.length)){fdLug+=format.charAt(gdWuL);gdWuL++}if(value[fdLug]!=null){fvgZc=fvgZc+value[fdLug]}else{fvgZc=fvgZc+fdLug}}return fvgZc}function uMkrl(number,format){if(number-0!=number){return null}var ohWXJ=format.indexOf(",")!=-1;var KosCn=format.indexOf("%")!=-1;var JirfJ=format.indexOf("$")!=-1;var MsEsu=(number<0);number=Math.abs(number);if(KosCn){number*=100}format=qtvoJ(format,",%$");number=""+number;var qTjFO=number.indexOf(".");var kgBmW=qTjFO!=-1;var IWSFB=(kgBmW)?number.substring(0,qTjFO):number;var XlvlR=(kgBmW)?number.substring(qTjFO+1):"";qTjFO=format.indexOf(".");kgBmW=qTjFO!=-1;var uHUlV=(kgBmW)?format.substring(0,qTjFO):format;var MRdVB=(kgBmW)?format.substring(qTjFO+1):"";if(MRdVB.length<XlvlR.length){var rFuPr=XlvlR.charAt(MRdVB.length)-0;XlvlR=XlvlR.substring(0,MRdVB.length);if(rFuPr>=5){XlvlR=""+((XlvlR-0)+1)}while(MRdVB.length>XlvlR.length){XlvlR="0"+XlvlR}if(MRdVB.length<XlvlR.length){XlvlR=XlvlR.substring(1);IWSFB=(IWSFB-0)+1}}else{for(var KxZst=XlvlR.length;MRdVB.length>XlvlR.length;KxZst++){if(MRdVB.charAt(KxZst)=="0"){XlvlR+="0"}else{break}}}uHUlV=qtvoJ(uHUlV,"#");while(uHUlV.length>IWSFB.length){IWSFB="0"+IWSFB}if(ohWXJ){IWSFB=NuKpj(IWSFB,",")}var wXeES=IWSFB+((XlvlR!="")?"."+XlvlR:"");wXeES=((JirfJ)?"$":"")+wXeES+((KosCn)?"%":"");if(MsEsu){wXeES=(JirfJ)?"("+wXeES+")":"-"+wXeES}return wXeES}function qtvoJ(input,TILqG){var wXeES="";for(var KxZst=0;KxZst<input.length;KxZst++){var NdQTT=input.charAt(KxZst);if(TILqG.indexOf(NdQTT)==-1){wXeES+=NdQTT}}return wXeES}function NuKpj(input,separator){input=""+input;var wXeES="";for(var KxZst=0;KxZst<input.length;KxZst++){if(KxZst!=0&&(input.length-KxZst)%3==0){wXeES+=separator}wXeES+=input.charAt(KxZst)}return wXeES}function bQxsD(number,format){var ohWXJ=format.indexOf(",")!=-1;var JirfJ=format.indexOf("$")!=-1;var MsEsu=(number.Sign<0)||number.toString().indexOf("-")==0;number=number.abs();format=WoVkh(format,",$");number=number.toString();var kgBmW=number.indexOf(".")!=-1;var IWSFB=(kgBmW)?number.substring(0,number.indexOf(".")):number;var XlvlR=(kgBmW)?number.substring(number.indexOf(".")+1):"";kgBmW=format.indexOf(".")!=-1;var uHUlV=(kgBmW)?format.substring(0,format.indexOf(".")):format;var MRdVB=(kgBmW)?format.substring(format.indexOf(".")+1):"";if(MRdVB.length<XlvlR.length){var rFuPr=XlvlR.charAt(MRdVB.length)-0;XlvlR=XlvlR.substring(0,MRdVB.length);if(rFuPr>=5){XlvlR=""+((XlvlR-0)+1)}while(MRdVB.length>XlvlR.length){XlvlR="0"+XlvlR}if(MRdVB.length<XlvlR.length){XlvlR=XlvlR.substring(1);IWSFB=(IWSFB-0)+1}}else{for(var KxZst=XlvlR.length;MRdVB.length>XlvlR.length;KxZst++){if(MRdVB.charAt(KxZst)=="0"){XlvlR+="0"}else{break}}}uHUlV=WoVkh(uHUlV,"#");while(uHUlV.length>IWSFB.length){IWSFB="0"+IWSFB}if(ohWXJ){IWSFB=bjMbW(IWSFB,",")}var wXeES=IWSFB+((XlvlR!="")?"."+XlvlR:"");wXeES=((JirfJ)?"$":"")+wXeES;if(MsEsu){wXeES=(JirfJ)?"("+wXeES+")":"-"+wXeES}return wXeES}function WoVkh(input,TILqG){var wXeES="";for(var KxZst=0;KxZst<input.length;KxZst++){if(TILqG.indexOf(input.charAt(KxZst))==-1){wXeES+=input.charAt(KxZst)}}return wXeES}function bjMbW(input,separator){input=""+input;var wXeES="";for(var KxZst=0;KxZst<input.length;KxZst++){if(KxZst!=0&&(input.length-KxZst)%3==0){wXeES+=separator}wXeES+=input.charAt(KxZst)}return wXeES}})(jQuery);(function($){$.fn.toBigDecimal=function(){if(this.length==1){return new BigDecimal($(this).val())}var arr=new Array();this.each(function(){arr.push(new BigDecimal($(this).val()))});return arr}})(jQuery);(function($){$.fn.toBoolean=function(){if(this.length==1){obj=$(this);return processBoolean(obj)}var arr=new Array();this.each(function(){obj=$(this);arr.push(processBoolean(obj))});return arr};function processBoolean(obj){if(obj.val()=="true"){return new Boolean(1)}return new Boolean(0)}})(jQuery);(function($){$.fn.toDate=function(options){var dt=new Date();var defaults={dataformat:"MM/dd/yyyy"};var opts=$.extend({},defaults,options);if(this.length==1){obj=$(this);return processDate(obj,opts)}var arr=new Array();this.each(function(){obj=$(this);arr.push(processDate(obj,opts))});return arr};function processDate(obj,opts){var o=$.meta?$.extend({},opts,obj.data()):opts;var inputVal=new String(obj.val());if(obj.metadata().dataFormat){o.dataformat=obj.metadata().dataFormat}var dt=MeGHH(obj.val(),o.dataformat);return dt?dt:null}function _autoFormatDate(obj,dataFormat){var s=obj.val();var formats=new Array(dataFormat).concat(_getDateFormatsArray(obj));var n=formats.length;for(var i=0;i<n;i++){var d=new SimpleDateFormat(formats[i]).parse(s);if(d&&d.constructor==Date){return d}}return null}function _getDateFormatsArray(obj){var dataType=obj.metadata().datatype;switch(Number(dataType)){case $.validator.dataTypes.DATE:return getDateFormats();case $.validator.dataTypes.TIME:return getTimeFormats();case $.validator.dataTypes.TIMESTAMP:return getDateTimeFormats();default:return null}}function getTimeFormats(){return["hh:mma","hhmma","HH:mm","HHmm","HH","hha"]}function getDateFormats(){return["dd/MM/yyyy","dd/MM/yy","dd-MM-yyyy","dd-MM-yy","dd.MM.yyyy","dd.MM.yy","ddMMyyyy","ddMMyy","MM/yyyy","MM/yy","MM-yyyy","MM-yy","MM.yyyy","MM.yy","MMyyyy","MMyy","dd-MM"]}function MeGHH(AAcUG,format){var SNXUf=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");AAcUG=AAcUG+"";var KxZst_AAcUG=0;var gdWuL=0;var NdQTT="";var fdLug="";var RCwtH="";var x,y;var YOikR=new Date(0);var osJBp=YOikR.getFullYear();var KFWOn=YOikR.getMonth()+1;var date=YOikR.getDate();var lZPDl=0;var lrUWh=0;var IXqtq=0;var ucZtw=0;var ecdhe="";while(gdWuL<format.length){NdQTT=format.charAt(gdWuL);fdLug="";while((format.charAt(gdWuL)==NdQTT)&&(gdWuL<format.length)){fdLug+=format.charAt(gdWuL);gdWuL++}if(fdLug=="yyyy"||fdLug=="yy"||fdLug=="y"){if(fdLug=="yyyy"){x=4;y=4}if(fdLug=="yy"){x=2;y=2}if(fdLug=="y"){x=2;y=4}osJBp=UehmR(AAcUG,KxZst_AAcUG,x,y);if(osJBp==null){return 0}KxZst_AAcUG+=osJBp.length;if(osJBp.length==2){if(osJBp>SimpleDateFormat.YEAR_ROLLOVER){osJBp=1900+(osJBp-0)}else{osJBp=2000+(osJBp-0)}}}else{if(fdLug=="MMM"){KFWOn=0;for(var KxZst=0;KxZst<SNXUf.length;KxZst++){var TKagH=SNXUf[KxZst];if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+TKagH.length).toLowerCase()==TKagH.toLowerCase()){KFWOn=KxZst+1;if(KFWOn>12){KFWOn-=12}KxZst_AAcUG+=TKagH.length;break}}if(KFWOn==0){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}}else{if(fdLug=="MM"||fdLug=="M"){x=fdLug.length;y=2;KFWOn=UehmR(AAcUG,KxZst_AAcUG,1,y);if(KFWOn==null){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}KxZst_AAcUG+=KFWOn.length}else{if(fdLug=="dd"||fdLug=="d"){x=fdLug.length;y=2;date=UehmR(AAcUG,KxZst_AAcUG,1,y);if(date==null){return 0}if((date<1)||(date>31)){return 0}KxZst_AAcUG+=date.length}else{if(fdLug=="hh"||fdLug=="h"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>12)){return 0}KxZst_AAcUG+=lZPDl.length;lZPDl=Number(lZPDl)}else{if(fdLug=="HH"||fdLug=="H"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>23)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="KK"||fdLug=="K"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>11)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="kk"||fdLug=="k"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>24)){return 0}KxZst_AAcUG+=lZPDl.length;JRHjB--}else{if(fdLug=="mm"||fdLug=="m"){x=fdLug.length;y=2;lrUWh=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lrUWh==null){return 0}if((lrUWh<0)||(lrUWh>59)){return 0}KxZst_AAcUG+=lrUWh.length}else{if(fdLug=="ss"||fdLug=="s"){x=fdLug.length;y=2;IXqtq=UehmR(AAcUG,KxZst_AAcUG,1,y);if(IXqtq==null){return 0}if((IXqtq<0)||(IXqtq>59)){return 0}KxZst_AAcUG+=IXqtq.length}else{if(fdLug=="SSS"||fdLug=="SS"||fdLug=="S"){x=fdLug.length;y=3;ucZtw=UehmR(AAcUG,KxZst_AAcUG,1,y);if(ucZtw==null){return 0}if(ucZtw<0||ucZtw>1000){return 0}KxZst_AAcUG+=ucZtw.length}else{if(fdLug=="a"){if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="am"){ecdhe="AM";KxZst_AAcUG+=ecdhe.length}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="pm"){ecdhe="PM";KxZst_AAcUG+=ecdhe.length}else{return 0}}}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+fdLug.length)!=fdLug){return 0}else{KxZst_AAcUG+=fdLug.length}}}}}}}}}}}}}}if(KxZst_AAcUG!=AAcUG.length){return 0}if(KFWOn==2){if(((osJBp%4==0)&&(osJBp%100!=0))||(osJBp%400==0)){if(date>29){return false}}else{if(date>28){return false}}}if((KFWOn==4)||(KFWOn==6)||(KFWOn==9)||(KFWOn==11)){if(date>30){return false}}if(lZPDl<12&&ecdhe=="PM"){lZPDl+=12}else{if(lZPDl>11&&ecdhe=="AM"){lZPDl-=12}}var WvJmn=new Date(osJBp,KFWOn-1,date,lZPDl,lrUWh,IXqtq);WvJmn.setTime(WvJmn.getTime()+Number(ucZtw));return WvJmn}function UehmR(hLsGd,KxZst,AMPcm,qnPfB){for(x=qnPfB;x>=AMPcm;x--){var fdLug=hLsGd.substring(KxZst,KxZst+x);if(fdLug.length<AMPcm){return null}if(BwFtt(fdLug)){return fdLug}}return null}function BwFtt(AAcUG){var YdeGj="1234567890";for(var KxZst=0;KxZst<AAcUG.length;KxZst++){if(YdeGj.indexOf(AAcUG.charAt(KxZst))==-1){return false}}return true}})(jQuery);(function($){$.fn.toDouble=function(){if(this.length==1){obj=$(this);return processDouble(obj)}var arr=new Array();this.each(function(){obj=$(this);arr.push(processDouble(obj))});return arr};function processDouble(obj){var inputVal=new String(obj.val());var doubleNum=new Number(inputVal.replace(/,/g,""));return doubleNum}})(jQuery);(function($){$.fn.toLong=function(){if(this.length==1){obj=$(this);return processLong(obj)}var arr=new Array();this.each(function(){obj=$(this);arr.push(processLong(obj))});return arr};function processLong(obj){var inputVal=new String(obj.val());var longNum=new Number(inputVal.replace(/,/g,""));return Math.floor(longNum)}})(jQuery);(function($){$.fn.toTimestamp=function(options){var dt=new Date();var defaults={dataformat:"MM/dd/yyyy HH:mm:ss.SSS"};var opts=$.extend({},defaults,options);if(this.length==1){obj=$(this);return processTimestamp(obj,opts)}var arr=new Array();this.each(function(){obj=$(this);arr.push(processTimestamp(obj,opts))});return arr};function processTimestamp(obj,opts){var o=$.meta?$.extend({},opts,obj.data()):opts;var inputVal=new String(obj.val());if(obj.metadata().dataFormat){o.dataformat=obj.metadata().dataFormat}var dt=MeGHH(obj.val(),o.dataformat);return dt?dt:null}function MeGHH(AAcUG,format){var SNXUf=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");AAcUG=AAcUG+"";var KxZst_AAcUG=0;var gdWuL=0;var NdQTT="";var fdLug="";var RCwtH="";var x,y;var YOikR=new Date(0);var osJBp=YOikR.getFullYear();var KFWOn=YOikR.getMonth()+1;var date=YOikR.getDate();var lZPDl=0;var lrUWh=0;var IXqtq=0;var ucZtw=0;var ecdhe="";while(gdWuL<format.length){NdQTT=format.charAt(gdWuL);fdLug="";while((format.charAt(gdWuL)==NdQTT)&&(gdWuL<format.length)){fdLug+=format.charAt(gdWuL);gdWuL++}if(fdLug=="yyyy"||fdLug=="yy"||fdLug=="y"){if(fdLug=="yyyy"){x=4;y=4}if(fdLug=="yy"){x=2;y=2}if(fdLug=="y"){x=2;y=4}osJBp=UehmR(AAcUG,KxZst_AAcUG,x,y);if(osJBp==null){return 0}KxZst_AAcUG+=osJBp.length;if(osJBp.length==2){if(osJBp>SimpleDateFormat.YEAR_ROLLOVER){osJBp=1900+(osJBp-0)}else{osJBp=2000+(osJBp-0)}}}else{if(fdLug=="MMM"){KFWOn=0;for(var KxZst=0;KxZst<SNXUf.length;KxZst++){var TKagH=SNXUf[KxZst];if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+TKagH.length).toLowerCase()==TKagH.toLowerCase()){KFWOn=KxZst+1;if(KFWOn>12){KFWOn-=12}KxZst_AAcUG+=TKagH.length;break}}if(KFWOn==0){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}}else{if(fdLug=="MM"||fdLug=="M"){x=fdLug.length;y=2;KFWOn=UehmR(AAcUG,KxZst_AAcUG,1,y);if(KFWOn==null){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}KxZst_AAcUG+=KFWOn.length}else{if(fdLug=="dd"||fdLug=="d"){x=fdLug.length;y=2;date=UehmR(AAcUG,KxZst_AAcUG,1,y);if(date==null){return 0}if((date<1)||(date>31)){return 0}KxZst_AAcUG+=date.length}else{if(fdLug=="hh"||fdLug=="h"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>12)){return 0}KxZst_AAcUG+=lZPDl.length;lZPDl=Number(lZPDl)}else{if(fdLug=="HH"||fdLug=="H"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>23)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="KK"||fdLug=="K"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>11)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="kk"||fdLug=="k"){x=fdLug.length;y=2;lZPDl=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>24)){return 0}KxZst_AAcUG+=lZPDl.length;JRHjB--}else{if(fdLug=="mm"||fdLug=="m"){x=fdLug.length;y=2;lrUWh=UehmR(AAcUG,KxZst_AAcUG,1,y);if(lrUWh==null){return 0}if((lrUWh<0)||(lrUWh>59)){return 0}KxZst_AAcUG+=lrUWh.length}else{if(fdLug=="ss"||fdLug=="s"){x=fdLug.length;y=2;IXqtq=UehmR(AAcUG,KxZst_AAcUG,1,y);if(IXqtq==null){return 0}if((IXqtq<0)||(IXqtq>59)){return 0}KxZst_AAcUG+=IXqtq.length}else{if(fdLug=="SSS"||fdLug=="SS"||fdLug=="S"){x=fdLug.length;y=3;ucZtw=UehmR(AAcUG,KxZst_AAcUG,1,y);if(ucZtw==null){return 0}if(ucZtw<0||ucZtw>1000){return 0}KxZst_AAcUG+=ucZtw.length}else{if(fdLug=="a"){if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="am"){ecdhe="AM";KxZst_AAcUG+=ecdhe.length}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="pm"){ecdhe="PM";KxZst_AAcUG+=ecdhe.length}else{return 0}}}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+fdLug.length)!=fdLug){return 0}else{KxZst_AAcUG+=fdLug.length}}}}}}}}}}}}}}if(KxZst_AAcUG!=AAcUG.length){return 0}if(KFWOn==2){if(((osJBp%4==0)&&(osJBp%100!=0))||(osJBp%400==0)){if(date>29){return false}}else{if(date>28){return false}}}if((KFWOn==4)||(KFWOn==6)||(KFWOn==9)||(KFWOn==11)){if(date>30){return false}}if(lZPDl<12&&ecdhe=="PM"){lZPDl+=12}else{if(lZPDl>11&&ecdhe=="AM"){lZPDl-=12}}var WvJmn=new Date(osJBp,KFWOn-1,date,lZPDl,lrUWh,IXqtq);WvJmn.setTime(WvJmn.getTime()+Number(ucZtw));return WvJmn}function UehmR(hLsGd,KxZst,AMPcm,qnPfB){for(x=qnPfB;x>=AMPcm;x--){var fdLug=hLsGd.substring(KxZst,KxZst+x);if(fdLug.length<AMPcm){return null}if(BwFtt(fdLug)){return fdLug}}return null}function BwFtt(AAcUG){var YdeGj="1234567890";for(var KxZst=0;KxZst<AAcUG.length;KxZst++){if(YdeGj.indexOf(AAcUG.charAt(KxZst))==-1){return false}}return true}})(jQuery);
(function($){$.extend({xatvalue:{defaults:{condition:"$this.val() == value",triggerDependent:true,labels:null,callback:null,callbackAfterLoad:null},defaultEvent:"xatvalueEvent",defaultXs:["enableAtValue","disableAtValue","unhideAtValue","hideAtValue","mandatoryAtValue","notMandatoryAtValue"],defaultXsHandling:["element.enable().toggleLabelAsterisk(opts.labels);","element.disable().toggleLabelAsterisk(opts.labels);","element.unhide().unhideLabel(opts.labels).toggleLabelAsterisk(opts.labels);","element.hideField().hideLabel(opts.labels).toggleLabelAsterisk(opts.labels);","element.setMandatory(true, opts.labels);","element.setMandatory(false, opts.labels); "],uiDefaults:{labelIdentifier:"_LBL",mandatoryAsteriskContainer:"span[class=MandatoryAsterisk]",mandatoryAsterisk:"*",notMandatoryAsterisk:"&nbsp;",disabledClass:"ui-state-disabled",hidingSpeed:"fast"},hasClassMetadata:function(element){return !$.isEmptyObject(element.metadata())},getElementMetaData:function(element){var metadata=element.metadata();var isEmpty=$.isEmptyObject(metadata);return isEmpty?element.get(0):metadata},setMetaAttr:function(element,metaAttr,value){var elementMetaData=$.xatvalue.getElementMetaData(element);var val=value?value:undefined;elementMetaData[metaAttr]=val;if($.xatvalue.hasClassMetadata(element)){element.attr("class",element.attr("class").replace(/{.*}/,JSON.stringify(elementMetaData)))}},getMetaAttr:function(element,metaAttr){var metaAttrVal=$.xatvalue.getElementMetaData(element)[metaAttr];if(metaAttrVal){return metaAttrVal}return""},getLabelElement:function(element){return $("#"+element.attr("name")+$.xatvalue.uiDefaults.labelIdentifier)},iterateLabels:function(labels,callback){if($.isArray(labels)){for(var i=0;i<labels.length;i++){callback($("#"+labels[i]+$.xatvalue.uiDefaults.labelIdentifier))}}else{callback($("#"+labels+$.xatvalue.uiDefaults.labelIdentifier))}},toggleLabelAsterisk:function(element,elementLabel){if(elementLabel.length>0){var mandatoryMarker=element.isMandatory()&&!element.is(":disabled")?$.xatvalue.uiDefaults.mandatoryAsterisk:$.xatvalue.uiDefaults.notMandatoryAsterisk;elementLabel.find($.xatvalue.uiDefaults.mandatoryAsteriskContainer).html(mandatoryMarker);try{var iForm=IS.getDefaultForm();if(iForm){var validator=$(iForm).validate();if(validator){var settings=validator.settings;var errorClass=settings.errorClass;settings.toggleLabelHighlight(element,settings.errorClass,null,settings.validLabelImageSrc,element.getLabel())}}}catch(e){}}},isDefaultConditionOverriden:function(condition){return !($.xatvalue.defaults.condition==condition)},overrideConditionIfNoValue:function(opts){if(!$.xatvalue.isDefaultConditionOverriden(opts.condition)){if(!opts.value){opts.condition=opts.controlCondition}}},defaultHandler:function(selectedElems,dependentElems,value,options){var opts=$.extend({value:value,dependentElems:dependentElems},$.xatvalue.defaults,options);opts.loaded=false;if(opts.labels){$.xatvalue.setLabel(dependentElems,opts.labels)}return selectedElems.each(function(){$this=$(this);type=$this.attr("type");if(this.tagName=="INPUT"&&(type=="radio"||type=="checkbox")){if(type=="radio"||eval(opts.condition)){opts.controlCondition='$this.is(":checked")';$.xatvalue.overrideConditionIfNoValue(opts);$this.on("click",opts,function(event){$.xatvalue.eventHandler(event,this)}).on($.xatvalue.defaultEvent,opts,function(event){$.xatvalue.eventHandler(event,this)});if($this.is(":checked")){$this.triggerHandler($.xatvalue.defaultEvent)}}}else{var event=this.tagName=="SELECT"?"change":"blur";opts.controlCondition='$this.val() != ""';$.xatvalue.overrideConditionIfNoValue(opts);$this.on(event,opts,function(event){$.xatvalue.eventHandler(event,this)}).on($.xatvalue.defaultEvent,opts,function(event){$.xatvalue.eventHandler(event,this)}).triggerHandler($.xatvalue.defaultEvent)}})},eventHandler:function(event,element){var $this=$(element);var v=$this.val();var opts=event.data;var value=opts.value;var handler;if($this.is(":disabled")||!eval(opts.controlCondition)){handler=opts.unsatisfyHandler}else{var cond=opts.condition;var result=jQuery.isFunction(cond)?cond($this,opts):eval(cond);if(result){handler=opts.satisfyHandler}else{handler=opts.unsatisfyHandler}}opts.dependentElems.each(function(){var element=$(this);handler(element,opts);if(opts.triggerDependent){element.triggerHandler($.xatvalue.defaultEvent)}});if(opts.callback){opts.callback(v,$this)}if(opts.loaded&&opts.callbackAfterLoad){opts.callbackAfterLoad(v,$this)}opts.loaded=true},setLabel:function setLabels(object,labels){var lbl;if(labels){if($.isArray(labels)){var labelBuilder;for(var i=0;i<labels.length;i++){if(i==0){labelBuilder="#"+labels[i]+$.xatvalue.uiDefaults.labelIdentifier}else{labelBuilder=labelBuilder+", #"+labels[i]+$.xatvalue.uiDefaults.labelIdentifier}}lbl=$(labelBuilder)}else{lbl=$("#"+labels+$.xatvalue.uiDefaults.labelIdentifier)}object.each(function(){this.lbl=lbl})}}}})})(jQuery);jQuery.each($.xatvalue.defaultXs,function(i,name){$.fn[name]=function(object,value,options){var defaults={satisfyHandler:function(element,opts){eval($.xatvalue.defaultXsHandling[i])},unsatisfyHandler:function(element,opts){eval($.xatvalue.defaultXsHandling[i%2==0?i+1:i-1])}};if(typeof(value)!="string"){options=value;value=null}return $.xatvalue.defaultHandler(this,object,value,$.extend({},defaults,options))}});$.fn.enable=function(enable){if(enable!=undefined&&!enable){return this.disable()}this.each(function(){var $this=$(this);if($this.is(":button")){addButtonHighlightClass($this)}});return this.prop("disabled",false).removeClass($.xatvalue.uiDefaults.disabledClass)};$.fn.disable=function(disable){if(disable!=undefined&&!disable){return this.enable()}this.each(function(){var $this=$(this);if($this.is(":button")){removeButtonHighlightClass($this)}});return this.prop("disabled",true).addClass($.xatvalue.uiDefaults.disabledClass)};$.fn.hideField=function(){return this.prop("disabled",true).fadeTo($.xatvalue.uiDefaults.hidingSpeed,0)};$.fn.unhide=function(){return this.prop("disabled",false).fadeTo($.xatvalue.uiDefaults.hidingSpeed,1)};$.fn.toggleLabelAsterisk=function(labels){this.each(function(){var element=$(this);$.xatvalue.toggleLabelAsterisk(element,$.xatvalue.getLabelElement(element))});if(labels){var elem=$(this).eq(0);$.xatvalue.iterateLabels(labels,function(label){$.xatvalue.toggleLabelAsterisk(elem,label)})}return this};$.fn.hideLabel=function(labels){this.each(function(){$.xatvalue.getLabelElement($(this)).hideField()});if(labels){$.xatvalue.iterateLabels(labels,function(label){label.hideField()})}return this};$.fn.unhideLabel=function(labels){this.each(function(){$.xatvalue.getLabelElement($(this)).unhide()});if(labels){$.xatvalue.iterateLabels(labels,function(label){label.unhide()})}return this};$.fn.setMandatory=function(isMandatory,labels){this.each(function(){var element=$(this);if(isMandatory){element.metaAttr("mandatory","mandatory");element.attr("aria-required",true)}else{element.removeMetaAttr("mandatory");element.attr("aria-required",false)}$.xatvalue.toggleLabelAsterisk(element,$.xatvalue.getLabelElement(element))});if(labels){var elem=$(this).eq(0);$.xatvalue.iterateLabels(labels,function(label){$.xatvalue.toggleLabelAsterisk(elem,label)})}return this};$.fn.metaAttr=function(metaAttr,value){if(value||value==""){return $.xatvalue.setMetaAttr(this.eq(0),metaAttr,value)}return $.xatvalue.getMetaAttr(this.eq(0),metaAttr)};$.fn.removeMetaAttr=function(metaAttr){$.xatvalue.setMetaAttr(this.eq(0),metaAttr,"");return this};$.fn.notify=function(){return this.each(function(){var element=$(this);if(element.is(":radio,:checkbox")&&element.is(":checked")){element.triggerHandler("click")}else{if(element.is("select")){element.triggerHandler("change")}else{element.triggerHandler("blur")}}})};$.fn.setAsNotModified=function(){return this.each(function(){var element=$(this);var type=element.attr("type");if(this.tagName=="INPUT"&&(type=="radio"||type=="checkbox")){this.defaultChecked=this.checked}else{if(element.is("select")){element.find("option:not(:selected)").prop("defaultSelected",false);element.find("option:selected").prop("defaultSelected",true)}else{this.defaultValue=this.value}}})};$.fn.isMandatory=function(){var elemMetadata=$.xatvalue.getElementMetaData(this);if(elemMetadata.mandatory!=null||elemMetadata.mandatory!=undefined){return true}return false};function removeButtonHighlightClass($button){var highlighButtonClasses=["btn_s5h","btn_s6h","btn_s7h"];for(var i=0;i<highlighButtonClasses.length;i++){if($button.hasClass(highlighButtonClasses[i])){$button.removeClass(highlighButtonClasses[i]).addClass("n"+highlighButtonClasses[i]);break}}}function addButtonHighlightClass($button){var buttonClasses=["nbtn_s5h","nbtn_s6h","nbtn_s7h"];for(var i=0;i<buttonClasses.length;i++){if($button.hasClass(buttonClasses[i])){$button.addClass(buttonClasses[i].substring(1));break}}}function enableButton(button){var buttonClasses=["tinyd","btn_s5d","btn_s6d","btn_s7d"];for(var i=0;i<buttonClasses.length;i++){if($(button).hasClass(buttonClasses[i])){$(button).removeClass(buttonClasses[i]);break}$(button).removeClass("ui-state-disabled")}$(button).prop("disabled",false)}function disableButton(button){var buttonClasses=["tiny","btn_s5","btn_s6","btn_s7"];for(var i=0;i<buttonClasses.length;i++){if($(button).hasClass(buttonClasses[i])){$(button).addClass(buttonClasses[i]+"d");break}$(button).addClass("ui-state-disabled")}$(button).prop("disabled",true)};
/*
 * jQuery UI 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function($,undefined){$.ui=$.ui||{};if($.ui.version){return}$.extend($.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem)}},delay)}):this._focus.apply(this,arguments)},scrollParent:function(){var scrollParent;scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1))}).eq(0);return(/fixed/).test(this.css("position"))||!scrollParent.length?$(document):scrollParent},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex)}if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"));if(!isNaN(value)&&value!=0){return value}}elem=elem.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(event){event.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.curCSS(elem,"padding"+this,true))||0;if(border){size-=parseFloat($.curCSS(elem,"border"+this+"Width",true))||0}if(margin){size-=parseFloat($.curCSS(elem,"margin"+this,true))||0}});return size}$.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this)}return this.each(function(){$.style(this,type,reduce(this,size)+"px")})};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size)}return this.each(function(){$.style(this,type,reduce(this,size,true,margin)+"px")})}});function visible(element){return !$(element).parents().andSelf().filter(function(){return $.curCSS(this,"visibility")==="hidden"||$.expr.filters.hidden(this)}).length}$.extend($.expr.pseudos,{data:function(elem,i,match){return !!$.data(elem,match[3])},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,"tabindex");if("area"===nodeName){var map=element.parentNode,mapName=map.name,img;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false}img=$("img[usemap=#"+mapName+"]")[0];return !!img&&visible(img)}return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&visible(element)},tabbable:function(element){var tabIndex=$.attr(element,"tabindex");return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(":focusable")}});$(function(){var div=document.createElement("div"),body=document.body;$.extend(div.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});$.support.minHeight=body.appendChild(div).offsetHeight===100;body.removeChild(div).style.display="none"});$.extend($.ui,{plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return}for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false}var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true}el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size))},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width)}})})(jQuery);
function doReset(){window.location.href=window.top.location.href}function doClearFormFields(itemList,form){form=form?form:document.forms[0];$(form).validate().resetForm();for(var i=0;i<itemList.length;i++){var item=$("[name="+itemList[i]+"]",form);if(item.length>1){item=item.filter(":checked").prop("checked",false)}else{item.val("")}}for(var x=0;x<form.elements.length;x++){if(canFocusControl(form.elements[x])){form[x].focus();break}}}function canFocusControl(item){return item.type!="hidden"&&item.type!="file"&&item.type!="button"&&item.type!="submit"&&item.type!="reset"&&!(item.type.indexOf("select")==0)&&item.focus&&item.offsetWidth>0&&item.offsetHeight>0&&!item.disabled&&!item.readOnly}function doFilter(gridId){if(gridId){GridUtils.refreshGrid(gridId)}else{alert("Please pass Grid Id or use doSearch instead if you have to separate pages for your criteria and results.")}}function doRefineSearch(e,action){$(e.form).attr("action",action).attr("target","_self").submit()}function checkAtLeastOneCriteria(itemList,form){form=form?form:document.forms[0];var hasCriterion=false;for(var i=0;i<itemList.length;i++){var item=$("[name="+itemList[i]+"]",form);if(item.length>1){item=item.filter(":checked")}hasCriterion=item.val()!=null&&item.val()!="";if(hasCriterion){break}}return hasCriterion}function doSearchAgain(){$("input[name=REFINE]").click();return false};
var _HTML_RE=new RegExp("[<>\"'&\r\n]");function _escapeHtmlChar(c,showLineBreak){switch(c){case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#39;";case"&":return"&amp;";case"\n":if(showLineBreak){return"<BR>\n"}else{return"\n"}}return""}function escapeHtml(str,showLineBreak,keepSpaces){if(!str){return""}var res;var n=str.search(_HTML_RE);if(n>=0){res=str.substring(0,n)+_escapeHtmlChar(str.charAt(n),showLineBreak)+escapeHtml(str.substring(n+1),showLineBreak,keepSpaces)}else{res=str}if(!keepSpaces){return res}else{return res.replace(/  /gi," &nbsp;")}}var _JS_RE=new RegExp("[\\\"'\r\n]");function _escapeJsChar(c,showLineBreak){switch(c){case"\\":return"\\\\";case'"':return"\\\x22";case"'":return"\\\x27";case"\r":return"\\\r";case"\n":return"\\\n"}return""}function escapeJs(str){if(!str){return""}var res;var n=str.search(_JS_RE);if(n>=0){return str.substring(0,n)+_escapeJsChar(str.charAt(n))+escapeJs(str.substring(n+1))}else{return str}};
var checkModifiedOnLeave=true;function doCheckModified(Eaeah){if(!Eaeah){Eaeah="Do you wish to leave without saving your changes?"}return(checkModifiedOnLeave&&$(document.forms[0]).isModified()&&!confirm(Eaeah))}var checkNotModifiedOnLeave=true;function doCheckNotModified(){if(!checkNotModifiedOnLeave||NavHandler.isRedirecting){return false}var topModal=window.top.getTopModal();if(topModal&&window!=topModal.Frame.contentWindow){return false}return true}function depedencyEventHandler(e){var data=e.data;jQuery.post(data.url,data.params,function(responseData){var opts={};if(data.callback){data.callback(opts)}if(!opts.preventDefault){var sb=new StringBuilder();var dependentMeta=data.dependent.metadata();if(!dependentMeta.hide_blank){var blankOption="Please select";if(dependentMeta.blankOption){blankOption=dependentMeta.blankOption}sb.appendFormat(data.messageFormat,"",blankOption)}var responseArray=eval("("+responseData+")");var i;for(i=0;i<responseArray.length;i+=2){sb.appendFormat(data.messageFormat,escapeHtml(responseArray[i]),escapeHtml(responseArray[i+1]))}data.dependent.html(sb.toString()).triggerHandler("lookupDependencyEvent")}},"text")}function rangeEventHandler(event){if(event.data.copyElem.val()!=""){return}event.data.copyElem.val(event.data.handler(event.target.value))}function exactCopy(value){return value}function convertToUpperCase(elem){var val=elem.value;if(val){elem.value=elem.value.toUpperCase()}}function StringBuilder(value){this.builder=[];this.append(value)}StringBuilder.prototype.append=function(value){if(value){this.builder.push(value)}return this};StringBuilder.prototype.appendFormat=function(pattern){if(pattern){var args=arguments;this.builder.push(pattern.replace(/\{(\d+)\}/g,function(){return args[(parseInt(arguments[1])+1)]}))}return this};StringBuilder.prototype.clear=function(){this.builder.length=0};StringBuilder.prototype.toString=function(){return this.builder.join("")};var DateTypes={DATE:4,TIME:5,TIMESTAMP:6};function _autoFormatDate(element){var $element=$(element);var value=$element.val();if($.trim(value)==""){return}var currDataFormat=$element.metadata().dataFormat;var formats=(new Array(currDataFormat)).concat(_getDateFormatsArray($element));var n=formats.length;for(var i=0;i<n;i++){var d=(new SimpleDateFormat(formats[i])).parse(value);if(d&&d.constructor==Date){$element.toFmtString(d);return}}}function _formatDateTimeTo(element){var $element=$(element);var value=$element.val();if($.trim(value)==""){return}var currDataFormat=$element.metadata().dataFormat;var formats=new Array(currDataFormat).concat(_getDateFormatsArray($element));var n=formats.length;for(var i=0;i<n;i++){var d=new SimpleDateFormat(formats[i]).parse(value);if(d&&d.constructor==Date){if(formats[i].indexOf("HH:mm")<0){d.setHours(23,59,59,0)}$element.toFmtString(d);return}}}function _getDateFormatsArray($element){var dataType=$element.metadata().datatype;switch(parseInt(dataType)){case DateTypes.DATE:return getDateFormats();case DateTypes.TIME:return getTimeFormats();case DateTypes.TIMESTAMP:return getDateTimeFormats();default:return null}}function getDateFormats(){return["dd/MM/yyyy","dd/MM/yy","dd-MM-yyyy","dd-MM-yy","dd.MM.yyyy","dd.MM.yy","ddMMyyyy","ddMMyy"]}function getDateTimeFormats(){var dates=getDateFormats();var times=getTimeFormats();var formats=new Array();for(var i=0;i<dates.length;i++){var dateFormat=dates[i];formats.push(dateFormat);for(var j=0;j<times.length;j++){formats.push(dateFormat+" "+times[j])}}return formats}function getTimeFormats(){return["hh:mma","hhmma","HH:mm","HHmm","HH","hha"]}var ROUND_CEILING=0;var ROUND_DOWN=1;var ROUND_FLOOR=2;var ROUND_HALF_DOWN=3;var ROUND_HALF_EVEN=4;var ROUND_HALF_UP=5;var ROUND_UP=7;function MScik(UrRup,fGncJ,ZBNtu){var YYgSE=new BigDecimal("0");YYgSE.PtSam=UrRup;YYgSE.grAaU=fGncJ;YYgSE.DcQEP=ZBNtu;return YYgSE}function BigDecimal(AAcUG){this.PtSam=new Array();this.grAaU=new Array();this.DcQEP=1;var KUCDi=String(AAcUG).trim();var KxZst;var ojdKY=false;for(KxZst=0;KxZst<KUCDi.length;KxZst++){var NdQTT=KUCDi.charAt(KxZst);if(NdQTT=="."){ojdKY=true}else{if(NdQTT=="+"){this.DcQEP=1}else{if(NdQTT=="-"){this.DcQEP=-1}else{if(!isNaN(NdQTT)){if(ojdKY){this.grAaU.push(Number(NdQTT))}else{this.PtSam.push(Number(NdQTT))}}}}}}this.normalize()}BigDecimal.prototype.normalize=HmZvD;BigDecimal.prototype.toString=cdQLH;BigDecimal.prototype.equals=wcWSa;BigDecimal.prototype.compareTo=wYwjE;BigDecimal.prototype.clone=UIDOO;BigDecimal.prototype.negate=pMIkr;BigDecimal.prototype.movePointLeft=OADQO;BigDecimal.prototype.movePointRight=eWvTk;BigDecimal.prototype.abs=pGqvM;BigDecimal.prototype.max=UBAZS;BigDecimal.prototype.min=agRoL;BigDecimal.prototype.add=JUqxw;BigDecimal.prototype.subtract=pXFfl;BigDecimal.prototype.multiply=KJlgk;BigDecimal.prototype.divide=eXhSn;BigDecimal.prototype.PPHQK=lIVww;BigDecimal.prototype.qlpCo=PgeVk;BigDecimal.prototype.kAqHC=ogUVo;function HmZvD(){if(this.PtSam.length==0){this.PtSam.push(0)}if(this.grAaU.length==0){this.grAaU.push(0)}for(var KxZst=this.grAaU.length-1;KxZst>=0;KxZst--){if(this.grAaU[KxZst]<0){this.grAaU[KxZst]+=10;if(KxZst==0){this.PtSam[this.PtSam.length-1]--}else{this.grAaU[KxZst-1]--}}else{if(this.grAaU[KxZst]>=10){var cMYGc=this.grAaU[KxZst];this.grAaU[KxZst]=cMYGc%10;if(KxZst==0){this.PtSam[this.PtSam.length-1]+=Math.floor(cMYGc/10)}else{this.grAaU[KxZst-1]+=Math.floor(cMYGc/10)}}}}for(var KxZst=this.PtSam.length-1;KxZst>=0;KxZst--){if(this.PtSam[KxZst]<0){this.PtSam[KxZst]+=10;this.PtSam[KxZst-1]--}else{if(this.PtSam[KxZst]>=10){var cMYGc=this.PtSam[KxZst];this.PtSam[KxZst]=cMYGc%10;if(KxZst==0){this.PtSam.unshift(Math.floor(cMYGc/10))}else{this.PtSam[KxZst-1]+=Math.floor(cMYGc/10)}}}}while(this.PtSam.length>1&&this.PtSam[0]==0){this.PtSam.shift()}while(this.grAaU.length>1&&this.grAaU[this.grAaU.length-1]==0){this.grAaU.pop()}if(this.PtSam.length==1&&this.PtSam[0]==0&&this.grAaU.length==1&&this.grAaU[0]==0){this.DcQEP=1}}function cdQLH(){var jncwT="";var KxZst;if(this.DcQEP<0){jncwT="-"}for(KxZst=0;KxZst<this.PtSam.length;KxZst++){jncwT=jncwT+String(this.PtSam[KxZst])}for(KxZst=0;KxZst<this.grAaU.length;KxZst++){if(KxZst==0){jncwT=jncwT+"."}jncwT=jncwT+String(this.grAaU[KxZst])}return jncwT}function wYwjE(AAcUG){if(AAcUG==Number.NEGATIVE_INFINITY){return 1}else{if(AAcUG==Number.POSITIVE_INFINITY){return -1}}if(this.PtSam.length>AAcUG.PtSam.length){return(this.DcQEP)}else{if(this.PtSam.length<AAcUG.PtSam.length){return(-1*AAcUG.DcQEP)}}var KxZst;for(KxZst=0;KxZst<this.PtSam.length;KxZst++){if(Number(this.PtSam[KxZst])>Number(AAcUG.PtSam[KxZst])){return(this.DcQEP)}else{if(Number(this.PtSam[KxZst])<Number(AAcUG.PtSam[KxZst])){return(-1*AAcUG.DcQEP)}}}if(this.grAaU.length==0&&AAcUG.grAaU.length==0){if(this.DcQEP>AAcUG.DcQEP){return 1}if(this.DcQEP<AAcUG.DcQEP){return -1}return 0}if(this.grAaU.length==1&&AAcUG.grAaU.length==1&&this.grAaU[0]==AAcUG.grAaU[0]){if(this.DcQEP>AAcUG.DcQEP){return 1}if(this.DcQEP<AAcUG.DcQEP){return -1}return 0}var cMYGc=this.grAaU.length>AAcUG.grAaU.length?this.grAaU.length:AAcUG.grAaU.length;var aoGBe=this.movePointRight(cMYGc);var Gexlh=AAcUG.movePointRight(cMYGc);return aoGBe.compareTo(Gexlh)}function wcWSa(AAcUG){return(this.compareTo(AAcUG)==0)}function UIDOO(){return MScik(this.PtSam.slice(0),this.grAaU.slice(0),new Number(this.DcQEP))}function pMIkr(){var YYgSE=this.clone();YYgSE.DcQEP=-YYgSE.DcQEP;YYgSE.normalize();return YYgSE}function eWvTk(cMYGc){var YYgSE=this.clone();var KxZst;for(KxZst=0;KxZst<cMYGc;KxZst++){if(YYgSE.grAaU.length>0){if(YYgSE.PtSam.length==1&&YYgSE.PtSam[0]==0){YYgSE.PtSam[0]=YYgSE.grAaU.shift()}else{YYgSE.PtSam.push(YYgSE.grAaU.shift())}}else{YYgSE.PtSam.push(0)}}YYgSE.normalize();return YYgSE}function OADQO(cMYGc){var YYgSE=this.clone();var KxZst;for(KxZst=0;KxZst<cMYGc;KxZst++){if(YYgSE.PtSam.length==1){YYgSE.grAaU.unshift(YYgSE.PtSam[0]);if(YYgSE.PtSam[0]!=0){YYgSE.PtSam[0]=0}}else{YYgSE.grAaU.unshift(YYgSE.PtSam.pop())}}YYgSE.normalize();return YYgSE}function pGqvM(){var YYgSE=this.clone();YYgSE.DcQEP=1;return YYgSE}function UBAZS(AAcUG){return this.compareTo(AAcUG)>=0?this:AAcUG}function agRoL(AAcUG){return this.compareTo(AAcUG)<=0?this:AAcUG}function JUqxw(AAcUG){if(this.DcQEP==1){if(AAcUG.DcQEP==-1){return this.subtract(AAcUG.negate())}}else{if(AAcUG.DcQEP==-1){return AAcUG.negate().add(this.negate()).negate()}else{return AAcUG.subtract(this.negate())}}var aoGBe=this.clone();var Gexlh=AAcUG.clone();var KxZst;if(aoGBe.grAaU.length>Gexlh.grAaU.length){var ePJFf=aoGBe.grAaU.length-Gexlh.grAaU.length;for(KxZst=0;KxZst<ePJFf;KxZst++){Gexlh.grAaU.push(0)}}else{if(Gexlh.grAaU.length>aoGBe.grAaU.length){var ePJFf=Gexlh.grAaU.length-aoGBe.grAaU.length;for(KxZst=0;KxZst<ePJFf;KxZst++){aoGBe.grAaU.push(0)}}}for(KxZst=0;KxZst<aoGBe.grAaU.length;KxZst++){aoGBe.grAaU[KxZst]+=Gexlh.grAaU[KxZst]}if(aoGBe.PtSam.length>Gexlh.PtSam.length){var ePJFf=aoGBe.PtSam.length-Gexlh.PtSam.length;for(KxZst=0;KxZst<ePJFf;KxZst++){Gexlh.PtSam.unshift(0)}}else{if(Gexlh.PtSam.length>aoGBe.PtSam.length){var ePJFf=Gexlh.PtSam.length-aoGBe.PtSam.length;for(KxZst=0;KxZst<ePJFf;KxZst++){aoGBe.PtSam.unshift(0)}}}for(KxZst=0;KxZst<aoGBe.PtSam.length;KxZst++){aoGBe.PtSam[KxZst]+=Gexlh.PtSam[KxZst]}aoGBe.normalize();return aoGBe}function pXFfl(AAcUG){if(this.DcQEP==1){if(AAcUG.DcQEP==-1){return this.add(AAcUG.negate())}}else{if(AAcUG.DcQEP==-1){return AAcUG.negate().subtract(this.negate())}else{return AAcUG.add(this.negate()).negate()}}if(this.compareTo(AAcUG)==0){return new BigDecimal("0")}if(this.compareTo(AAcUG)>0){var aoGBe=this.clone();var Gexlh=AAcUG.clone();var KxZst;if(aoGBe.grAaU.length>Gexlh.grAaU.length){var ePJFf=aoGBe.grAaU.length-Gexlh.grAaU.length;for(KxZst=0;KxZst<ePJFf;KxZst++){Gexlh.grAaU.push(0)}}else{if(Gexlh.grAaU.length>aoGBe.grAaU.length){var ePJFf=Gexlh.grAaU.length-aoGBe.grAaU.length;for(KxZst=0;KxZst<ePJFf;KxZst++){aoGBe.grAaU.push(0)}}}for(KxZst=0;KxZst<aoGBe.grAaU.length;KxZst++){aoGBe.grAaU[KxZst]-=Gexlh.grAaU[KxZst]}var cMYGc=0;for(KxZst=aoGBe.grAaU.length-1;KxZst>=0;KxZst--){if(aoGBe.grAaU[KxZst]>=10){if(KxZst>0){aoGBe.grAaU[KxZst-1]-=Math.floor(aoGBe.grAaU[KxZst]/10)}else{cMYGc=Math.floor(aoGBe.grAaU[KxZst]/10)}aoGBe.grAaU[KxZst]=aoGBe.grAaU[KxZst]%10}}if(aoGBe.PtSam.length>Gexlh.PtSam.length){var ePJFf=aoGBe.PtSam.length-Gexlh.PtSam.length;for(KxZst=0;KxZst<ePJFf;KxZst++){Gexlh.PtSam.unshift(0)}}else{if(Gexlh.PtSam.length>aoGBe.PtSam.length){var ePJFf=Gexlh.PtSam.length-aoGBe.PtSam.length;for(KxZst=0;KxZst<ePJFf;KxZst++){aoGBe.PtSam.unshift(0)}}}for(KxZst=0;KxZst<aoGBe.PtSam.length;KxZst++){aoGBe.PtSam[KxZst]-=Gexlh.PtSam[KxZst]}aoGBe.PtSam[aoGBe.PtSam.length-1]+=cMYGc;cMYGc=0;for(KxZst=aoGBe.PtSam.length-1;KxZst>=0;KxZst--){if(aoGBe.PtSam[KxZst]>=10){if(KxZst<aoGBe.PtSam.length-1){aoGBe.PtSam[KxZst-1]-=Math.floor(aoGBe.PtSam[KxZst]/10)}else{cMYGc=Math.floor(aoGBe.PtSam[KxZst]/10)}aoGBe.PtSam[KxZst]=aoGBe.PtSam[KxZst]%10}}aoGBe.PtSam.unshift(cMYGc);aoGBe.normalize();return aoGBe}else{return AAcUG.subtract(this).negate()}}function lIVww(){var HRVpN=true;var VvgYA=0;if(this.PtSam[0]==1){for(var KxZst=1;KxZst<this.PtSam.length;KxZst++,VvgYA++){HRVpN=(HRVpN&&(this.PtSam[KxZst]==0))}for(var KxZst=0;KxZst<this.grAaU.length;KxZst++){HRVpN=(HRVpN&&(this.grAaU[KxZst]==0))}}else{HRVpN=false}return(HRVpN?this.DcQEP*VvgYA:0)}function KJlgk(AAcUG){var tCQZs=new BigDecimal("0");var GKJYm=new BigDecimal("1");if(this.equals(tCQZs)||AAcUG.equals(tCQZs)){return tCQZs}if(this.equals(GKJYm)){return AAcUG.clone()}if(AAcUG.equals(GKJYm)){return this.clone()}if(this.equals(GKJYm.negate())){return AAcUG.negate()}if(AAcUG.equals(GKJYm.negate())){return this.negate()}var Vfjio=this.PPHQK();if(Vfjio>0){return AAcUG.movePointRight(Vfjio)}if(Vfjio<0){return AAcUG.movePointRight(-Vfjio).negate()}Vfjio=AAcUG.PPHQK();if(Vfjio>0){return this.movePointRight(Vfjio)}if(Vfjio<0){return this.movePointRight(-Vfjio).negate()}var WFMUC=this.qlpCo();var ZrtKd=AAcUG.qlpCo();var cMYGc=WFMUC+ZrtKd;var aoGBe=this.movePointRight(WFMUC);var Gexlh=AAcUG.movePointRight(ZrtKd);var MelFh=new Array(aoGBe.PtSam.length+Gexlh.PtSam.length);for(var KxZst=0;KxZst<MelFh.length;KxZst++){MelFh[KxZst]=0}for(var KxZst=0;KxZst<Gexlh.PtSam.length;KxZst++){for(var cpdcK=0;cpdcK<aoGBe.PtSam.length;cpdcK++){MelFh[KxZst+cpdcK+1]+=(Gexlh.PtSam[KxZst]*aoGBe.PtSam[cpdcK])}}var bJprv=MScik(MelFh,[0],aoGBe.DcQEP*Gexlh.DcQEP);bJprv.normalize();return bJprv.movePointLeft(cMYGc)}function PgeVk(){var VvgYA=this.grAaU.length;if((VvgYA==1)&&(this.grAaU[0]==0)){return 0}return VvgYA}function ogUVo(){var VvgYA=this.PtSam.length;if((VvgYA==1)&&(this.PtSam[0]==0)){return 0}return VvgYA}function FexSm(wrZIl,UJPgX){var Qqafc=new Object();if(wrZIl.equals(new BigDecimal("0"))){Qqafc.number=wrZIl;Qqafc.moves=1;return Qqafc}Qqafc.number=wrZIl.clone();Qqafc.moves=0;var giKDZ=wrZIl.kAqHC()-UJPgX.kAqHC();if(giKDZ<0){Qqafc.number=wrZIl.movePointRight(-giKDZ);Qqafc.moves=-giKDZ}if(Qqafc.number.compareTo(UJPgX)<0){Qqafc.number=Qqafc.number.movePointRight(1);Qqafc.moves=Qqafc.moves+1}return Qqafc}function bHYaj(wrZIl,UJPgX){var Qqafc=new Object();var OTOPn=1;var RqwHi=new BigDecimal("0");var UppqP=UJPgX.clone();while(true){var PQfPg=wrZIl.compareTo(UppqP);if(PQfPg==0){Qqafc.quotient=OTOPn;Qqafc.remainder=new BigDecimal("0");return Qqafc}else{if(PQfPg<0){Qqafc.quotient=OTOPn-1;Qqafc.remainder=wrZIl.subtract(RqwHi);return Qqafc}}RqwHi=UppqP;UppqP=UppqP.add(UJPgX);OTOPn++}}function euVBF(EChDD,uWJTr){var VmhsM=(uWJTr?1:-1);if(EChDD.length==0){EChDD.push(VmhsM)}else{if(EChDD.length==1){EChDD.pop();EChDD.push(VmhsM)}else{EChDD.pop();EChDD[EChDD.length-1]=EChDD[EChDD.length-1]+VmhsM}}}function eXhSn(TuLYt,nrsGi,EBIWb){var HUqCc=new BigDecimal("0");var EPUPA;if(TuLYt.equals(HUqCc)){throw"Division by zero. Die!!!"}if(this.equals(HUqCc)){return HUqCc}if(this.abs().equals(TuLYt.abs())){EPUPA=new BigDecimal("1");EPUPA.DcQEP=this.DcQEP*TuLYt.DcQEP;return EPUPA}var keJpj=this.DcQEP*TuLYt.DcQEP;var PnpSN=TuLYt.qlpCo();var TnkVJ=this.qlpCo();var dvwUI=TuLYt.movePointRight(PnpSN).abs();var brjqT=this.movePointRight(PnpSN).abs();var mnPHF=0;var giKDZ=brjqT.kAqHC()-dvwUI.kAqHC();if(giKDZ>0){brjqT=brjqT.movePointLeft(giKDZ);mnPHF=-giKDZ}var FTatT=new Array();while(!brjqT.equals(HUqCc)&&(mnPHF<=nrsGi)){var Qqafc=FexSm(brjqT,dvwUI);brjqT=Qqafc.number;giKDZ=Qqafc.moves;Qqafc=bHYaj(brjqT,dvwUI);brjqT=Qqafc.remainder;if(giKDZ>1){for(var KxZst=0;KxZst<giKDZ-1;KxZst++){FTatT.push(0)}}FTatT.push(Qqafc.quotient);mnPHF=mnPHF+giKDZ}while(mnPHF-1>nrsGi){if(FTatT.length>0){FTatT.pop()}mnPHF--}if(mnPHF-1==nrsGi||!(brjqT.equals(HUqCc))){var nkXpo;if(FTatT.length==0){nkXpo=0}else{nkXpo=FTatT[FTatT.length-1]}var bgXCO=(nkXpo==0)&&(brjqT.equals(HUqCc));var EcUQV;if(FTatT.length>=2){EcUQV=FTatT[FTatT.length-2]}else{EcUQV=0}if(!bgXCO){if((EBIWb==ROUND_CEILING&&keJpj>0)||(EBIWb==ROUND_FLOOR&&keJpj<0)||(EBIWb==ROUND_UP)||(EBIWb==ROUND_HALF_UP&&nkXpo>=5)||(EBIWb==ROUND_HALF_DOWN&&nkXpo>5)||(EBIWb==ROUND_HALF_EVEN&&(nkXpo>5||(nkXpo==5&&EcUQV%2==1)))){euVBF(FTatT,true);mnPHF--}else{if(mnPHF-1==nrsGi){if(FTatT.length>0){FTatT.pop()}mnPHF--}}}}var gRZRG=MScik(FTatT,[0],keJpj);if(mnPHF>0){gRZRG=gRZRG.movePointLeft(mnPHF)}else{if(mnPHF<0){gRZRG=gRZRG.movePointRight(-mnPHF)}else{gRZRG.normalize()}}return gRZRG}String.prototype.strReplace=bhivr;String.prototype.trim=nFCbf;String.prototype.lengthb=uXWeM;String.prototype.trimWS=PpUSC;String.prototype.isASCII=ZnwpH;String.prototype.isExtendedASCII=WBWat;String.prototype.isUnihan=oUFRa;String.prototype.isUnihanHKSCS=WhXhF;function bhivr(target,TCrWC){var eMUFf=this;var rmiwS=eMUFf.indexOf(target);if(rmiwS==-1){return eMUFf}return eMUFf.substring(0,rmiwS)+TCrWC+eMUFf.substring(rmiwS+target.length).strReplace(target,TCrWC)}function nFCbf(eKulb){if(eKulb==null){eKulb=" "}return this.replace(eval("/^["+eKulb+"]*/"),"").replace(eval("/["+eKulb+"]*$/"),"")}function uXWeM(){var kcdcC=new RegExp("%[A-Z0-9]{2}","g");return encodeURI(this).replace(kcdcC,"X").length}function PpUSC(){return this.replace(/^\s*/,"").replace(/\s*$/,"")}function trimAllControls(Rxiaq){var KxZst;for(KxZst=0;KxZst<Rxiaq.elements.length;KxZst++){if(Rxiaq.elements[KxZst].type=="text"||Rxiaq.elements[KxZst].type=="textarea"||Rxiaq.elements[KxZst].type=="password"){Rxiaq.elements[KxZst].onblur=cncqW}}}function cncqW(){this.value=String(this.value).trimWS()}function ZnwpH(){var cMYGc=this.length;for(var KxZst=0;KxZst<cMYGc;KxZst++){var NdQTT=this.charCodeAt(KxZst);var YYgSE=UnicodeBlock.of(NdQTT);if(YYgSE!=UnicodeBlock.BASIC_LATIN){return false}}return true}function WBWat(){var cMYGc=this.length;for(var KxZst=0;KxZst<cMYGc;KxZst++){var NdQTT=this.charCodeAt(KxZst);var YYgSE=UnicodeBlock.of(NdQTT);if((YYgSE!=UnicodeBlock.BASIC_LATIN)&&(YYgSE!=UnicodeBlock.LATIN_1_SUPPLEMENT)){return false}}return true}function oUFRa(){var cMYGc=this.length;for(var KxZst=0;KxZst<cMYGc;KxZst++){var NdQTT=this.charCodeAt(KxZst);if(!UnicodeBlock.isUnihan(NdQTT)){return false}}return true}function WhXhF(){var cMYGc=this.length;for(var KxZst=0;KxZst<cMYGc;KxZst++){var NdQTT=this.charCodeAt(KxZst);if(!UnicodeBlock.isUnihanHKSCS(NdQTT)){return false}}return true}function SimpleDateFormat(KrNbT){this.cdZUt=String(KrNbT);this.SNXUf=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")}SimpleDateFormat.prototype.isDate=gipsB;SimpleDateFormat.prototype.format=DuppZ;SimpleDateFormat.prototype.parse=MeGHH;SimpleDateFormat.prototype.bWbte=BwFtt;SimpleDateFormat.prototype.SrCfb=UehmR;SimpleDateFormat.YEAR_ROLLOVER=70;function gipsB(AAcUG){var date=this.parse(AAcUG);if(date.constructor!=Date){return false}return true}function DuppZ(date){format=this.cdZUt;var fvgZc="";var gdWuL=0;var NdQTT="";var fdLug="";var y=date.getFullYear()+"";var SlNNT=date.getMonth()+1;var MQQjA=date.getDate();var fsaEj=date.getHours();var EnLLG=date.getMinutes();var jncwT=date.getSeconds();var NfItQ=date.getTime()%1000;var KViMG,mKhIk,NKmQC,lLfcX,ZXTrG,aBvsJ,lZPDl,JRHjB,lrUWh,IXqtq,ecdhe,jgGTr,fsaEj,elfrO,MjjuD,Wkigp,BVYYT;if(y.length<4){y=y-0+1900}y=""+y;KViMG=y;mKhIk=y.substring(2,4);if(SlNNT<10){ZXTrG="0"+SlNNT}else{ZXTrG=SlNNT}NKmQC=this.SNXUf[SlNNT-1];lLfcX=this.SNXUf[SlNNT-1+12];if(MQQjA<10){aBvsJ="0"+MQQjA}else{aBvsJ=MQQjA}JRHjB=fsaEj;MjjuD=fsaEj;BVYYT=fsaEj+1;if(JRHjB>12){JRHjB-=12}if(JRHjB==0){JRHjB=12}if(JRHjB<10){lZPDl="0"+JRHjB}else{lZPDl=JRHjB}if(fsaEj<10){jgGTr="0"+MjjuD}else{jgGTr=fsaEj}if(MjjuD>11){MjjuD-=12}if(MjjuD<10){elfrO="0"+MjjuD}else{elfrO=MjjuD}if(BVYYT<10){Wkigp="0"+BVYYT}else{Wkigp=BVYYT}if(fsaEj>11){ecdhe="PM"}else{ecdhe="AM"}if(EnLLG<10){lrUWh="0"+EnLLG}else{lrUWh=EnLLG}if(jncwT<10){IXqtq="0"+jncwT}else{IXqtq=jncwT}ucZtw=NfItQ;whxMu=NfItQ;if(NfItQ<100){ucZtw="0"+NfItQ;whxMu=NfItQ}if(NfItQ<10){ucZtw="00"+NfItQ;whxMu="0"+NfItQ}var value=new Object();value.yyyy=KViMG;value.yy=mKhIk;value.y=y;value.MMMM=NKmQC;value.MMM=lLfcX;value.MM=ZXTrG;value.M=SlNNT;value.dd=aBvsJ;value.d=MQQjA;value.hh=lZPDl;value.h=JRHjB;value.HH=jgGTr;value.H=fsaEj;value.KK=elfrO;value.K=MjjuD;value.kk=Wkigp;value.k=BVYYT;value.mm=lrUWh;value.m=EnLLG;value.ss=IXqtq;value.s=jncwT;value.a=ecdhe;value.SSS=ucZtw;value.SS=whxMu;value.S=NfItQ;while(gdWuL<format.length){NdQTT=format.charAt(gdWuL);fdLug="";while((format.charAt(gdWuL)==NdQTT)&&(gdWuL<format.length)){fdLug+=format.charAt(gdWuL);gdWuL++}if(value[fdLug]!=null){fvgZc=fvgZc+value[fdLug]}else{fvgZc=fvgZc+fdLug}}return fvgZc}function BwFtt(AAcUG){var YdeGj="1234567890";for(var KxZst=0;KxZst<AAcUG.length;KxZst++){if(YdeGj.indexOf(AAcUG.charAt(KxZst))==-1){return false}}return true}function UehmR(hLsGd,KxZst,AMPcm,qnPfB){for(x=qnPfB;x>=AMPcm;x--){var fdLug=hLsGd.substring(KxZst,KxZst+x);if(fdLug.length<AMPcm){return null}if(this.bWbte(fdLug)){return fdLug}}return null}function MeGHH(AAcUG){AAcUG=AAcUG+"";format=this.cdZUt;var KxZst_AAcUG=0;var gdWuL=0;var NdQTT="";var fdLug="";var RCwtH="";var x,y;var YOikR=new Date(0);var osJBp=YOikR.getFullYear();var KFWOn=YOikR.getMonth()+1;var date=YOikR.getDate();var lZPDl=0;var lrUWh=0;var IXqtq=0;var ucZtw=0;var ecdhe="";while(gdWuL<format.length){NdQTT=format.charAt(gdWuL);fdLug="";while((format.charAt(gdWuL)==NdQTT)&&(gdWuL<format.length)){fdLug+=format.charAt(gdWuL);gdWuL++}if(fdLug=="yyyy"||fdLug=="yy"||fdLug=="y"){if(fdLug=="yyyy"){x=4;y=4}if(fdLug=="yy"){x=2;y=2}if(fdLug=="y"){x=2;y=4}osJBp=this.SrCfb(AAcUG,KxZst_AAcUG,x,y);if(osJBp==null){return 0}KxZst_AAcUG+=osJBp.length;if(osJBp.length==2){if(osJBp>SimpleDateFormat.YEAR_ROLLOVER){osJBp=1900+(osJBp-0)}else{osJBp=2000+(osJBp-0)}}}else{if(fdLug=="MMM"){KFWOn=0;for(var KxZst=0;KxZst<this.SNXUf.length;KxZst++){var TKagH=this.SNXUf[KxZst];if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+TKagH.length).toLowerCase()==TKagH.toLowerCase()){KFWOn=KxZst+1;if(KFWOn>12){KFWOn-=12}KxZst_AAcUG+=TKagH.length;break}}if(KFWOn==0){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}}else{if(fdLug=="MM"||fdLug=="M"){x=fdLug.length;y=2;KFWOn=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(KFWOn==null){return 0}if((KFWOn<1)||(KFWOn>12)){return 0}KxZst_AAcUG+=KFWOn.length}else{if(fdLug=="dd"||fdLug=="d"){x=fdLug.length;y=2;date=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(date==null){return 0}if((date<1)||(date>31)){return 0}KxZst_AAcUG+=date.length}else{if(fdLug=="hh"||fdLug=="h"){x=fdLug.length;y=2;lZPDl=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>12)){return 0}KxZst_AAcUG+=lZPDl.length;lZPDl=Number(lZPDl)}else{if(fdLug=="HH"||fdLug=="H"){x=fdLug.length;y=2;lZPDl=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>23)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="KK"||fdLug=="K"){x=fdLug.length;y=2;lZPDl=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<0)||(lZPDl>11)){return 0}KxZst_AAcUG+=lZPDl.length}else{if(fdLug=="kk"||fdLug=="k"){x=fdLug.length;y=2;lZPDl=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(lZPDl==null){return 0}if((lZPDl<1)||(lZPDl>24)){return 0}KxZst_AAcUG+=lZPDl.length;JRHjB--}else{if(fdLug=="mm"||fdLug=="m"){x=fdLug.length;y=2;lrUWh=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(lrUWh==null){return 0}if((lrUWh<0)||(lrUWh>59)){return 0}KxZst_AAcUG+=lrUWh.length}else{if(fdLug=="ss"||fdLug=="s"){x=fdLug.length;y=2;IXqtq=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(IXqtq==null){return 0}if((IXqtq<0)||(IXqtq>59)){return 0}KxZst_AAcUG+=IXqtq.length}else{if(fdLug=="SSS"||fdLug=="SS"||fdLug=="S"){x=fdLug.length;y=3;ucZtw=this.SrCfb(AAcUG,KxZst_AAcUG,1,y);if(ucZtw==null){return 0}if(ucZtw<0||ucZtw>1000){return 0}KxZst_AAcUG+=ucZtw.length}else{if(fdLug=="a"){if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="am"){ecdhe="AM";KxZst_AAcUG+=ecdhe.length}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+2).toLowerCase()=="pm"){ecdhe="PM";KxZst_AAcUG+=ecdhe.length}else{return 0}}}else{if(AAcUG.substring(KxZst_AAcUG,KxZst_AAcUG+fdLug.length)!=fdLug){return 0}else{KxZst_AAcUG+=fdLug.length}}}}}}}}}}}}}}if(KxZst_AAcUG!=AAcUG.length){return 0}if(KFWOn==2){if(((osJBp%4==0)&&(osJBp%100!=0))||(osJBp%400==0)){if(date>29){return false}}else{if(date>28){return false}}}if((KFWOn==4)||(KFWOn==6)||(KFWOn==9)||(KFWOn==11)){if(date>30){return false}}if(lZPDl<12&&ecdhe=="PM"){lZPDl+=12}else{if(lZPDl>11&&ecdhe=="AM"){lZPDl-=12}}var WvJmn=new Date(osJBp,KFWOn-1,date,lZPDl,lrUWh,IXqtq);WvJmn.setTime(WvJmn.getTime()+Number(ucZtw));return WvJmn};
function toggleMsgVisibility(msg){var JTRhW=getMessageContainer();var msgParentContainer=document.getElementById("msgDivContainer_");if(msg==""){msgParentContainer.style.display="none"}else{msgParentContainer.style.display=""}fixCover(false,true);setTimeout(redrawWindow,15)}function getMessageContainer(){return document.getElementById("MESSAGE_")};
function UrlWrapper(JrBoL,FYRFS){this.rhpVw=new Array();this.aslTl(JrBoL);this.separator=FYRFS}function JKuMG(wctaO,GTsSB){this.rhpVw[this.rhpVw.length]=new Param(wctaO,GTsSB)}function EdXKZ(HvnqS){var nbQlu;var ppKFb;nbQlu=HvnqS.indexOf(this.separator?this.separator:"=");if(nbQlu<0){throw"invalid url"}ppKFb=this.getParam(HvnqS.substring(0,nbQlu));if(ppKFb==null){this.addParam(HvnqS.substring(0,nbQlu),HvnqS.substring(nbQlu+1))}else{ppKFb.addValue(HvnqS.substring(nbQlu+1))}}function NUVnw(JrBoL){var PtcVg;var rmiwS;var gWMre;var tiwni=-1;var CChOS=JrBoL;rmiwS=0;PtcVg=LVTUc(CChOS);var dtKfC="";while(PtcVg>-1){rmiwS=0;gWMre=CChOS.substring(rmiwS,PtcVg);this.parseParam(gWMre);rmiwS=PtcVg+1;CChOS=CChOS.substring(rmiwS);PtcVg=LVTUc(CChOS)}if(CChOS.length>0){this.parseParam(CChOS)}}function LVTUc(JrBoL){var ePJFf=JrBoL.length;var SHdIq="";for(var KxZst=0;KxZst<ePJFf;KxZst++){SHdIq=JrBoL.substring(KxZst,KxZst+1);if(SHdIq=="&"){return KxZst}}return -1}function OnAiQ(JrBoL,waWCb,CYreV){for(var KxZst=0;KxZst<JrBoL.length;KxZst++){var sub=JrBoL.substring(KxZst);var PtcVg=KxZst+sub.indexOf(CYreV);if(PtcVg==waWCb){return false}}return true}function cwnBl(){var GVuPf=new Array();var KxZst;for(KxZst=0;KxZst<this.rhpVw.length;KxZst++){GVuPf[KxZst]=this.rhpVw[KxZst].getName()}return GVuPf}function GpEhQ(wctaO){var KxZst;for(KxZst=0;KxZst<this.rhpVw.length;KxZst++){if(this.rhpVw[KxZst].getName()==wctaO){return this.rhpVw[KxZst]}}return null}function CCjmq(wctaO){var ppKFb=this.getParam(wctaO);if(ppKFb!=null){return ppKFb.getValues()}return null}function VlgKk(wctaO){var ppKFb=this.getParam(wctaO);if(ppKFb!=null){return ppKFb.getValue()}return null}function xnZfL(){var XHoVq="";var jcpqv=this.getParameterNames();for(var KxZst=0;KxZst<jcpqv.length;KxZst++){var ppKFb=this.getParam(jcpqv[KxZst]);if(KxZst!=0){XHoVq+="&"}var LZxvM=ppKFb.getValues();if(LZxvM&&LZxvM.length>1){var qbXNo=ppKFb.getName();for(var cpdcK=0;cpdcK<LZxvM.length;cpdcK++){XHoVq+=qbXNo+"="+LZxvM[cpdcK]+"&"}XHoVq=XHoVq.slice(0,-1)}else{XHoVq+=ppKFb.getName()+"="+ppKFb.getValue()}}return XHoVq}UrlWrapper.prototype.addParam=JKuMG;UrlWrapper.prototype.parseParam=EdXKZ;UrlWrapper.prototype.aslTl=NUVnw;UrlWrapper.prototype.getParam=GpEhQ;UrlWrapper.prototype.getParameter=VlgKk;UrlWrapper.prototype.getParameterNames=cwnBl;UrlWrapper.prototype.getParameterValues=CCjmq;UrlWrapper.prototype.getUrl=xnZfL;function Param(wctaO,GTsSB){this.name=wctaO;this.values=new Array();this.addValue(GTsSB)}function XRHbK(GTsSB){this.values[this.values.length]=GTsSB}function VSMWi(){return this.name}function WISPC(){return this.values}function sNTHj(){return this.values[0]}function YqAgp(){return decodeURIComponent(this.values[0].replace(/\+/g,"%20"))}function FMNAq(){this.values=new Array()}Param.prototype.addValue=XRHbK;Param.prototype.getName=VSMWi;Param.prototype.getValues=WISPC;Param.prototype.getValue=sNTHj;Param.prototype.getCleanValue=YqAgp;Param.prototype.clear=FMNAq;
function doBack(){window.history.go(-1)}function scrollToTop(){NavHandler.goToHashAnchor(NavHandler.contentTop)}function daterange(props1,props2){date(false,props1);note("\xa0to\xa0");date(true,props2)}function messageContainer(){alert("Use message tag instead.")}function showAppError(aMsg){if(aMsg){if(window.parent!=window){window.parent.IS.clearErrors();window.parent.showAppError(aMsg)}else{displayMessageTable(true,window.top.document);var msgElement=window.top.document.getElementById("MESSAGE_");msgElement.style.display="";var divElements=msgElement.getElementsByTagName("div");if(divElements&&divElements.length&&divElements[0].className=="error"){var ulElem=divElements[0].nextSibling;if(ulElem.innerHTML.indexOf(aMsg)==-1){ulElem.innerHTML+="<li>"+aMsg+"</li>"}}else{msgElement.innerHTML='<div class="error"><div class="ui-icon ui-icon-info"></div><div class="messageText">Please correct the following error(s):</div>;</div><ul><li>'+aMsg+"</li></ul>"}setMessageAsError();toggleMsgVisibility("_");window.top.scroll(0,0)}}}function showAppMessage(aMsg){if(aMsg){if(window.parent!=window){window.parent.showAppMessage(aMsg)}else{displayMessageTable(true,window.top.document);var msgElement=window.top.document.getElementById("MESSAGE_");var jMsgElement=$(msgElement);jMsgElement.addClass("ui-state-highlight");jMsgElement.removeClass("ui-state-error-box");msgElement.style.display="";msgElement.innerHTML='<div class="info group-row"><div class="info-message">'+aMsg+"</div></div>";toggleMsgVisibility("_")}}}function clearMessageContent(){var oDiv=getMessageContainer();if(oDiv){toggleMsgVisibility("");oDiv.innerHTML="";oDiv.style.display="none";displayMessageTable(false);fixCover(false,true)}}function setMessageContent(aContent){var errs=[];var msgContent=aContent.replace(/<!--error:(.*?)-->/g,function(message,expr){var err={};expr.replace(/\[name:([^\]]+)\]/g,function(message1,expr1){err.name=expr1;return expr1});expr.replace(/\[idx:([^\]]+)\]/g,function(message2,expr2){err.idx=String(expr2).trim();return expr2});expr.replace(/\[msg:(.*)\]/g,function(message3,expr3){err.msg=expr3;return expr3});errs.push(err);return""});var oDiv=getMessageContainer();if(oDiv){oDiv.innerHTML=msgContent;if(errs.length>0){setMessageAsError();$(oDiv).children().remove()}else{setMessageAsInfo()}for(var i=0;i<errs.length;i++){var err=errs[i];var form=err.name?$(document.getElementsByName(err.name)[eval(err.idx)].form):IS.getDefaultForm();if(err.name){$(form).addErrorMsg(err.msg,document.getElementsByName(err.name)[eval(err.idx)],null,true,true)}else{$(form).addErrorMsg(err.msg,null,null,true,true)}}if(msgContent){toggleMsgVisibility("_")}oDiv.style.display="";displayMessageTable(true);fixCover(false,true);NavHandler.goToHashAnchor(NavHandler.messageContainer);window.focus()}}function setMessageAsError(){$("#MESSAGE_").removeClass("ui-state-highlight").addClass("ui-state-error-box")}function setMessageAsInfo(){$("#MESSAGE_").removeClass("ui-state-error-box").addClass("ui-state-highlight")}function addMessageContent(aContent){var oDiv=getMessageContainer();if(oDiv){oDiv.innerHTML+=aContent;oDiv.style.display="";displayMessageTable(true);fixCover(false,true);NavHandler.goToHashAnchor(NavHandler.messageContainer);window.focus()}}function hasError(anItem,msg,n){for(var i=0;i<IS.Errors.length;i++){oError=IS.Errors[i];if(anItem==oError.Item&&msg==oError.Msg){return true}}return false}function hasNoInfoMessage(){return(getMessageContainer().getElementsByTagName("div")[0]&&getMessageContainer().getElementsByTagName("div")[0].className!="info")}function hasNoErrorMessage(){return(getMessageContainer().getElementsByTagName("div")[0]&&getMessageContainer().getElementsByTagName("div")[0].className!="error")}function displayMessageTable(display,context){$("#_MESSAGE_TBL",context).toggle(!display)}function checkRadioButton(itemName,value,check){document.getElementById("_rd_"+itemName+"_"+value).checked=(check?"checked":"")}function outputErrorOnConsole(err){if(window.console){if(window.console.debug){window.console.debug(err)}else{if(window.console.log){window.console.log(err)}}}}function toggleCollapse(clpse){var pdiv=clpse.parentNode.parentNode;if(clpse.src.indexOf("display.gif")>=0){clpse.src="../../images/hide.gif";$(pdiv).find(".collBody").hide();try{resizeCanvas()}catch(e){}}else{clpse.src="../../images/display.gif";$(pdiv).find(".collBody").show();try{resizeCanvas()}catch(e){}}}function ajaxRetrieve(aQid,aReturnFunc,aCustomParams,aForm){var sParams=aForm?$(aForm).serialize()+"&":"";sParams+="QID="+aQid;if(aCustomParams){sParams+="&"+aCustomParams}if(!aForm&&document.forms.length>0){var elem=document.forms[0]["AQSID_"+aQid+"_"];if(elem){sParams+="&AQSID_="+encodeURIComponent(elem.value)}elem=document.forms[0]["_CSRF_TOKEN"];if(elem){sParams+="&_CSRF_TOKEN="+encodeURIComponent(elem.value)}}$.post("com.azeus.isweb.ajax.AjaxQuery.ajax",sParams,function(data){aReturnFunc(eval("("+data+")"))},"text")}function doResetMaintenance(){if($(document.forms[0]).isModified()){if(confirm(LBJSWarningMsgs.RESET_MODIFIED_WARNING)){document.forms[0].reset();$(document.forms[0]).validate().resetForm()}}else{document.forms[0].reset();$(document.forms[0]).validate().resetForm()}}function initEditableFieldFocus(){var inputs=$("input[type!='submit'][type!='button'][type!='hidden']:not([readonly][disabled]),textarea:not([readonly][disabled]),select",document.getElementById("Panel")||document.getElementById("modal"));var firstInput=$(inputs.get(0));var element;for(var i=0;i<inputs.length;i++){element=$(inputs.get(i));if(element.attr("tabindex")){firstInput=element;break}}if(firstInput&&firstInput.offset&&firstInput.offset()){if($(window).height()+$(document).scrollTop()>firstInput.offset().top){firstInput.focus()}else{$(document.body).focus();firstInput.attr("tabindex","1")}}}function setToUpperCase(item,fromBd){var target;if(fromBd){target=$(item)}else{target=$(item.target)}target.val(target.val().toUpperCase())}function scrollToMessage(){var userAgent=navigator.userAgent;var selector;if(userAgent.match(/AppleWebKit\//)){selector="html body"}else{selector="html"}var posTop;posTop=$("#MESSAGE_").position().top;setTimeout(function(){$(window.top.document).find(selector).scrollTop(posTop)},400)}function scrollToContentHeader(){var userAgent=navigator.userAgent;var selector;if(userAgent.match(/AppleWebKit\//)){selector="html body"}else{selector="html"}setTimeout(function(){$(selector).scrollTop($("#ContentHeader").position().top)},400)}function scrollToId(id){var el=document.getElementById(id);var range=document.createRange();var sel=window.getSelection();sel.removeAllRanges();range.selectNode(el);range.setStart(el,0);range.collapse(true);sel.addRange(range);setTimeout(function(){$("html,body").scrollTop($("#"+id).position().top)},200)}function redrawWindow(){document.body.className=document.body.className}function openFaqPage(parent,path,hash){var aHash="";if(typeof(hash)!="undefined"){aHash="#"+hash}if(typeof(parent)=="undefined"){var pathname=window.location.pathname.toUpperCase();if(pathname.indexOf("INS")!=-1){parent="INS"}else{if(pathname.indexOf("VAS")!=-1){parent="VAS"}else{if(pathname.indexOf("WES")!=-1){parent="WES"}else{parent="ENS"}}}}switch(parent){case"INS":openPopUpWindow("ins0401.jsp"+aHash,path,"EBILLING_FAQ");break;case"VAS":openPopUpWindow("vas0301.jsp"+aHash,path,"EBILLING_FAQ");break;case"ENS":openPopUpWindow("../ens/ens0501.jsp"+aHash,path,"EBILLING_FAQ");break;case"WES":openPopUpWindow("wes0201.jsp"+aHash,path,"EBILLING_FAQ");break;default:break}}function openHelpDeskPage(parent,path){if(typeof(parent)=="undefined"){var pathname=window.location.pathname.toUpperCase();if(pathname.indexOf("ENS")!=-1){parent="ENS"}else{if(pathname.indexOf("INS")!=-1){parent="INS"}else{if(pathname.indexOf("VAS")!=-1){parent="VAS"}else{if(pathname.indexOf("WES")!=-1){parent="WES"}else{if(pathname.indexOf("SYS")!=-1){parent="SYS"}else{parent="ENS"}}}}}}switch(parent){case"INS":openPopUpWindow("ins0501.jsp",path,"EBILLING_HELP_DESK");break;case"VAS":openPopUpWindow("vas0401.jsp",path,"EBILLING_HELP_DESK");break;case"ENS":openPopUpWindow("../ens/ens0601.jsp",path,"EBILLING_HELP_DESK");break;case"WES":openPopUpWindow("wes0301.jsp",path,"EBILLING_HELP_DESK");break;case"SYS":openPopUpWindow("sys0001.jsp",path,"EBILLING_HELP_DESK");break;default:break}}var timeoutid=null;function openPopUpWindow(page,path,name){var child=null;var url=window.top.location.href;if(path!=null){url=path+page}else{url=page}var windowName=name?name:window.top.name+"_"+new Date().getTime();var params="width="+(window.screen.availWidth*0.84)+",height="+(window.screen.availHeight*0.6)+",top="+(((document.all)?window.screenTop:window.screenY)+60)+",left="+(((document.all)?window.screenLeft:window.screenX)+50)+",directories=0,location=0,menubar=0,scrollbars=1,status=0,statusbar=0,toolbar=0,resizable=1";var userAgent=navigator.userAgent;if(userAgent.match(/AppleWebKit\//)){child=window.open(url,windowName,params);child.focus()}else{if(timeoutid){clearTimeout(timeoutid)}timeoutid=setTimeout(function(){if(url.indexOf("pdf")>-1&&windowName.indexOf("_blank")<0){child=window.open("about:blank",windowName,params);try{child.focus()}catch(e){}}child=window.open(url,windowName,params);try{child.focus()}catch(e){}},500)}}function isChinese(){return"zh_TW"==LanguageOption.Locale}function openExternalPopUp(path){openPopUpWindow("",path,"_blank")}function goToMyBill(){NavHandler.redirectToURL("../../jsp_registered/ens/ens0201.jsp")}function goToMyGovHK(){if(isChinese()){openExternalPopUp("http://www.gov.hk/tc/apps/mygovhk.htm")}else{openExternalPopUp("http://www.gov.hk/en/apps/mygovhk.htm")}}function goToCopyright(){if(isChinese()){openExternalPopUp("http://www.gov.hk/tc/about/copyright.htm")}else{openExternalPopUp("http://www.gov.hk/en/about/copyright.htm")}}function goToPrivacy(){if(isChinese()){openExternalPopUp("http://www.gov.hk/tc/about/privacy.htm")}else{openExternalPopUp("http://www.gov.hk/en/about/privacy.htm")}}function goToDisclaimer(){if(isChinese()){openExternalPopUp("http://www.gov.hk/tc/about/disclaimer.htm")}else{openExternalPopUp("http://www.gov.hk/en/about/disclaimer.htm")}}function goToAbout(){if(isChinese()){openExternalPopUp("http://www.gov.hk/tc/about/aboutus.htm")}else{openExternalPopUp("http://www.gov.hk/en/about/aboutus.htm")}}function closePopUpWindow(){window.close()}function doLinks(){NavHandler.redirectToURL("../../jsp/sample/sample.jsp")}function doWhatsNew(){if(isChinese()){openExternalPopUp("http://www.sfaa.gov.hk/tc/index.htm")}else{openExternalPopUp("http://www.sfaa.gov.hk/eng/index.htm")}}function goToPayMethodFaqPage(){openFaqPage("ENS",undefined,"temp")}function goToEducationBureau(){openExternalPopUp("http://www.edb.gov.hk")}function goToSFAA(){openExternalPopUp(LBJSParams.SFAA_URL)}function goToCEF(){openExternalPopUp("http://www.sfaa.gov.hk/cef/")}function goToPYJ(){openExternalPopUp("http://www.edb.org.hk/yijin/")}function goToTermsOfUse(){if(typeof(LanguageOption.Locale)!="undefined"){openPopUpWindow("","../ens/ens0102.jsp?language="+LanguageOption.Locale,"EBILLING_TERMS_OF_USE")}else{openPopUpWindow("","../ens/ens0102.jsp","EBILLING_TERMS_OF_USE")}}function goToWAC(){openPopUpWindow("","https://www.w3.org/WAI/WCAG2AA-Conformance","EBILLING_WAC")}function goToCopyrightEns(){openPopUpWindow("","../ens/ens0102.jsp#TOU_H18","EBILLING_TERMS_OF_USE")}function goToPrivacyEns(){if(typeof(LanguageOption.Locale)!="undefined"){openPopUpWindow("","../ens/ens0102.jsp?language="+LanguageOption.Locale+"#TOU_H10","EBILLING_TERMS_OF_USE")}else{openPopUpWindow("","../ens/ens0102.jsp#TOU_H10","EBILLING_TERMS_OF_USE")}}function goToDisclaimerEns(){openPopUpWindow("","../ens/ens0102.jsp#TOU_H16","EBILLING_TERMS_OF_USE")}function goToSettings(){openPopUpWindow("","../../jsp_registered/ens/ens0301.jsp",PopUp.windowId)}function goToEssLandingPage(){window.location=PageSettings.ESS_LANDING_PAGE+"?language="+LanguageOption.Locale}function goToEssPpsPage(){window.location=PageSettings.ESS_PPS_PAGE+"_"+(LanguageOption.Locale==="zh_TW"?"zh":"en")}function goToEssFaqPage(){openPopUpWindow("",PageSettings.ESS_FAQ_PAGE+"?language="+LanguageOption.Locale,"ESS_FAQ")}function goToOcasLandingPage(){var language=LanguageOption.Locale=="zh_TW"?"zh-TW":"en-US";window.location=PageSettings.OCAS_LANDING_PAGE+"?language="+language}var Tooltip=function(aTooltipObj){var hideTimeout;var parentPosition;var offsetLeft;var offsetTop;var hideTime=400;var tooltipObj=aTooltipObj;var event;function showTooltip(obj,tooltipMessage){initOffsets(obj);$(tooltipObj).css("left",(parentPosition.left+offsetLeft)+"px").css("top",(parentPosition.top+offsetTop)+"px").html(tooltipMessage).show()}function hideTooltip(){$(tooltipObj).hide()}function initOffsets(elem){var _x=0;var _y=0;var tempElem=$(elem);_x+=$(tempElem).offset().left;_y+=$(tempElem).offset().top;parentPosition={top:_y,left:_x};offsetLeft=0;offsetTop=25}$(tooltipObj).mouseover(function(){clearTimeout(hideTimeout)});$(tooltipObj).mouseout(function(){hideTimeout=setTimeout(hideTooltip,hideTime)});var tooltip={initTooltip:function(obj,tooltipMessage){$(obj).mouseover(function(aEvent){event=aEvent;clearTimeout(hideTimeout);showTooltip(this,tooltipMessage)});$(obj).on("click",function(aEvent){event=aEvent;clearTimeout(hideTimeout);showTooltip(this,tooltipMessage);aEvent.stopPropagation();return false});$(document).on("click",function(){hideTimeout=setTimeout(hideTooltip,hideTime)});$(obj).mouseout(function(){hideTimeout=setTimeout(hideTooltip,hideTime)})}};return tooltip};function openLinkImage(element){var link=($(element).attr("src"))?$(element).attr("src"):$(element).find("img").attr("src");openPopUpWindow("",link,"EBILLING_LEAFLET")}function openPfm1(element){if(LanguageOption.Locale=="en"){openPopUpWindow("","../../docs/"+LBJSParams.ORG_NAME_SHORT+"_PFM1_Early_Financial_Planning.pdf","EBILLING_PFM1")}else{if(LanguageOption.Locale=="zh_TW"){openPopUpWindow("","../../docs/"+LBJSParams.ORG_NAME_SHORT+"_PFM1C_Early_Financial_Planning.pdf","EBILLING_PFM1")}}}function openPfm2(element){if(LanguageOption.Locale=="en"){openPopUpWindow("","../../docs/"+LBJSParams.ORG_NAME_SHORT+"_PFM2_Prudent_Financial_Planning.pdf","EBILLING_PFM2")}else{if(LanguageOption.Locale=="zh_TW"){openPopUpWindow("","../../docs/"+LBJSParams.ORG_NAME_SHORT+"_PFM2C_Prudent_Financial_Planning.pdf","EBILLING_PFM2")}}}function toggleFolder(element){var folder;if($(element).is(".folder")){folder=$(element)}else{folder=$(element).closest(".folder")}var contents=$(folder).find(".folder-contents");var button1=$(folder).find(".folder-toggle-open");var button2=$(folder).find(".folder-toggle-close");contents.toggle();button1.toggle();button2.toggle();$(folder).attr("aria-expanded",$(folder).attr("aria-expanded")!="true")}function collapseFolder(element){var folder;if($(element).is(".folder")){folder=$(element)}else{folder=$(element).closest(".folder")}var contents=$(folder).find(".folder-contents");var button1=$(folder).find(".folder-toggle-open");var button2=$(folder).find(".folder-toggle-close");contents.hide();button1.show();button2.hide()}function goToFeedbackForm(){openPopUpWindow("","../../jsp_public/ens/ens1301.jsp","EBILLING_ENS13")}function getCurrentDate(){CURRENT_DATE=$("[name=CURRENT_DATE]").val();if(CURRENT_DATE!=null){var currentDateArray=CURRENT_DATE.split("-");var newClientDateTime=new Date();var today=new Date(currentDateArray[2],parseInt(currentDateArray[1],10)-1,currentDateArray[0],newClientDateTime.getHours(),newClientDateTime.getMinutes(),newClientDateTime.getSeconds());return today}return new Date()}function goToCefApplicationPage(){if(LanguageOption.Locale=="zh_TW"){openExternalPopUp("https://eform.cefs.gov.hk/form/sfo017/tc/")}else{openExternalPopUp("https://eform.cefs.gov.hk/form/sfo017/en/")}}function openOnlineDemonstration(){openExternalPopUp(LBJSParams.LINK_ONLINE_DEMO)};
(function($){$.extend($.fn,{validate:function(options){var form=this[0];if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var validator=$.data(form,"validator");if(validator){if(options){validator.setOptions(options)}return validator}validator=new $.validator(options,form);$.data(form,"validator",validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this})}this.submit(function(event){validator.alreadySubmitted=true;if(validator.settings.debug){event.preventDefault()}function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove()}return false}return true}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle()}if(validator.settings.bypassValidations!==true&&validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false}return handle()}else{validator.focusInvalid();return false}})}return validator},valid:function(isOnSubmit){var thisFirst=this[0],validator,valid;if($(thisFirst).is("form")){validator=$.data(thisFirst,"validator");if(validator.settings.bypassValidations===true){return true}var beforeValid=validator.settings.beforeValidation;if(beforeValid&&typeof beforeValid=="function"){beforeValid.call(this,valid,thisFirst)}validator.settings.calledFromValid=true;if(isOnSubmit){validator.currentEvent="submit"}valid=validator.form();validator.settings.calledFromValid=false;var afterValid=validator.settings.afterValidation;if(afterValid&&typeof afterValid=="function"){afterValid.call(this,valid,thisFirst)}}else{validator=$.data(thisFirst.form,"validator");if(validator.settings.bypassValidations===true){return true}valid=true;validator.alreadySubmitted=true;var beforeValid=validator.settings.beforeValidation;if(beforeValid&&typeof beforeValid=="function"){beforeValid.call(this,valid,this)}validator.settings.calledFromValid=true;validator.settings.calledFromValidMultiItems=true;$.each(this,function(){var validElem=validator.element(this);if(validElem){validator.formatValue(this)}valid=valid&&validElem});validator.settings.calledFromValidMultiItems=undefined;validator.settings.calledFromValid=false;var afterValid=validator.settings.afterValidation;if(afterValid&&typeof afterValid=="function"){afterValid.call(this,valid,this)}}if(!valid){validator.focusInvalid()}return valid},callBeforeValidate:function(elem,valid,validator){var beforeValid=validator.settings.beforeValidation;if(beforeValid&&typeof beforeValid=="function"){beforeValid.call(elem,valid,elem[0])}validator.settings.calledFromValid=true},callAfterValidate:function(elem,valid,validator){validator.settings.calledFromValid=false;var afterValid=validator.settings.afterValidation;if(afterValid&&typeof afterValid=="function"){afterValid.call(elem,valid,elem[0])}},removeAttrs:function(attributes){var result={},$element=this,elem=$element[0];for(var atts=attributes.split(/\s/),i=atts.length-1;i>=0;i--){var value=atts[i];result[value]=elem.getAttribute(value);$element.removeAttr(value)}return result},rules:function(command,argument,params,msgParam,fireOnSubmit){var element=this[0];if(command){if(!element.settings){element.settings={rules:{},messages:{}}}var settings=element.settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument,params));if(fireOnSubmit===false){existingRules[argument].fireOnSubmit=false}staticRules[element.name]=existingRules;if(msgParam){settings.messages[element.name]=$.extend(settings.messages[element.name],msgParam)}break;case"remove":if(!argument){delete staticRules[element.name];return existingRules}var filtered={};for(var args=argument.split(/\s/),i=args.length-1;i>=0;i--){var method=args[i];filtered[method]=existingRules[method];delete existingRules[method]}return filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.datatype){var value=data.datatype;delete data.datatype;data=$.extend({datatype:value},data)}if(data.mandatory){var value=data.mandatory;delete data.mandatory;data=$.extend({mandatory:value},data)}return data}});$.extend($.expr.pseudos,{blank:function(a){return !$.trim(""+a.value)},filled:function(a){return !!$.trim(""+a.value)},unchecked:function(a){return !a.checked}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();form.formRules={};form.formElementRules={}};$.validator.format=function(source,params){var argLen=arguments.length;if(argLen==1){if(typeof source=="object"){return source}return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args)}}if(argLen>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(params.constructor!=Array){params=[params]}for(var i=params.length-1;i>=0;i--){source=source.replace(new RegExp("\\{"+i+"\\}","g"),params[i])}return source};$.validator.formatMessage=function(sourceParam,params,elem){var sourceType=typeof sourceParam;if(sourceType!="string"&&sourceType=="object"){var source={};$.extend(source,sourceParam);if(source.message){if(source.params){var parameters;if(typeof source.params=="string"){parameters=source.params.split(/\s/)}else{parameters=source.params}source.message=source.message.replace(/\{\{([^\}]+)\}\}/g,function(message,expr){return eval(expr)});$.each(parameters,function(key,value){var val=value;if(typeof value=="function"){val=value.call(this,elem,params)}source.message=source.message.replace(new RegExp("\\{"+key+"\\}","g"),val)})}return source.message}return source}else{if(sourceType=="string"){return sourceParam.replace(/\{\{([^\}]+)\}\}/g,function(message,expr){return eval(expr)})}}return sourceParam};$.validator.formatErrorMessage=function(source,params,elem){var arLength=arguments.length;if(arLength==1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.formatErrorMessage.apply(this,args)}}if(arLength>2&&params&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(!$.isArray(params)){params=params?[params]:[]}source=source.replace(/\{\{([^\}]+)\}\}/g,function(message,expr){return eval(expr)});if($.isArray(elem)&&elem.length>1){var tempArray=[];for(currElem in elem){var labelElem=elem[currElem];label=(labelElem?$(labelElem).metadata().label||labelElem.getAttribute("label")||labelElem.getAttribute("title")||labelElem.name:""),tempArray.push(label)}params=tempArray.concat(params)}else{var labelElem=arguments[arLength-1],label=(labelElem?$(labelElem).metadata().label||labelElem.getAttribute("label")||labelElem.getAttribute("title")||labelElem.name:""),value=labelElem.value;params.unshift(label,value)}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)});return source};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,currentEvent:null,errorContainer:$([]),errorLabelContainer:$([]),otherErrorContainers:$([]),onsubmit:true,ignore:[],ignoreTitle:true,calledFromValid:false,defaultonfocusin:function(element){this.lastActive=element;this.lastElement=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorLabelClass,this.settings.validClass);this.errorsFor(element).hide()}},onfocusin:function(element){this.lastActive=element;this.lastElement=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorLabelClass,this.settings.validClass);this.errorsFor(element).hide()}},defaultonfocusout:function(element){var result=false;if(!this.checkable(element)&&(element.submitted||!this.optional(element))){result=this.element(element)}if(result){this.formatValue(element)}},onfocusout:function(element){var result=false;if(!this.checkable(element)&&(element.submitted||!this.optional(element))){result=this.element(element)}if(result){this.formatValue(element)}},defaultonkeyup:function(element){if(element.submitted||element==this.lastElement){this.element(element)}},onkeyup:function(element){if(element.submitted||element==this.lastElement){this.element(element)}},defaultonclick:function(element){if(element.submitted){this.element(element)}else{if(element.parentNodesubmitted){this.element(element.parentNode)}}},onclick:function(element){if(element.submitted){this.element(element)}else{if(element.parentNodesubmitted){this.element(element.parentNode)}}},toggleLabelHighlight:function(element,removeClass,appendClass,imageSrc,elemLbl){if(elemLbl){if(removeClass&&elemLbl.hasClass(removeClass)){elemLbl.removeClass(removeClass)}if(appendClass){elemLbl.addClass(appendClass)}$(element).each(function(){if(!this.errImg){var $this=$(this);this.errImg=$this.next("img")[0];if(!this.errImg){var elemName=$this.attr("name");$this.focus();var $divParent=$("#"+elemName+"_group");if($divParent.length>0){this.errImg=$divParent.find("img:last")[0]}else{$divParent=$this.parent("div");this.errImg=$divParent.find("img:last")[0]}}}if(this.errImg){this.errImg.setAttribute("src",imageSrc);if(appendClass){$(this.errImg).addClass(appendClass)}if(removeClass){$(this.errImg).removeClass(removeClass)}}})}},defaultHighlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass)},defaultUnhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{normalizeOnEvents:function(validator){var events=["onkeyup","onfocusin","onfocusout","onclick"];for(var i=events.length-1;i>=0;i--){var eventType=events[i];if(validator.settings[eventType]&&validator.settings[eventType]===true){validator.settings[eventType]=$.validator.defaults["default"+eventType]}}},setOptions:function(options){$.extend(true,this.settings,options);if(options.errorContainer||options.errorLabelContainer||options.otherErrorContainers){this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer).add(this.settings.otherErrorContainers)}this.normalizeOnEvents(this)},init:function(){this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer).add(this.settings.otherErrorContainers);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();this.currentEvent=null;this.manualErrorLabels=[];this.normalizeOnEvents(this);this.alreadySubmitted=false;var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)});function delegate(event){var eventType="on"+event.type,elem=this[0],validator=$.data(elem.form,"validator"),elemName=elem.name,validateEvent="validate"+eventType,currentEvent=event.type;validator.currentEvent=currentEvent;validator.settings.calledFromValid=false;if(!shouldValidate(validator,elem,eventType)){return}if((validator.settings[validateEvent][elemName]===undefined||validator.settings[validateEvent][elemName])&&validator.settings[eventType]){var elemToFire=elem;if($(elem).is(":radio, :checkbox")){if(validator.currentForm&&validator.currentForm[elem.name]&&validator.currentForm[elem.name][0]){elemToFire=validator.currentForm[elem.name][0]}}validator.settings[eventType].call(validator,elemToFire)}}function shouldValidate(validator,elem,eventType){if(validator.settings.bypassValidations===true){return false}if(validator.settings.onblurValidation===true){return true}if(validator.alreadySubmitted&&validator.settings.onblurValidation==="default"){return true}var event=eventType;if(eventType=="onfocusout"){event="onblur"}if(elem.options&&elem.options[event]===true){return true}return false}var thisJCurrForm=$(this.currentForm);thisJCurrForm.delegate("focusin",".ui-widget-content",function(e){var $target=$(e.target);$target.addClass("ui-state-highlight")}).delegate("focusout",".ui-widget-content",function(e){var $target=$(e.target);$target.removeClass("ui-state-highlight")}).delegate("focusout",":text, textarea",function(e){var $target=$(e.target);$target.val(jQuery.trim($target.val()))}).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox, select, option",delegate);if(this.settings.invalidHandler){thisJCurrForm.on("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.alreadySubmitted=true;var isValid=this.checkForm();if(this.settings.invalidHandler&&!isValid){$(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return isValid},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){var element=elements[i];if(this.checkable(element)){element=this.findByName(element.name)[0]}var result=this.check(element);if(result){this.formatValue(element)}if(element.options&&element.options.afterValidation){element.options.afterValidation.call(this,element,element.options.jQueryScope,result)}}var formRulesResult=this.checkFormRules();return this.valid()&&formRulesResult},checkFormRules:function(){if(this.currentForm.formRules){this.formErrorList=[];var rules=this.currentForm.formRules;var result=true;var overallResult=true;for(method in rules){var rule=rules[method];result=rule.method.call(this,this.currentForm,this);if(result!==true){var labels=null,focusElem=null,highlightAll=false;if(rule.options){labels=rule.options.labels;focusElem=rule.options.focusElem;highlightAll=rule.options.highlightAll}var msg=typeof result=="string"?result:rule.message;this.formErrorList.push({message:msg,focusElem:focusElem,labels:labels,highlightAll:highlightAll});overallResult=false}}return overallResult}return true},element:function(element){if(!this.settings.calledFromValid){var beforeValid=this.settings.beforeValidation;if(beforeValid&&typeof beforeValid=="function"){beforeValid.call(this,element)}}if(this.checkable(element)){element=this.findByName(element.name)[0]}this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(element.options&&element.options.afterValidation){element.options.afterValidation.call(this,element,element.options.jQueryScope,result)}this.showErrors();if(!this.settings.calledFromValid){var afterValid=this.settings.afterValidation;if(afterValid&&typeof afterValid=="function"){afterValid.call(this,element)}}return result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]})}this.successList=$.grep(this.successList,function(element){return !(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},buildLabels:function(labels){var lbl=null;if(labels!=null){if($.isArray(labels)){var labelBuilder;for(var i=0;i<labels.length;i++){if(i==0){labelBuilder="#"+labels[i]+"_LBL"}else{labelBuilder=labelBuilder+", #"+labels[i]+"_LBL"}}lbl=$(labelBuilder)}else{lbl=$("#"+labels+"_LBL")}}return lbl},addError:function(message,elementToFocus,labels,highlightAll,serverSideValidation){return this.defaultShowErrorManual(elementToFocus,message,labels,highlightAll,serverSideValidation)},removeError:function(msgRef,aElementToFocus,aLabels,aHighLightAll){var elementToFocus,labels,highLightAll;elementToFocus=aElementToFocus;highLightAll=aHighLightAll;labels=aLabels;var lbls=null;var manualErrorLabel=(typeof msgRef=="string"?this.findError(msgRef):msgRef);if(manualErrorLabel&&manualErrorLabel.lbl){var lbl=manualErrorLabel.lbl[0];if(arguments.length==1){elementToFocus=lbl.elementToFocus;labels=lbl.labels;highLightAll=lbl.highLightAll}var elem;var shoudHighLightAll=true;if(highLightAll!=null&&highLightAll==false){shoudHighLightAll=false}if((!labels||shoudHighLightAll)){if(arguments.length!=1){elem=elementToFocus}else{if(!elementToFocus){var jElem=manualErrorLabel.lbl.focusElem;if(jElem){elem=jElem[0]}}else{elem=elementToFocus}}if(elem&&this.settings.unhighlight){this.settings.unhighlight.call(this,elem,this.settings.errorLabelClass,this.settings.validClass)}}if(aLabels){lbls=this.buildLabels(labels)}else{if(arguments.length==1&&lbl.lbls){lbls=lbl.lbls}else{if(arguments.length==1&&labels){lbls=this.buildLabels(labels)}}}if(lbls){this.settings.toggleLabelHighlight(null,this.settings.errorLabelClass,null,this.settings.validLabelImageSrc,lbls)}this.reset();this.toHide=this.toHide.add(manualErrorLabel.lbl);this.hideErrors();if(this.numberOfInvalids()<=0){this.containers.hide();toggleMsgVisibility("")}}},removeErrorWithSpecificLabels:function(msgRef,labels){var lbls=null;var manualErrorLabel=(typeof msgRef=="string"?this.findError(msgRef):msgRef);if(manualErrorLabel&&manualErrorLabel.lbl){if(labels&&labels!=null){lbls=this.buildLabels(labels)}if(lbls){this.settings.toggleLabelHighlight(null,this.settings.errorLabelClass,null,this.settings.validLabelImageSrc,lbls)}this.reset();this.toHide=this.toHide.add(manualErrorLabel.lbl);this.hideErrors();if(this.numberOfInvalids()<=0){this.containers.hide();toggleMsgVisibility("")}}},findError:function(message){var err=$(this.manualErrorLabels).filter(function(){return this.message&&this.message==message});if(err&&err.length){return err[0]}return null},resetElement:function(element){this.prepareElement(element);this.currentElements=$(element);this.showErrors()},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);if(this.settings.unhighlight){for(var i=0,elements=this.elements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorLabelClass,this.settings.validClass)}}for(var i=0,manualLabels=this.manualErrorLabels;manualLabels[i];i++){this.settings.toggleLabelHighlight(null,this.settings.errorLabelClass,null,this.settings.validLabelImageSrc,manualLabels[i].lbl[0].lbls)}},numberOfInvalids:function(){return this.settings.errorContainer.find(this.settings.errorElement+"."+this.settings.errorClass).not(":hidden").length},objectLength:function(obj){var count=0;for(var i in obj){count++}return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).not(":hidden").focus()}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name}).length==1&&lastActive},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":button, :submit, :reset, :image, [disabled], :hidden").not(this.settings.ignore).filter(function(){if(!this.name||(rulesCache[this.name]&&validator.checkable(this))){return false}rulesCache[this.name]=true;return true})},clean:function(selector){return $(selector)[0]},errors:function(){return $(this.settings.errorContainer).find(this.settings.errorElement+"."+this.settings.errorClass)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);if(element.errorSS){this.toHide=this.toHide.add(element.errorSS)}},check:function(element){var elementToBindWithError=element;var beforeElementSubmitted=element.submitted;element.submitted=true;IS.FormValidated=element.form;if(element.options&&element.options.beforeValidation){var shouldProceed=element.options.beforeValidation.call(this,element,element.options.jQueryScope);if(!shouldProceed){return true}}var rules=$(element).rules(),dependencyMismatch=false,trimmedElemValue=$.trim(element.value.replace(/\r/g,"")),rulesLength=this.objectLength(rules),validator=$.data(element.form,"validator");if(!rulesLength){return true}if(rules.mandatory||(!rules.mandatory&&trimmedElemValue)||(element.options&&element.options.shouldFire===true)||(!$.isEmptyObject(rules)&&this.settings.alwaysFireAddedValidators===true)){for(method in rules){var cont=false;var rule={method:method,parameters:rules[method]};try{var result=true;if(rule.parameters.elements&&$.isArray(rule.parameters.elements)){if((beforeElementSubmitted!==true&&validator.currentEvent!="submit")||(validator.currentEvent=="submit"&&rules[method].fireOnSubmit===false)){cont=true}else{if($.validator.methods[method]){result=$.validator.methods[method].call(this,rule.parameters.elements,rule.parameters.params);elementToBindWithError=$(rule.parameters.elements).get(0);if(result===true){this.handleGroupErrorHiding(elementToBindWithError,rule,result)}}}}else{if($.validator.methods[method]){result=$.validator.methods[method].call(this,trimmedElemValue,element,rule.parameters)}}if(!cont){if(typeof result=="string"&&result!="dependency-mismatch"&&result!="pending"){this.formatAndAdd(elementToBindWithError,rule,result);return false}if(result=="dependency-mismatch"){dependencyMismatch=true;continue}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return}if(!result){this.formatAndAdd(elementToBindWithError,rule);return false}}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e);throw e}}}if(dependencyMismatch){return}if(rulesLength){this.successList.push(element)}return true},handleGroupErrorHiding:function(element,rule,result){var label=this.errorsFor(element);var customMessage=null;if(typeof result=="string"&&result!="dependency-mismatch"&&result!="pending"){customMessage=result}var message=customMessage?(LBJSErrorMsgs[customMessage]?LBJSErrorMsgs[customMessage]:customMessage):this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g,typeOfMessage=typeof message;if(typeOfMessage=="function"){message=message.call(this,rule.parameters,element)}else{if(typeOfMessage=="string"&&/\$?\{(\d+)\}/.test(message)){if(rule.parameters==null||(rule.parameters&&(typeof rule.parameters=="string"||$.isArray(rule.parameters)))){message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters,element)}else{if(rule.parameters.elements){message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters.params,rule.parameters.elements)}else{message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters,element)}}}else{if(rule.parameters.elements){message=$.validator.formatMessage(message,rule.parameters.params,rule.parameters.elements)}else{message=$.validator.formatMessage(message,rule.parameters,element)}}}if(label.html()==message){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorLabelClass,this.settings.validClass)}this.toHide=this.toHide.add(label)}},formatValue:function(element){if(!element.value){return}var elem=$(element);var elemFmtFunc=elem.data("fmtFunc");if(elemFmtFunc==undefined){var format,fmtFunc,type=elem.metadata().datatype;if(type){switch(Number(type)){case $.validator.dataTypes.LONG:fmtFunc=function(element){var elem=$(element);elem.toFmtString(elem.toLong())};break;case $.validator.dataTypes.BIG_DECIMAL:case $.validator.dataTypes.BIG_INTEGER:fmtFunc=function(element){var elem=$(element);elem.toFmtString(elem.toBigDecimal())};break;case $.validator.dataTypes.DOUBLE:fmtFunc=function(element){var elem=$(element);elem.toFmtString(elem.toDouble())};break;case $.validator.dataTypes.DATE:case $.validator.dataTypes.TIME:case $.validator.dataTypes.TIMESTAMP:fmtFunc=function(element){var elem=$(element);elem.toFmtString(elem.toDate())};break;default:fmtFunc=false}elem.data("fmtFunc",fmtFunc);elemFmtFunc=fmtFunc}else{fmtFunc=false}}if(typeof elemFmtFunc=="function"){elemFmtFunc.call(this,element)}},customMetaMessage:function(element,method){if(!$.metadata){return}var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method])},findDefined:function(){for(var i=0,argLen=arguments.length;i<argLen;i++){var arg=arguments[i];if(arg!==undefined){return arg}}return undefined},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule,customMessage){var message=customMessage?(LBJSErrorMsgs[customMessage]?LBJSErrorMsgs[customMessage]:customMessage):this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g,typeOfMessage=typeof message;if(typeOfMessage=="function"){message=message.call(this,rule.parameters,element)}else{if(typeOfMessage=="string"&&/\$?\{(\d+)\}/.test(message)){if(rule.parameters==null||(rule.parameters&&(typeof rule.parameters=="string"||$.isArray(rule.parameters)))){message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters,element)}else{if(rule.parameters.elements){message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters.params,rule.parameters.elements)}else{message=$.validator.formatErrorMessage(message.replace(theregex,"{$1}"),rule.parameters,element)}}}else{if(rule.parameters.elements){message=$.validator.formatMessage(message,rule.parameters.params,rule.parameters.elements)}else{message=$.validator.formatMessage(message,rule.parameters,element)}}}message=message.replace(/\u00a0/g," ");this.errorList.push({message:message,element:element})},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))}return toToggle},defaultShowErrors:function(){if(this.errorList.length){this.preDefaultShowError()}this.setLabelHtmls(true);var errCount=0;if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorLabelClass,this.settings.validClass)}}for(;this.errorList[errCount];errCount++){var error=this.errorList[errCount];this.showLabel(error.element,error.message);this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorLabelClass,this.settings.validClass)}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i])}}this.addedParentWrapper=undefined;this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();if(errCount==0&&this.numberOfInvalids()<=0){this.containers.hide();toggleMsgVisibility("")}else{toggleMsgVisibility("_")}this.showFormErrors()},showFormErrors:function(){if(this.currentForm.formRules&&this.formErrorList){var oldCalledFromValid=this.settings.calledFromValid;this.settings.calledFromValid=false;var errCount=0;for(;this.formErrorList[errCount];errCount++){var error=this.formErrorList[errCount];$(this.currentForm).addErrorMsg(error.message,error.focusElem,error.labels,error.highlightAll)}this.settings.calledFromValid=oldCalledFromValid}},defaultShowErrorManual:function(element,message,labels,highLightAll,serverSideValidation){this.reset();var shoudHighLightAll=true;var lbls=null;var manualErrorLabel=this.findError(message);var label;var lbl;if(highLightAll!=null&&highLightAll==false){shoudHighLightAll=false}this.preDefaultShowError();var pointer=!!element;this.setLabelHtmls(pointer);if(labels){lbls=this.buildLabels(labels);if(lbls){this.settings.toggleLabelHighlight(null,null,this.settings.errorLabelClass,this.settings.errorLabelImageSrc,lbls)}}if((!labels||shoudHighLightAll)&&!!element){this.settings.highlight&&this.settings.highlight.call(this,element,this.settings.errorLabelClass,this.settings.validClass)}if(manualErrorLabel&&manualErrorLabel.lbl){label=manualErrorLabel.lbl;lbl=label[0];lbl.innerHTML=message;var msgContainer=this.settings.errorContainer;var labelParent=label.parents("#"+msgContainer[0].id);if(labelParent){if(labelParent.length<=0){this.toShow=this.toShow.add(label);var label1=label;if(serverSideValidation&&element){if(!element.errorSS){element.errorSS=$([]).add(label1)}else{element.errorSS=element.errorSS.add(label1)}}label=this.setupLabelParents(label)}}else{this.toShow=this.toShow.add(label);var label1=label;if(serverSideValidation&&element){if(!element.errorSS){element.errorSS=$([]).add(label1)}else{element.errorSS=element.errorSS.add(label1)}}label=this.setupLabelParents(label)}}else{label=$(this.settings.labelHtmlStart+message+this.settings.labelHtmlEnd);lbl=label[0];lbl.generated=true;if(!!element){label.click(function(){this.focusElem.not(":hidden").focus()})}manualErrorLabel={message:message,lbl:label};var label1=label;this.manualErrorLabels.push(manualErrorLabel);if(serverSideValidation&&element){if(!element.errorSS){element.errorSS=$([]).add(label1)}else{element.errorSS=element.errorSS.add(label1)}}label=this.setupLabelParents(label)}if(!!element){lbl.focusElem=$(element);lbl.elementToFocus=element;element.submitted=true}else{lbl.focusElem=null;lbl.elementToFocus=null}if(labels){lbl.lbls=lbls}lbl.labels=labels;lbl.highLightAll=highLightAll;this.addedParentWrapper=undefined;this.toShow=this.toShow.add(label);this.addWrapper(this.toShow).show();toggleMsgVisibility("_");return manualErrorLabel},setupLabelParents:function(label){if(this.settings.wrapper){label=$(this.settings.wrapperHtml).append(label)}var messageContainer=this.settings.errorContainer,parentWrapper=this.settings.parentWrapper;if(messageContainer){if(this.settings.wrapper){if(parentWrapper){if(this.addedParentWrapper){this.addedParentWrapper.append(label)}}else{messageContainer.append(label)}}else{messageContainer.append(label)}}else{this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element)}return label},preDefaultShowError:function(){this.toShow=this.toShow.add(this.containers);var messageContainer=this.settings.errorContainer,parentWrapper=this.settings.parentWrapper,parentWrapperAttribs=this.settings.parentWrapperAttributes;if(messageContainer){messageContainer.addClass("ui-state-error-box");if(messageContainer.find("div.error").length<=0){messageContainer.html('<div class="error">  <div class=""><img alt="" src="../../js/backgrounds/images/icons/exclam.gif"/></div>  <div class="messageText">'+window.top.PageSettings.errorLabel+"</div></div>")}if(parentWrapper){var foundParentWrapper=messageContainer.find(parentWrapper);if(foundParentWrapper.length<=0){var parentWrapperBuild=$("<"+parentWrapper+"/>");if(parentWrapperAttribs){if(parentWrapperAttribs.attrClass){parentWrapperBuild.attr("class",parentWrapperAttribs.attrClass)}if(parentWrapperAttribs.attrType){parentWrapperBuild.attr("type",parentWrapperAttribs.attrType)}}messageContainer.append(parentWrapperBuild)}else{if(this.settings.calledFromValid===true&&!this.settings.calledFromValidMultiItems){foundParentWrapper.html("")}}this.addedParentWrapper=messageContainer.find(parentWrapper)}}if(this.settings.wrapper){this.settings.wrapperHtml="<"+this.settings.wrapper+" role='alert'/>"}},setLabelHtmls:function(pointer){this.settings.labelHtmlStart="<"+this.settings.errorElement+" "+(pointer?"style='cursor: pointer' ":"")+"class='"+this.settings.errorClass+(pointer?" error-link ":"")+" genError' >";this.settings.labelHtmlEnd="</"+this.settings.errorElement+">"},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},focusErrorItem:function(event){if(event.target&&event.target.focusElem){event.target.focusElem.not(":hidden").focus()}},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.click(this.focusErrorItem);if(!label.hasClass(this.settings.errorClass)){label.addClass(this.settings.errorClass)}label[0].generated&&label.html(message);var msgContainer=this.settings.errorContainer;var labelParent=label.parents("#"+msgContainer[0].id);if(labelParent&&labelParent.length<=0){this.toShow=this.toShow.add(label);label=this.setupLabelParents(label)}}else{label=$(this.settings.labelHtmlStart+message+this.settings.labelHtmlEnd).click(this.focusErrorItem);var lbl=label[0];lbl.generated=true;lbl.focusElem=$(element);element.errElem=label;label=this.setupLabelParents(label)}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label)}this.toShow=this.toShow.add(label)},errorsFor:function(element){var errElem=element.errElem;if(!errElem){return $([])}return errElem},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},checkable:function(element){return element.type=="radio"||element.type=="checkbox"},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null})},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $(element).find("option:selected").length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length}}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return !!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){return !$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch"},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).trigger("submit");this.formSubmitted=false}else{if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},removeClassRules:function(className){delete this.classRuleSettings[className]},classRules:function(element){var rules={},classes=element.getAttribute("class");classes&&$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this])}});return rules},attributeRules:function(element){var rules={};for(method in $.validator.methods){var value=element.getAttribute(method);if(value){rules[method]=value}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength}return rules},getFormElementRules:function(element){var validator=$.data(element.form,"validator");return validator.settings.formElementRules},metadataRules:function(element){if(!$.metadata){return{}}var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={};if(!element.settings){element.settings={}}if(element.settings.rules){rules=$.validator.normalizeRule(element.settings.rules[element.name])||{}}return rules},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return}var valParam=val.param;if(val.param){var keepRule=true;if(keepRule){rules[prop]=typeof val=="function"?val(element):val}else{delete rules[prop]}}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength}if(rules.minvalue&&rules.maxvalue){rules.rangevalue=[rules.minvalue,rules.maxvalue];delete rules.minvalue;delete rules.maxvalue}}if(rules.messages){delete rules.messages}return rules},normalizeRule:function(data,params){if(typeof data=="string"){var transformed={};for(var rules=data.split(/\s/),i=rules.length-1;i>=0;i--){transformed[rules[i]]=params?params:true}data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name))}},removeMethod:function(name){delete $.validator.methods[name];delete $.validator.messages[name];delete $.validator.removeClassRules(name)},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch"}switch(element.nodeName.toLowerCase()){case"select":var val=element.value;return val&&val.length>0;case"input":if(this.checkable(element)){return this.getLength(value,element)>0}default:return $.trim(value).length>0}},remote:function(value,element,param){if(this.optional(element)){return"dependency-mismatch"}var previous=this.previousValue(element);if(!this.settings.messages[element.name]){this.settings.messages[element.name]={}}previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors()}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors)}previous.valid=valid;validator.stopRequest(element,valid)}},param));return"pending"}else{if(this.pending[element.name]){return"pending"}}return previous.valid},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1])},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||value<=param},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1])},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return true},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element)){return"dependency-mismatch"}if(/[^0-9-]+/.test(value)){return false}var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9}}nCheck+=nDigit;bEven=!bEven}return(nCheck%10)==0},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"))},equalTo:function(value,element,param){var target=$(param).off(".validate-equalTo").on("blur.validate-equalTo",function(){$(element).valid()});return value==target.val()}}});$.format=$.validator.format})(jQuery);(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort()}return(pendingRequests[port]=ajax.apply(this,arguments))}return ajax.apply(this,arguments)}})(jQuery);(function($){$.each({focus:"focusin",blur:"focusout"},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,$.event.special[fix].handler,true)},teardown:function(){this.removeEventListener(original,$.event.special[fix].handler,true)},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.dispatch.apply(this,arguments)}}});$.extend($.fn,{delegate:function(type,delegate,handler){return this.on(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments)}})},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})])}})})(jQuery);
var fromSuffix="FR";var toSuffix="TO";(function($){$.validator.autoCreateRanges=true;$.validator.dataTypes={STRING:0,LONG:1,DOUBLE:2,BOOLEAN:3,DATE:4,TIME:5,TIMESTAMP:6,BIG_DECIMAL:7,BIG_INTEGER:9,BLOB:8};$.validator.possibleDateFormats=new Array({Pattern:"MMMM",RegExpStr:"(January|February|March|April|May|June|July|Auguest|September|October|November|December)"},{Pattern:"MMM",RegExpStr:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"},{Pattern:"MM",RegExpStr:"((0?[1-9])|(10|11|12))"},{Pattern:"M",RegExpStr:"((0?[1-9])|(10|11|12))"},{Pattern:"dd",RegExpStr:"(((0?[1-9])|((1|2)\\d)|(30|31)))"},{Pattern:"d",RegExpStr:"(((0?[1-9])|((1|2)\\d)|(30|31)))"},{Pattern:"yyyy",RegExpStr:"(\\d{4})"},{Pattern:"yy",RegExpStr:"(\\d{2})"},{Pattern:"HH",RegExpStr:"(((0|1)?[0-9])|(2[0-3]))"},{Pattern:"mm",RegExpStr:"([0-5]?[0-9])"},{Pattern:"ss",RegExpStr:"([0-5]?[0-9])"},{Pattern:"hh",RegExpStr:"(((0)?[1-9])|(1[0-2]))"},{Pattern:"a",RegExpStr:"(AM|PM)"});$.validator.getRegExForDateFormat=function(dateFormat){var regEx="^",startIdx=0,dateFormatLen=dateFormat.length;while(startIdx<dateFormatLen){var formats=$.validator.possibleDateFormats;var pattern=dateFormat.substr(startIdx),match=false,formatsLen=formats.length,ctr=0;for(ctr=0;ctr<formatsLen;ctr++){var format=formats[ctr];if(pattern.indexOf(format.Pattern)==0){regEx+=format.RegExpStr;startIdx+=format.Pattern.length;match=true;break}}if(!match){regEx+=dateFormat.charAt(startIdx++)}}regEx+="$";return new RegExp(regEx,"i")};var iswebDefaultValidations={mandatory:function(value,element,param){switch(element.nodeName.toLowerCase()){case"select":var val=element.value;return val&&val.length>0;case"input":if(this.checkable(element)){return this.getLength(value,element)>0}default:return !(value.length<=0)}},minValue:function(value,element,param){if(!value){return true}var elem=$(element),dataType=$(element).metadata().datatype;if(!dataType){return true}switch(parseInt(dataType)){case $.validator.dataTypes.LONG:case $.validator.dataTypes.BIG_INTEGER:return elem.toLong()>=Number(param);case $.validator.dataTypes.DOUBLE:case $.validator.dataTypes.BIG_DECIMAL:return elem.toBigDecimal().compareTo(new BigDecimal(param))>=0;default:return true}},maxValue:function(value,element,param){if(!value){return true}var elem=$(element),dataType=$(element).metadata().datatype;if(!dataType){return true}switch(parseInt(dataType)){case $.validator.dataTypes.LONG:case $.validator.dataTypes.BIG_INTEGER:return elem.toLong()<=Number(param);case $.validator.dataTypes.DOUBLE:case $.validator.dataTypes.BIG_DECIMAL:return elem.toBigDecimal().compareTo(new BigDecimal(param))<=0;default:return true}},rangeValue:function(value,element,param){if(!value){return true}var elem=$(element),dataType=$(element).metadata().datatype;if(!dataType){return true}switch(parseInt(dataType)){case $.validator.dataTypes.LONG:case $.validator.dataTypes.BIG_INTEGER:var numberValue=elem.toLong();return numberValue>=Number(param[0])&&numberValue<=Number(param[1]);case $.validator.dataTypes.DOUBLE:case $.validator.dataTypes.BIG_DECIMAL:var elemVal=elem.toBigDecimal();return elemVal.compareTo(new BigDecimal(param[0]))>=0&&elemVal.compareTo(new BigDecimal(param[1]))<=0;default:return true}},datatype:function(value,element,param){if(!value){return true}switch(parseInt(param)){case $.validator.dataTypes.STRING:return true;case $.validator.dataTypes.LONG:case $.validator.dataTypes.BIG_INTEGER:return/^(\+|-)?(\d+,)*(\d+)$/.test(value);case $.validator.dataTypes.DOUBLE:case $.validator.dataTypes.BIG_DECIMAL:return/^(\+|-)?((((\d+,)*(\d+))(\.\d*)?)|((\.\d+)))$/.test(value);case $.validator.dataTypes.BOOLEAN:return value==="true"||value==="false";case $.validator.dataTypes.DATE:case $.validator.dataTypes.TIME:case $.validator.dataTypes.TIMESTAMP:var dataFormat={dataformat:$(element).metadata().dataFormat};return $.validator.getRegExForDateFormat(dataFormat.dataformat).test(value)&&$(element).toDate(dataFormat);default:return true}},minlength:function(value,element,param){if(!value){return true}return this.getLength(value,element)>=param},maxlength:function(value,element,param){if(!value){return true}return param<=0||this.getLength(value,element)<=param},maxSize:function(value,element,param){if(!value){return true}return param<=0||this.getLength(value,element)<=param},rangelength:function(value,element,param){if(!value){return true}var length=this.getLength(value,element);return(length>=param[0]&&length<=param[1])}};$.extend($.validator.methods,iswebDefaultValidations);var iswebDefaultSettings={bypassValidations:false,validateonkeyup:{},validateonfocusout:{},validateonclick:{},validateonfocusin:{},onblurValidation:false,onfocusin:false,onkeyup:false,focusInvalid:true,errorLabelImageSrc:"../../images/icons/error.gif",validLabelImageSrc:"../../images/icons/no_error.gif",errorElement:"span",wrapper:"li",parentWrapper:"ul",errorClass:"errorLbl",errorLabelClass:"errorLbl",errorElementClass:"ui-state-error",errorContainer:$("#MESSAGE_"),otherErrorContainers:$("#_MESSAGE_TBL"),alwaysFireAddedValidators:false,highlight:function(element,errorClass){var elementLabel=$(element).getLabel();this.settings.defaultHighlight(element,this.settings.errorElementClass,null);this.settings.toggleLabelHighlight(element,null,errorClass,this.settings.errorLabelImageSrc,elementLabel)},unhighlight:function(element,errorClass){var elementLabel=$(element).getLabel();this.settings.defaultUnhighlight(element,this.settings.errorElementClass,null);this.settings.toggleLabelHighlight(element,errorClass,null,this.settings.validLabelImageSrc,elementLabel)},beforeValidation:function(result,elements){},afterValidation:function(result,elements){},rangeRegExes:[/_FR/,/_TO/]};$.validator.setDefaults(iswebDefaultSettings);function getFunctionName(func){if(typeof func=="function"){var funcNm=func.toString().match(/^\s*function\s+([^\s\(]+)/);return funcNm?funcNm[1]:""}else{return func}}function getFunctionNameUpper(func){return getFunctionName(func).toUpperCase()}function getValidatorMethodName(method){return"ISVALIDATEMETHOD_"+getFunctionNameUpper(method)}function createGroupMessage(msg){return function(params,element){var msgParams=[];if(params.params){$.each(params.params,function(){msgParams.push(this)})}$.each(params.elements,function(index,val){msgParams.splice(index,0,$(val).metadata().label||val.getAttribute("label")||val.getAttribute("title")||val.name)});$.each(msgParams,function(i,n){msg=msg.replace(new RegExp("\\{"+i+"\\}","g"),n)});return msg}}$.extend($.fn,{getLabel:function(){var element=this[0];var elemLbl=element.lbl;if(elemLbl==undefined){var elemLblName=($(this).metadata()&&$(this).metadata().labelName&&$(this).metadata().labelName!==""&&document.getElementById($(this).metadata().labelName)?$(this).metadata().labelName:element.name+"_LBL"),elemNames=document.getElementsByName(element.name),elemForm=element.form;var elemNamesLength=elemNames.length;if(elemNamesLength>=1){elemLbl=$(document.getElementById(elemLblName));element.lbl=elemLbl}else{var elemIndex=-1;for(var i=0;i<elemNamesLength;i++){if(!elemNames[i].form||elemNames[i].form!==elemForm){continue}if(elemNames[i]===element){elemIndex=i;break}}if(elemIndex<0){return undefined}var tbl=$(elemForm).find("table.lbl").filter(function(index,value){return this.id==elemLblName}).get(elemIndex),tableLbl=$(tbl);if(tableLbl&&tableLbl.length==1&&tableLbl.html()){elemLbl=tableLbl;element.lbl=tableLbl}else{return undefined}}}return elemLbl},setLabel:function(labels){var lbl;if(labels!=null){if($.isArray(labels)){var labelBuilder;for(var i=0;i<labels.length;i++){if(i==0){labelBuilder="#"+labels[i]+"_LBL"}else{labelBuilder=labelBuilder+", #"+labels[i]+"_LBL"}}lbl=$(labelBuilder)}else{lbl=$("#"+labels+"_LBL")}this.each(function(){this.lbl=lbl})}},addValidator:function(method,message,params){var validatorMethodName=getValidatorMethodName(method);message=message?(LBJSErrorMsgs[message]?LBJSErrorMsgs[message]:message):(window.LBJSErrorMsgs?LBJSErrorMsgs[getFunctionNameUpper(method)]:undefined);if(this.is("form")){var form=this[0];var validator=this.validate();var ruleCont={};var rule={method:method,message:message,params:params};ruleCont[validatorMethodName]=$.extend({},rule);$.extend(true,validator.settings.formElementRules,ruleCont);return this}var group=this.length>1;$.validator.addMethod(validatorMethodName,typeof method=="function"?method:window[method],message?message:undefined);var bindingElement=(group?$(this.get(0)):this);var msgParam={};msgParam[validatorMethodName]=message;(bindingElement).rules("add",validatorMethodName,group?{params:params,elements:this.get()}:params,msgParam);if(group){var isAllCheckable=true;var validator=$(this[0].form).validate();$.each(this,function(value,index){if(validator&&!validator.checkable(this)){isAllCheckable=false}});if(!isAllCheckable){var others=this.not(this.get(0));var $this=this.get();$.each(others,function(value,index){$(this).rules("add",validatorMethodName,{params:params,elements:$this},msgParam,false)})}}if(this.length==2){var first=this.get(0);var firstName=first.name;var second=this.get(1);var secondName=second.name;var from=null;var to=null;var validator=$.data(first.form,"validator");var fromSuffix=validator.settings.rangeRegExes[0];var toSuffix=validator.settings.rangeRegExes[1];if(fromSuffix.test(firstName)&&toSuffix.test(secondName)){from=first;to=second}else{if(fromSuffix.test(secondName)&&toSuffix.test(firstName)){from=second;to=first}}if(from){from.partner=to}}return this},removeValidator:function(method){if(this.is("form")){this.removeFormValidator(method);return this}this.rules("remove",getValidatorMethodName(method===undefined?"":method));return this},addErrorMsg:function(message,elementToFocus,labels,highlightElementToFocusLabel,serverSideValidation){if(!message){return null}return this.validate().addError(message,elementToFocus,labels,highlightElementToFocusLabel,serverSideValidation)},removeErrorMsg:function(message,labels){if(arguments.length==0){return this}else{if(arguments.length==1){this.validate().removeError(message)}else{this.validate().removeErrorWithSpecificLabels(message,labels)}}return this},resetValidation:function(){if(this.length==0){return this}if(this.is("form")){this.validate().resetForm()}else{$.each(this,function(){var validator=$(this.form).validate();validator.resetElement(this)})}return this},isModified:function(){var elements=$(this||IS.getDefaultForm()).find("input[type!='submit'][type!='button'][type!='hidden'],textarea,select");var element;for(var i=0;i<elements.size();i++){element=$(elements.get(i));if(element.is("select")){if(element.prop("selectedIndex")>=0&&!element.find("option").get(element.prop("selectedIndex")).defaultSelected){return true}}else{if(element.is(":radio")||element.is(":checkbox")){if(element.prop("checked")!=element.prop("defaultChecked")){return true}}else{if(element.is(":text")){var defVal=element.prop("defaultValue");if(defVal==undefined){defVal=""}if(element.get(0).value!=defVal){return true}}else{if(element.get(0).value!=element.prop("defaultValue")){return true}}}}}return false},setOptions:function(options){var withScope=$.extend({jQueryScope:this},options);$.each(this,function(){if(this.options){this.options=$.extend(this.options,withScope)}else{this.options=$.extend({},withScope)}})},setValidateOptions:function(options){var withScope=$.extend({jQueryScope:this},options);$.each(this,function(){if(this.options){this.options=$.extend(this.options,withScope)}else{this.options=$.extend({},withScope)}})},addFormValidator:function(method,message,options){var form=this[0];var validator=this.validate();var validatorMethodName=getValidatorMethodName(method);message=message?message:window.LBJSErrorMsgs?LBJSErrorMsgs[getFunctionNameUpper(method)]:undefined;var ruleCont={};var rule={method:method,message:message,options:options};ruleCont[validatorMethodName]=$.extend({},rule);$.extend(true,validator.settings.formRules,ruleCont);return this},removeFormValidator:function(method){var validatorSettings=this.validate().settings;var validatorMethodName=getValidatorMethodName(method);delete validatorSettings.formRules[validatorMethodName];delete validatorSettings.formElementRules[validatorMethodName]}})})(jQuery);var IS=$.validator;function getFunctionName(func){if(func){var funcNm=func.toString().match(/^\s*function\s+([^\s\(]+)/);return funcNm?funcNm[1]:""}return""}function getFunctionNameUpper(func){return getFunctionName(func).toUpperCase()}IS.addError=function(message,form,elementToFocus,labels,highlightAll){$(form||IS.getDefaultForm()).validate().addError(message,elementToFocus,labels,highlightAll)};IS.removeError=function(message,form,elementToFocus,labels,highLightAll){if(arguments.length<=2){$(form||IS.getDefaultForm()).validate().removeError(message)}else{$(form||IS.getDefaultForm()).validate().removeError(message,elementToFocus,labels,highLightAll)}};IS.getValidatorMethodName=function(method){return"ISVALIDATEMETHOD_"+getFunctionNameUpper(method)};IS.addValidator=function(method,message){var funcName=getFunctionNameUpper(method),methodName=IS.getValidatorMethodName(method);if(message){IS.addMethod(methodName,method,message)}else{if(LBJSErrorMsgs[funcName]){IS.addMethod(methodName,method,LBJSErrorMsgs[funcName])}}};IS.addRemoveItemValidator=function(itemName,method,isAdd,form,methodName,params){var item=IS.getItem(itemName,null,form);if(item){form=form?form:item.form;$("[name="+itemName+"]",form).each(function(index,val){$(this).rules(isAdd?"add":"remove",methodName||IS.getValidatorMethodName(method),params)})}};IS.addItemValidator=function(itemName,method,methodName,message,form,params){IS.addValidator(method,message);IS.addRemoveItemValidator(itemName,method,true,form,methodName,params)};IS.removeItemValidator=function(itemName,method,form){IS.addRemoveItemValidator(itemName,method,false,form)};IS.getDefaultForm=function(){return IS.FormValidated||document.forms[0]};IS.getItem=function(elemName,index,form){try{return $("[name="+elemName+"]",form||IS.getDefaultForm()).get(index?index:0)}catch(e){return null}};IS.removeValidator=function(method){$(IS.getDefaultForm()).validate().elements().each(function(index,val){$(this).rules("remove",IS.getValidatorMethodName(method))});IS.removeMethod(IS.getValidatorMethodName(method))};IS.submitForm=function(form){if(IS.validateForm(form,true)){form=form||IS.getDefaultForm();if(!form.submitting){form.submitting=true;form.submit()}}};IS.validate=function(form,isOnSubmit){return $(form||IS.getDefaultForm()).valid(isOnSubmit)};IS.validateForm=function(form,isOnSubmit){return $(form||IS.getDefaultForm()).valid(isOnSubmit)};IS.addGroupValidator=function(elementNames,method,methodName,params,message){var elements=[];var firstElem=null;var funcName=methodName||getFunctionNameUpper(method);var msg=message||LBJSErrorMsgs[funcName];if(elementNames){if(!$.isArray(elementNames)){elementNames=[elementNames]}$.each(elementNames,function(index,val){var elem=IS.getItem(val);if(!firstElem&&elem){firstElem=elem}elements.push(elem)})}var formatMessage=function(params,element){var msgParams=params.params||[];var elems=elements;elems.reverse();$.each(elems,function(index,val){msgParams.unshift($(val).metadata().label||val.name)});$.each(msgParams,function(i,n){msg=msg.replace(new RegExp("\\{"+i+"\\}","g"),n)});return msg};if(firstElem){IS.addItemValidator(firstElem.name,method,null,message||formatMessage,null,{params:params,elements:elements})}return method};IS.addRangeValidator=function(itemName,method,params){var elemFr=itemName+"_"+fromSuffix,elemTo=itemName+"_"+toSuffix;IS.getItem(elemFr).partner=IS.getItem(elemTo);IS.addGroupValidator([elemFr,elemTo],method,params)};IS.clear=function(form){$(form||IS.getDefaultForm()).validate().resetForm()};IS.isModified=function(form){return $(form||IS.getDefaultForm()).isModified()};IS.focusControl=function(itemname,index){var item=IS.getItem(itemname,index);try{item.focus()}catch(e){}};
$.extend($.validator.messages,iswebDefaultMessages);
/*
 * Copyright (c) 2010 Azeus Systems Holdings Limited.
 * All rights reserved.
 *
 * This software is the proprietary product of Azeus Systems Holdings Limited ("Azeus")
 * and contains confidential and proprietary information of Azeus ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with Azeus. 
 */


//additional validators
// As most of the isweb3 validators are either incompatible or redundant
// a lot of it has been removed. If you have written a validator that
// can be used by other screens, please consider putting it here.


/**
 * Verified to be still working.
 * @params elements - an array of length 2 containing number from element at index 1
 *                   and number to element at index 0 
 * @return true if num from <= num to
 * sample usage: numberRangeValidator($('[name=INTEGER_RANGE_FR],[name=INTEGER_RANGE_TO]').get())
 */
function numberRangeValidator(elements) {
  var fromElement = elements[0].value;
  var toElement = elements[1].value;
  
  if(String(fromElement).trim() == '' || String(toElement).trim() == '') {
    return true;
  }
  
  fromElement = new BigDecimal(fromElement);
  toElement = new BigDecimal(toElement);
  
  if(fromElement.compareTo(toElement) == 1) {
    return false;
  }
  return true;
}  
 
/**
 * 
 * @param elements - an array of length 2 containing date to element at index 0
 *                   and date from element at index 1          
 * @return true if date from <= date to
 * sample usage: dateRangeValidator($('[name=DATE_RANGE_TO],[name=DATE_RANGE_FROM]').get())
 */
function dateRangeValidator(elements) {

  var parserFr = new SimpleDateFormat($(elements[1]).metadata().dataFormat || $(elements[1]).attr('dataformat'));
  var parserTo = new SimpleDateFormat($(elements[0]).metadata().dataFormat || $(elements[0]).attr('dataformat'));
  
  var fromElement = elements[1].value;
  var toElement = elements[0].value;
  
  if(String(fromElement).trim() == '' || String(toElement).trim() == '') {return true;}
  
  fromElement = parserFr.parse(fromElement);
  toElement = parserTo.parse(toElement);
  
  if(new Date(fromElement).getTime() > new Date(toElement).getTime()) {
    return false;
  }
  return true;
}

/**
* 
* @param elements - an array of length 2 containing string from element at index 0
*                   and string to element at index 1          
* @return true if string from <= string to
* sample usage: stringRangeValidator($('[name=STR_RANGE_FR],[name=STR_RANGE_TO]').get())
*/
function stringRangeValidator(elements) {
  var fromElement = elements[0].value;
  var toElement = elements[1].value;
  
  if(String(fromElement).trim() == '' || String(toElement).trim() == '') {return true;}
  
  fromElement = fromElement.toUpperCase();
  toElement = toElement.toUpperCase();
  
  if(fromElement > toElement) {
    return false;
  }
  return true;
}

/**
 * 
 * @param form
 * @return true if at least 1 of the form input controls(except button, submit and hidden) have a value.
 * Note: This function does not check if the form is disabled or hidden. 
 *       Consider using checkAtLeastOneCriteria(itemList,form) instead. checkAtLeastOneCriteria and 
 *       its usage instructions are found at
 *       search_utils.js.
 */
function searchElementsValidator(form) {
  var elements = $(form || IS.getDefaultForm()).find("input[type!='submit'][type!='button'][type!='hidden'],textarea,select");
  var element;
  
  for(var i = 0; i < elements.size(); i++){
    element = $(elements.get(i));
    if(element.val() != "") {      
      return true;
    }
  }
  
  return false;
}

//
/**
 * Override validateEnglishOnly in isweb.js, to support extended ASCII and to use INVALID_VALUE error message.
 * 
 */
function validateEnglishOnly(value, element) {
  if(!String(value).trim().isExtendedASCII()) { 
    return false;
  } 

  return true;
}

/**
 * Override validateChineseOnly in isweb.js, to use INVALID_VALUE error message.
 * 
 */
function validateChineseOnly(value, element) {
  if(!String(value).trim().isUnihanHKSCS2()) { 
    return false;
  }

  return true;
}


var CURR_DATE = new Date();

/**
* Validate a numeric ranged item pair, such that "From" must be <= "To".
*  
* @param item the "From" item.
* @return
* 
* @deprecated Use numberRangeValidator instead
*             {@link numberRangeValidator}
**/
function validateNumericRange(item) {
  if (item && item.value && item.value != "") {
    var itemTo = item.partner;
    if (itemTo) {
      if (itemTo && itemTo.value && itemTo.value != "") {
        return numberRangeValidator([item.partner, item]);
      }
    }
  }
  return true;  
}

/**
 * Validate a date field must not be later than the current date.
 * Checks withtimestamp precision
 * @param item
 * @return
 */
function validateDateNotLaterThanCurrDate(item) {   
  if (item && item.value && item.value != "") {    
    if (window.top && window.top.CURR_DATE) {
      CURR_DATE = window.top.CURR_DATE;
    }    
    if ($(item).toTimestamp().getTime() > CURR_DATE.getTime()) {      
      return false;
    }
  }
  return true;
}

/**
 * Validate a date item must not be earlier than the current date.
 * Checks with timestamp precision
 * 
 * @param item
 * @return
 */
function validateDateNotEarlierThanCurrDate(item) {
  if (item && item.value && item.value != "") {    
    if (window.top && window.top.CURR_DATE) {
      CURR_DATE = window.top.CURR_DATE;
    }    
    if ($(item).toTimestamp().getTime() < CURR_DATE.getTime()) {      
      return false;
    }
  }
  return true;
}

/**
 * Validate a date ranged item pair, such that "From" must be < "To".
 *  
 * @param item the "To" item.
 * @return
 */
function validateDateRangeLaterThan(itemFr, itemTo) {

   
  if (itemFr && itemFr.value && itemFr.value != "") {
    if (itemTo && itemTo.value && itemTo.value != "") {
      var itemToTimestamp = $(itemTo).toTimestamp();      
      if ($(itemFr).toTimestamp().getTime() > itemToTimestamp.getTime()) {
        return false;
      }
    }    
  }
  return true;
}

function validateEmail(value, element) {
  if (value.length > 0) {
    var reValidChars = /[^A-Za-z0-9\.@\-_]+/;
    if(reValidChars.test(value)){
      return false;
    }

    var reContainAt = /^[^@]*[@]+[\w\W]*$/;
    if(!reContainAt.test(value)){
      return false;
    }
    
    var reFormat = /^[\w\W]*[A-Za-z0-9]{1}[\w\W]*@[\w\W]*[A-Za-z0-9]{1}[\.]{1}[A-Za-z0-9]{1}[\w\W]*$/;
    if(!reFormat.test(value)){
      return false;
    }
      
    var reStartEndAlpha = /^[A-Za-z0-9]+[\w\W]*[A-Za-z0-9]+$/;
    if(!reStartEndAlpha.test(value)){
      return false;
    }
    
    if (!(value.indexOf("@@") == -1 && value.indexOf("..") == -1)) {
      return false;
    }
  }
  return true;
}

function validateNewString(value, element, params) {
  if(value.toUpperCase() !== params[0].toUpperCase()){
    return true;
  }
  return false;
}

function validateFileSize(value, element, params) {
  const size = (element.files[0].size/1024/1024).toFixed(2);
  if(size <= params[0]){
    return true;
  }
  return false;
}

function validateFileNumberEquals(value, element, params) {
  if(element.files.length == params[0]){
    return true;
  }
  return false;
}

function validateFileNameLength(value, element, params) {
  if(element.files[0].name.length <= params[0]) {
    return true;
  }
  return false;
}

/*
 * TODO: FIX THIS SECTION
 */
/**
 * @param date1
 * @param date2
 * @return (date2 - date1) in years. Fractions of a year are truncated.
 */
function yearsBetween(date1, date2) {
  var yrs = date2.getFullYear() - date1.getFullYear();
  var date3 = new Date(date1);
  date3.setFullYear(date1.getFullYear() + yrs);
  return yrs;
}

// HKID
/**
* @param value
* @param element
* @return true if HK Id format is valid; otherwise, return false
*/
function validateHkIdFormat(value, element) {
  if(value.length == 0) 
  { 
    return true; 
  }
  var validator = new HkidValidator(); 
  if(!validator.validateFormat(value)){ 
    return false; 
  } 
  return true;
}

/**
* @param value
* @param element
* @return true if HK Id value is valid; otherwise, return false
*/
function validateHkIdValue(value, element) 
{ 
  if(value.length == 0) 
  { 
    return true; 
  }
  var validator = new HkidValidator(); 
  if( !validator.validate( value ) ) 
  { 
    return false; 
  } 
  return true; 
}

function validateYear(value, element, params) {
  if (value ="" || value.length == 4) {
    return true;
  }
  return false;
}

function validateLengthEquals(value, element, params) {
  if (params) {
    if (value == "" || value.length == params[0]) {
      return true;
    }
  }
  return false;
}

function validateDigitsOnly(value, element) {
  if (value != "") {
    for (var i = 0; i < value.length; i++) {
      if (value.charAt(i) < '0' || value.charAt(i) > '9') {
        return false;
      }
    }
  }
  return true;
}

function validateAtmPpsAcctNo(value, element) {
  var rnre3 = /^[0-9]{12,12}$/;
  if (rnre3.test(value)) {
    return true;
  }
  return false;
}

function validateLoanReferenceNo2(value, element) {
  return /^[A-Z]{2,2}[0-9]{6,6}\-[0-9]\-[0-9][0-9]$/.test(value)
    || /^[A-Z][0-9]{6,6}\-[0-9]$/.test(value);
}

function validateLoanReferenceNo1(value, element) {
  return /^[A-Z]{2,2}[0-9]{6,6}\-[0-9]\-[0-9][0-9]$/.test(value);
}

function validateLinkUpCode(value, element) {
  return /^[A-Z][0-9]{7,7}$/i.test(value);
}

//LoanReferenceNo validator for multiple fields
function validateLoanReferenceNoFields(elements, parameters) {
  var rnre1 = /^[A-Z][A-Z]?[0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9]$/i;
  var rnre2 = /^[A-Z][A-Z][0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9]\-[0-9][0-9]$/i;
  
  var value = ""; 
  for (var i=0; i< elements.length; i++) {
    if (i>1 && $(elements[i]).val()) {
      value+="-";
    }
    value+=$(elements[i]).val();
  }
  
  if (rnre1.test(value) || rnre2.test(value)) {
    return true;
  }
  return false;
}

function validateHkIdWithoutCheckDigitFormatOnly(value, element) {
  var hkId = value.toUpperCase();
  var re = /^[A-Z][A-Z]?[0-9][0-9][0-9][0-9][0-9][0-9]$/;
  return re.test(hkId);
}

function validateHkIdFormatOnly(value, element) {
  var hkId = value.toUpperCase();
  var re = /^[A-Z][A-Z]?[0-9][0-9][0-9][0-9][0-9][0-9][0-9A]$/;
  return re.test(hkId);
}

function validateHkId(value, element) {
  var hkId = value.toUpperCase(); 
  if(!validateHkIdFormatOnly(value, element)) {
    return false;
  }
  var total = 0;
  
  if (hkId.length < 9) {
    total = 9*36;
  }
  
  for (var i = 0; i < hkId.length; i++) {
    var code = hkId.charCodeAt(i);
    if (i < hkId.length - 7) {
      code -= "A".charCodeAt(0) - 10;
    } else if (i==hkId.length - 1) {
      if (code >= "0".charCodeAt(0) && code <= "9".charCodeAt(0)) {
        code -= 48;
      } else if (code == "A".charCodeAt(0)) {
        code = 10;
      }
    } else {
      code -= 48;
    }
    total += code*(hkId.length-i);
  }
  return total % 11 == 0;
}

//HKID validator for multiple fields
function validateHkIdFields(elements, parameters) {
  var hkid = "";
  parameters[0] = "";
  for (var i = 0; i < elements.length; i++) {
    hkid += $(elements[i]).val();    
  }
  
  parameters[1] = $(elements[0]).val() + $(elements[1]).val() + "(" +  $(elements[2]).val() +")";
  parameters[0] = $(elements[0]).metadata().label;
  return validateHkId(hkid);
}

function validateMobileNumber(value, element) {
  var re = /^[456789].*$/;
  if (re.test(value)) {
    return true;
  }
  return false;
}

function validateReferenceNumber(value, element) {
  rnre1 = /^[A-Z][A-Z]?[0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9]$/;
  rnre2 = /^[A-Z][A-Z][0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9]\-[0-9][0-9]$/;
  rnre3 = /^[0-9]{12,12}$/;
  if (rnre1.test(value)) {
    return true;
  }
  if (rnre2.test(value)) {
    return true;
  }
  if (rnre3.test(value)) {
    return true;
  }
  return false;
}

function validateTriDate(elements, parameters) {
  var $date = $(elements[3]);
  var $day = $(elements[0]);
  var $month = $(elements[1]);
  var $year = $(elements[2]);
  if ($day.val() == "" || $month.val() == "" || $year.val() == "") {
    return true;
  }
  parameters[0] = $day.val() + "/" + $month.val() + "/" + $year.val();
  $date.metadata().dataFormat = "dd/MM/yyyy";
  $date.val(parameters[0]);
  if ($date.toDate() == null) {
    return false;    
  }
  return true;
}

//value must be in dd/MM/yyyy format
function validateNotFutureDate(value, element) {
  var now = Date.parse(new Date().toDateString());
  
  var valueArray = value.split("/");
  var newValue = `${valueArray[2]}/${valueArray[1]}/${valueArray[0]}`;
  
  var input = Date.parse(newValue);
  if(input <= now) {
    return true;
  }
  return false;
}

// this does not check if value is a valid integer
// only the if value of the right part of "." is zero or undefined
function validateInteger(value, element) {
  var numArray = value.split(".");  
  if ((numArray[1] != undefined && numArray[1] != 0)) {
    return false;
  }
  return true;
}

function validateMinValueExclusive(value, element) {
  var numValue = new BigDecimal(value);
  var minValue = new BigDecimal($(element).metadata().minValue);
  if (minValue.compareTo(numValue) >= 0) {
    return false;
  }
  return true;
}

function validateValidationCode(elements, parameters) {
  var format = /^[0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9][0-9]$/;
  
  function getChecksum(code) {
    return parseInt(code.substr(25,3),10);
  }
  
  function calculateChecksum(code) {
    var sum = 0;
    var cleanCode = code.replace(/\-/g, "");
    for(var i = 0; i < cleanCode.length - 3; i++) {
      var k = parseInt(cleanCode.charAt(i));
      sum += k;
    }
    return sum;
  }
  
  function getCheckDigit(code) {
    return parseInt(code.substr(21,1), 10);
  }
  
  function calculateCheckDigit(code) {
    var cleanCode = code.substr(0,4) + code.substr(7,7) + code.substr(15,6);
    var sum = 0;
    var mul = 10;
    for (var i = 0; i < cleanCode.length; i++) {
      if(mul == 0)
        mul = 10;
      var temp = (parseInt(cleanCode.charAt(i), 10) * mul);

      sum += temp;
      mul--;
    }
    sum = 11 - (sum % 11);
    if (sum>=10) {
      sum %= 10;
    }
    return sum;
  }
  
  for (var x = 0; x < elements.length; x++) {
    if ($(elements[x]).val() == "") {
      return true;
    }
  }
  
  var code = $(elements[0]).val() + "-" + $(elements[1]).val() + "-" + $(elements[2]).val() + "-" + $(elements[3]).val();
  
  if (!format.test(code)) {
    return false;
  }

  if (getChecksum(code)!=calculateChecksum(code)) {
    return false;
  }
  
  if (getCheckDigit(code)!=calculateCheckDigit(code)) {
    return false;
  }
  
  return true;
}
var HiddenActionHandler={submitting:false,hiddenFrameName:"hidden_action_",hiddenFrame:function(){return frames[this.hiddenFrameName]},getAckMessage:function(){var hiddenFrame=this.hiddenFrame();if(hiddenFrame&&hiddenFrame.document&&hiddenFrame.getMessageContainer&&hiddenFrame.getMessageContainer()){return hiddenFrame.getMessageContainer().innerHTML}return""},hasError:function(){if(this.hiddenFrame().document.getElementById("MESSAGE_")==null){return false}var nodes=this.hiddenFrame().document.getElementById("MESSAGE_").childNodes;for(var ctr=0;ctr<nodes.length;ctr++){if(nodes[ctr].className=="error"){return true}}return false},copyMessage:function(){var hiddenFrameMessage=HiddenActionHandler.getAckMessage();if(hiddenFrameMessage!=""){setMessageContent(hiddenFrameMessage)}},addClassToMessageContainer:function(hasError){var oDiv=getMessageContainer();if(oDiv){if(hasError){$(oDiv).addClass("ui-state-error").removeClass("ui-state-highlight")}else{$(oDiv).toggleClass("ui-state-highlight").removeClass("ui-state-error")}}},markLabelsWithErrors:function(){var hiddenFrame=this.hiddenFrame();hiddenFrame.$&&hiddenFrame.$(".lbl").each(function(i){if($(this).hasClass("errorLbl")){$(".lbl:eq("+i+")").addClass("errorLbl").find("img").attr("src",function(i,val){return val.replace(/\bno_error\.gif\b/,"error.gif")})}})},doHiddenAction:function(actionString,callback,form){if(form.HIDDEN_ACTION==undefined){$('<input type="hidden" name="HIDDEN_ACTION" value="Y" />').appendTo(form)}if(!HiddenActionHandler.submitting){this.callback=callback;this.activeForm=form;form.ACTION.value=actionString;this.oldTarget=form.target;form.target=this.hiddenFrameName;if($(form).valid(true)){this.submitting=true;showProgressDialog();form.submit()}}},notifyParent:function(){if(_WAIT_FOR_READY_LIST_COMPLETE==true){window.setTimeout("HiddenActionHandler.notifyParent();",100);return}var parentHandler=window.parent.HiddenActionHandler;var topWindow=window.top;var options={preventDefault:false,message:parentHandler.getAckMessage(),hasError:parentHandler.hasError()};if(parentHandler){if(parentHandler.callback&&$.isFunction(parentHandler.callback)){parentHandler.callback(options)}if(options.preventDefault==false){try{parentHandler.copyMessage()}catch(e){}}parentHandler.submitting=false;topWindow.hideProgressDialog();delete (parentHandler.callback);if(parentHandler.oldTarget){parentHandler.activeForm.target=parentHandler.oldTarget;delete (parentHandler.oldTarget)}delete (parentHandler.activeForm);if(options.performOnExit&&$.isFunction(options.performOnExit)){options.performOnExit()}}}};var _WAIT_FOR_READY_LIST_COMPLETE=true;$(function(){window.HiddenActionHandler=HiddenActionHandler;if(window.name==HiddenActionHandler.hiddenFrameName){HiddenActionHandler.notifyParent();if(document.readyState==="complete"){_WAIT_FOR_READY_LIST_COMPLETE=false}else{$(window).on("load",function(){_WAIT_FOR_READY_LIST_COMPLETE=false})}}});function doHiddenAction(actionString,callback,pForm){var form=pForm?pForm:document.forms[0];HiddenActionHandler.doHiddenAction(actionString,callback,form)}WarningUtils={hasWarning:function(str){return str.indexOf("_WARNING_MSG")>0},getWarningList:function(str){try{var jsonWarnings=eval($(str).find("li")[0].innerHTML);return jsonWarnings._WARNING_MSG}catch(e){return null}}};
var LocationHashManager={lastHash:null,isPollingHash:true,keyObservers:new Object(),DELIM_PAIRS:"&&",DELIM_KEY_VALUE:"==",KEY_PAGE_HASH:"PAGE_HASH",POLL_INTERVAL:100,staticHashKeys:[],pollHash:function(){var currentHash=window.location.hash;if(currentHash!=this.lastHash){var oldHashData=this.decomposeHash(this.lastHash);var newHashData=this.decomposeHash(currentHash);for(observedKey in this.keyObservers){if(oldHashData[observedKey]!=newHashData[observedKey]){this.keyObservers[observedKey](observedKey,newHashData[observedKey],this._cloneHashData(newHashData))}}this.embedHashDataInAnchors(newHashData)}this.lastHash=currentHash;if(this.isPollingHash){setTimeout("LocationHashManager.pollHash();",this.POLL_INTERVAL)}},addKeyObserver:function(keyToObserve,functionToCall){if(functionToCall){this.keyObservers[keyToObserve]=functionToCall}else{this.removeKeyObserver(keyToObserve)}},embedValue:function(key,value,suppressHistory){if(key==this.KEY_PAGE_HASH||!key){return}var hashData=this.decomposeHash(window.location.hash);if(value){if(hashData[key]==value){return}hashData[key]=value}else{if(!hashData[key]){return}delete hashData[key]}var newHash=this._composeHash(hashData);if(suppressHistory){var curLocation=new String(window.location);var hashLocation=curLocation.indexOf("#");if(hashLocation==-1){hashLocation=curLocation.length}window.location.replace(curLocation.substring(0,hashLocation)+newHash);return}else{window.location.hash=newHash}},retrieveValue:function(key){return this.decomposeHash(window.location.hash)[key]},removeKeyObserver:function(keyToObserve){delete this.keyObservers[keyToObserve]},addStaticKey:function(key){this.staticHashKeys.push(key)},embedHashDataInAnchors:function(newHashData,parentElement){if(!newHashData){newHashData=this.decomposeHash(window.location.hash)}if(!parentElement){parentElement=document}var anchorList=parentElement.getElementsByTagName("a");for(var i=0;i<anchorList.length;i++){var anchor=anchorList[i];this.updateAnchorHash(anchor,newHashData,"href")}},updateAnchorHash:function(anchor,newHashData,hashAttribute){var hrefValue=anchor.getAttribute(hashAttribute);if(!hrefValue||this._redirectsToOtherPage(hrefValue)){return}var elementHashData=this.decomposeHash(hrefValue);for(newHashKey in newHashData){var newValue=newHashData[newHashKey];var oldValue=elementHashData[oldValue];if(oldValue!=newValue&&this._isVolatileHashValue(anchor,newHashKey)){if(newValue){elementHashData[newHashKey]=newHashData[newHashKey]}else{delete elementHashData[newHashKey]}}}for(oldHashKey in elementHashData){if(!newHashData[oldHashKey]&&this._isVolatileHashValue(anchor,oldHashKey)){delete elementHashData[oldHashKey]}}var newHashValue=this._composeHash(elementHashData);anchor.setAttribute(hashAttribute,newHashValue);if("href"==hashAttribute){this._updateHrefTargets(hrefValue,newHashValue)}},_updateHrefTargets:function(oldTargetID,newTargetID){var searchID=oldTargetID;if(oldTargetID.charAt(0)!="#"){searchID=oldTargetID.substring(oldTargetID.indexOf("#"))}searchID=searchID.substring(1);newTargetID=newTargetID.substring(1);var targetAnchor=document.getElementById(searchID);if(targetAnchor){targetAnchor.setAttribute("id",newTargetID);targetAnchor.setAttribute("name",newTargetID)}},_isVolatileHashValue:function(element,key){if($.inArray(key,this.staticHashKeys)!=-1){return false}var constantHashValues=element.getAttribute("constantHashValues");if(!constantHashValues){return true}var tempConstantHashValues=","+constantHashValues+",";return tempConstantHashValues.indexOf(","+key+",")==-1},decomposeHash:function(hashValue){if(!hashValue){return new Object()}if(hashValue.charAt(0)=="#"){hashValue=hashValue.substring(1)}var hashData=new Object();var splitHash=hashValue.split(this.DELIM_PAIRS);for(var i=0;i<splitHash.length;i++){if(i==0){hashData[this.KEY_PAGE_HASH]=splitHash[i]}else{var keyValuePair=splitHash[i].split(this.DELIM_KEY_VALUE);hashData[keyValuePair[0]]=keyValuePair[1]}}return hashData},_composeHash:function(hashData){var hashString="#";if(hashData[this.KEY_PAGE_HASH]){var pageHash=hashData[this.KEY_PAGE_HASH];if(pageHash.indexOf("#")!=-1){pageHash=pageHash.substring(pageHash.indexOf("#")+1)}hashString+=pageHash}for(key in hashData){if(key!=this.KEY_PAGE_HASH){hashString+=this.DELIM_PAIRS+key+this.DELIM_KEY_VALUE+hashData[key]}}return hashString},_cloneHashData:function(hashData){var dataClone=new Object();for(key in hashData){dataClone[key]=hashData[key]}return dataClone},_redirectsToOtherPage:function(hrefValue){if(!hrefValue){return true}if(hrefValue.indexOf("#")==-1){return true}if(hrefValue.charAt(0)=="#"){return false}var hrefNoHash=hrefValue.substring(0,hrefValue.indexOf("#"));var windowLocNoHash=new String(window.location);var hashIndex=windowLocNoHash.indexOf("#");if(hashIndex==-1){hashIndex=windowLocNoHash.length}windowLocNoHash=windowLocNoHash.substring(0,hashIndex);return hrefNoHash!=windowLocNoHash}};LocationHashManager.addStaticKey(LocationHashManager.KEY_PAGE_HASH);$(document).ready(function(){var hashData=LocationHashManager.decomposeHash(window.location.hash);if(hashData[LocationHashManager.KEY_PAGE_HASH]){var currentHash=window.location.hash;window.location.hash=hashData[LocationHashManager.KEY_PAGE_HASH];window.location.hash=currentHash}NavHandler.leaveHandlersActive=false;LocationHashManager.pollHash();NavHandler.leaveHandlersActive=true});
var NavHandler={KEY_WINDOW_ID:"WINDOW_ID",KEY_GO_TO_LINK:"GO_TO_LINK",onLeaveHandlers:new Array(),leaveHandlersActive:true,leaveHandlersChecked:false,windowID:null,messageContainer:null,contentTop:null,isRedirecting:false,redirectToURL:function(targetURL,bRedirect){if(bRedirect!=false){this.isRedirecting=true}if(NavHandler.warnUserBeforeLink()){var newURL=NavHandler.addWindowIDToURL(targetURL);window.location=newURL}else{this.isRedirecting=false}},goToHashAnchor:function(hashAnchor){if(!hashAnchor){return}var anchorID=hashAnchor.id;if(!anchorID){return}var anchorTarget=LocationHashManager.decomposeHash("#"+anchorID)[LocationHashManager.KEY_PAGE_HASH];if(!anchorTarget){return}var hashData=LocationHashManager.decomposeHash(window.location.href);hashData[LocationHashManager.KEY_PAGE_HASH]=anchorTarget;LocationHashManager.updateAnchorHash(hashAnchor,hashData,"name");hashAnchor.id=hashAnchor.name;var newHash=LocationHashManager._composeHash(hashData);hashAnchor.id=newHash.substring(1);window.location.hash=newHash},initWindowID:function(){var newWindowID=null;var wrapper=new HashURLWrapper(new String(window.location));var urlWindowID=wrapper.getQueryParam(NavHandler.KEY_WINDOW_ID);var windowIDItem=$("input[name='WINDOW_ID']").get(0);if(urlWindowID){newWindowID=urlWindowID}else{if(windowIDItem){newWindowID=windowIDItem.value}}this.windowID=newWindowID;if(windowIDItem){windowIDItem.setAttribute("value",this.windowID)}},addLeaveHandler:function(warningMessage,condition,options){var leaveHandler=new Object();leaveHandler.MESSAGE=warningMessage;if(!condition){condition=function(){return true}}leaveHandler.CONDITION=condition;if(options){leaveHandler.OPTIONS=options}this.onLeaveHandlers.push(leaveHandler)},_warnUserBeforeUnload:function(){var actionItem=IS.getItem("ACTION");var isSubmitting=false;if(actionItem){isSubmitting=actionItem.value!=null&&actionItem.value!=""}if(!(this.leaveHandlersChecked||isSubmitting)&&this.leaveHandlersActive){var compositeMessage=this._generateWarning();if(compositeMessage!=""){return compositeMessage}}},warnUserBeforeLink:function(){if(!this.leaveHandlersActive){return true}var compositeMessage=this._generateWarning();if(compositeMessage!=""){var leaveQuestion=LBJSWarningMsgs.LEAVE_QUESTION;var leaveInstruction=LBJSWarningMsgs.LEAVE_INSTRUCTION;if(leaveQuestion!=""){compositeMessage=leaveQuestion+"\n\n"+compositeMessage}if(leaveInstruction!=""){compositeMessage=compositeMessage+"\n\n"+leaveInstruction}if(!confirm(compositeMessage)){return false}}this.leaveHandlersChecked=true;return true},_generateWarning:function(){var compositeMessage="";for(var i=0;i<this.onLeaveHandlers.length;i++){var handler=this.onLeaveHandlers[i];if(handler.CONDITION()){compositeMessage+=handler.MESSAGE+"\n";if(handler.OPTIONS&&handler.OPTIONS.breakIfSatisfy){break}}}if(compositeMessage!=""){return compositeMessage.substring(0,compositeMessage.length-1)}return compositeMessage},addWindowIDToURL:function(url){var wrapper=new HashURLWrapper(url);wrapper.setQueryParam(this.KEY_WINDOW_ID,this.windowID);return wrapper.getURL()}};function HashURLWrapper(url){var hashIndex=url.lastIndexOf("#");if(hashIndex!=-1){this.hash=url.substring(hashIndex);url=url.substring(0,hashIndex)}var queryIndex=url.lastIndexOf("?");if(queryIndex!=-1){var query=url.substring(queryIndex);var splitQuery=query.substring(1).split("&");this.queryMap=new Object();for(var i=0;i<splitQuery.length;i++){var splitParam=splitQuery[i].split("=");if(!this.queryMap[splitParam[0]]){this.queryMap[splitParam[0]]=new Array()}this.queryMap[splitParam[0]].push(splitParam[1])}url=url.substring(0,queryIndex)}this.url=url}HashURLWrapper.prototype.setQueryParam=function(key,value){if(!this.queryMap){this.queryMap=new Object()}if(value){this.queryMap[key]=[value]}else{delete this.queryMap[key]}};HashURLWrapper.prototype.getQueryParam=function(key){if(!this.queryMap||!this.queryMap[key]){return null}var result=this.queryMap[key];if(result.length==1){return result[0]}return result};HashURLWrapper.prototype.getURL=function(){var hash=(this.hash)?this.hash:"";var query="";if(this.queryMap){query="";for(var key in this.queryMap){var values=this.queryMap[key];for(var i=0;i<values.length;i++){if(query==""){query+="?"}else{query+="&"}query+=key+"="+values[i]}}}return this.url+query+hash};LocationHashManager.addStaticKey(NavHandler.KEY_GO_TO_LINK);$(window).on("beforeunload",function(){return NavHandler._warnUserBeforeUnload()});$(function(){NavHandler.initWindowID();NavHandler.messageContainer=$("#msgContainer_").get(0);NavHandler.contentTop=$("#top").get(0);$("a").each(function(index,anchor){var href=$(anchor).attr("href");if(((anchor.hostname&&location.hostname!=anchor.hostname&&anchor.target!="_self")||(anchor.target&&anchor.target!="_self"))&&!$(anchor).attr("onclick")){$(anchor).addClass("external-link");$(anchor).on("click",function(){openPopUpWindow("",href,anchor.target||"_blank");return false})}});$("a.external-link,button.external-link").each(function(index,anchor){$(anchor).attr("title",LBJSParams.EXTERNAL_LINK_TITLE)})});
LocationHashManager.addKeyObserver(NavHandler.KEY_GO_TO_LINK,function(observedKey,keyValue,hashData){if(!keyValue){return}LocationHashManager.embedValue(NavHandler.KEY_GO_TO_LINK,null,true);NavHandler.redirectToURL(keyValue)});
(function($){$.tools=$.tools||{version:"1.2.3"};$.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip",extraClasses:null},addEffect:function(name,loadFn,hideFn){effects[name]=[loadFn,hideFn]}};var effects={toggle:[function(done){var conf=this.getConf(),tip=this.getTip(),o=conf.opacity;if(o<1){tip.css({opacity:o})}tip.show();done.call()},function(done){this.getTip().hide();done.call()}],fade:[function(done){var conf=this.getConf();this.getTip().fadeTo(conf.fadeInSpeed,conf.opacity,done)},function(done){this.getTip().fadeOut(this.getConf().fadeOutSpeed,done)}]};function getPosition(trigger,tip,conf){var top=conf.relative?trigger.position().top:trigger.offset().top,left=conf.relative?trigger.position().left:trigger.offset().left,pos=conf.position[0];top-=tip.outerHeight()-conf.offset[0];left+=trigger.outerWidth()+conf.offset[1];var height=tip.outerHeight()+trigger.outerHeight();if(pos=="center"){top+=height/2}if(pos=="bottom"){top+=height}pos=conf.position[1];var width=tip.outerWidth()+trigger.outerWidth();if(pos=="center"){left-=width/2}if(pos=="left"){left-=width}return{top:top,left:left}}function Tooltip(trigger,conf){var self=this,fire=trigger.add(self),tip,timer=0,pretimer=0,title=trigger.attr("title"),effect=effects[conf.effect],shown,isInput=trigger.is(":input"),isWidget=isInput&&trigger.is(":checkbox, :radio, select, :button, :submit"),type=trigger.attr("type"),evt=conf.events[type]||conf.events[isInput?(isWidget?"widget":"input"):"def"];if(!effect){throw'Nonexistent effect "'+conf.effect+'"'}evt=evt.split(/,\s*/);if(evt.length!=2){throw"Tooltip: bad events configuration for "+type}trigger.bind(evt[0],function(e){clearTimeout(timer);if(conf.predelay){pretimer=setTimeout(function(){self.show(e)},conf.predelay)}else{self.show(e)}}).bind(evt[1],function(e){clearTimeout(pretimer);if(conf.delay){timer=setTimeout(function(){self.hide(e)},conf.delay)}else{self.hide(e)}});if(title&&conf.cancelDefault){trigger.removeAttr("title");trigger.data("title",title)}$.extend(self,{show:function(e){if(!tip){if(title){tip=$(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide().append(title);if(conf.extraClasses){tip.attr("class",tip.attr("class")+" "+conf.extraClasses)}}else{if(conf.tip){tip=$(conf.tip).eq(0)}else{tip=trigger.next();if(!tip.length){tip=trigger.parent().next()}}}if(!tip.length){throw"Cannot find tooltip for "+trigger}}if(self.isShown()){return self}tip.stop(true,true);var pos=getPosition(trigger,tip,conf);e=e||$.Event();e.type="onBeforeShow";fire.trigger(e,[pos]);if(e.isDefaultPrevented()){return self}pos=getPosition(trigger,tip,conf);tip.css({position:"absolute",top:pos.top,left:pos.left});shown=true;effect[0].call(self,function(){e.type="onShow";shown="full";fire.trigger(e)});var event=conf.events.tooltip.split(/,\s*/);tip.bind(event[0],function(){clearTimeout(timer);clearTimeout(pretimer)});if(event[1]&&!trigger.is("input:not(:checkbox, :radio), textarea")){tip.bind(event[1],function(e){if(e.relatedTarget!=trigger[0]){trigger.trigger(evt[1].split(" ")[0])}})}return self},hide:function(e){if(!tip||!self.isShown()){return self}e=e||$.Event();e.type="onBeforeHide";fire.trigger(e);if(e.isDefaultPrevented()){return}shown=false;effects[conf.effect][1].call(self,function(){e.type="onHide";shown=false;fire.trigger(e)});return self},isShown:function(fully){return fully?shown=="full":shown},getConf:function(){return conf},getTip:function(){return tip},getTrigger:function(){return trigger}});$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,name){if($.isFunction(conf[name])){$(self).bind(name,conf[name])}self[name]=function(fn){$(self).bind(name,fn);return self}})}$.fn.tooltip=function(conf){var api=this.data("tooltip");if(api){return api}conf=$.extend(true,{},$.tools.tooltip.conf,conf);if(typeof conf.position=="string"){conf.position=conf.position.split(/,?\s/)}this.each(function(){api=new Tooltip($(this),conf);$(this).data("tooltip",api)});return conf.api?api:this}})(jQuery);
(function($){var t=$.tools.tooltip;t.dynamic={conf:{classNames:"top right bottom left"}};function getCropping(el){var w=$(window);var right=w.width()+w.scrollLeft();var bottom=w.height()+w.scrollTop();return[el.offset().top<=w.scrollTop(),right<=el.offset().left+el.width(),bottom<=el.offset().top+el.height(),w.scrollLeft()>=el.offset().left]}function isVisible(crop){var i=crop.length;while(i--){if(crop[i]){return false}}return true}$.fn.dynamic=function(conf){if(typeof conf=="number"){conf={speed:conf}}conf=$.extend({},t.dynamic.conf,conf);var cls=conf.classNames.split(/\s/),orig;this.each(function(){var api=$(this).tooltip().onBeforeShow(function(e,pos){var tip=this.getTip(),tipConf=this.getConf();if(!orig){orig=[tipConf.position[0],tipConf.position[1],tipConf.offset[0],tipConf.offset[1],$.extend({},tipConf)]}$.extend(tipConf,orig[4]);tipConf.position=[orig[0],orig[1]];tipConf.offset=[orig[2],orig[3]];tip.css({visibility:"hidden",position:"absolute",top:pos.top,left:pos.left}).show();var crop=getCropping(tip);if(!isVisible(crop)){if(crop[2]){$.extend(tipConf,conf.top);tipConf.position[0]="top";tip.addClass(cls[0])}if(crop[3]){$.extend(tipConf,conf.right);tipConf.position[1]="right";tip.addClass(cls[1])}if(crop[0]){$.extend(tipConf,conf.bottom);tipConf.position[0]="bottom";tip.addClass(cls[2])}if(crop[1]){$.extend(tipConf,conf.left);tipConf.position[1]="left";tip.addClass(cls[3])}if(crop[0]||crop[2]){tipConf.offset[0]*=-1}if(crop[1]||crop[3]){tipConf.offset[1]*=-1}}tip.css({visibility:"visible"}).hide()});api.onBeforeShow(function(){var c=this.getConf(),tip=this.getTip();setTimeout(function(){c.position=[orig[0],orig[1]];c.offset=[orig[2],orig[3]]},0)});api.onHide(function(){var tip=this.getTip();tip.removeClass(conf.classNames)});ret=api});return conf.api?ret:this}})(jQuery);
function UnicodeBlock(aName,aLowerBound,aUpperBound){this.Name=aName;this.LowerBound=aLowerBound;this.UpperBound=aUpperBound}UnicodeBlock.prototype.toString=UnicodeBlock_toString;function UnicodeBlock_toString(){return this.Name}UnicodeBlock.BASIC_LATIN=new UnicodeBlock("Basic Latin",0,127);UnicodeBlock.LATIN_1_SUPPLEMENT=new UnicodeBlock("Latin-1 Supplement",128,255);UnicodeBlock.LATIN_EXTENDED_A=new UnicodeBlock("Latin Extended-A",256,383);UnicodeBlock.LATIN_EXTENDED_B=new UnicodeBlock("Latin Extended-B",384,591);UnicodeBlock.IPA_EXTENSIONS=new UnicodeBlock("IPA Extensions",592,687);UnicodeBlock.SPACING_MODIFIER_LETTERS=new UnicodeBlock("Spacing Modifier Letters",688,767);UnicodeBlock.COMBINING_DIACRITICAL_MARKS=new UnicodeBlock("Combining Diacritical Marks",768,879);UnicodeBlock.GREEK_AND_COPTIC=new UnicodeBlock("Greek and Coptic",880,1023);UnicodeBlock.CYRILLIC=new UnicodeBlock("Cyrillic",1024,1279);UnicodeBlock.CYRILLIC_SUPPLEMENTARY=new UnicodeBlock("Cyrillic Supplementary",1280,1327);UnicodeBlock.ARMENIAN=new UnicodeBlock("Armenian",1328,1423);UnicodeBlock.HEBREW=new UnicodeBlock("Hebrew",1424,1535);UnicodeBlock.ARABIC=new UnicodeBlock("Arabic",1536,1791);UnicodeBlock.SYRIAC=new UnicodeBlock("Syriac",1792,1871);UnicodeBlock.THAANA=new UnicodeBlock("Thaana",1920,1983);UnicodeBlock.DEVANAGARI=new UnicodeBlock("Devanagari",2304,2431);UnicodeBlock.BENGALI=new UnicodeBlock("Bengali",2432,2559);UnicodeBlock.GURMUKHI=new UnicodeBlock("Gurmukhi",2560,2687);UnicodeBlock.GUJARATI=new UnicodeBlock("Gujarati",2688,2815);UnicodeBlock.ORIYA=new UnicodeBlock("Oriya",2816,2943);UnicodeBlock.TAMIL=new UnicodeBlock("Tamil",2944,3071);UnicodeBlock.TELUGU=new UnicodeBlock("Telugu",3072,3199);UnicodeBlock.KANNADA=new UnicodeBlock("Kannada",3200,3327);UnicodeBlock.MALAYALAM=new UnicodeBlock("Malayalam",3328,3455);UnicodeBlock.SINHALA=new UnicodeBlock("Sinhala",3456,3583);UnicodeBlock.THAI=new UnicodeBlock("Thai",3584,3711);UnicodeBlock.LAO=new UnicodeBlock("Lao",3712,3839);UnicodeBlock.TIBETAN=new UnicodeBlock("Tibetan",3840,4095);UnicodeBlock.MYANMAR=new UnicodeBlock("Myanmar",4096,4255);UnicodeBlock.GEORGIAN=new UnicodeBlock("Georgian",4256,4351);UnicodeBlock.HANGUL_JAMO=new UnicodeBlock("Hangul Jamo",4352,4607);UnicodeBlock.ETHIOPIC=new UnicodeBlock("Ethiopic",4608,4991);UnicodeBlock.CHEROKEE=new UnicodeBlock("Cherokee",5024,5119);UnicodeBlock.UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS=new UnicodeBlock("Unified Canadian Aboriginal Syllabics",5120,5759);UnicodeBlock.OGHAM=new UnicodeBlock("Ogham",5760,5791);UnicodeBlock.RUNIC=new UnicodeBlock("Runic",5792,5887);UnicodeBlock.TAGALOG=new UnicodeBlock("Tagalog",5888,5919);UnicodeBlock.HANUNOO=new UnicodeBlock("Hanunoo",5920,5951);UnicodeBlock.BUHID=new UnicodeBlock("Buhid",5952,5983);UnicodeBlock.TAGBANWA=new UnicodeBlock("Tagbanwa",5984,6015);UnicodeBlock.KHMER=new UnicodeBlock("Khmer",6016,6143);UnicodeBlock.MONGOLIAN=new UnicodeBlock("Mongolian",6144,6319);UnicodeBlock.LIMBU=new UnicodeBlock("Limbu",6400,6479);UnicodeBlock.TAI_LE=new UnicodeBlock("Tai Le",6480,6527);UnicodeBlock.KHMER_SYMBOLS=new UnicodeBlock("Khmer Symbols",6624,6655);UnicodeBlock.PHONETIC_EXTENSIONS=new UnicodeBlock("Phonetic Extensions",7424,7551);UnicodeBlock.LATIN_EXTENDED_ADDITIONAL=new UnicodeBlock("Latin Extended Additional",7680,7935);UnicodeBlock.GREEK_EXTENDED=new UnicodeBlock("Greek Extended",7936,8191);UnicodeBlock.GENERAL_PUNCTUATION=new UnicodeBlock("General Punctuation",8192,8303);UnicodeBlock.SUPERSCRIPTS_AND_SUBSCRIPTS=new UnicodeBlock("Superscripts and Subscripts",8304,8351);UnicodeBlock.CURRENCY_SYMBOLS=new UnicodeBlock("Currency Symbols",8352,8399);UnicodeBlock.COMBINING_MARKS_FOR_SYMBOLS=new UnicodeBlock("Combining Diacritical Marks for Symbols",8400,8447);UnicodeBlock.LETTERLIKE_SYMBOLS=new UnicodeBlock("Letterlike Symbols",8448,8527);UnicodeBlock.NUMBER_FORMS=new UnicodeBlock("Number Forms",8528,8591);UnicodeBlock.ARROWS=new UnicodeBlock("Arrows",8592,8703);UnicodeBlock.MATHEMATICAL_OPERATORS=new UnicodeBlock("Mathematical Operators",8704,8959);UnicodeBlock.MISCELLANEOUS_TECHNICAL=new UnicodeBlock("Miscellaneous Technical",8960,9215);UnicodeBlock.CONTROL_PICTURES=new UnicodeBlock("Control Pictures",9216,9279);UnicodeBlock.OPTICAL_CHARACTER_RECOGNITION=new UnicodeBlock("Optical Character Recognition",9280,9311);UnicodeBlock.ENCLOSED_ALPHANUMERICS=new UnicodeBlock("Enclosed Alphanumerics",9312,9471);UnicodeBlock.BOX_DRAWING=new UnicodeBlock("Box Drawing",9472,9599);UnicodeBlock.BLOCK_ELEMENTS=new UnicodeBlock("Block Elements",9600,9631);UnicodeBlock.GEOMETRIC_SHAPES=new UnicodeBlock("Geometric Shapes",9632,9727);UnicodeBlock.MISCELLANEOUS_SYMBOLS=new UnicodeBlock("Miscellaneous Symbols",9728,9983);UnicodeBlock.DINGBATS=new UnicodeBlock("Dingbats",9984,10175);UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A=new UnicodeBlock("Miscellaneous Mathematical Symbols-A",10176,10223);UnicodeBlock.SUPPLEMENTAL_ARROWS_A=new UnicodeBlock("Supplemental Arrows-A",10224,10239);UnicodeBlock.BRAILLE_PATTERNS=new UnicodeBlock("Braille Patterns",10240,10495);UnicodeBlock.SUPPLEMENTAL_ARROWS_B=new UnicodeBlock("Supplemental Arrows-B",10496,10623);UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B=new UnicodeBlock("Miscellaneous Mathematical Symbols-B",10624,10751);UnicodeBlock.SUPPLEMENTAL_MATHEMATICAL_OPERATORS=new UnicodeBlock("Supplemental Mathematical Operators",10752,11007);UnicodeBlock.MISCELLANEOUS_SYMBOLS_AND_ARROWS=new UnicodeBlock("Miscellaneous Symbols and Arrows",11008,11263);UnicodeBlock.CJK_RADICALS_SUPPLEMENT=new UnicodeBlock("CJK Radicals Supplement",11904,12031);UnicodeBlock.KANGXI_RADICALS=new UnicodeBlock("Kangxi Radicals",12032,12255);UnicodeBlock.IDEOGRAPHIC_DESCRIPTION_CHARACTERS=new UnicodeBlock("Ideographic Description Characters",12272,12287);UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION=new UnicodeBlock("CJK Symbols and Punctuation",12288,12351);UnicodeBlock.HIRAGANA=new UnicodeBlock("Hiragana",12352,12447);UnicodeBlock.KATAKANA=new UnicodeBlock("Katakana",12448,12543);UnicodeBlock.BOPOMOFO=new UnicodeBlock("Bopomofo",12544,12591);UnicodeBlock.HANGUL_COMPATIBILITY_JAMO=new UnicodeBlock("Hangul Compatibility Jamo",12592,12687);UnicodeBlock.KANBUN=new UnicodeBlock("Kanbun",12688,12703);UnicodeBlock.BOPOMOFO_EXTENDED=new UnicodeBlock("Bopomofo Extended",12704,12735);UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS=new UnicodeBlock("Katakana Phonetic Extensions",12784,12799);UnicodeBlock.ENCLOSED_CJK_LETTERS_AND_MONTHS=new UnicodeBlock("Enclosed CJK Letters and Months",12800,13055);UnicodeBlock.CJK_COMPATIBILITY=new UnicodeBlock("CJK Compatibility",13056,13311);UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A=new UnicodeBlock("CJK Unified Ideographs Extension A",13312,19903);UnicodeBlock.YIJING_HEXAGRAM_SYMBOLS=new UnicodeBlock("Yijing Hexagram Symbols",19904,19967);UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS=new UnicodeBlock("CJK Unified Ideographs",19968,40959);UnicodeBlock.YI_SYLLABLES=new UnicodeBlock("Yi Symbols",40960,42127);UnicodeBlock.YI_RADICALS=new UnicodeBlock("Yi Radicals",42128,42191);UnicodeBlock.HANGUL_SYLLABLES=new UnicodeBlock("Hangul Syllables",44032,55215);UnicodeBlock.HIGH_SURROGATES=new UnicodeBlock("High Surrogates",55296,56191);UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES=new UnicodeBlock("High Private Use Surrogates",56192,56319);UnicodeBlock.LOW_SURROGATES=new UnicodeBlock("Low Surrogates",56320,57343);UnicodeBlock.PRIVATE_USE_AREA=new UnicodeBlock("Private Use Area",57344,63743);UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS=new UnicodeBlock("CJK Compatibility Ideographs",63744,64255);UnicodeBlock.ALPHABETIC_PRESENTATION_FORMS=new UnicodeBlock("Alphabetic Presentation Forms",64256,64335);UnicodeBlock.ARABIC_PRESENTATION_FORMS_A=new UnicodeBlock("Arabic Presentation Forms-A",64336,65023);UnicodeBlock.VARIATION_SELECTORS=new UnicodeBlock("Variation Selectors",65024,65039);UnicodeBlock.COMBINING_HALF_MARKS=new UnicodeBlock("Combining Half Marks",65056,65071);UnicodeBlock.CJK_COMPATIBILITY_FORMS=new UnicodeBlock("CJK Compatibility Forms",65072,65103);UnicodeBlock.SMALL_FORM_VARIANTS=new UnicodeBlock("Small Form Variants",65104,65135);UnicodeBlock.ARABIC_PRESENTATION_FORMS_B=new UnicodeBlock("Arabic Presentation Forms-B",65136,65279);UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS=new UnicodeBlock("Halfwidth and Fullwidth Forms",65280,65519);UnicodeBlock.SPECIALS=new UnicodeBlock("Specials",65520,65535);UnicodeBlock.LINEAR_B_SYLLABARY=new UnicodeBlock("Linear B Syllabary",65536,65663);UnicodeBlock.LINEAR_B_IDEOGRAMS=new UnicodeBlock("Linear B Ideograms",65664,65791);UnicodeBlock.AEGEAN_NUMBERS=new UnicodeBlock("Aegean Numbers",65792,65855);UnicodeBlock.OLD_ITALIC=new UnicodeBlock("Old Italic",66304,66351);UnicodeBlock.GOTHIC=new UnicodeBlock("Gothic",66352,66383);UnicodeBlock.UGARITIC=new UnicodeBlock("Ugaritic",66432,66463);UnicodeBlock.DESERET=new UnicodeBlock("Deseret",66560,66639);UnicodeBlock.SHAVIAN=new UnicodeBlock("Shavian",66640,66687);UnicodeBlock.OSMANYA=new UnicodeBlock("Osmanya",66688,66735);UnicodeBlock.CYPRIOT_SYLLABARY=new UnicodeBlock("Cypriot Syllabary",67584,67647);UnicodeBlock.BYZANTINE_MUSICAL_SYMBOLS=new UnicodeBlock("Byzantine Musical Symbols",118784,119039);UnicodeBlock.MUSICAL_SYMBOLS=new UnicodeBlock("Musical Symbols",119040,119295);UnicodeBlock.TAI_XUAN_JING_SYMBOLS=new UnicodeBlock("Tai Xuan Jing Symbols",119552,119647);UnicodeBlock.MATHEMATICAL_ALPHANUMERIC_SYMBOLS=new UnicodeBlock("Mathematical Alphanumeric Symbols",119808,120831);UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B=new UnicodeBlock("CJK Unified Ideographs Extension B",131072,173791);UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT=new UnicodeBlock("CJK Compatibility Ideographs Supplement",194560,195103);UnicodeBlock.TAGS=new UnicodeBlock("Tags",917504,917631);UnicodeBlock.VARIATION_SELECTORS_SUPPLEMENT=new UnicodeBlock("Variation Selectors Supplement",917760,983039);UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A=new UnicodeBlock("Supplementary Private Use Area-A",983040,1048575);UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B=new UnicodeBlock("Supplementary Private Use Area-B",1048576,4294967295);UnicodeBlock.blockStarts=[0,128,256,384,592,688,768,880,1024,1280,1328,1424,1536,1792,1872,1920,1984,2304,2432,2560,2688,2816,2944,3072,3200,3328,3456,3584,3712,3840,4096,4256,4352,4608,4992,5024,5120,5760,5792,5888,5920,5952,5984,6016,6144,6320,6400,6480,6528,6624,6656,7424,7552,7680,7936,8192,8304,8352,8400,8448,8528,8592,8704,8960,9216,9280,9312,9472,9600,9632,9728,9984,10176,10224,10240,10496,10624,10752,11008,11264,11904,12032,12256,12272,12288,12352,12448,12544,12592,12688,12704,12736,12784,12800,13056,13312,19904,19968,40960,42128,42192,44032,55216,55296,56192,56320,57344,63744,64256,64336,65024,65040,65056,65072,65104,65136,65280,65520,65536,65664,65792,65856,66304,66352,66384,66432,66464,66560,66640,66688,66736,67584,67648,118784,119040,119296,119552,119648,119808,120832,131072,173792,194560,195104,917504,917632,917760,918000,983040,1048576];UnicodeBlock.blocks=[UnicodeBlock.BASIC_LATIN,UnicodeBlock.LATIN_1_SUPPLEMENT,UnicodeBlock.LATIN_EXTENDED_A,UnicodeBlock.LATIN_EXTENDED_B,UnicodeBlock.IPA_EXTENSIONS,UnicodeBlock.SPACING_MODIFIER_LETTERS,UnicodeBlock.COMBINING_DIACRITICAL_MARKS,UnicodeBlock.GREEK,UnicodeBlock.CYRILLIC,UnicodeBlock.CYRILLIC_SUPPLEMENTARY,UnicodeBlock.ARMENIAN,UnicodeBlock.HEBREW,UnicodeBlock.ARABIC,UnicodeBlock.SYRIAC,null,UnicodeBlock.THAANA,null,UnicodeBlock.DEVANAGARI,UnicodeBlock.BENGALI,UnicodeBlock.GURMUKHI,UnicodeBlock.GUJARATI,UnicodeBlock.ORIYA,UnicodeBlock.TAMIL,UnicodeBlock.TELUGU,UnicodeBlock.KANNADA,UnicodeBlock.MALAYALAM,UnicodeBlock.SINHALA,UnicodeBlock.THAI,UnicodeBlock.LAO,UnicodeBlock.TIBETAN,UnicodeBlock.MYANMAR,UnicodeBlock.GEORGIAN,UnicodeBlock.HANGUL_JAMO,UnicodeBlock.ETHIOPIC,null,UnicodeBlock.CHEROKEE,UnicodeBlock.UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,UnicodeBlock.OGHAM,UnicodeBlock.RUNIC,UnicodeBlock.TAGALOG,UnicodeBlock.HANUNOO,UnicodeBlock.BUHID,UnicodeBlock.TAGBANWA,UnicodeBlock.KHMER,UnicodeBlock.MONGOLIAN,null,UnicodeBlock.LIMBU,UnicodeBlock.TAI_LE,null,UnicodeBlock.KHMER_SYMBOLS,null,UnicodeBlock.PHONETIC_EXTENSIONS,null,UnicodeBlock.LATIN_EXTENDED_ADDITIONAL,UnicodeBlock.GREEK_EXTENDED,UnicodeBlock.GENERAL_PUNCTUATION,UnicodeBlock.SUPERSCRIPTS_AND_SUBSCRIPTS,UnicodeBlock.CURRENCY_SYMBOLS,UnicodeBlock.COMBINING_MARKS_FOR_SYMBOLS,UnicodeBlock.LETTERLIKE_SYMBOLS,UnicodeBlock.NUMBER_FORMS,UnicodeBlock.ARROWS,UnicodeBlock.MATHEMATICAL_OPERATORS,UnicodeBlock.MISCELLANEOUS_TECHNICAL,UnicodeBlock.CONTROL_PICTURES,UnicodeBlock.OPTICAL_CHARACTER_RECOGNITION,UnicodeBlock.ENCLOSED_ALPHANUMERICS,UnicodeBlock.BOX_DRAWING,UnicodeBlock.BLOCK_ELEMENTS,UnicodeBlock.GEOMETRIC_SHAPES,UnicodeBlock.MISCELLANEOUS_SYMBOLS,UnicodeBlock.DINGBATS,UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A,UnicodeBlock.SUPPLEMENTAL_ARROWS_A,UnicodeBlock.BRAILLE_PATTERNS,UnicodeBlock.SUPPLEMENTAL_ARROWS_B,UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B,UnicodeBlock.SUPPLEMENTAL_MATHEMATICAL_OPERATORS,UnicodeBlock.MISCELLANEOUS_SYMBOLS_AND_ARROWS,null,UnicodeBlock.CJK_RADICALS_SUPPLEMENT,UnicodeBlock.KANGXI_RADICALS,null,UnicodeBlock.IDEOGRAPHIC_DESCRIPTION_CHARACTERS,UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION,UnicodeBlock.HIRAGANA,UnicodeBlock.KATAKANA,UnicodeBlock.BOPOMOFO,UnicodeBlock.HANGUL_COMPATIBILITY_JAMO,UnicodeBlock.KANBUN,UnicodeBlock.BOPOMOFO_EXTENDED,null,UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS,UnicodeBlock.ENCLOSED_CJK_LETTERS_AND_MONTHS,UnicodeBlock.CJK_COMPATIBILITY,UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,UnicodeBlock.YIJING_HEXAGRAM_SYMBOLS,UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS,UnicodeBlock.YI_SYLLABLES,UnicodeBlock.YI_RADICALS,null,UnicodeBlock.HANGUL_SYLLABLES,null,UnicodeBlock.HIGH_SURROGATES,UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES,UnicodeBlock.LOW_SURROGATES,UnicodeBlock.PRIVATE_USE_AREA,UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS,UnicodeBlock.ALPHABETIC_PRESENTATION_FORMS,UnicodeBlock.ARABIC_PRESENTATION_FORMS_A,UnicodeBlock.VARIATION_SELECTORS,null,UnicodeBlock.COMBINING_HALF_MARKS,UnicodeBlock.CJK_COMPATIBILITY_FORMS,UnicodeBlock.SMALL_FORM_VARIANTS,UnicodeBlock.ARABIC_PRESENTATION_FORMS_B,UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS,UnicodeBlock.SPECIALS,UnicodeBlock.LINEAR_B_SYLLABARY,UnicodeBlock.LINEAR_B_IDEOGRAMS,UnicodeBlock.AEGEAN_NUMBERS,null,UnicodeBlock.OLD_ITALIC,UnicodeBlock.GOTHIC,null,UnicodeBlock.UGARITIC,null,UnicodeBlock.DESERET,UnicodeBlock.SHAVIAN,UnicodeBlock.OSMANYA,null,UnicodeBlock.CYPRIOT_SYLLABARY,null,UnicodeBlock.BYZANTINE_MUSICAL_SYMBOLS,UnicodeBlock.MUSICAL_SYMBOLS,null,UnicodeBlock.TAI_XUAN_JING_SYMBOLS,null,UnicodeBlock.MATHEMATICAL_ALPHANUMERIC_SYMBOLS,null,UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B,null,UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT,null,UnicodeBlock.TAGS,null,UnicodeBlock.VARIATION_SELECTORS_SUPPLEMENT,null,UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A,UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B];UnicodeBlock.of=UnicodeBlock_of;function UnicodeBlock_of(codePoint){var top,bottom,current;bottom=0;top=UnicodeBlock.blockStarts.length;current=top/2;while(top-bottom>1){if(codePoint>=UnicodeBlock.blockStarts[current]){bottom=current}else{top=current}current=Math.floor((top+bottom)/2)}return UnicodeBlock.blocks[current]}Array.prototype.binarySearch=Array_binarySearch;function Array_binarySearch(key){var low=0;var high=this.length-1;while(low<=high){var mid=(low+high)>>>1;var midVal=this[mid];if(midVal<key){low=mid+1}else{if(midVal>key){high=mid-1}else{return mid}}}return -(low+1)}UnicodeBlock.HKSCS_CODEPOINTS=[57344,57346,57347,57349,57352,57353,57354,57356,57358,57362,57363,57364,57365,57366,57368,57370,57371,57372,57373,57374,57376,57378,57379,57381,57384,57387,57389,57390,57392,57394,57395,57396,57397,57398,57399,57400,57403,57404,57411,57413,57420,57434,57436,57439,57440,57441,57444,57446,57450,57451,57452,57454,57457,57460,57461,57464,57469,57470,57478,57479,57481,57482,57484,57491,57492,57496,57497,57498,57499,57500,57501,57502,57504,57510,57511,57512,57513,57515,57518,57530,57531,57532,57534,57538,57539,57541,57543,57544,57546,57549,57552,57556,57557,57559,57562,57564,57567,57570,57571,57572,57573,57575,57576,57577,57579,57580,57582,57585,57586,57588,57592,57593,57594,57595,57596,57597,57603,57604,57605,57606,57609,57610,57611,57614,57616,57620,57621,57623,57628,57629,57633,57637,57638,57639,57640,57642,57643,57648,57649,57654,57657,57660,57665,57666,57667,57668,57669,57671,57672,57674,57677,57680,57683,57684,57685,57686,57687,57689,57690,57693,57694,57695,57696,57698,57700,57704,57705,57706,57713,57714,57717,57720,57721,57723,57724,57726,57727,57728,57733,57735,57737,57739,57740,57743,57744,57747,57749,57750,57754,57756,57759,57760,57764,57766,57767,57769,57770,57774,57776,57777,57779,57780,57782,57784,57787,57788,57789,57790,57791,57793,57796,57797,57798,57800,57804,57805,57807,57812,57813,57815,57818,57821,57824,57825,57826,57827,57830,57831,57834,57835,57839,57840,57842,57844,57847,57848,57850,57854,57856,57857,57858,57859,57861,57863,57866,57867,57868,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57883,57884,57887,57888,57889,57894,57895,57896,57898,57903,57905,57907,57911,57913,57915,57917,57918,57919,57923,57925,57926,57928,57930,57931,57932,57933,57934,57935,57937,57938,57939,57940,57949,57950,57953,57960,57963,57965,57966,57967,57969,57978,57981,57985,57986,57992,57993,57994,57995,58000,58001,58004,58005,58006,58008,58009,58010,58011,58015,58017,58018,58020,58022,58028,58033,58034,58035,58036,58037,58039,58040,58042,58046,58047,58049,58055,58056,58057,58068,58071,58072,58073,58078,58080,58081,58082,58087,58089,58091,58092,58093,58096,58097,58104,58108,58111,58112,58113,58118,58120,58124,58125,58127,58129,58131,58133,58134,58136,58139,58140,58143,58149,58150,58154,58156,58160,58161,58165,58166,58171,58172,58173,58178,58181,58184,58193,58194,58196,58203,58204,58206,58208,58210,58212,58213,58216,58223,58226,58228,58229,58230,58231,58232,58233,58235,58241,58242,58246,58247,58248,58249,58250,58253,58257,58259,58260,58262,58264,58266,58267,58268,58270,58271,58272,58274,58277,58278,58279,58280,58281,58284,58285,58289,58290,58291,58292,58293,58297,58298,58299,58300,58301,58302,58306,58307,58311,58312,58315,58316,58317,58319,58321,58322,58325,58328,58329,58330,58334,58337,58338,58339,58340,58343,58344,58346,58349,58350,58352,58354,58355,58356,58357,58359,58360,58362,58365,58367,58374,58377,58378,58379,58382,58388,58395,58397,58398,58403,58405,58406,58407,58408,58412,58413,58418,58422,58423,58426,58427,58428,58429,58430,58432,58433,58436,58440,58441,58444,58445,58446,58447,58448,58449,58457,58458,58461,58462,58464,58465,58466,58467,58469,58471,58472,58473,58474,58475,58476,58478,58479,58481,58482,58484,58486,58490,58494,58495,58500,58502,58503,58504,58505,58506,58509,58510,58513,58514,58515,58517,58518,58519,58528,58529,58530,58531,58532,58533,58537,58539,58543,58546,58547,58548,58549,58550,58551,58552,58553,58554,58558,58559,58560,58561,58566,58569,58573,58574,58582,58585,58588,58589,58590,58595,58596,58597,58598,58599,58600,58605,58606,58607,58614,58615,58616,58617,58623,58624,58625,58626,58629,58631,58634,58637,58638,58639,58642,58644,58646,58650,58652,58653,58654,58655,58656,58657,58660,58664,58665,58666,58667,58668,58670,58671,58676,58679,58681,58682,58683,58685,58686,58689,58691,58699,58707,58708,58709,58711,58712,58713,58715,58716,58718,58719,58722,58726,58727,58729,58733,58734,58736,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58754,58755,58756,58757,58758,58760,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58774,58775,58776,58778,58780,58781,58782,58783,58784,58785,58788,58790,58791,58792,58794,58798,58799,58801,58802,58805,58807,58808,58809,58810,58811,58812,58814,58815,58816,58818,58824,58825,58839,58840,58841,58843,58844,58847,58848,58849,58850,58851,58853,58854,58857,58860,58862,58863,58864,58865,58867,58869,58874,58875,58876,58878,58880,58882,58884,58892,58895,58896,58897,58898,58905,58906,58907,58908,58909,58913,58915,58916,58919,58921,58923,58925,58930,58931,58932,58935,58936,58937,58938,58939,58940,58941,58943,58944,58945,58946,58949,58950,58952,58955,58958,58959,58961,58962,58963,58964,58965,58967,58968,58969,58973,58974,58975,58976,58978,58979,58980,58981,58982,58983,58984,58986,58990,58991,58993,58997,58998,58999,59000,59001,59003,59004,59005,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59018,59019,59020,59021,59022,59023,59024,59026,59028,59030,59031,59033,59034,59036,59037,59038,59039,59040,59041,59042,59044,59046,59049,59051,59052,59053,59058,59062,59065,59066,59069,59070,59072,59073,59077,59079,59080,59082,59089,59090,59095,59096,59098,59099,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59112,59117,59118,59119,59121,59122,59123,59124,59127,59128,59130,59131,59132,59133,59134,59135,59136,59137,59138,59142,59143,59145,59146,59148,59152,59153,59154,59155,59158,59159,59160,59161,59162,59163,59165,59172,59173,59174,59179,59182,59183,59184,59187,59188,59189,59190,59191,59192,59194,59195,59196,59197,59200,59201,59202,59204,59207,59209,59212,59213,59214,59215,59217,59218,59227,59228,59229,59231,59232,59233,59234,59236,59237,59239,59240,59241,59244,59245,59246,59248,59253,59254,59255,59256,59258,59260,59261,59262,59264,59268,59270,59273,59275,59277,59279,59280,59282,59284,59286,59287,59289,59298,59300,59301,59302,59303,59304,59305,59306,59308,59309,59310,59313,59316,59320,59324,59328,59329,59332,59335,59338,59339,59342,59344,59345,59349,59352,59353,59354,59356,59357,59364,59366,59367,59368,59369,59370,59371,59373,59374,59375,59376,59377,59378,59379,59382,59384,59386,59387,59388,59391,59392,59393,59394,59398,59400,59404,59406,59407,59409,59411,59413,59414,59415,59416,59418,59419,59421,59425,59426,59428,59431,59432,59437,59438,59439,59441,59442,59445,59447,59448,59450,59451,59453,59455,59457,59458,59467,59469,59470,59472,59473,59475,59477,59478,59479,59480,59483,59484,59485,59487,59488,59489,59490,59493,59494,59495,59497,59498,59499,59500,59501,59505,59510,59512,59517,59518,59519,59520,59527,59534,59535,59537,59538,59540,59541,59545,59546,59547,59548,59549,59552,59553,59555,59556,59557,59558,59559,59561,59562,59564,59565,59566,59567,59568,59571,59573,59574,59575,59576,59580,59581,59582,59583,59584,59585,59586,59587,59589,59591,59595,59597,59598,59600,59601,59602,59603,59605,59606,59608,59609,59610,59613,59615,59616,59617,59618,59620,59621,59622,59624,59625,59626,59628,59629,59630,59633,59634,59636,59637,59638,59639,59641,59642,59643,59645,59646,59648,59649,59651,59654,59655,59656,59659,59660,59662,59663,59664,59665,59666,59669,59671,59672,59675,59676,59678,59679,59680,59681,59682,59685,59686,59687,59688,59689,59690,59691,59692,59694,59695,59697,59698,59699,59700,59701,59702,59704,59706,59708,59709,59710,59713,59716,59717,59718,59720,59721,59725,59728,59730,59731,59732,59733,59735,59736,59738,59740,59741,59742,59744,59745,59748,59749,59751,59752,59756,59758,59759,59763,59764,59765,59767,59768,59769,59770,59771,59773,59777,59778,59783,59786,59789,59790,59793,59796,59798,59804,59805,59806,59807,59809,59810,59815,59818,59820,59822,59824,59829,59831,59833,59834,59836,59837,59845,59851,59855,59856,59862,59864,59867,59870,59877,59878,59881,59883,59887,59895,59902,59907,59914,59915,59919,59923,59925,59931,59937,59946,59953,59957,59964,59965,59971,59980,59983,59991,60003,60006,60021,60022,60029,60034,60037,60039,60041,60045,60048,60059,60061,60070,60072,60073,60095,60096,60097,60101,60104,60105,60106,60107,60108,60111,60112,60113,60115,60116,60118,60119,60120,60121,60122,60124,60126,60127,60128,60129,60130,60131,60135,60136,60137,60138,60139,60140,60142,60144,60145,60146,60148,60149,60150,60151,60152,60153,60154,60155,60158,60159,60160,60162,60163,60164,60165,60168,60169,60170,60171,60172,60173,60174,60175,60177,60178,60181,60183,60184,60185,60186,60187,60188,60189,60191,60192,60193,60195,60197,60199,60202,60204,60205,60206,60207,60208,60209,60210,60211,60212,60213,60214,60215,60216,60217,60221,60222,60223,60225,60227,60228,60230,60234,60235,60236,60237,60238,60239,60240,60241,60242,60243,60244,60245,60246,60247,60248,60249,60250,60251,60253,60255,60256,60257,60258,60259,60261,60262,60263,60264,60265,60266,60267,60269,60271,60272,60273,60275,60276,60278,60279,60280,60282,60286,60287,60288,60289,60291,60292,60293,60295,60296,60297,60298,60299,60300,60301,60302,60303,60304,60306,60307,60309,60310,60311,60312,60313,60314,60315,60319,60320,60322,60323,60325,60326,60328,60330,60331,60333,60334,60335,60336,60337,60338,60339,60340,60342,60345,60348,60349,60351,60354,60355,60357,60358,60359,60360,60362,60364,60365,60366,60368,60371,60373,60374,60375,60376,60378,60379,60381,60383,60384,60385,60388,60390,60391,60392,60393,60394,60395,60396,60398,60399,60401,60402,60405,60406,60409,60410,60411,60413,60414,60415,60416,60419,60421,60422,60424,60425,60427,60428,60429,60430,60431,60432,60435,60436,60438,60439,60440,60441,60442,60443,60444,60445,60448,60450,60452,60454,60458,60459,60460,60461,60462,60463,60465,60466,60469,60471,60475,60476,60477,60479,60480,60481,60482,60483,60484,60485,60486,60487,60488,60489,60490,60491,60492,60493,60495,60498,60499,60500,60501,60502,60503,60504,60506,60508,60509,60511,60512,60513,60514,60515,60519,60520,60521,60522,60523,60524,60525,60526,60527,60528,60529,60530,60531,60533,60534,60535,60537,60539,60540,60542,60543,60544,60548,60550,60551,60556,60557,60558,60559,60561,60562,60563,60564,60565,60566,60567,60568,60569,60570,60571,60573,60574,60576,60579,60580,60583,60584,60587,60589,60590,60591,60592,60596,60598,60601,60602,60603,60623,60624,60628,60629,60635,60636,60638,60639,60640,60641,60645,60656,60658,60660,60661,60668,60676,60677,60679,60682,60684,60685,60686,60687,60688,60689,60691,60693,60694,60695,60696,60698,60699,60700,60701,60702,60703,60706,60707,60708,60709,60710,60711,60713,60714,60716,60717,60723,60727,60728,60730,60731,60733,60737,60738,60740,60741,60743,60744,60746,60747,60748,60749,60750,60751,60753,60754,60755,60756,60759,60760,60761,60764,60765,60766,60767,60770,60772,60774,60779,60781,60783,60785,60786,60789,60791,60792,60794,60795,60801,60804,60805,60806,60808,60809,60810,60811,60814,60817,60838,60846,60865,60870,60879,60881,60887,60890,60891,60893,60897,60909,60915,60917,60936,60945,60949,60955,60960,60962,60970,60974,60976,60977,60980,60995,60997,61000,61002,61011,61014,61017,61019,61021,61024,61028,61029,61034,61046,61052,61054,61065,61073,61075,61079,61084,61087,61089,61090,61091,61092,61093,61094,61095,61096,61097,61098,61100,61101,61102,61103,61104,61105,61106,61108,61111,62054,62055,62056,62057,62058,62059,62060,62061,62062,62063,62064,62065,62066,62067,62068,62069,62070,62071,62072,62073,62074,62075,62076,62077,62078,62079,62080,62081,62082,62083,62084,62086,62087,62088,62089,62095,62096,62098,62100,62102,62103,62109,62211,62212,62213,62214,62215,62216,62217,62218,62219,62220,62221,62222,62223,62224,62225,62226,62227,62228,62229,62230,62231,62232,62245,62247,62276,62278,62282,62283,62368,62369,62380,62448,62453,62456,62457,62458,62460,62461,62467,62472,62473,62474,62475,62483,62485,62488,62489,62490,62500,62502,62504,62507,62508,62509,62519,62521,62522,62524,62525,62528,62529,62530,62532,62533,62534,62536,62537,62538,62539,62541,62542,62543,62544,62545,62546,62548,62549,62550,62551,62554,62555,62556,62557,62558,62559,62561,62562,62563,62564,62565,62566,62568,62569,62570,62571,62572,62573,62574,62575,62579,62580,62583,62584,62585,62586,62587,62588,62589,62590,62592,62593,62595,62596,62597,62599,62600,62601,62603,62605,62606,62607,62608,62609,62611,62612,62614,62615,62616,62619,62621,62622,62626,62628,62629,62630,62631,62633,62634,62635,62636,62637,62638,62639,62640,62642,62643,62644,62645,62647,62650,62651,62652,62653,62654,62655,62656,62657,62659,62660,62661,62662,62663,62664,62665,62666,62667,62668,62669,62670,62671,62673,62674,62675,62676,62677,62678,62679,62681,62682,62683,62684,62685,62686,62687,62688,62689,62690,62691,62692,62693,62694,62695,62696,62697,62703,62706,62707,62712,62714,62716,62718,62719,62720,62721,62722,62723,62724,62725,62727,62728,62729,62730,62731,62732,62733,62734,62735,62736,62737,62739,62740,62741,62742,62744,62745,62746,62747,62748,62749,62750,62751,62752,62753,62754,62755,62756,62757,62758,62761,62762,62765,62766,62768,62771,62772,62774,62778,62779,62781,62784,62788,62798,62803,62804,62806,62809,62810,62814,62821,62827,62834,62841,62842,62843,62845,62848,62849,62850,62851,62853,62859,62860,62861,62862,62863,62867,62868,62870,62871,62873,62875,62876,62880,62883,62884,62891,62896,62900,62902,62905,62909,62911,62912,62916,62917,62924,62926,62928,62933,62934,62935,62936,62937,62944,62948,62950,62951,62952,62954,62955,62956,62957,62959,62964,62965,62966,62967,62968,62969,62972,62975,62976,62978,62980,62981,62982,62983,62984,62985,62986,62987,62990,62994,62996,62998,62999,63000,63001,63002,63003,63004,63005,63006,63007,63008,63009,63010,63011,63012,63013,63014,63015,63016,63017,63018,63019,63020,63021,63022,63023,63024,63025,63026,63027,63031,63032,63035,63036,63041,63042,63043,63044,63048,63052,63057,63059,63064,63069,63071,63074,63076,63078,63081,63084,63085,63086,63093,63095,63100,63102,63112,63117,63124,63133,63134,63137,63138,63141,63143,63149,63150,63151,63152,63197,63461,63462,63464,63466,63467,63469,63470,63520,63521,63522,63523,63524,63525,63526,63527,63528,63529,63530,63531,63532,63533,63534,63535,63536,63537,63538,63539,63540,63541,63542,63543,63544,63545,63546,63547];UnicodeBlock.isHKSCS=UnicodeBlock_isHKSCS;function UnicodeBlock_isHKSCS(codePoint){return(UnicodeBlock.of(codePoint)==UnicodeBlock.PRIVATE_USE_AREA)&&(UnicodeBlock.HKSCS_CODEPOINTS.binarySearch(codePoint)>=0)}UnicodeBlock.isUnihan=UnicodeBlock_isUnihan;function UnicodeBlock_isUnihan(codePoint){var b=UnicodeBlock.of(codePoint);return(b==UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A)||(b==UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS)||(b==UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS)||(b==UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B)||(b==UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT)}UnicodeBlock.isUnihanHKSCS=UnicodeBlock_isUnihanHKSCS;function UnicodeBlock_isUnihanHKSCS(codePoint){return UnicodeBlock.isUnihan(codePoint)||UnicodeBlock.isHKSCS(codePoint)};
(function(){String.prototype.strReplace=String_strReplace;String.prototype.trimLeft=String_trimLeft;String.prototype.trimRight=String_trimRight;String.prototype.trim=String_trim;String.prototype.lengthb=String_lengthb;String.prototype.trimWSLeft=String_trimWSLeft;String.prototype.trimWSRight=String_trimWSRight;String.prototype.trimWS=String_trimWS;String.prototype.isASCII=String_isASCII;String.prototype.isExtendedASCII=String_isExtendedASCII;String.prototype.isUnihan=String_isUnihan;String.prototype.isUnihanHKSCS=String_isUnihanHKSCS;String.prototype.isUnihanHKSCS2=String_isUnihanHKSCS2;function String_strReplace(target,replacement){var aStr=this;var iStart=aStr.indexOf(target);if(iStart==-1){return aStr}return aStr.substring(0,iStart)+replacement+aStr.substring(iStart+target.length).strReplace(target,replacement)}function String_trimRight(trimChar){var result=this;while(result.length>0&&result.charAt(result.length-1)==trimChar){result=result.substring(0,result.length-1)}return result}function String_trimLeft(trimChar){var result=this;while(result.length>0&&result.charAt(0)==trimChar){result=result.substring(1)}return result}function String_trim(trimChar){if(trimChar==null){trimChar=" "}var result=this.trimLeft(trimChar);result=result.trimRight(trimChar);return result}function String_lengthb(){var r=new RegExp("%[A-Z0-9]{2}","g");return encodeURI(this).replace(r,"X").length}function isWhiteSpace(c){var n=c.charCodeAt(0);switch(n){case 32:case 160:case 8199:case 8239:case 9:case 10:case 11:case 12:case 13:case 28:case 29:case 30:case 31:return true;default:return false}}function String_trimWSRight(){var result=this;while((result.length>0)&&isWhiteSpace(result.charAt(result.length-1))){result=result.substring(0,result.length-1)}return result}function String_trimWSLeft(){var result=this;while((result.length>0)&&isWhiteSpace(result.charAt(0))){result=result.substring(1)}return result}function String_trimWS(){var result=this.trimWSLeft();result=result.trimWSRight();return result}function trimAllControls(aForm){var i;for(i=0;i<aForm.elements.length;i++){if(aForm.elements[i].type=="text"||aForm.elements[i].type=="textarea"||aForm.elements[i].type=="password"){aForm.elements[i].onblur=_trimValue}}}function _trimValue(){this.value=String(this.value).trimWS()}function String_isASCII(){var n=this.length;for(var i=0;i<n;i++){var c=this.charCodeAt(i);var b=UnicodeBlock.of(c);if(b!=UnicodeBlock.BASIC_LATIN){return false}}return true}function String_isExtendedASCII(){var n=this.length;for(var i=0;i<n;i++){var c=this.charCodeAt(i);var b=UnicodeBlock.of(c);if((b!=UnicodeBlock.BASIC_LATIN)&&(b!=UnicodeBlock.LATIN_1_SUPPLEMENT)){return false}}return true}function String_isUnihan(){var n=this.length;for(var i=0;i<n;i++){var c=this.charCodeAt(i);if(!UnicodeBlock.isUnihan(c)){return false}}return true}function String_isUnihanHKSCS(){var n=this.length;for(var i=0;i<n;i++){var c=this.charCodeAt(i);if(!UnicodeBlock.isUnihanHKSCS(c)){return false}}return true}function String_isUnihanHKSCS2(){var n=this.length;for(var i=0;i<n;i++){var c=this.charCodeAt(i);if(UnicodeBlock.of(c)===UnicodeBlock.HIGH_SURROGATES){i++;var H=c;var L=this.charCodeAt(i);c=(H-55296)*1024+(L-56320)+65536}if(!UnicodeBlock.isUnihanHKSCS(c)){return false}}return true}})();
DataTypeName=new Array("string","integer","double","boolean","date","time","timestamp","big decimal","blob","big integer");DataTypeErrorCode=new Array("[5000]","[5001]","[5002]","[5003]","[5006]","[5005]","[5006]","[5007]","[5008]","[5009]");
/*
 * jQuery UI Widget 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function($,undefined){if($.cleanData){var _cleanData=$.cleanData;$.cleanData=function(elems){for(var i=0,elem;(elem=elems[i])!=null;i++){$(elem).triggerHandler("remove")}_cleanData(elems)}}else{var _remove=$.fn.remove;$.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).length){$("*",this).add([this]).each(function(){$(this).triggerHandler("remove")})}}return _remove.call($(this),selector,keepData)})}}$.widget=function(name,base,prototype){var namespace=name.split(".")[0],fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget}$.expr.pseudos[fullName]=function(elem){return !!$.data(elem,name)};$[namespace]=$[namespace]||{};$[namespace][name]=function(options,element){if(arguments.length){this._createWidget(options,element)}};var basePrototype=new base();basePrototype.options=$.extend(true,{},basePrototype.options);$[namespace][name].prototype=$.extend(true,basePrototype,{namespace:namespace,widgetName:name,widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);$.widget.bridge(name,$[namespace][name])};$.widget.bridge=function(name,object){$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.substring(0,1)==="_"){return returnValue}if(isMethodCall){this.each(function(){var instance=$.data(this,name);if(!instance){throw"cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'"}if(!$.isFunction(instance[options])){throw"no such method '"+options+"' for "+name+" widget instance"}var methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false}})}else{this.each(function(){var instance=$.data(this,name);if(instance){instance.option(options||{})._init()}else{$.data(this,name,new object(options,this))}})}return returnValue}};$.Widget=function(options,element){if(arguments.length){this._createWidget(options,element)}};$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){$.data(element,this.widgetName,this);this.element=$(element);this.options=$.extend(true,{},this.options,$.metadata&&$.metadata.get(element)[this.widgetName],options);var self=this;this.element.on("remove."+this.widgetName,function(){self.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.off("."+this.widgetName).removeData(this.widgetName);this.widget().off("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(key,value){var options=key,self=this;if(arguments.length===0){return $.extend({},self.options)}if(typeof key==="string"){if(value===undefined){return this.options[key]}options={};options[key]=value}$.each(options,function(key,value){self._setOption(key,value)});return self},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget()[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",value)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(type,event,data){var callback=this.options[type];event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop]}}this.element.trigger(event,data);return !($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented())}}})(jQuery);
/*
 * jQuery UI Mouse 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *  jquery.ui.widget.js
 */
(function($,undefined){$.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var self=this;this.element.on("mousedown."+this.widgetName,function(event){return self._mouseDown(event)}).on("click."+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName)},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true}}this._mouseMoveDelegate=function(event){return self._mouseMove(event)};this._mouseUpDelegate=function(event){return self._mouseUp(event)};$(document).on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();event.originalEvent.mouseHandled=true;return true},_mouseMove:function(event){if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault()}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event))}return !this._mouseStarted},_mouseUp:function(event){$(document).off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event)}return false},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance)},_mouseDelayMet:function(event){return this.mouseDelayMet},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true}})})(jQuery);
(function($,undefined){$.widget("ui.draggable",$.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").off(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(event);if(!this.handle){return false}return true},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));if(o.containment){this._setContainment()}if(this._trigger("start",event)===false){this._clear();return false}this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp({});return false}this.position=ui.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}return false},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}if(this.dropped){dropped=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode){return false}if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(self._trigger("stop",event)!==false){self._clear()}})}else{if(this._trigger("stop",event)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target){handle=true}});return handle},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=="clone"?this.element.clone():this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo=="parent"?this.element[0].parentNode:o.appendTo))}if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute")}return helper},_adjustOffsetFromHelper:function(obj){if(typeof obj=="string"){obj=obj.split(" ")}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left" in obj){this.offset.click.left=obj.left+this.margins.left}if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top" in obj){this.offset.click.top=obj.top+this.margins.top}if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var o=this.options;if(o.containment=="parent"){o.containment=this.helper[0].parentNode}if(o.containment=="document"||o.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce){return}var co=$(o.containment).offset();var over=($(ce).css("overflow")!="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(o.containment.constructor==Array){this.containment=o.containment}}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod)}},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left}if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top}if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top}}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left}}return{top:(pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))),left:(pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft()))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return $.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});$.extend($.ui.draggable,{version:"1.8.5"});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,"sortable");if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable)}})},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable)}})},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth)};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0]};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst}if(this.instance.currentItem){this.instance._mouseDrag(event)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}inst._trigger("fromSortable",event);inst.dropped=false}}})}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$("body"),o=$(this).data("draggable").options;if(t.css("cursor")){o._cursor=t.css("cursor")}t.css("cursor",o.cursor)},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._cursor){$("body").css("cursor",o._cursor)}}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data("draggable").options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body")})},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("opacity")){o._opacity=t.css("opacity")}t.css("opacity",o.opacity)},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._opacity){$(ui.helper).css("opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){i.overflowOffset=i.scrollParent.offset()}},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){if(!o.axis||o.axis!="x"){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed}else{if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed}}}if(!o.axis||o.axis!="y"){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed}else{if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed}}}}else{if(!o.axis||o.axis!="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed)}else{if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}}}if(!o.axis||o.axis!="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed)}else{if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}}}if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event)}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||":data(draggable)"):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})}})},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping){(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})))}inst.snapElements[i].snapping=false;continue}if(o.snapMode!="inner"){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top}if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left}if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left}}var first=(ts||bs||ls||rs);if(o.snapMode!="outer"){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top}if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left}if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left}}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})))}inst.snapElements[i].snapping=(ts||bs||ls||rs||first)}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});if(!group.length){return}var min=parseInt(group[0].style.zIndex)||0;$(group).each(function(i){this.style.zIndex=min+i});this[0].style.zIndex=min+group.length}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex")){o._zIndex=t.css("zIndex")}t.css("zIndex",o.zIndex)},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex)}}})})(jQuery);
(function($,undefined){$.widget("ui.resizable",$.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var self=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap($('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var n=this.handles.split(",");this.handles={};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),hname="ui-resizable-"+handle;var axis=$('<div class="ui-resizable-handle '+hname+'"></div>');if(/sw|se|ne|nw/.test(handle)){axis.css({zIndex:++o.zIndex})}if("se"==handle){axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[handle]=".ui-resizable-"+handle;this.element.append(axis)}}this._renderAxis=function(target){target=target||this.element;for(var i in this.handles){if(this.handles[i].constructor==String){this.handles[i]=$(this.handles[i],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var axis=$(this.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize()}if(!$(this.handles[i]).length){continue}}};this._renderAxis(this.element);this._handles=$(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!self.resizing){if(this.className){var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}self.axis=axis&&axis[1]?axis[1]:"se"}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");self._handles.show()},function(){if(!self.resizing){$(this).addClass("ui-resizable-autohide");self._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){_destroy(this.element);var wrapper=this.element;wrapper.after(this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this},_mouseCapture:function(event){var handle=false;for(var i in this.handles){if($(this.handles[i])[0]==event.target){handle=true}}return !this.options.disabled&&handle},_mouseStart:function(event){var o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;this.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is(".ui-draggable")||(/absolute/).test(el.css("position"))){el.css({position:"absolute",top:iniPos.top,left:iniPos.left})}this._renderProxy();var curleft=num(this.helper.css("left")),curtop=num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio=="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor=="auto"?this.axis+"-resize":cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true},_mouseDrag:function(event){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger){return false}var data=trigger.apply(this,[event,dx,dy]);ie6=false;csdif=this.sizeDiff;if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event)}data=this._respectSize(data,event);this._propagate("resize",event);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(data);this._trigger("resize",event,this.ui());return false},_mouseStop:function(event){this.resizing=false;var o=this.options,self=this;if(this._helper){var pr=this._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],"left")?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css("left"),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css("top"),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}))}self.helper.height(self.size.height);self.helper.width(self.size.width);if(this._helper&&!o.animate){this._proportionallyResize()}}$("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove()}return false},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(isNumber(data.left)){this.position.left=data.left}if(isNumber(data.top)){this.position.top=data.top}if(isNumber(data.height)){this.size.height=data.height}if(isNumber(data.width)){this.size.width=data.width}},_updateRatio:function(data,event){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height){data.width=(csize.height*this.aspectRatio)}else{if(data.width){data.height=(csize.width/this.aspectRatio)}}if(a=="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null}if(a=="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width)}return data},_respectSize:function(data,event){var el=this.helper,o=this.options,pRatio=this._aspectRatio||event.shiftKey,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height);if(isminw){data.width=o.minWidth}if(isminh){data.height=o.minHeight}if(ismaxw){data.width=o.maxWidth}if(ismaxh){data.height=o.maxHeight}var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw){data.left=dw-o.minWidth}if(ismaxw&&cw){data.left=dw-o.maxWidth}if(isminh&&ch){data.top=dh-o.minHeight}if(ismaxh&&ch){data.top=dh-o.maxHeight}var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top){data.top=null}else{if(isNotwh&&!data.top&&data.left){data.left=null}}return data},_proportionallyResize:function(){var o=this.options;if(!this._proportionallyResizeElements.length){return}var element=this.helper||this.element;for(var i=0;i<this._proportionallyResizeElements.length;i++){var prel=this._proportionallyResizeElements[i];if(!this.borderDif){var b=[prel.css("borderTopWidth"),prel.css("borderRightWidth"),prel.css("borderBottomWidth"),prel.css("borderLeftWidth")],p=[prel.css("paddingTop"),prel.css("paddingRight"),prel.css("paddingBottom"),prel.css("paddingLeft")];this.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding})}prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=false,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+pxyoffset,height:this.element.outerHeight()+pxyoffset,position:"absolute",left:this.elementOffset.left-ie6offset+"px",top:this.elementOffset.top-ie6offset+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(event,dx,dy){return{width:this.originalSize.width+dx}},w:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!="resize"&&this._trigger(n,event,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});$.extend($.ui.resizable,{version:"1.8.5"});$.ui.plugin.add("resizable","alsoResize",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options;var _store=function(exp){$(exp).each(function(){var el=$(this);el.data("resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10),position:el.css("position")})})};if(typeof(o.alsoResize)=="object"&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize)}else{$.each(o.alsoResize,function(exp){_store(exp)})}}else{_store(o.alsoResize)}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null}});el.css(style)})};if(typeof(o.alsoResize)=="object"&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c)})}else{_alsoResize(o.alsoResize)}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var _reset=function(exp){$(exp).each(function(){var el=$(this);el.css({position:el.data("resizable-alsoresize").position})})};if(self._revertToRelativePosition){self._revertToRelativePosition=false;if(typeof(o.alsoResize)=="object"&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp){_reset(exp)})}else{_reset(o.alsoResize)}}$(this).removeData("resizable-alsoresize")}});$.ui.plugin.add("resizable","animate",{stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var pr=self._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],"left")?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css("left"),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css("top"),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(self.element.css("width"),10),height:parseInt(self.element.css("height"),10),top:parseInt(self.element.css("top"),10),left:parseInt(self.element.css("left"),10)};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height})}self._updateCache(data);self._propagate("resize",event)}})}});$.ui.plugin.add("resizable","containment",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce){return}self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}}else{var element=$(ce),p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name))});self.containerOffset=element.offset();self.containerPosition=element.position();self.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=self._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&(/static/).test(ce.css("position"))){cop=co}if(cp.left<(self._helper?co.left:0)){self.size.width=self.size.width+(self._helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio){self.size.height=self.size.width/o.aspectRatio}self.position.left=o.helper?co.left:0}if(cp.top<(self._helper?co.top:0)){self.size.height=self.size.height+(self._helper?(self.position.top-co.top):self.position.top);if(pRatio){self.size.width=self.size.height*o.aspectRatio}self.position.top=self._helper?co.top:0}self.offset.left=self.parentData.left+self.position.left;self.offset.top=self.parentData.top+self.position.top;var woset=Math.abs((self._helper?self.offset.left-cop.left:(self.offset.left-cop.left))+self.sizeDiff.width),hoset=Math.abs((self._helper?self.offset.top-cop.top:(self.offset.top-co.top))+self.sizeDiff.height);var isParent=self.containerElement.get(0)==self.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(self.containerElement.css("position"));if(isParent&&isOffsetRelative){woset-=self.parentData.left}if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio){self.size.height=self.size.width/self.aspectRatio}}if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio){self.size.width=self.size.height*self.aspectRatio}}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options,cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.outerWidth()-self.sizeDiff.width,h=helper.outerHeight()-self.sizeDiff.height;if(self._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}if(self._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}});$.ui.plugin.add("resizable","ghost",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size;self.ghost=self.originalElement.clone();self.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof o.ghost=="string"?o.ghost:"");self.ghost.appendTo(self.helper)},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost){self.ghost.css({position:"relative",height:self.size.height,width:self.size.width})}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost&&self.helper){self.helper.get(0).removeChild(self.ghost.get(0))}}});$.ui.plugin.add("resizable","grid",{resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||event.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.height-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy}else{if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy}else{if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox}else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox}}}}});var num=function(v){return parseInt(v,10)||0};var isNumber=function(value){return !isNaN(parseInt(value,10))}})(jQuery);
(function($,undefined){$.ui=$.ui||{};var horizontalPositions=/left|center|right/,verticalPositions=/top|center|bottom/,center="center",_position=$.fn.position,_offset=$.fn.offset;$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments)}options=$.extend({},options);var target=$(options.of),targetElem=target[0],collision=(options.collision||"flip").split(" "),offset=options.offset?options.offset.split(" "):[0,0],targetWidth,targetHeight,basePosition;if(targetElem.nodeType===9){targetWidth=target.width();targetHeight=target.height();basePosition={top:0,left:0}}else{if(targetElem.scrollTo&&targetElem.document){targetWidth=target.width();targetHeight=target.height();basePosition={top:target.scrollTop(),left:target.scrollLeft()}}else{if(targetElem.preventDefault){options.at="left top";targetWidth=targetHeight=0;basePosition={top:options.of.pageY,left:options.of.pageX}}else{targetWidth=target.outerWidth();targetHeight=target.outerHeight();basePosition=target.offset()}}}$.each(["my","at"],function(){var pos=(options[this]||"").split(" ");if(pos.length===1){pos=horizontalPositions.test(pos[0])?pos.concat([center]):verticalPositions.test(pos[0])?[center].concat(pos):[center,center]}pos[0]=horizontalPositions.test(pos[0])?pos[0]:center;pos[1]=verticalPositions.test(pos[1])?pos[1]:center;options[this]=pos});if(collision.length===1){collision[1]=collision[0]}offset[0]=parseInt(offset[0],10)||0;if(offset.length===1){offset[1]=offset[0]}offset[1]=parseInt(offset[1],10)||0;if(options.at[0]==="right"){basePosition.left+=targetWidth}else{if(options.at[0]===center){basePosition.left+=targetWidth/2}}if(options.at[1]==="bottom"){basePosition.top+=targetHeight}else{if(options.at[1]===center){basePosition.top+=targetHeight/2}}basePosition.left+=offset[0];basePosition.top+=offset[1];return this.each(function(){var elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseInt($.curCSS(this,"marginLeft",true))||0,marginTop=parseInt($.curCSS(this,"marginTop",true))||0,collisionWidth=elemWidth+marginLeft+parseInt($.curCSS(this,"marginRight",true))||0,collisionHeight=elemHeight+marginTop+parseInt($.curCSS(this,"marginBottom",true))||0,position=$.extend({},basePosition),collisionPosition;if(options.my[0]==="right"){position.left-=elemWidth}else{if(options.my[0]===center){position.left-=elemWidth/2}}if(options.my[1]==="bottom"){position.top-=elemHeight}else{if(options.my[1]===center){position.top-=elemHeight/2}}position.left=parseInt(position.left);position.top=parseInt(position.top);collisionPosition={left:position.left-marginLeft,top:position.top-marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:offset,my:options.my,at:options.at})}});if($.fn.bgiframe){elem.bgiframe()}elem.offset($.extend(position,{using:options.using}))})};$.ui.position={fit:{left:function(position,data){var win=$(window),over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft();position.left=over>0?position.left-over:Math.max(position.left-data.collisionPosition.left,position.left)},top:function(position,data){var win=$(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop();position.top=over>0?position.top-over:Math.max(position.top-data.collisionPosition.top,position.top)}},flip:{left:function(position,data){if(data.at[0]===center){return}var win=$(window),over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft(),myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:-data.targetWidth,offset=-2*data.offset[0];position.left+=data.collisionPosition.left<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0},top:function(position,data){if(data.at[1]===center){return}var win=$(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop(),myOffset=data.my[1]==="top"?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:-data.targetHeight,offset=-2*data.offset[1];position.top+=data.collisionPosition.top<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0}}};if(!$.offset.setOffset){$.offset.setOffset=function(elem,options){if(/static/.test($.curCSS(elem,"position"))){elem.style.position="relative"}var curElem=$(elem),curOffset=curElem.offset(),curTop=parseInt($.curCSS(elem,"top",true),10)||0,curLeft=parseInt($.curCSS(elem,"left",true),10)||0,props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props)}else{curElem.css(props)}};$.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null}if(options){return this.each(function(){$.offset.setOffset(this,options)})}return _offset.call(this)}}}(jQuery));
(function($,undefined){var lastActive,baseClasses="ui-button ui-widget ui-state-default ui-corner-all",stateClasses="ui-state-hover ui-state-active ",typeClasses="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",formResetHandler=function(event){$(":ui-button",event.target.form).each(function(){var inst=$(this).data("button");setTimeout(function(){inst.refresh()},1)})},radioGroup=function(radio){var name=radio.name,form=radio.form,radios=$([]);if(name){if(form){radios=$(form).find("[name='"+name+"']")}else{radios=$("[name='"+name+"']",radio.ownerDocument).filter(function(){return !this.form})}}return radios};$.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").off("reset.button").on("reset.button",formResetHandler);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.prop("disabled")}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var self=this,options=this.options,toggleButton=this.type==="checkbox"||this.type==="radio",hoverClass="ui-state-hover"+(!toggleButton?" ui-state-active":""),focusClass="ui-state-focus";if(options.label===null){options.label=this.buttonElement.html()}if(this.element.is(":disabled")){options.disabled=true}this.buttonElement.addClass(baseClasses).attr("role","button").on("mouseenter.button",function(){if(options.disabled){return}$(this).addClass("ui-state-hover");if(this===lastActive){$(this).addClass("ui-state-active")}}).on("mouseleave.button",function(){if(options.disabled){return}$(this).removeClass(hoverClass)}).on("focus.button",function(){$(this).addClass(focusClass)}).on("blur.button",function(){$(this).removeClass(focusClass)});if(toggleButton){this.element.on("change.button",function(){self.refresh()})}if(this.type==="checkbox"){this.buttonElement.on("click.button",function(){if(options.disabled){return false}$(this).toggleClass("ui-state-active");self.buttonElement.attr("aria-pressed",self.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.on("click.button",function(){if(options.disabled){return false}$(this).addClass("ui-state-active");self.buttonElement.attr("aria-pressed",true);var radio=self.element[0];radioGroup(radio).not(radio).map(function(){return $(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)})}else{this.buttonElement.on("mousedown.button",function(){if(options.disabled){return false}$(this).addClass("ui-state-active");lastActive=this;$(document).one("mouseup",function(){lastActive=null})}).on("mouseup.button",function(){if(options.disabled){return false}$(this).removeClass("ui-state-active")}).on("keydown.button",function(event){if(options.disabled){return false}if(event.keyCode==$.ui.keyCode.SPACE||event.keyCode==$.ui.keyCode.ENTER){$(this).addClass("ui-state-active")}}).on("keyup.button",function(){$(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(event){if(event.keyCode===$.ui.keyCode.SPACE){$(this).click()}})}}}this._setOption("disabled",options.disabled)},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else{if(this.element.is(":radio")){this.type="radio"}else{if(this.element.is("input")){this.type="input"}else{this.type="button"}}}if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var checked=this.element.is(":checked");if(checked){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",checked)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(baseClasses+" "+stateClasses+" "+typeClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}$.Widget.prototype.destroy.call(this)},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="disabled"){if(value){this.element.prop("disabled",true)}else{this.element.prop("disabled",false)}}this._resetButton()},refresh:function(){var isDisabled=this.element.is(":disabled");if(isDisabled!==this.options.disabled){this._setOption("disabled",isDisabled)}if(this.type==="radio"){radioGroup(this.element[0]).each(function(){if($(this).is(":checked")){$(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true)}else{$(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)}})}else{if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true)}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)}}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var buttonElement=this.buttonElement.removeClass(typeClasses),buttonText=$("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),icons=this.options.icons,multipleIcons=icons.primary&&icons.secondary;if(icons.primary||icons.secondary){buttonElement.addClass("ui-button-text-icon"+(multipleIcons?"s":(icons.primary?"-primary":"-secondary")));if(icons.primary){buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>")}if(icons.secondary){buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>")}if(!this.options.text){buttonElement.addClass(multipleIcons?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");if(!this.hasTitle){buttonElement.attr("title",buttonText)}}}else{buttonElement.addClass("ui-button-text-only")}}});$.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(key,value){if(key==="disabled"){this.buttons.button("option",key,value)}$.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":visible").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");$.Widget.prototype.destroy.call(this)}})}(jQuery));
(function($,undefined){var uiDialogClasses="ui-dialog ui-widget ui-widget-content ui-corner-all ",sizeRelatedOptions={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},attrFn={val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};$.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css("top",pos.top-topOffset)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var self=this,options=self.options,title=options.title||"&#160;",titleId=$.ui.dialog.getTitleId(self.element),uiDialog=(self.uiDialog=$("<div></div>")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){if(options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){self.close(event);event.preventDefault()}}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,event)}),uiDialogContent=self.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(uiDialog),uiDialogTitlebar=(self.uiDialogTitlebar=$("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(uiDialog),uiDialogTitle=$("<span></span>").addClass("ui-dialog-title").attr("id",titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){options.beforeClose=options.beforeclose}uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable){self._makeDraggable()}if(options.resizable&&$.fn.resizable){self._makeResizable()}self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe){uiDialog.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var self=this;if(self.overlay){self.overlay.destroy()}self.uiDialog.hide();self.element.off(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");self.uiDialog.remove();if(self.originalTitle){self.element.attr("title",self.originalTitle)}return self},widget:function(){return this.uiDialog},close:function(event){var self=this,maxZ,thisZ;if(false===self._trigger("beforeClose",event)){return}if(self.overlay){self.overlay.destroy()}self.uiDialog.off("keypress.ui-dialog");self._isOpen=false;if(self.options.hide){self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)})}else{self.uiDialog.hide();self._trigger("close",event)}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$(".ui-dialog").each(function(){if(this!==self.uiDialog[0]){thisZ=$(this).css("z-index");if(!isNaN(thisZ)){maxZ=Math.max(maxZ,thisZ)}}});$.ui.dialog.maxZ=maxZ}if(self.success){self.successCallback(self.results)}else{self.errorCallback(self.results)}return self},successCallback:function(results){alert("success")},errorCallback:function(results){},isOpen:function(){return this._isOpen},moveToTop:function(force,event){var self=this,options=self.options,saveScroll;if((options.modal&&!force)||(!options.stack&&!options.modal)){return self._trigger("focus",event)}if(options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=options.zIndex}if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)}saveScroll={scrollTop:self.element.attr("scrollTop"),scrollLeft:self.element.attr("scrollLeft")};$.ui.dialog.maxZ+=1;self.uiDialog.css("z-index",$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger("focus",event);return self},open:function(){if(this._isOpen){return}var self=this,options=self.options,uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal){uiDialog.on("keypress.ui-dialog",function(event){if(event.keyCode!==$.ui.keyCode.TAB){return}var tabbables=$(":tabbable",this),first=tabbables.filter(":first"),last=tabbables.filter(":last");if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false}else{if(event.target===first[0]&&event.shiftKey){last.focus(1);return false}}})}$(self.element.find(":tabbable").get().concat(uiDialog.find(".ui-dialog-buttonpane :tabbable").get().concat(uiDialog.get()))).eq(0).focus();self._isOpen=true;self._trigger("open");return self},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),uiButtonSet=$("<div></div>").addClass("ui-dialog-buttonset").appendTo(uiDialogButtonPane);self.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof buttons==="object"&&buttons!==null){$.each(buttons,function(){return !(hasButtons=true)})}if(hasButtons){$.each(buttons,function(name,props){props=$.isFunction(props)?{click:props,text:name}:props;var button=$('<button type="button"></button>').click(function(){props.click.apply(self.element[0],arguments)}).appendTo(uiButtonSet);$.each(props,function(key,value){if(key==="click"){return}if(key in attrFn){button[key](value)}else{button.attr(key,value)}});if($.fn.button){button.button()}});uiDialogButtonPane.appendTo(self.uiDialog)}},_makeDraggable:function(){var self=this,options=self.options,doc=$(document),heightBeforeDrag;function filteredUi(ui){return{position:ui.position,offset:ui.offset}}self.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){self._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger("dragStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=self.options,position=self.uiDialog.css("position"),resizeHandles=(typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw");function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}self.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){self._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger("resizeStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}}).css("position",position).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var options=this.options;if(options.height==="auto"){return options.minHeight}else{return Math.min(options.minHeight,options.height)}},_position:function(position){var myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||(typeof position==="object"&&"0" in position)){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0]}$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition}});position={my:myAt.join(" "),at:myAt.join(" "),offset:offset.join(" ")}}position=$.extend({},$.ui.dialog.prototype.options.position,position)}else{position=$.ui.dialog.prototype.options.position}isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position($.extend({of:window},position));if(!isVisible){this.uiDialog.hide()}},_setOptions:function(options){var self=this,resizableOptions={},resize=false;$.each(options,function(key,value){self._setOption(key,value);if(key in sizeRelatedOptions){resize=true}if(key in resizableRelatedOptions){resizableOptions[key]=value}});if(resize){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",resizableOptions)}},_setOption:function(key,value){var self=this,uiDialog=self.uiDialog;switch(key){case"beforeclose":key="beforeClose";break;case"buttons":self._createButtons(value);break;case"closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case"dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case"disabled":if(value){uiDialog.addClass("ui-dialog-disabled")}else{uiDialog.removeClass("ui-dialog-disabled")}break;case"draggable":var isDraggable=uiDialog.is(":data(draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy")}if(!isDraggable&&value){self._makeDraggable()}break;case"position":self._position(value);break;case"resizable":var isResizable=uiDialog.is(":data(resizable)");if(isResizable&&!value){uiDialog.resizable("destroy")}if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value)}if(!isResizable&&value!==false){self._makeResizable(value)}break;case"title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||"&#160;"));break}$.Widget.prototype._setOption.apply(self,arguments)},_size:function(){var options=this.options,nonContentHeight,minContentHeight,isVisible=this.uiDialog.is(":visible");this.element.show().css({minHeight:0,height:0});if(options.minWidth>options.width){options.width=options.minWidth}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);if(options.height==="auto"){if($.support.minHeight){this.element.css({minHeight:minContentHeight,height:"auto"})}else{this.uiDialog.show();var autoHeight=this.element.css("height","auto").height();if(!isVisible){this.uiDialog.hide()}this.element.height(Math.max(autoHeight,minContentHeight))}}else{this.element.height(Math.max(options.height-nonContentHeight,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});$.extend($.ui.dialog,{version:"1.8.12",uuid:0,maxZ:0,getTitleId:function($el){var id=$el.attr("id");if(!id){this.uuid+=1;id=this.uuid}return"ui-dialog-title-"+id},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).on($.ui.dialog.overlay.events,function(event){if($(event.target).zIndex()<$.ui.dialog.overlay.maxZ){return false}})}},1);$(document).on("keydown.dialog-overlay",function(event){if(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){dialog.close(event);event.preventDefault()}});$(window).on("resize.dialog-overlay",$.ui.dialog.overlay.resize)}var $el=(this.oldInstances.pop()||$("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body);if($.fn.bgiframe){$el.bgiframe()}this.instances.push($el);return $el},destroy:function($el){var indexOf=$.inArray($el,this.instances);if(indexOf!=-1){this.oldInstances.push(this.instances.splice(indexOf,1)[0])}if(this.instances.length===0){$([document,window]).off(".dialog-overlay")}$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css("z-index"))});this.maxZ=maxZ},height:function(){var scrollHeight,offsetHeight;return $(document).height()+"px"},width:function(){var scrollWidth,offsetWidth;return $(document).width()+"px"},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this)});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()})}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el)}})}(jQuery));
var MODAL_PENDING=false;var bRootWindow=window.top==window;var newModal=undefined;var modal=undefined;var PageModals=new Array();function Modal(){this.id=null;this.url=null;this.options=null;this.params=null;this.successCallback=null;this.cancelCallback=null;this.modalSuccess=true;this.adjustWidth=0}Modal.prototype.setSuccess=function(success){this.modalSuccess=success};var ModalUtils={getParentWindow:function(modalId){var ctr=0;var modalList=window.top.PageModals;for(ctr=0;ctr<modalList.length;ctr++){if(modalList[ctr].id==modalId){break}}if(ctr>=modalList.length){alert("Modal ID not found.");return undefined}if(modalList.length<=1){return window.top}else{return modalList[ctr-1].Frame.contentWindow}},hasModalId:function(newId){for(var ctr=0;ctr<window.top.PageModals.length;ctr++){if(window.top.PageModals[ctr].id==newId){return true}}return false},showModal:function(id,url,options){showProgressDialog();newModal=new Modal();newModal.id="_MODAL_"+id;newModal.url=url;newModal.options=options;if(ModalUtils.hasModalId(id)==true){alert("Modal ID already exists.");return undefined}if(newModal.options){if(newModal.options.params){var paramString="";var params=newModal.options.params;if($.isArray(params)){for(var ctr=0;ctr<params.length;ctr++){paramString=ModalUtils.appendParam(params[ctr],paramString)}}else{if(typeof(params)=="object"){paramString=ModalUtils.appendParam(params,paramString)}else{paramString=params}}newModal.params=paramString}if(newModal.options.adjustWidth!=undefined){newModal.adjustWidth=newModal.options.adjustWidth}}newModal.init();return newModal},appendParam:function(paramObject,pString){var paramString=pString;if(typeof(paramObject)=="object"){if(paramObject.jquery!=undefined){paramObject.each(function(){if(paramString!=""){paramString+="&"}if(this.nodeName=="INPUT"||this.nodeName=="TEXTAREA"){paramString+=(this.name?this.name:this.id)+"="+encodeURIComponent(this.value)}else{paramString+=(this.name?this.name:this.id)+"="+encodeURIComponent($(this).text())}})}else{for(key in paramObject){if(paramString!=""){paramString+="&"}paramString+=key+"=";if($.isFunction(paramObject[key])){paramString+=encodeURIComponent(paramObject[key]())}else{paramString+=encodeURIComponent(paramObject[key])}}}}else{if(paramString!=""){paramString+="&"}paramString+=paramObject}return paramString},getData:function(){if(!bRootWindow){if(modal.options){return modal.options.data}}return undefined},setAdjustWidth:function(value,modalObj){if(modalObj!=undefined){modalObj.adjustWidth=value}else{modal.adjustWidth=value}}};Modal.prototype.register=function(){var fr=createFrame(this.id,this.url,this.params);window.top.document.body.appendChild(fr);this.Frame=window.top.document.getElementById(this.id);window.top.PageModals.push(this)};function createFrame(aId,aSrc,aParams){var ifr=window.parent.document.createElement("iframe");ifr.id=aId;ifr.className="child iframe-modal";ifr.style.display="none";ifr.style.border="1px solid #CCCCCC";$(ifr).attr("role","dialog");$(ifr).attr("aria-modal","true");if(aParams){if(aSrc.indexOf("?")==-1){aSrc+="?"+aParams}else{aSrc+="&"+aParams}}ifr.src=aSrc;ifr.allowTransparency="true";ifr.scrolling="no";ifr.frameBorder="0";if(navigator.appVersion.indexOf("MSIE")!=-1){if(/MSIE [678]/.exec(navigator.appVersion)!=null){ifr.outerHTML=ifr.outerHTML}}return ifr}function closeTopModal(){modal.close()}Modal.prototype.init=function(){if(window.top.MODAL_PENDING){return}if(this.options!=undefined){this.successCallback=this.options.success;this.cancelCallback=this.options.cancel}showCover();this.register();CHECK_ACTIVE_INTERVAL=window.setInterval("checkActiveElement()",100);window.top.MODAL_PENDING=true};var CHECK_ACTIVE_INTERVAL=window.top!=window?window.top.CHECK_ACTIVE_INTERVAL:null;function checkActiveElement(){var ae=window.document.activeElement;if(!ae){ae=new Object()}var elem=(ae.type&&ae.type!=null&&ae.type!=""?ae.type:ae.tagName);if(window.top.PageModals.length>0){var topModal=PageModals[PageModals.length-1];if(topModal!=undefined&&elem!="IFRAME"){var oModal=topModal.Frame;if(oModal){try{oModal.contentWindow.focus()}catch(e){}}}}}Modal.prototype.callback=function(anId,aResults){if(this.modalSuccess===true){if(this.successCallback){this.successCallback(anId,aResults)}}else{if(this.cancelCallback){this.cancelCallback(anId,aResults)}}};Modal.prototype.close=function(){var oModal=this.Frame;var oCover=getCover();oModal.style.display="none";window.top.PageModals.pop();if(!(window.top.PageModals.length>0)){oCover.style.display="none";oCover.style.height=0;oCover.style.width=0;window.parent.clearInterval(CHECK_ACTIVE_INTERVAL)}window.clearTimeout(_MODAL_CONTENT_RESIZE_EVENT);arrangeFrames();window.top.document.body.removeChild(oModal);delete this.Frame};$(function(){if(!bRootWindow){modal=window.top.getTopModal();if(modal){if(window==modal.Frame.contentWindow){addHandle(document.getElementById("DRAG"),window);showModalPage();if(modal.options){if(modal.options.autoAdjust!="onload"){_MODAL_CONTENT_RESIZE_EVENT=window.setTimeout("modalContentResizeEvent()",500)}}hideProgressDialog()}}}else{$(window).on("resize",function(){if(!window.top.MODAL_PENDING){var topModal=window.top.getTopModal();if(topModal&&topModal.Frame&&topModal.Frame.contentWindow&&topModal.Frame.contentWindow.fixCover){topModal.Frame.contentWindow.fixCover(true,true)}}})}});var _prevContentWidth;var _prevContentHeight;var _MODAL_CONTENT_RESIZE_EVENT;function getTopModal(){return PageModals[PageModals.length-1]}function modalContentResizeEvent(){try{if(modal.Frame!=undefined){var ifrBody=modal.Frame.contentWindow.document.body;if(_prevContentWidth!=ifrBody.scrollWidth||_prevContentHeight!=ifrBody.scrollHeight){fixCover(false,true)}}_MODAL_CONTENT_RESIZE_EVENT=window.setTimeout("modalContentResizeEvent()",500)}catch(e){}}function fixCover(aAlign,aAdjustHeight){if(modal==undefined||modal.Frame==undefined){return}var oModal=modal.Frame;var nModalHeight=modal.options.height?modal.options.height:"auto";var nModalWidth=modal.options.width?modal.options.width:"auto";var ifrBody=oModal.contentWindow.document.body;var ifrHtml=oModal.contentWindow.document.getElementsByTagName("html")[0];var adjustWidth=parseInt((modal.adjustWidth+"").replace(/[^0-9]/g,""));function getScrollWidth(){return window.top.document.body.scrollWidth}function getScrollHeight(){return ifrHtml.scrollHeight}if(aAdjustHeight){if(nModalWidth=="auto"){oModal.style.width="auto";nModalWidth=(getScrollWidth()+adjustWidth)+"px"}else{nModalWidth=(nModalWidth+"").replace(/[^0-9]/g,"")+"px"}oModal.style["max-width"]=nModalWidth;oModal.style.width="100%";if(nModalHeight=="auto"){nModalHeight=ifrBody.scrollHeight+"px"}else{nModalHeight=(nModalHeight+"").replace(/[^0-9]/g,"")+"px"}oModal.style.height=nModalHeight;_prevContentWidth=ifrBody.scrollWidth;_prevContentHeight=ifrBody.scrollHeight}if(aAlign){nLeft=getCenterX(nModalWidth.replace(/[^0-9]/g,""));oModal.style.left=nLeft+"px";nTop=getCenterY(nModalHeight.replace(/[^0-9]/g,""));oModal.style.top=nTop+"px"}var oCover=getCover();if(oCover&&(oCover.style.display=="")){oCover.style.height=$(window.top.document).height()+"px";oCover.style.width=window.top.document.body.scrollWidth+"px"}}function showCover(){var oCover=getCover();if(!oCover){return}var s=oCover.style;if(s.display=="none"){s.display=""}if(s.display==""){s.height=$(window.top.document).height()+"px";s.width=$(window.top.document).width()+"px"}}function getCover(){return window.top.document.getElementById("cover")}function showModalPage(){var oRecord=modal;var nTop=oRecord.options.top?oRecord.options.top:"auto";var nLeft=oRecord.options.left?oRecord.options.left:"auto";var oCover=getCover();oCover.style.display="";var oModal=oRecord.Frame;oModal.style.height="auto";oModal.style.width="auto";oModal.style.display="";if(oRecord.options.width){var nModalWidth=oRecord.options.width;nModalWidth=(nModalWidth+"").replace(/[^0-9]/g,"");if(nModalWidth){nModalWidth=parseInt((nModalWidth+"").replace(/[^0-9]/g,""))-30;nModalWidth=nModalWidth+"px";var ifrBody=oModal.contentWindow.document.body}}oModal.contentWindow.initEditableFieldFocus();fixCover(true,true);arrangeFrames();window.parent.MODAL_PENDING=false}function arrangeFrames(){var zIndex=9000;var oCover=getCover();oCover.style.display="none";for(var ctr=0;ctr<window.top.PageModals.length;ctr++){var oModal=window.top.PageModals[ctr].Frame;oModal.style.display="none";oCover.style.zIndex=zIndex++;oModal.style.zIndex=zIndex++;oModal.style.display=""}oCover.style.display=""}function getScrollTop(){if(window.top.scrollY){return window.top.scrollY}return window.top.document.body.scrollTop+window.top.document.documentElement.scrollTop}function getScrollLeft(){if(window.top.scrollX){return window.top.scrollX}return window.top.document.body.scrollLeft+window.top.document.documentElement.scrollLeft}function getCenterX(aWidth){var nWin=window.top.document.documentElement.clientWidth;var nDim=nWin-aWidth;if(nDim<0){return getScrollLeft()}else{return((nWin-aWidth)/2)+getScrollLeft()}}function getCenterY(aHeight){var nWin=window.top.document.documentElement.clientHeight;var nDim=nWin-aHeight;if(nDim<0){return getScrollTop()+2}else{return((nWin-aHeight)/2)+getScrollTop()}}function cancelModal(){if(!NavHandler.warnUserBeforeLink()){return}closeTopModal()}function isModal(){return !bRootWindow}function getRootScrollWidth(){var frBody=window.top.document.body;var frHtml=window.top.document.getElementsByTagName("html")[0];return frBody.scrollWidth}function getRootScrollHeight(){var frBody=window.top.document.body;var frHtml=window.top.document.getElementsByTagName("html")[0];return window.top.document.body.scrollHeight}function showProgressCover(){var pCover=window.top.document.getElementById("progress_cover");if(pCover!=undefined){pCover.style.display="";pCover.style.width=getRootScrollWidth()+"px";pCover.style.height=getRootScrollHeight()+"px"}}function hideProgressCover(){var pCover=window.top.document.getElementById("progress_cover");if(pCover!=undefined){pCover.style.display="none";pCover.style.width="0px";pCover.style.height="0px"}}function showProgressDialog(){showProgressCover();var progress=window.top.document.getElementById("progress_dialog");var progress_text=window.top.document.getElementById("progress_text");if(progress!=undefined){progress.style.left="0px";progress.style.top=getCenterY($(progress).height())+"px";progress.style.display="";progress_text.style.left="0px";progress_text.style.top=(getCenterY($(progress).height())+70)+"px";progress_text.style.display=""}}function hideProgressDialog(){hideProgressCover();var progress=window.top.document.getElementById("progress_dialog");var progress_text=window.top.document.getElementById("progress_text");if(progress!=undefined){progress.style.display="none";progress_text.style.display="none"}}var DIF_dragging=false;var DIF_iframeBeingDragged="";var DIF_iframeObjects=new Object();var DIF_iframeWindows=new Object();var DIF_iframeMouseDownLeft=new Object();var DIF_iframeMouseDownTop=new Object();var DIF_pageMouseDownLeft=new Object();var DIF_pageMouseDownTop=new Object();var DIF_handles=new Object();var DIF_highestZIndex=99;var DIF_raiseSelectedIframe=false;var DIF_allowDragOffScreen=false;function bringSelectedIframeToTop(val){DIF_raiseSelectedIframe=val}function allowDragOffScreen(val){DIF_allowDragOffScreen=val}function addHandle(o,win){if(!o){return}if(arguments.length==2&&win==window){var p=win;while(p=p.parent){if(p.addHandle){p.addHandle(o,win,true);return}if(p==win.top){return}}return}var topRef=win;var topRefStr="window";while(topRef.parent&&topRef.parent!=window){topRef=topRef.parent;topRefStr=topRefStr+".parent"}if(typeof(win.DIF_mainHandlersAdded)=="undefined"||!win.DIF_mainHandlersAdded){with(win){eval("function OnMouseDownHandler(evt) { if(typeof(evt)=='undefined'){evt=event;}"+topRefStr+".parent.DIF_begindrag(evt, "+topRefStr+"); getMouseXYPos(evt); }");eval("document.onmousedown = OnMouseDownHandler;");eval("function OnMouseUpHandler(evt) { if(typeof(evt)=='undefined'){evt=event;}"+topRefStr+".parent.DIF_enddrag(evt, "+topRefStr+") }");eval("document.onmouseup = OnMouseUpHandler;");eval("function OnMouseMoveHandler(evt) { if(typeof(evt)=='undefined'){evt=event;}"+topRefStr+".parent.DIF_iframemove(evt, "+topRefStr+") }");eval("document.onmousemove = OnMouseMoveHandler;");win.DIF_handlersAdded=true;win.DIF_mainHandlersAdded=true}}if(typeof(window.DIF_handlersAdded)!="undefined"||!window.DIF_handlersAdded){eval("function OnMouseMoveHandler(evt) { if(typeof(evt)=='undefined'){evt=event;}DIF_mouseMove(evt, window) }");eval("document.onmousemove = OnMouseMoveHandler;");eval("function OnMouseUpHandler(evt) { if(typeof(evt)=='undefined'){evt=event;}DIF_enddrag(evt, "+topRefStr+") }");eval("document.onmouseup = OnMouseUpHandler;");window.DIF_handlersAdded=true}o.style.cursor="move";var name=DIF_getIframeId(topRef);if(DIF_handles[name]==null){DIF_handles[name]=new Array();DIF_iframeMouseDownLeft[name]=0;DIF_iframeMouseDownTop[name]=0;DIF_pageMouseDownLeft[name]=0;DIF_pageMouseDownTop[name]=0}DIF_handles[name][0]=o}function DIF_getEventPosition(evt){var pos=new Object();pos.x=0;pos.y=0;if(!evt){evt=window.event}if(typeof(evt.pageX)=="number"){pos.x=evt.pageX;pos.y=evt.pageY}else{pos.x=evt.clientX;pos.y=evt.clientY;if(!top.opera){if((!window.document.compatMode)||(window.document.compatMode=="BackCompat")){pos.x+=window.document.body.scrollLeft;pos.y+=window.document.body.scrollTop}else{pos.x+=window.document.documentElement.scrollLeft;pos.y+=window.document.documentElement.scrollTop}}}return pos}function DIF_getIframeId(win){var iframes=document.getElementsByTagName("IFRAME");for(var i=0;i<iframes.length;i++){var o=iframes.item(i);var w=null;if(o.contentWindow){w=o.contentWindow}else{if(window.frames&&window.frames[o.id].window){w=window.frames[o.id]}}if(w==win){DIF_iframeWindows[o.id]=win;DIF_iframeObjects[o.id]=o;return o.id}}return null}function DIF_getObjectXY(o){var res=new Object();res.x=0;res.y=0;if(o!=null){res.x=o.style.left.substring(0,o.style.left.indexOf("px"));res.y=o.style.top.substring(0,o.style.top.indexOf("px"))}return res}function getSrcElement(e){var tgt=e.target;while(tgt.nodeType!=1){tgt=tgt.parentNode}return tgt}function isHandleClicked(handle,objectClicked){if(handle==objectClicked){return true}while(objectClicked.parentNode!=null){if(objectClicked==handle){return true}objectClicked=objectClicked.parentNode}return false}function DIF_begindrag(e,win){var iframename=DIF_getIframeId(win);if(iframename==null){return}if(DIF_handles[iframename]==null||DIF_handles[iframename].length<1){return}var isHandle=false;var t=e.srcElement||getSrcElement(e);for(var i=0;i<DIF_handles[iframename].length;i++){if(isHandleClicked(DIF_handles[iframename][i],t)){isHandle=true;break}}if(!isHandle){return false}DIF_iframeBeingDragged=iframename;if(DIF_raiseSelectedIframe){DIF_iframeObjects[DIF_iframeBeingDragged].style.zIndex=DIF_highestZIndex++}DIF_dragging=true;var pos=DIF_getEventPosition(e);DIF_iframeMouseDownLeft[DIF_iframeBeingDragged]=pos.x;DIF_iframeMouseDownTop[DIF_iframeBeingDragged]=pos.y;var o=DIF_getObjectXY(DIF_iframeObjects[DIF_iframeBeingDragged]);DIF_pageMouseDownLeft[DIF_iframeBeingDragged]=o.x-0+pos.x;DIF_pageMouseDownTop[DIF_iframeBeingDragged]=o.y-0+pos.y}function DIF_enddrag(e){if(DIF_dragging){DIF_dragging=false;DIF_iframeBeingDragged=""}}function DIF_mouseMove(e){if(DIF_dragging){var pos=DIF_getEventPosition(e);pos.x+=window.top.document.body.scrollLeft;pos.y+=window.top.document.body.scrollTop;DIF_drag(pos.x-DIF_pageMouseDownLeft[DIF_iframeBeingDragged],pos.y-DIF_pageMouseDownTop[DIF_iframeBeingDragged])}}function DIF_iframemove(e){if(DIF_dragging){var pos=DIF_getEventPosition(e);DIF_drag(pos.x-DIF_iframeMouseDownLeft[DIF_iframeBeingDragged],pos.y-DIF_iframeMouseDownTop[DIF_iframeBeingDragged])}}function DIF_drag(x,y){var f=DIF_iframeObjects[DIF_iframeBeingDragged];var o=DIF_getObjectXY(f);var newPositionX=o.x-0+x;var newPositionY=o.y-0+y;var nWidth=f.style.width;var nHeight=f.style.height;nWidth=new Number(nWidth.substring(0,nWidth.indexOf("px")));nHeight=new Number(nHeight.substring(0,nHeight.indexOf("px")));if(!DIF_allowDragOffScreen){var b=$(window.top.document);var d={width:b.width(),height:b.height()};if(newPositionX<0){newPositionX=0}else{if(newPositionX+nWidth+5>d.width){newPositionX=d.width-5-nWidth}}if(newPositionY<0){newPositionY=0}else{if(newPositionY+nHeight+5>d.height){newPositionY=d.height-5-nHeight}}}f.style.left=newPositionX+"px";f.style.top=newPositionY+"px";DIF_pageMouseDownLeft[DIF_iframeBeingDragged]+=x;DIF_pageMouseDownTop[DIF_iframeBeingDragged]+=y}function MousePos(){this.X=0;this.Y=0;return this}var MOUSE_POS=new MousePos();function getMouseXYPos(anEvent){if(!anEvent){var anEvent=window.event||window.Event}var eX=anEvent.clientX;var eY=anEvent.clientY;MOUSE_POS.X=eX+document.body.scrollLeft;MOUSE_POS.Y=eY+document.body.scrollTop;if(MOUSE_POS.Y-100>10){MOUSE_POS.Y=MOUSE_POS.Y-100}}function ModalReturn(aReturn){var ret=new UrlWrapper((aReturn));this.Value=ret;return this}ModalReturn.prototype.get=function(aKey,convertLineBreaks){if(!this.Value||!this.Value.getParam(aKey)){return}var sVal=this.Value.getParam(aKey).getValue();if(sVal){sVal=sVal.replace(new RegExp("&amp;","gi"),"&");sVal=sVal.replace(/\+/gi," ")}var val=decodeURIComponent(sVal);if(convertLineBreaks){val=val.replace(new RegExp("<br>","gi"),"\n")}return(val)};
var ProjUtils={doBackToEServices:function(){NavHandler.redirectToURL("../../jsp_public/ens/ens0101.jsp")},doBrowserSave:function(panelIds){if($("form[name='frmSAVE_HTML']").length==0){alert("Missing save form, add the SaveFormTag, will not proceed.");return}$.each(panelIds.split(","),function(index,value){$("<input>",{type:"hidden",name:"HTML_DUMP",value:$("#"+value).html()}).appendTo($("form[name='frmSAVE_HTML']"))});$("form[name='frmSAVE_HTML']").submit()},doClear:function(form,callback){$(form).resetValidation();$(form).find("input[type=text]").val("");$(form).find("input[type=radio]").prop("checked",false);$(form).find("input[type=checkbox]").prop("checked",false);if(typeof(callback)=="function"){callback()}else{if(typeof(callback)=="string"){eval(callback+"()")}}},addCustomMessage:function(element,method,message){if($(element).length>0){var messages=$(element).validate().settings.messages;var name=$(element).attr("name");if((messages[name])==undefined){messages[name]={}}var customMessages=messages[name];customMessages[method]=message}},formatValidationMessage:function(message){var re=/\{params\[(.*?)\]\}/g;var retVal=message;var result=re.exec(message);while(result!=null){retVal=retVal.replace(result[0],result[1]);result=re.exec(message)}return retVal},adjustMainHeaderContent:function(){},formatErrorMessage:function(id,params){var formattedError=ProjUtils.formatValidationMessage(LBJSErrorMsgs[id]);for(var i=0;i<params.length;i++){formattedError=formattedError.replace("{"+i+"}",params[i])}return formattedError},formatWarningMessage:function(id,params){var formattedError=LBJSWarningMsgs[id];return ProjUtils.formatMessage(formattedError,params)},formatMessage:function(string,params){var working=string;for(var i=0;i<params.length;i++){working=working.replace("{"+i+"}",params[i])}return working},setupTridate:function(day,month,year,date){var $date=$("#"+date);var $day=$("#"+day);var $month=$("#"+month);var $year=$("#"+year);$("#"+year+"_ERR").remove();$("#"+month+"_ERR").remove();$("#"+day+"_ERR").remove();$date.css("display","none");$day.setMandatory(true);$day.change(function(){$date.val($day.val()+"/"+$month.val()+"/"+$year.val());if($day.val()!=""){$month.setMandatory(true)}else{$month.setMandatory(false)}});if($day.is(":hidden")){$month.setMandatory(true)}$month.change(function(){$date.val($day.val()+"/"+$month.val()+"/"+$year.val());if($month.val()!=""){$year.setMandatory(true)}else{$year.setMandatory(false)}});$year.change(function(){$date.val($day.val()+"/"+$month.val()+"/"+$year.val())});$([$day[0],$month[0],$year[0],$date[0]]).addValidator(validateTriDate,LBJSErrorMsgs.VALIDATOR_INVAL_DATE,[])},toStatic:function(formElement){var $element=$(formElement);var id=$element.attr("id");var tagName=$element[0].tagName.toUpperCase();var name=$element[0].name;var appendText;if(tagName=="SELECT"){if($element.val()!=""){appendText=$element.find(":selected").text()}else{appendText=""}}else{if($element[0].type.toUpperCase()=="RADIO"){var $groupDiv=$element.parents("#"+name+"_group");$element.hide();if($element[0].checked==true){$groupDiv.find("label[for="+id+"]").show().find("span").addClass("form_text")}else{$groupDiv.find("label[for="+id+"]").hide().parent().hide()}return}else{appendText=$element.val()}}if(appendText==""){appendText="-"}$('<span class="form_text">'+appendText+"</span>").insertBefore($element);$element.hide()},addComma:function(input){var number=new String(input);number=number.replace(/\,/g,"");if(number==""){return number}var split=number.split(".");var whole=split[0].length>0?split[0]:"0";var decimal=".";if(split.length>1){for(var i=0;i<2;i++){decimal+=split[1].charAt(i)?split[1].charAt(i):"0"}}else{decimal+="00"}var regex=/([\+\-]?\d+)(\d{3})/;while(regex.test(whole)){whole=whole.replace(regex,"$1,$2")}return whole+decimal}};
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null,tabId:"",autoscroll:false},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$(".tabs ul","#"+o.tabId),tLi=$(".tabs li","#"+o.tabId),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("#"+o.tabId+" .tabs li"),itemLength=f.size(),curr=o.start;var fUl=$(ul);var fLi=$("#"+o.tabId+" .tabs li");c.css("visibility","visible");f.css("overflow","hidden");f.css("float",o.vertical?"none":"left");ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"409",left:"0px"});c.css({overflow:"hidden",position:"relative","z-index":"501",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;fUl.css({width:f.width(),height:f.height()});fUl.parent().css("display","block");fUl.css("display","block");fLi.css("display","block");var max=0;var ulMaxWidth=0;var origTabsContainerWidth=(fUl.parent().width()-92)+"px";var offset=4;fUl.width("2000");fLi.each(function(i){var liElem=$(this);if(navigator.appVersion.indexOf("MSIE 7.0")==-1){if(i<o.visible){max=max+liElem.width()+offset}ulMaxWidth=ulMaxWidth+liElem.outerWidth()+offset;liElem.css("width",liElem.outerWidth())}else{if(i<o.visible){max=max+liElem.width()+offset}ulMaxWidth=ulMaxWidth+(liElem.outerWidth()+offset)}});fUl.css("width",ulMaxWidth);fUl.parent().css("display","block");fUl.css("display","block");fLi.css("display","inline");var tabContainerWidth=0;if($("body").hasClass("visible-sidemenu")){tabContainerWidth=894}else{tabContainerWidth=689}if(tabContainerWidth<ulMaxWidth){$("#"+o.tabId).removeClass("TabsNoScroll");$("#"+o.tabId+" input.tabnext").css("visibility","visible").css("display","inline").css("z-index","501");$("#TabSearch input","#"+o.tabId).css("visibility","visible").css("display","inline");$("#"+o.tabId+" input.tabprev").css("display","inline").prop("disabled",true).addClass("tabprev-disabled");var location=window.location+"";var locationCurrLeftIndex=location.indexOf("currLeft=");var pageCurrLeft=null;if(locationCurrLeftIndex){pageCurrLeft=location.substring(locationCurrLeftIndex);locationAmpIndex=pageCurrLeft.indexOf("&");if(locationAmpIndex){pageCurrLeft=pageCurrLeft.substring(9,locationAmpIndex)}}if(pageCurrLeft){fUl.css("left",pageCurrLeft)}else{fUl.css("left","-"+$(fUl.children("li").get(curr)).position().left+"px")}$(".tabsContainer").width(origTabsContainerWidth)}else{$(".tabsContainer").width("100%")}if(fUl.position().left<0){$("#"+o.tabId+" input.tabprev").prop("disabled",false).removeClass("tabprev-disabled")}if(o.btnPrev){$(o.btnPrev).click(function(){return go(curr-o.scroll,true)}).mousedown(function(){o.autoscroll=true;$(o.btnPrev).trigger("mouseover")}).mouseup(function(){o.autoscroll=false}).mouseout(function(){o.autoscroll=false}).mouseover(function doAutoScrollPrev(){setTimeout(function(){if(o.autoscroll){autoScroll(true,doAutoScrollPrev)}},20)})}if(o.btnNext){$(o.btnNext).click(function(){return go(curr+o.scroll,false)}).mousedown(function(){o.autoscroll=true;$(o.btnNext).trigger("mouseover")}).mouseup(function(){o.autoscroll=false}).mouseout(function(){o.autoscroll=false}).mouseover(function doAutoScrollNext(){setTimeout(function(){if(o.autoscroll){autoScroll(false,doAutoScrollNext)}},20)})}if(o.btnGo){$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})})}if(o.mouseWheel&&c.mousewheel){c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)})}if(o.auto){setInterval(function(){go(curr+o.scroll)},o.auto+o.speed)}function vis(){return f.slice(curr).slice(0,v)}function autoScroll(goLeft,callback){if(!o.autoscroll){return}var totalLeft=0;if(goLeft){totalLeft=moveLeft(ul)}else{totalLeft=moveRight(ul)}if((ul.parent().width()+(totalLeft))>=ul.width()){$("#"+o.tabId+" .tabnext").attr("disabled","disabled").addClass("tabnext-disabled");o.autoscroll=false}else{$("#"+o.tabId+" .tabnext").prop("disabled",false).removeClass("tabnext-disabled")}if(totalLeft!=0){$("#"+o.tabId+" .tabprev").prop("disabled",false).removeClass("tabprev-disabled")}ul.animate({left:-(totalLeft)},o.speed,o.easing,function(){if(callback){callback.call()}});if(totalLeft==0){$("#"+o.tabId+" .tabprev").prop("disabled",true).addClass("tabprev-disabled");o.autoscroll=false}}function go(a,goLeft,callBack){if(!b){if(o.beforeStart){o.beforeStart.call(this,vis())}if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else{if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else{curr=a}}}else{curr=a}b=true;var totalLeft=0;if(goLeft){totalLeft=moveLeft(ul)}else{totalLeft=moveRight(ul)}var maxUlWidth=0;$(".tabsContainer li").each(function(){maxUlWidth=maxUlWidth+$(this).outerWidth()});if(Math.ceil(ul.parent().width()+(totalLeft))>=maxUlWidth){$("#"+o.tabId+" .tabnext").prop("disabled",true).addClass("tabnext-disabled")}else{$("#"+o.tabId+" .tabnext").prop("disabled",false).removeClass("tabnext-disabled")}if(totalLeft==0){$("#"+o.tabId+" .tabprev").prop("disabled",true).addClass("tabprev-disabled")}else{$("#"+o.tabId+" .tabprev").prop("disabled",false).removeClass("tabprev-disabled")}ul.animate(animCss=="left"?{left:-(totalLeft)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd){o.afterEnd.call(this,vis())}b=false})}return false}return})};function moveLeft(list){var currLeftStyle=-(list.position().left);var tabXpos=0;list.find("li").each(function(i){var temp=($(this).position().left);if(temp==currLeftStyle){tabXpos=($(this).prev("li").position().left);return false}else{if((temp<currLeftStyle)&&(temp+$(this).outerWidth(true)>currLeftStyle)){tabXpos=temp;return false}}});return tabXpos}function moveRight(list){var tabWidth=list.parent("div.tabsContainer").outerWidth();var currLeftStyle=-(list.position().left);var leftTotal=currLeftStyle+tabWidth;var tabXpos=0;list.find("li").each(function(i){var temp=($(this).position().left);if(temp==leftTotal){tabXpos=$(this).outerWidth(true);return false}else{if((temp<leftTotal)&&(temp+$(this).outerWidth(true)>leftTotal)){tabXpos=(temp+$(this).outerWidth(true))-leftTotal;return false}}});return currLeftStyle+tabXpos}function findLastTabShowing(currElem,list){var addtlLeft=0;var tabWidth=list.parent("div.tabsContainer").outerWidth();var rightMostTab=0;list.find("li").each(function(i){if(i<currElem){addtlLeft=($(this).outerWidth(true))}else{if(addtlLeft<tabWidth){addtlLeft+=($(this).outerWidth(true));rightMostTab=i}else{if(addtlLeft>=tabWidth){return false}}}});return rightMostTab}function findFirstTabShowing(currElem,list){var addtlLeft=0;var tabWidth=list.parent("div.tabsContainer").outerWidth();var leftMostTab=0;list.find("li").each(function(i){if(i<currElem){addtlLeft=($(this).outerWidth(true))}else{if(addtlLeft<tabWidth){addtlLeft+=($(this).outerWidth(true));rightMostTab=i}else{if(addtlLeft>=tabWidth){return false}}}});return leftMostTab}function css(a,b){return parseInt($.css(a[0],b))||0}function width(a){return a[0].offsetWidth+css(a,"marginLeft")+css(a,"marginRight")}function height(a){return a[0].offsetHeight+css(a,"marginTop")+css(a,"marginBottom")}})(jQuery);
function SidePanel(sidePanelId){this.sidePanelId=sidePanelId;this.sidePanelObj=$("#"+sidePanelId);this.activePanel=this.sidePanelObj.children().eq(0).children().filter("div.sidepanel-body").children().eq(0);this.widgets=new Object();this.bookmarks=new Object()}SidePanel.prototype.openWidget=function(widgetId){var obj=document.getElementById(widgetId).owner;var url=obj.getRequestURL(true);NavHandler.redirectToURL(url)};SidePanel.prototype.activateWidget=function(widgetId){$("#widgetPanelShadow").addClass("inshadow");var widget={widgetId:widgetId,description:this.widgets[widgetId].descrip,url:this.widgets[widgetId].url,params:{},thumbnail:this.widgets[widgetId].thumbnail,title:this.widgets[widgetId].title,sendCol:this.widgets[widgetId].sendCol,linkText:this.widgets[widgetId].linkText,useCustomClass:this.widgets[widgetId].useCustomClass};var row=this.createRow(widgetId);this.widgets[widgetId].row=row;this.widgets[widgetId].status="active";this.activePanel.append(row);return JSON.stringify(widget)};SidePanel.prototype.deactivateWidget=function(widgetId,fromSidepanel){this.widgets[widgetId].status="inactive";this.widgets[widgetId].row.remove();if($("tr",this.activePanel).length==0){$("#widgetPanelShadow").removeClass("inshadow")}};SidePanel.prototype.initialize=function(){this.getWidgetList("CUR");this.getWidgetList("OTH")};SidePanel.prototype.getWidgetList=function(active){var sp=this;$.ajax({data:"1",contentType:"text/plain",dataType:"text",success:function(msg){if(msg){var obj=eval("("+msg+")");for(var i=0;i<obj.RESPONSE.length;i++){var widgetId=obj.RESPONSE[i].widgetId;var cObj=obj.RESPONSE[i];sp.widgets[widgetId]=new Object();sp.widgets[widgetId].descrip=cObj.description;sp.widgets[widgetId].status=(active==="OTH")?"inactive":"active";sp.widgets[widgetId].url=cObj.url;sp.widgets[widgetId].title=cObj.title;sp.widgets[widgetId].thumbnail=cObj.thumbnail;sp.widgets[widgetId].sendCol=cObj.sendCol;sp.widgets[widgetId].linkText=cObj.linkText;sp.widgets[widgetId].useCustomClass=cObj.useCustomClass;if(active==="CUR"){sp.widgets[widgetId].row=sp.createRow(widgetId);sp.activePanel.append(sp.widgets[widgetId].row);if(sp.widgets.length!=0){$("#widgetPanelShadow").addClass("inshadow")}}}}},error:function(msg,stat,err){},beforeSend:function(req){req.setRequestHeader("ACTION",active)}})};SidePanel.prototype.showAddWidgetPanel=function(item,anEvent){if(this.widgetPanel!=undefined){return}var div=document.createElement("div");$(div).append('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr>  <td class="addWidgetTitleBar"><table border="0" cellpadding="0" width="100%"><tr><td>Add Widgets</td><td style="text-align:right"><input type="button" value="" onclick="sidePanel.buffer = undefined; sidePanel.closeAddWidgetPanel()" class="closeBtn" style="border:none"></td></tr></table></td> </tr> <tr>  <td style="height:91.5%"><iframe src="../base/add_widget.jsp" scrolling="no" frameborder="0" class="addWidgetIframe"></iframe></td> </tr></table>');$(div).addClass("addWidgetPanel");$(document.body).append(div);this.widgetPanel=$(div);this.widgetPanel.draggable({containment:$(document.body),iframeFix:true});this.widgetPanel.css("cursor","move");var off=$(item).offset();this.widgetPanel.css("left",off.left+40);this.widgetPanel.css("top",off.top-5)};SidePanel.prototype.closeAddWidgetPanel=function(){if(this.buffer){var idList=this.buffer.split(":");var widgetArr=[];for(var i=0;i<idList.length;i++){if(idList[i]!==""){widgetArr.push(this.activateWidget(idList[i]))}}addWidget(widgetArr,false)}this.widgetPanel.remove();this.widgetPanel=undefined};SidePanel.prototype.createRow=function(widgetId){var row=$(document.createElement("tr"));row.append('<td><table cellspacing="0" width="100%" style="border:none;background:none;padding-left:0px"><tr><td style="padding-left: 5px;"><a class="widget-link" href = "javascript:sidePanel.openWidget(\''+widgetId+"')\">"+this.widgets[widgetId].title+'</a></td><td style="text-align:right"><input type="button" value="" onclick="javascript:removeWidget(\''+widgetId+'\')" class="removeBtn" style="border:none"></td></tr></table></td>');return row};function closeSidePanel(){if($("#SidePanel").hasClass("sidepanel-shown")){$("body,#SidePanel,#SidePanelCover").addClass("sidepanel-hidden");$("body,#SidePanel,#SidePanelCover").removeClass("sidepanel-shown");$("#SidePanelCover").off("click",closeSidePanel);$(document).off("keyup",closeSidePanelWithKeyboard)}}function closeSidePanelWithKeyboard(event){if(event.key=="Escape"){closeSidePanel()}}function toggleSidePanel(){if($("#SidePanel").hasClass("sidepanel-shown")){$(".menu-close-container").hide();$("body,#SidePanel,#SidePanelCover").addClass("sidepanel-hidden");$("body,#SidePanel,#SidePanelCover").removeClass("sidepanel-shown");$("#SidePanelCover").off("click",closeSidePanel);$(document).off("keyup",closeSidePanelWithKeyboard);$("#BannerMenuButton").focus()}else{$(".menu-close-container").show();$("body,#SidePanel,#SidePanelCover").removeClass("sidepanel-hidden");$("body,#SidePanel,#SidePanelCover").addClass("sidepanel-shown");$("#SidePanelCover").on("click",closeSidePanel);$(document).on("keyup",closeSidePanelWithKeyboard);window.scrollTo(0,0);$("#SidePanel .menu-close-button").focus()}}function adjustSidePanel(){var width=$(window).width();if(width<=991){if(!$("body").hasClass("small-window")){$("body").addClass("small-window");$("#SidePanel").attr("role","dialog")}}else{if($("body").hasClass("small-window")){$("body").removeClass("small-window")}$("#SidePanelCover").off("click",closeSidePanel);$(document).off("keyup",closeSidePanelWithKeyboard);$("body,#SidePanel,#SidePanelCover").addClass("sidepanel-hidden");$("body,#SidePanel,#SidePanelCover").removeClass("sidepanel-shown");$("#SidePanel").removeAttr("role")}}$(document).on("ready",adjustSidePanel);$(window).on("resize",adjustSidePanel);
(function($,undefined){$.widget("ui.sortable",$.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").off(".sortable");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData("sortable-item")}return this},_setOption:function(key,value){if(key==="disabled"){this.options[key]=value;this.widget()[value?"addClass":"removeClass"]("ui-sortable-disabled")}else{$.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(event,overrideHandle){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(event);var currentItem=null,self=this,nodes=$(event.target).parents().each(function(){if($.data(this,"sortable-item")==self){currentItem=$(this);return false}});if($.data(event.target,"sortable-item")==self){currentItem=$(event.target)}if(!currentItem){return false}if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==event.target){validHandle=true}});if(!validHandle){return false}}this.currentItem=currentItem;this._removeCurrentsFromItems();return true},_mouseStart:function(event,overrideHandle,noActivation){var o=this.options,self=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(o.containment){this._setContainment()}if(o.cursor){if($("body").css("cursor")){this._storedCursor=$("body").css("cursor")}$("body").css("cursor",o.cursor)}if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",o.opacity)}if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",o.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,self._uiHash(this))}}if($.ui.ddmanager){$.ui.ddmanager.current=this}if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true},_mouseDrag:function(event){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var o=this.options,scrolled=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed}else{if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed}else{if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed}}}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed)}else{if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}}if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed)}else{if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}}if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var i=this.items.length-1;i>=0;i--){var item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item);if(!intersection){continue}if(itemElement!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=itemElement&&!$.ui.contains(this.placeholder[0],itemElement)&&(this.options.type=="semi-dynamic"?!$.ui.contains(this.element[0],itemElement):true)){this.direction=intersection==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item)}else{break}this._trigger("change",event,this._uiHash());break}}this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(event,noPropagation){if(!event){return}if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event)}if(this.options.revert){var self=this;var cur=self.placeholder.offset();self.reverting=true;$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(event)})}else{this._clear(event,noPropagation)}return false},cancel:function(){var self=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,self._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,self._uiHash(this));this.containers[i].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem)}else{$(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}});if(!str.length&&o.key){str.push(o.key+"=")}return str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")});return ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b)}},_intersectsWithPointer:function(item){var isOverElementHeight=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement){return false}return this.floating?(((horizontalDirection&&horizontalDirection=="right")||verticalDirection=="down")?2:1):(verticalDirection&&(verticalDirection=="down"?2:1))},_intersectsWithSides:function(item){var isOverBottomHalf=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection=="right"&&isOverRightHalf)||(horizontalDirection=="left"&&!isOverRightHalf))}else{return verticalDirection&&((verticalDirection=="down"&&isOverBottomHalf)||(verticalDirection=="up"&&!isOverBottomHalf))}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!=0&&(delta>0?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!=0&&(delta>0?"right":"left")},refresh:function(event){this._refreshItems(event);this.refreshPositions();return this},_connectWith:function(){var options=this.options;return options.connectWith.constructor==String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];var connectWith=this._connectWith();if(connectWith&&connected){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],"sortable");if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst])}}}}queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this)})}return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0]){this.items.splice(i,1)}}}},_refreshItems:function(event){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]];var connectWith=this._connectWith();if(connectWith){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],"sortable");if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst)}}}}for(var i=queries.length-1;i>=0;i--){var targetData=queries[i][1];var _queries=queries[i][0];for(var j=0,queriesLength=_queries.length;j<queriesLength;j++){var item=$(_queries[j]);item.data("sortable-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})}}},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var i=this.items.length-1;i>=0;i--){var item=this.items[i];var t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight()}var p=t.offset();item.left=p.left;item.top=p.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}}return this},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||self.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!className){el.style.visibility="hidden"}return el},update:function(container,p){if(className&&!o.forcePlaceholderSize){return}if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css("paddingTop")||0,10)-parseInt(self.currentItem.css("paddingBottom")||0,10))}if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css("paddingLeft")||0,10)-parseInt(self.currentItem.css("paddingRight")||0,10))}}}}self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.after(self.placeholder);o.placeholder.update(self,self.placeholder)},_contactContainers:function(event){var innermostContainer=null,innermostIndex=null;for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.currentItem[0],this.containers[i].element[0])){continue}if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.ui.contains(this.containers[i].element[0],innermostContainer.element[0])){continue}innermostContainer=this.containers[i];innermostIndex=i}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0}}}if(!innermostContainer){return}if(this.containers.length===1){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}else{if(this.currentContainer!=this.containers[innermostIndex]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[innermostIndex].floating?"left":"top"];for(var j=this.items.length-1;j>=0;j--){if(!$.ui.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue}var cur=this.items[j][this.containers[innermostIndex].floating?"left":"top"];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j]}}if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[innermostIndex];itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[innermostIndex].element,true);this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}}},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper=="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){$(o.appendTo!="parent"?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0])}if(helper[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(helper[0].style.width==""||o.forceHelperSize){helper.width(this.currentItem.width())}if(helper[0].style.height==""||o.forceHelperSize){helper.height(this.currentItem.height())}return helper},_adjustOffsetFromHelper:function(obj){if(typeof obj=="string"){obj=obj.split(" ")}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left" in obj){this.offset.click.left=obj.left+this.margins.left}if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top" in obj){this.offset.click.top=obj.top+this.margins.top}if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var o=this.options;if(o.containment=="parent"){o.containment=this.helper[0].parentNode}if(o.containment=="document"||o.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-((this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-((this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))}},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left}if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top}if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top}}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left}}return{top:(pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))}},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter){self.refreshPositions(!hardRefresh)}},0)},_clear:function(event,noPropagation){this.reverting=false;var delayedTriggers=[],self=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS){if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static"){this._storedCSS[i]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())})}if(!$.ui.contains(this.element[0],this.currentItem[0])){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())})}for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.containers[i].element[0],this.currentItem[0])&&!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}).call(this,this.containers[i]));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}).call(this,this.containers[i]))}}}for(var i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("deactivate",event,this._uiHash(this))}}).call(this,this.containers[i]))}if(this.containers[i].containerCache.over){delayedTriggers.push((function(c){return function(event){c._trigger("out",event,this._uiHash(this))}}).call(this,this.containers[i]));this.containers[i].containerCache.over=0}}if(this._storedCursor){$("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event)}this._trigger("stop",event,this._uiHash())}return false}if(!noPropagation){this._trigger("beforeStop",event,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!noPropagation){for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event)}this._trigger("stop",event,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(inst){var self=inst||this;return{helper:self.helper,placeholder:self.placeholder||$([]),position:self.position,originalPosition:self.originalPosition,offset:self.positionAbs,item:self.currentItem,sender:inst?inst.element:null}}});$.extend($.ui.sortable,{version:"1.8.5"})})(jQuery);
jQuery.extend(jQuery.easing,{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2){return 2*c*t*t/(d*d)+b}var ts=t-d/2;return -2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b},easeout:function(x,t,b,c,d){return -c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}if(t<d/2){return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b}return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing.bounceout(x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}}}},bounceinout:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.bouncein(x,t*2,0,c,d)*0.5+b}return jQuery.easing.bounceout(x,t*2-d,0,c,d)*0.5+c*0.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b}});
$(function(){$("ul, li").disableSelection();initSidepanel();$("#Tabs ul").show();$("input[value='Submit Query']").hide();initPortletToggle();$("input[type='Submit']").css("border","0 none");$("input[type='Submit']").css("display","block");$("input[type='Submit']").css("height","0px");$("input[type='Submit']").css("visibility","hidden");$("input[type='Submit']").css("overflow","hidden")});function setUserLocale(){if($("div.language").length>0){$.ajax({url:"../../RetrieveUserLocaleService",contentType:"text/plain",dataType:"JSON",type:"POST",success:setUserLocaleCallback})}}function togglePanel(){var body=$("body");if(body.hasClass("hidden-sidemenu")){body.addClass("visible-sidemenu");body.removeClass("hidden-sidemenu")}else{body.removeClass("visible-sidemenu");body.addClass("hidden-sidemenu")}initPageWidth();var tabsContainers=$(".tabsContainer");tabsContainers.each(function(){var tabsContainer=$(this);if(tabsContainer.length>0){var maxUlWidth=0;tabsContainer.find("li").each(function(){maxUlWidth=maxUlWidth+$(this).outerWidth()});var tabsContainerUl=tabsContainer.find("ul");if(tabsContainer.outerWidth()-tabsContainerUl.position().left>=maxUlWidth){$(".tabnext").addClass("tabnext-disabled")}else{$(".tabnext").removeClass("tabnext-disabled")}}})}function setUserLocaleCallback(results){if(results=="zh"){$("div.language").get(0).className="language en"}else{$("div.language").get(0).className="language zh"}}function changeLanguage(elem){if(NavHandler.warnUserBeforeLink()){if(elem){var locale=elem.split("_");LanguageOption.changeLanguage(locale[0],locale[1])}else{LanguageOption.changeLanguage("en","US")}}}function setLanguageLocale(locale){if(doCheckModified()){return}$.ajax({url:"../../ChangeLanguageLocaleService",contentType:"text/plain",data:locale,type:"POST",success:setLanguageLocaleCallback})}function setLanguageLocaleCallback(){window.location.reload(true)}function toggleTabSearch(e,parentId){var event=e||window.event;if(event.stopPropagation){event.stopPropagation()}else{event.cancelBubble=true}var temp=$("#TabsSearchItemContainer","#"+parentId);temp.toggleClass("hidden");if(!temp.hasClass("hidden")){$(document.body).on("click",function(){doHideTabSearch(parentId)})}}function doHideTabSearch(parentId){var temp=$("#TabsSearchItemContainer","#"+parentId);if(!temp.hasClass("hidden")){temp.addClass("hidden")}$(document.body).off("click")}function adjustTabContainerWidth(hasSideMenu){}function initPortletToggle(){$("#PortletExpand").click(function(){$("div.collapse img[src='../../images/hide.gif']").click()});$("#PortletCollapse").click(function(){$("div.collapse img[src='../../images/display.gif']").click()})}function initTabs(index,tabId){if(index<0){var jTab=$("#"+tabId);var temp=jTab.find("li").index(jTab.find("li.sel"));if(temp>-1){index=temp}else{index=0}}$("#"+tabId+" .tabs",document.getElementById("Panel")||document.getElementById("modal")).jCarouselLite({btnNext:"#"+tabId+" .tabnext",btnPrev:"#"+tabId+" .tabprev",visible:5,circular:false,start:index,tabId:tabId})}function initSidepanel(){}function initTooltip(){$("[title]",document.getElementById("Panel")||document.getElementById("modal")).tooltip({extraClasses:"ui-widget-content isweb-ui ui-state-active",position:"top right"}).dynamic()}function initPageWidth(){$("#Mainbody").width(screen.width);$("#Mainbody").width($("body").width());$("#Banner").width($("#Mainbody").width());$(".tabsContainer").width(0);$(".tabsContainer").width($("#Content").outerWidth()-((($(".tabprev").css("display")!="none")?$(".tabprev").outerWidth():0)+(($(".tabnext").css("display")!="none")?$(".tabnext").outerWidth():0)+(($("#TabSearch input").css("display")!="none")?$("#TabSearch input").outerWidth():0)+2))}function toggleCollapsiblePanel(elem){var $panel=$(elem).closest(".portletPanel");$panel.toggleClass("collapsed");$panel.attr("aria-expanded",!$panel.hasClass("collapsed"));$(elem).attr("aria-expanded",!$panel.hasClass("collapsed"));var $expand=$(elem).find("span");if(!$panel.hasClass("collapsed")){$expand.text(MenuLabels.COL)}else{$expand.text(MenuLabels.EXP)}};
var tabsScroll=true;var tabsIsOnclick=true;var tabsTimeoutId;var tabsIsIE=(navigator.appName.indexOf("Microsoft")!=-1);var tabsLeftClick=0;var tabsE;var tabsDirection;var tabsContainer;function scrollOnmousedown(id,dir,event){tabsE=event;var sourceOffset;if(tabsIsIE){sourceOffset=$(tabsE.srcElement).offset()}else{sourceOffset=$(tabsE.target).offset()}tabsDirection=dir;tabsContainer=initTabsContainer(id);if(tabsIsIE){tabsLeftClick=1}if(tabsE.button==tabsLeftClick){tabsTimeoutId=setTimeout("setOnclickFalse()",500)}}function scrollOnclick(id,dir,event){e=event;var sourceOffset;if(tabsIsIE){sourceOffset=$(e.srcElement).offset()}else{sourceOffset=$(e.target).offset()}tabsDirection=dir;tabsContainer=initTabsContainer(id);moveToNextTab()}function dropdownClick(id,event){if(!$("div#"+id+"_links").get(0)){tabsContainer=initTabsContainer(id);openLinksWindow()}else{$("div#"+id+"_links").remove()}}function initTabsContainer(id){var container=$("#"+id).get(0);var containerPosX=$(container).offset().left;if(tabsIsIE){containerPosX+=11}var children=$("#"+id+" table tbody tr td table.tab").get();return{id:id,posX:containerPosX,width:container.offsetWidth,tabs:children,tabCount:children.length}}function scrollOnmouseup(){if(tabsIsIE){tabsLeftClick=1}if(tabsE.button==tabsLeftClick){if(tabsIsOnclick){clearTimeout(tabsTimeoutId);tabsIsOnclick=true}if(tabsIsOnclick){moveToNextTab()}}}function setOnclickFalse(){tabsIsOnclick=false;continuousScroll()}function continuousScroll(){tabsIsOnclick=true}function openLinksWindow(){var tabs=retrieveTabs();if(tabs.length>0){var popUpX;var popUpY;$("div.search").after('<div tabindex="-1" id="'+tabsContainer.id+'_links" class="linkbox" onblur="closeLinkBox(this);">'+createLinks(tabs)+"</div>");var linksWindowWidth=$("div#"+tabsContainer.id+"_links").get(0).offsetWidth;var dropdownTab=$("table#"+tabsContainer.id+"_dropdownTab").get(0);var dropdownTabOffset=$(dropdownTab).offset();popUpX=dropdownTabOffset.left-(linksWindowWidth-dropdownTab.offsetWidth);popUpY=dropdownTabOffset.top+dropdownTab.offsetHeight;$("#"+tabsContainer.id+"_links").css({top:popUpY+"px",left:popUpX+"px"}).focus()}else{tabsIsOnclick=true}}function createLinks(tabs){var linkBoxBody="<ul>";for(var i=0;i<tabs.length;i++){linkBoxBody+='<li class="';if(tabs[i].isHidden){linkBoxBody+="hidden"}linkBoxBody+='">';linkBoxBody+='<div class="tabicon ';if(tabs[i].isActive){linkBoxBody+=" active"}linkBoxBody+='">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';if(tabs[i].isActive){linkBoxBody+='<span tabindex="-1" onclick="$(this).focus();">'+tabs[i].name+"</span>"}else{linkBoxBody+='<a href="'+tabs[i].link+'">'+tabs[i].name+"</a>"}linkBoxBody+="</div></li>"}return linkBoxBody+"</ul>"}function moveToNextTab(){var children=tabsContainer.tabs;var childrenCount=children.length;var i;if(tabsDirection=="right"){for(i=0;i<childrenCount;i++){if(!processTabs(children[i],"next")){break}}}else{if(tabsDirection=="left"){for(i=childrenCount-1;i>=0;i--){if(!processTabs(children[i],"next")){break}}}}}function processTabs(child,flag){var childPosition=$(child).offset();var elem={element:child,posX:Math.round(childPosition.left-tabsContainer.posX),width:child.offsetWidth};if(tabsIsIE){elem.posX+=11}if(flag=="next"){if(evaluateTab(elem,flag)){if(tabsDirection=="right"){startScroll((elem.posX+elem.width)-tabsContainer.width)}else{if(tabsDirection=="left"){startScroll(elem.posX)}}}if(!tabsScroll){tabsScroll=true;return false}return true}return evaluateTab(elem,flag)}function evaluateTab(elem,flag){if(flag=="next"){if((tabsDirection=="right"&&elem.posX+elem.width>tabsContainer.width)||(tabsDirection=="left"&&elem.posX<0)){return true}}else{if(flag=="hidden"){if((tabsDirection=="right"&&elem.posX+elem.width>tabsContainer.width)||(tabsDirection=="left"&&elem.posX<0)){return{name:$(elem.element).find("td.topMiddleTab").html(),link:$(elem.element).attr("link")}}}else{var link={name:$(elem.element).find("td.topMiddleTab").html(),link:$(elem.element).attr("link"),posX:elem.posX,width:elem.width};if($(elem.element).hasClass("activeTab")){link=$.extend(link,{isActive:true})}if(elem.posX+elem.width>tabsContainer.width||elem.posX<0){link=$.extend(link,{isHidden:true})}return link}}return null}function retrieveTabs(){var tabs=new Array();var o;var i;var children=tabsContainer.tabs;var childrenCount=children.length;for(i=0;i<childrenCount;i++){o=processTabs(children[i]);if(o!=null){tabs.push(o)}}return tabs}function retrieveHiddenTabs(dir){tabsDirection=dir;var hiddenTabs=new Array();var o;var i;var children=tabsContainer.tabs;var childrenCount=children.length;if(tabsDirection=="right"){for(i=0;i<childrenCount;i++){o=processTabs(children[i],"hidden");if(o!=null){hiddenTabs.push(o)}}}else{if(tabsDirection=="left"){for(i=childrenCount-1;i>=0;i--){o=processTabs(children[i],"hidden");if(o!=null){hiddenTabs.push(o)}}}}return hiddenTabs}function startScroll(val,flag){var scroller=document.getElementById(tabsContainer.id);if(flag=="set"){scroller.scrollLeft=val}else{scroller.scrollLeft=scroller.scrollLeft+val}tabsScroll=false;processScrolls()}var linkBox;function closeLinkBox(elem){linkBox=elem;setTimeout("doRemove()",125)}function doRemove(){$(linkBox).remove();tabsIsOnclick=true}function processScrolls(){var hiddenLeft=retrieveHiddenTabs("left");var hiddenRight=retrieveHiddenTabs("right");if(hiddenLeft.length==0){$("div#"+tabsContainer.id+"_scrollLeft").removeClass("scrollLeft").addClass("scrollLeftDisabled")}else{$("div#"+tabsContainer.id+"_scrollLeft").removeClass("scrollLeftDisabled").addClass("scrollLeft")}if(hiddenRight.length==0){$("div#"+tabsContainer.id+"_scrollRight").removeClass("scrollRight").addClass("scrollRightDisabled")}else{$("div#"+tabsContainer.id+"_scrollRight").removeClass("scrollRightDisabled").addClass("scrollRight")}}function scrollToActiveTab(){var tabs=retrieveTabs();var tab;for(var i=0;i<tabs.length;i++){tab=tabs[i];if(tab.isActive&&tab.isHidden){startScroll((tab.posX+tab.width)-tabsContainer.width,"set")}}}function divOnload(id){var elem=document.getElementById(id);if(elem.clientWidth>=elem.scrollWidth){hideScrollers(id)}else{showScrollers(id);tabsContainer=initTabsContainer(id);processScrolls();scrollToActiveTab()}}function hideScrollers(id){$("table#"+id+"_scrollLeftTab").attr("style","display: none;");$("table#"+id+"_scrollRightTab").attr("style","display: none;");$("table#"+id+"_dropdownTab").attr("style","display: none;");$("div#"+id).attr("style","width: 757px;")}function showScrollers(id){$("table#"+id+"_scrollLeftTab").attr("style","display: block;");$("table#"+id+"_scrollRightTab").attr("style","display: block;");$("table#"+id+"_dropdownTab").attr("style","display: block;")}function tabOnmouseover(elem){var table=$(elem);if(table.hasClass("inactiveTab")||(table.hasClass("scrollTab")&&!table.find("div.scroll").hasClass("scrollLeftDisabled")&&!table.find("div.scroll").hasClass("scrollRightDisabled"))){table.addClass("hover")}}function tabOnmouseout(elem){var table=$(elem);if(table.hasClass("hover")){table.removeClass("hover")}};
var jqueryslidemenu={animateduration:{over:200,out:100},buildmenu:function(menuid,arrowsvar){jQuery(document).ready(function($){var $mainmenu=$("#"+menuid+">ul");var $headers=$mainmenu.find("ul").parent();$headers.each(function(i){var $curobj=$(this);var $subul=$(this).find("ul:eq(0)");this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()};this.istopheader=$curobj.parents("ul").length==1?true:false;$subul.css({top:this.istopheader?this._dimensions.h+"px":0});if(!this.istopheader){$curobj.children("a:eq(0)").append("<span class='rightarrow'>&nbsp;</span>")}var $targetul=$curobj.children("ul:eq(0)");$curobj.hover(function(e){var li=$(this);li.removeClass("ui-widget-content");li.addClass("ui-state-hover");this._offsets={left:li.offset().left,top:li.offset().top};var menuleft=this.istopheader?0:this._dimensions.w;menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft;menuleft=menuleft-2;if($targetul.queue().length<=1){$targetul.css({left:menuleft+"px",width:this._dimensions.subulw+"px"}).slideDown(jqueryslidemenu.animateduration.over)}},function(e){var li=$(this);li.removeClass("ui-state-hover");li.addClass("ui-widget-content");var $targetul=li.children("ul:eq(0)");$targetul.slideUp(jqueryslidemenu.animateduration.out)});$targetul.children("li").each(function(){var subsubMenu=$(this);subsubMenu.hover(function(){subsubMenu.removeClass("ui-widget-content");subsubMenu.addClass("ui-state-hover")},function(){subsubMenu.removeClass("ui-state-hover");subsubMenu.addClass("ui-widget-content")})});$curobj.click(function(){$(this).children("ul:eq(0)").hide()})});$mainmenu.find("ul").css({display:"none",visibility:"visible"})})}};jqueryslidemenu.buildmenu("myslidemenu");
function openUndecoratedPortalWindow(url){WindowUtils.openPortalWindow(url)}function doShowFavouritesMaintenance(){ModalUtils.showModal("MENUFAV_MODAL","../templates/editfavourites.jsp",{width:"730px",success:favouritesMaintenanceSuccessCallback,cancel:favouritesMaintenanceCancelCallback})}function favouritesMaintenanceSuccessCallback(){$.ajax({url:"../../UpdateMenuService",contentType:"text/plain",type:"POST",success:setUserMenu})}function favouritesMaintenanceCancelCallback(){}function setUserMenu(results){if(results!=null){$("#Favourites .mainmenu").html(results)}}function showFavourites(){$("#Sidemenu").hide();$("#Favourites").show()}function showSidemenu(){$("#Favourites").hide();$("#Sidemenu").show()}function showSubMenu(groupId){$("#"+groupId).toggle()}function changeVisibleMenu(state){$.ajax({url:"../../ChangeVisibleMenuService",contentType:"text/plain",type:"POST",data:state})}function changeVisibleSidepanel(state){$.ajax({url:"../../ChangeVisibleSidepanelService",contentType:"text/plain",type:"POST",data:state})}function initAccordion(state){var panel=$("#Sidemenu").accordion({active:state,header:"ul:first > li > a",selectedClass:"active",navigation:true,event:"click",fillSpace:false,animated:"easeslide",autoheight:false,duration:100}).on("accordionchange",function(event,ui){var newId=ui.newHeader.parent().attr("id");var href=ui.newHeader.attr("href");if(state!=getState(newId)){state=getState(newId);changeActiveMenu(newId,href)}});$("#Sidemenu").accordion({active:state})}function execLink(href){if((href).trim().indexOf("javascript:")==0){eval((href).trim().substring(11))}else{NavHandler.redirectToURL(href)}}function changeActiveMenu(state,href){$.ajax({url:"../../ChangeActiveMenuService",contentType:"text/plain",data:getState(state),type:"POST",success:execLink(href)})}function getState(stateInput){var state=-1;$("#Sidemenu ul.mainmenu > li").each(function(i){var elem=$(this);if(elem.attr("id").trim()==stateInput){state=""+(i)}});return state}function initSortable(){$("#Favourites .mainmenu").sortable({update:onFavouritesUpdate,placeholder:"ui-state-highlight"});$("#Favourites .mainmenu").disableSelection()}function onFavouritesUpdate(event,ui){var item=ui.item.attr("id");var favArr=$("#Favourites .mainmenu").sortable("toArray");var order=favArr.indexOf(item);reorderFavourites(item,order)}function reorderFavourites(itemId,newOrder){$.ajax({url:"../../ShiftMenuService",contentType:"text/plain",dataType:"text",type:"POST",data:itemId+","+(newOrder)})};
var DatePicker=DatePicker||{};var CalendarButtonInput=function(inputNode,buttonNode,datepicker){this.inputNode=inputNode;this.buttonNode=buttonNode;this.imageNode=false;this.datepicker=datepicker;this.defaultLabel=LBJSCalendar.SEL_DATE;this.keyCode=Object.freeze({ENTER:13,SPACE:32})};CalendarButtonInput.prototype.init=function(){this.buttonNode.addEventListener("click",this.handleClick.bind(this));this.buttonNode.addEventListener("keydown",this.handleKeyDown.bind(this));this.buttonNode.addEventListener("focus",this.handleFocus.bind(this))};CalendarButtonInput.prototype.handleKeyDown=function(event){var flag=false;switch(event.keyCode){case this.keyCode.SPACE:case this.keyCode.ENTER:if($(this.inputNode).prop("readonly")||$(this.inputNode).prop("disabled")){break}this.datepicker.show();this.datepicker.setFocusDay();flag=true;break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};CalendarButtonInput.prototype.handleClick=function(){if($(this.inputNode).prop("readonly")||$(this.inputNode).prop("disabled")){return}if(!this.datepicker.isOpen()){this.datepicker.show();this.datepicker.setFocusDay()}else{this.datepicker.hide()}event.stopPropagation();event.preventDefault()};CalendarButtonInput.prototype.setLabel=function(str){if(typeof str==="string"&&str.length){str=", "+str}this.buttonNode.setAttribute("aria-label",this.defaultLabel+str)};CalendarButtonInput.prototype.setFocus=function(){this.buttonNode.focus()};CalendarButtonInput.prototype.setDate=function(day){var format=$(this.inputNode).metadata().dataFormat||"YYYY-MM-DD";format=format.toUpperCase();this.inputNode.value=moment().year(day.getFullYear()).month(day.getMonth()).date(day.getDate()).format(format);$(this.inputNode).trigger("change");$(this.inputNode).trigger("blur")};CalendarButtonInput.prototype.getDate=function(){var format=$(this.inputNode).metadata().dataFormat||"YYYY-MM-DD";format=format.toUpperCase();return moment(this.inputNode.value,format).format("YYYY-MM-DD")};CalendarButtonInput.prototype.getDateLabel=function(){var label="";var format=$(this.inputNode).metadata().dataFormat||"YYYY-MM-DD";format=format.toUpperCase();var parts=moment(this.inputNode.value,format);if(parts.isValid()){var month=parts.month();var day=parts.date();var year=parts.year();label=this.datepicker.getDateForButtonLabel(year,month,day)}return label};CalendarButtonInput.prototype.handleFocus=function(){var dateLabel=this.getDateLabel();if(dateLabel){this.setLabel("selected date is "+dateLabel)}else{this.setLabel("")}};window.addEventListener("load",function(){var datePickers=document.querySelectorAll(".datepicker");for(var i=0;i<datePickers.length;i++){var dp=datePickers[i];var inputNode=dp.querySelector("input");var buttonNode=dp.querySelector("button");var dialogNode=dp.querySelector("[role=dialog]");var datePicker=new DatePicker(inputNode,buttonNode,dialogNode);datePicker.init()}});
var CalendarButtonInput=CalendarButtonInput||{};var DatePickerDay=DatePickerDay||{};var DatePicker=function(inputNode,buttonNode,dialogNode){this.dayLabels=[LBJSCalendar.DAY1,LBJSCalendar.DAY2,LBJSCalendar.DAY3,LBJSCalendar.DAY4,LBJSCalendar.DAY5,LBJSCalendar.DAY6,LBJSCalendar.DAY7];this.monthLabels=[LBJSCalendar.MONTH1,LBJSCalendar.MONTH2,LBJSCalendar.MONTH3,LBJSCalendar.MONTH4,LBJSCalendar.MONTH5,LBJSCalendar.MONTH6,LBJSCalendar.MONTH7,LBJSCalendar.MONTH8,LBJSCalendar.MONTH9,LBJSCalendar.MONTH10,LBJSCalendar.MONTH11,LBJSCalendar.MONTH12,];this.messageCursorKeys=LBJSCalendar.MESSAGE_CURSOR;this.lastMessage="";this.inputNode=inputNode;this.buttonNode=buttonNode;this.dialogNode=dialogNode;this.messageNode=dialogNode.querySelector(".message");this.dateInput=new CalendarButtonInput(this.inputNode,this.buttonNode,this);this.MonthYearNode=this.dialogNode.querySelector(".monthYear");this.prevYearNode=this.dialogNode.querySelector(".prevYear");this.prevMonthNode=this.dialogNode.querySelector(".prevMonth");this.nextMonthNode=this.dialogNode.querySelector(".nextMonth");this.nextYearNode=this.dialogNode.querySelector(".nextYear");$(this.prevYearNode).attr("aria-label",LBJSCalendar.PREV_YEAR);$(this.prevMonthNode).attr("aria-label",LBJSCalendar.PREV_MONTH);$(this.nextYearNode).attr("aria-label",LBJSCalendar.NEXT_YEAR);$(this.nextMonthNode).attr("aria-label",LBJSCalendar.NEXT_MONTH);this.okButtonNode=this.dialogNode.querySelector('button[value="ok"]');this.cancelButtonNode=this.dialogNode.querySelector('button[value="cancel"]');this.tbodyNode=this.dialogNode.querySelector("table.dates tbody");this.lastRowNode=null;this.days=[];this.focusDay=new Date();this.selectedDay=new Date(0,0,1);this.isMouseDownOnBackground=false;this.keyCode=Object.freeze({TAB:9,ENTER:13,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});$(this.dialogNode).find("th").each(function(index,item){$(item).html(LBJSCalendar["D"+(index+1)]);$(item).attr("abbr",LBJSCalendar["DAY"+(index+1)])})};DatePicker.prototype.init=function(){this.dateInput.init();this.okButtonNode.addEventListener("click",this.handleOkButton.bind(this));this.okButtonNode.addEventListener("keydown",this.handleOkButton.bind(this));this.cancelButtonNode.addEventListener("click",this.handleCancelButton.bind(this));this.cancelButtonNode.addEventListener("keydown",this.handleCancelButton.bind(this));this.prevMonthNode.addEventListener("click",this.handlePreviousMonthButton.bind(this));this.nextMonthNode.addEventListener("click",this.handleNextMonthButton.bind(this));this.prevYearNode.addEventListener("click",this.handlePreviousYearButton.bind(this));this.nextYearNode.addEventListener("click",this.handleNextYearButton.bind(this));this.prevMonthNode.addEventListener("keydown",this.handlePreviousMonthButton.bind(this));this.nextMonthNode.addEventListener("keydown",this.handleNextMonthButton.bind(this));this.prevYearNode.addEventListener("keydown",this.handlePreviousYearButton.bind(this));this.nextYearNode.addEventListener("keydown",this.handleNextYearButton.bind(this));document.body.addEventListener("mousedown",this.handleBackgroundMouseDown.bind(this),true);document.body.addEventListener("mouseup",this.handleBackgroundMouseUp.bind(this),true);this.tbodyNode.innerHTML="";var index=0;for(var i=0;i<6;i++){var row=this.tbodyNode.insertRow(i);this.lastRowNode=row;row.classList.add("dateRow");for(var j=0;j<7;j++){var cell=document.createElement("td");cell.classList.add("dateCell");var cellButton=document.createElement("button");$(cellButton).attr("type","button");cellButton.classList.add("dateButton");cell.appendChild(cellButton);row.appendChild(cell);var dpDay=new DatePickerDay(cellButton,this,index,i,j);dpDay.init();this.days.push(dpDay);index++}}this.updateGrid();this.setFocusDay()};DatePicker.prototype.updateGrid=function(){var i,flag;var fd=this.focusDay;this.MonthYearNode.innerHTML=this.monthLabels[fd.getMonth()]+" "+fd.getFullYear();var firstDayOfMonth=new Date(fd.getFullYear(),fd.getMonth(),1);var daysInMonth=new Date(fd.getFullYear(),fd.getMonth()+1,0).getDate();var dayOfWeek=firstDayOfMonth.getDay();firstDayOfMonth.setDate(firstDayOfMonth.getDate()-dayOfWeek);var d=new Date(firstDayOfMonth);for(i=0;i<this.days.length;i++){flag=d.getMonth()!=fd.getMonth();this.days[i].updateDay(flag,d);if((d.getFullYear()==this.selectedDay.getFullYear())&&(d.getMonth()==this.selectedDay.getMonth())&&(d.getDate()==this.selectedDay.getDate())){this.days[i].domNode.setAttribute("aria-selected","true")}d.setDate(d.getDate()+1)}if((dayOfWeek+daysInMonth)<36){this.hideLastRow()}else{this.showLastRow()}};DatePicker.prototype.hideLastRow=function(){this.lastRowNode.style.visibility="hidden"};DatePicker.prototype.showLastRow=function(){this.lastRowNode.style.visibility="visible"};DatePicker.prototype.setFocusDay=function(flag){if(typeof flag!=="boolean"){flag=true}var fd=this.focusDay;function checkDay(d){d.domNode.setAttribute("tabindex","-1");if((d.day.getDate()==fd.getDate())&&(d.day.getMonth()==fd.getMonth())&&(d.day.getFullYear()==fd.getFullYear())){d.domNode.setAttribute("tabindex","0");if(flag){d.domNode.focus()}}}for(var i=0;i<this.days.length;i++){checkDay.bind(this)(this.days[i])}};DatePicker.prototype.updateDay=function(day){var d=this.focusDay;this.focusDay=day;if((d.getMonth()!==day.getMonth())||(d.getFullYear()!==day.getFullYear())){this.updateGrid();this.setFocusDay()}};DatePicker.prototype.getDaysInLastMonth=function(){var fd=this.focusDay;var lastDayOfMonth=new Date(fd.getFullYear(),fd.getMonth(),0);return lastDayOfMonth.getDate()};DatePicker.prototype.getDaysInMonth=function(){var fd=this.focusDay;var lastDayOfMonth=new Date(fd.getFullYear(),fd.getMonth()+1,0);return lastDayOfMonth.getDate()};DatePicker.prototype.show=function(){this.dialogNode.style.display="block";this.dialogNode.style.zIndex=2;this.getDateInput();this.updateGrid();this.setFocusDay()};DatePicker.prototype.isOpen=function(){return window.getComputedStyle(this.dialogNode).display!=="none"};DatePicker.prototype.hide=function(){this.setMessage("");this.dialogNode.style.display="none";this.hasFocusFlag=false;this.dateInput.setFocus()};DatePicker.prototype.handleBackgroundMouseDown=function(event){if(!this.buttonNode.contains(event.target)&&!this.dialogNode.contains(event.target)){this.isMouseDownOnBackground=true;if(this.isOpen()){this.hide();event.stopPropagation();event.preventDefault()}}};DatePicker.prototype.handleBackgroundMouseUp=function(){this.isMouseDownOnBackground=false};DatePicker.prototype.handleOkButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ENTER:case this.keyCode.SPACE:this.setTextboxDate();this.hide();flag=true;break;case this.keyCode.TAB:if(!event.shiftKey){this.prevYearNode.focus();flag=true}break;case this.keyCode.ESC:this.hide();flag=true;break;default:break}break;case"click":this.setTextboxDate();this.hide();flag=true;break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.handleCancelButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ENTER:case this.keyCode.SPACE:this.hide();flag=true;break;case this.keyCode.ESC:this.hide();flag=true;break;default:break}break;case"click":this.hide();flag=true;break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.handleNextYearButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ESC:this.hide();flag=true;break;case this.keyCode.ENTER:case this.keyCode.SPACE:this.moveToNextYear();this.setFocusDay(false);flag=true;break}break;case"click":this.moveToNextYear();this.setFocusDay(false);break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.handlePreviousYearButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ENTER:case this.keyCode.SPACE:this.moveToPreviousYear();this.setFocusDay(false);flag=true;break;case this.keyCode.TAB:if(event.shiftKey){this.okButtonNode.focus();flag=true}break;case this.keyCode.ESC:this.hide();flag=true;break;default:break}break;case"click":this.moveToPreviousYear();this.setFocusDay(false);break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.handleNextMonthButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ESC:this.hide();flag=true;break;case this.keyCode.ENTER:case this.keyCode.SPACE:this.moveToNextMonth();this.setFocusDay(false);flag=true;break}break;case"click":this.moveToNextMonth();this.setFocusDay(false);break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.handlePreviousMonthButton=function(event){var flag=false;switch(event.type){case"keydown":switch(event.keyCode){case this.keyCode.ESC:this.hide();flag=true;break;case this.keyCode.ENTER:case this.keyCode.SPACE:this.moveToPreviousMonth();this.setFocusDay(false);flag=true;break}break;case"click":this.moveToPreviousMonth();this.setFocusDay(false);flag=true;break;default:break}if(flag){event.stopPropagation();event.preventDefault()}};DatePicker.prototype.moveToNextYear=function(){this.focusDay.setFullYear(this.focusDay.getFullYear()+1);this.updateGrid()};DatePicker.prototype.moveToPreviousYear=function(){this.focusDay.setFullYear(this.focusDay.getFullYear()-1);this.updateGrid()};DatePicker.prototype.moveToNextMonth=function(){this.focusDay.setMonth(this.focusDay.getMonth()+1);this.updateGrid()};DatePicker.prototype.moveToPreviousMonth=function(){this.focusDay.setMonth(this.focusDay.getMonth()-1);this.updateGrid()};DatePicker.prototype.moveFocusToDay=function(day){var d=this.focusDay;this.focusDay=day;if((d.getMonth()!=this.focusDay.getMonth())||(d.getYear()!=this.focusDay.getYear())){this.updateGrid()}this.setFocusDay()};DatePicker.prototype.moveFocusToNextDay=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()+1);this.moveFocusToDay(d)};DatePicker.prototype.moveFocusToNextWeek=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()+7);this.moveFocusToDay(d)};DatePicker.prototype.moveFocusToPreviousDay=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()-1);this.moveFocusToDay(d)};DatePicker.prototype.moveFocusToPreviousWeek=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()-7);this.moveFocusToDay(d)};DatePicker.prototype.moveFocusToFirstDayOfWeek=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()-d.getDay());this.moveFocusToDay(d)};DatePicker.prototype.moveFocusToLastDayOfWeek=function(){var d=new Date(this.focusDay);d.setDate(d.getDate()+(6-d.getDay()));this.moveFocusToDay(d)};DatePicker.prototype.setTextboxDate=function(day){if(day){this.dateInput.setDate(day)}else{this.dateInput.setDate(this.focusDay)}};DatePicker.prototype.getDateInput=function(){var parts=this.dateInput.getDate().split("-");if((parts.length===3)){this.focusDay=new Date(parseInt(parts[0]),parseInt(parts[1])-1,parseInt(parts[2]));this.selectedDay=new Date(this.focusDay)}else{this.focusDay=new Date();this.selectedDay=new Date(0,0,1)}};DatePicker.prototype.getDateForButtonLabel=function(year,month,day){if(typeof year!=="number"||typeof month!=="number"||typeof day!=="number"){this.selectedDay=this.focusDay}else{this.selectedDay=new Date(year,month,day)}var label=this.dayLabels[this.selectedDay.getDay()];label+=" "+this.monthLabels[this.selectedDay.getMonth()];label+=" "+(this.selectedDay.getDate());label+=", "+this.selectedDay.getFullYear();return label};DatePicker.prototype.setMessage=function(str){function setMessageDelayed(){this.messageNode.textContent=str}if(str!==this.lastMessage){setTimeout(setMessageDelayed.bind(this),200);this.lastMessage=str}};function enableDate(id){$("#"+id).attr("readonly",false).val("");$("[name="+id+"_DATEPICKER_BTN]").attr("aria-disabled","false")}function disableDate(id){$("#"+id).attr("readonly",true).val("");$("[name="+id+"_DATEPICKER_BTN]").attr("aria-disabled","true")};
var DatePickerDay=function(domNode,datepicker,index,row,column){this.index=index;this.row=row;this.column=column;this.day=new Date();this.domNode=domNode;this.datepicker=datepicker;this.keyCode=Object.freeze({TAB:9,ENTER:13,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40})};DatePickerDay.prototype.init=function(){this.domNode.setAttribute("tabindex","-1");this.domNode.addEventListener("mousedown",this.handleMouseDown.bind(this));this.domNode.addEventListener("keydown",this.handleKeyDown.bind(this));this.domNode.addEventListener("focus",this.handleFocus.bind(this));this.domNode.innerHTML="-1"};DatePickerDay.prototype.isDisabled=function(){return this.domNode.classList.contains("disabled")};DatePickerDay.prototype.updateDay=function(disable,day){if(disable){this.domNode.classList.add("disabled")}else{this.domNode.classList.remove("disabled")}this.day=new Date(day);this.domNode.innerHTML=this.day.getDate();this.domNode.setAttribute("tabindex","-1");this.domNode.removeAttribute("aria-selected");var d=this.day.getDate().toString();if(this.day.getDate()<9){d="0"+d}var m=this.day.getMonth()+1;if(this.day.getMonth()<9){m="0"+m}this.domNode.setAttribute("data-date",this.day.getFullYear()+"-"+m+"-"+d)};DatePickerDay.prototype.handleKeyDown=function(event){var flag=false;switch(event.keyCode){case this.keyCode.ESC:this.datepicker.hide();break;case this.keyCode.TAB:this.datepicker.cancelButtonNode.focus();if(event.shiftKey){this.datepicker.nextYearNode.focus()}this.datepicker.setMessage("");flag=true;break;case this.keyCode.ENTER:case this.keyCode.SPACE:this.datepicker.setTextboxDate(this.day);this.datepicker.hide();flag=true;break;case this.keyCode.RIGHT:this.datepicker.moveFocusToNextDay();flag=true;break;case this.keyCode.LEFT:this.datepicker.moveFocusToPreviousDay();flag=true;break;case this.keyCode.DOWN:this.datepicker.moveFocusToNextWeek();flag=true;break;case this.keyCode.UP:this.datepicker.moveFocusToPreviousWeek();flag=true;break;case this.keyCode.PAGEUP:if(event.shiftKey){this.datepicker.moveToPreviousYear()}else{this.datepicker.moveToPreviousMonth()}flag=true;break;case this.keyCode.PAGEDOWN:if(event.shiftKey){this.datepicker.moveToNextYear()}else{this.datepicker.moveToNextMonth()}flag=true;break;case this.keyCode.HOME:this.datepicker.moveFocusToFirstDayOfWeek();flag=true;break;case this.keyCode.END:this.datepicker.moveFocusToLastDayOfWeek();flag=true;break}if(flag){event.stopPropagation();event.preventDefault()}};DatePickerDay.prototype.handleMouseDown=function(event){if(this.isDisabled()){this.datepicker.moveFocusToDay(this.day)}else{this.datepicker.setTextboxDate(this.day);this.datepicker.hide()}event.stopPropagation();event.preventDefault()};DatePickerDay.prototype.handleFocus=function(){this.datepicker.setMessage(this.datepicker.messageCursorKeys)};
var arrInst=new Array();var arrULevel=new Array({label:isChinese()?"研究院":"Postgraduate",value:"postgrad"},{label:isChinese()?"本科或學士學位":"Undergraduate or Degree",value:"undergrad"},{label:isChinese()?"副學位、副學士或高級文憑":"Sub-degree, Associate Degree, or Higher Diploma",value:"undergrad"});var arrAPALevel=new Array({label:isChinese()?"\u526F\u5B78\u4F4D":"Subdegree",value:"subdegree"},{label:isChinese()?"\u5B78\u4F4D":"Degree",value:"degree"});var arrAE={};var arrGLBound=new Array();var arrGPer=new Array();var arrLPer=new Array();var arrAssetBound=new Array();var arrAssetPer=new Array();var arrTFee=new Array();var curMaxLoan=0;var curMaxME=0;var datestr="";var datestr2="";var MaxMedicalExpense=0;var yearStart="";var yearLast="";var yearBeforeStart="";var calculator_node,institutions_node,ae_node,subjects_node;var grantandloan_node,asset_node,fee_node,maxloan_node,maxME_node;var datestr_node;var notWhitespace=/\S/;var adj2MembersSingleParentFamily=0;var adj3MembersSingleParentFamily=0;var adj3MembersNonSingleParentFamily=0;var adj4MembersFamily=0;var xmlDoc;var langDoc;var langChi={};var langEng={};function readData(){return Promise.all([loadXML(),loadLang()])}function loadLang(){return new Promise(function(resolve,reject){$.ajax({type:"GET",url:"../../js/vas/xml/tsfs_lang.xml?lastMod="+(new Date).getTime(),dataType:"text",success:function(results){langDoc=parseXML(results);getLang();resolve()},error:function(xmlReq,status,errorMsg){alert("XML cannot be loaded due to error: "+errorMsg);reject()}})})}function loadXML(){return new Promise(function(resolve,reject){$.ajax({type:"GET",url:"../../js/vas/xml/tsfs_data.xml?lastMod="+(new Date).getTime(),dataType:"text",success:function(results){xmlDoc=parseXML(results);getData();resolve()},error:function(xmlReq,status,errorMsg){alert("XML cannot be loaded due to error: "+errorMsg);reject()}})})}function parseXML(text){if(window.ActiveXObject){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.loadXML(text);return doc}else{if(window.DOMParser){return(new DOMParser).parseFromString(text,"text/xml")}}return""}function getData(){if(typeof xmlDoc!="undefined"){if(window.ActiveXObject){iegetdata()}else{nsgetdata()}}}function iegetdata(){var msgobj=xmlDoc.getElementsByTagName("calculator")[0];for(var i=0;i<msgobj.childNodes.length;i++){if((msgobj.childNodes[i].nodeType==3)&&(!notWhitespace.test(msgobj.childNodes[i].nodeValue))){msgobj.removeChild(msgobj.childNodes[i]);i--}}calculator_node=xmlDoc.documentElement;institutions_node=calculator_node.firstChild;ae_node=institutions_node.nextSibling;grantandloan_node=ae_node.nextSibling;asset_node=grantandloan_node.nextSibling;fee_node=asset_node.nextSibling;maxloan_node=fee_node.nextSibling;maxME_node=maxloan_node.nextSibling;datestr_node=maxME_node.nextSibling;adj2MembersSingleParentFamily_node=datestr_node.nextSibling;adj3MembersSingleParentFamily_node=adj2MembersSingleParentFamily_node.nextSibling;adj3MembersNonSingleParentFamily_node=adj3MembersSingleParentFamily_node.nextSibling;adj4MembersFamily_node=adj3MembersNonSingleParentFamily_node.nextSibling;readInstitution();readDisNames();iereadgrantloan();iereadasset();iereadfee();iereadmaxloan();iereadmaxME();iereadadj2MembersSingleParentFamily();iereadadj3MembersSingleParentFamily();iereadadj3MembersNonSingleParentFamily();iereadadj4MembersFamily();readdatestr()}function iereadgrantloan(){var i;for(i=0;i<grantandloan_node.childNodes.length;i++){arrGLBound[i]=grantandloan_node.childNodes[i].attributes.getNamedItem("lbound").value;arrGPer[i]=grantandloan_node.childNodes[i].attributes.getNamedItem("grantpercent").value;arrLPer[i]=grantandloan_node.childNodes[i].attributes.getNamedItem("loanpercent").value}}function iereadasset(){var i;for(i=0;i<asset_node.childNodes.length;i++){arrAssetBound[i]=asset_node.childNodes[i].attributes.getNamedItem("lbound").value;arrAssetPer[i]=asset_node.childNodes[i].attributes.getNamedItem("assetpercent").value}}function iereadfee(){var i;for(i=0;i<fee_node.childNodes.length;i++){arrTFee[i]=fee_node.childNodes[i].firstChild.nodeValue}}function iereadmaxloan(){curMaxLoan=maxloan_node.firstChild.nodeValue}function iereadmaxME(){curMaxME=maxME_node.firstChild.nodeValue}function iereadadj2MembersSingleParentFamily(){adj2MembersSingleParentFamily=adj2MembersSingleParentFamily_node.firstChild.nodeValue}function iereadadj3MembersSingleParentFamily(){adj3MembersSingleParentFamily=adj3MembersSingleParentFamily_node.firstChild.nodeValue}function iereadadj3MembersNonSingleParentFamily(){adj3MembersNonSingleParentFamily=adj3MembersNonSingleParentFamily_node.firstChild.nodeValue}function iereadadj4MembersFamily(){adj4MembersFamily=adj4MembersFamily_node.firstChild.nodeValue}function readdatestr(){datestr=$(xmlDoc).find("datestr").text();yearStart=datestr.substring(0,4)+"";yearLast=datestr.substring(5,7)+"";yearBeforeStart=parseInt(yearStart)-1;var temp1=parseInt(yearStart)+1+"";var temp2=parseInt(yearStart)+2+"";datestr2=temp1+"/"+temp2.substring(2,4)+""}function nsgetdata(){var msgobj=xmlDoc.getElementsByTagName("calculator")[0];for(var i=0;i<msgobj.childNodes.length;i++){if((msgobj.childNodes[i].nodeType==3)&&(!notWhitespace.test(msgobj.childNodes[i].nodeValue))){msgobj.removeChild(msgobj.childNodes[i]);i--}}readInstitution();readDisNames();nsreadgrantloan();nsreadasset();nsreadfee();nsreadmaxloan();nsreadmaxME();nsreadadj2MembersSingleParentFamily();nsreadadj3MembersSingleParentFamily();nsreadadj3MembersNonSingleParentFamily();nsreadadj4MembersFamily();readdatestr()}function readDisNames(){$(xmlDoc).find("subjects").each(function(i,subjects){genReadDisName($(subjects).attr("type"))})}function genReadDisName(typName){arrAE[typName]=new Array();var disArr=arrAE[typName];var disNodes=$(xmlDoc).find("subjects[type="+typName+"]").children();for(var i=0;i<disNodes.length;i++){disArr[i]={name:$(disNodes[i]).attr("discipline"),undergrad:$(disNodes[i]).attr("undergrad"),postgrad:$(disNodes[i]).attr("postgrad"),degree:$(disNodes[i]).attr("degree"),subdegree:$(disNodes[i]).attr("subdegree")}}}function readInstitution(){var i,j=1;var $institutions=$(xmlDoc).find("institutions").find("institution");for(i=0;i<$institutions.length;i++){arrInst[i]={name:$($institutions.get(i)).attr("name"),type:$($institutions.get(i)).attr("type")}}}function nsreadgrantloan(){var i,j=1;for(i=0;i<parseInt((xmlDoc.getElementsByTagName("grantandloan")[0].childNodes.length-1)/2);i++){arrGLBound[i]=xmlDoc.getElementsByTagName("grantandloan")[0].childNodes[j].attributes.getNamedItem("lbound").value;arrGPer[i]=xmlDoc.getElementsByTagName("grantandloan")[0].childNodes[j].attributes.getNamedItem("grantpercent").value;arrLPer[i]=xmlDoc.getElementsByTagName("grantandloan")[0].childNodes[j].attributes.getNamedItem("loanpercent").value;j=j+2}}function nsreadasset(){var i,j=1;for(i=0;i<parseInt((xmlDoc.getElementsByTagName("asset")[0].childNodes.length-1)/2);i++){arrAssetBound[i]=xmlDoc.getElementsByTagName("asset")[0].childNodes[j].attributes.getNamedItem("lbound").value;arrAssetPer[i]=xmlDoc.getElementsByTagName("asset")[0].childNodes[j].attributes.getNamedItem("assetpercent").value;j=j+2}}function nsreadfee(){var i,j=1;for(i=0;i<parseInt((xmlDoc.getElementsByTagName("fee")[0].childNodes.length-1)/2);i++){arrTFee[i]=xmlDoc.getElementsByTagName("fee")[0].childNodes[j].firstChild.nodeValue;j=j+2}}function nsreadmaxloan(){curMaxLoan=xmlDoc.getElementsByTagName("calculator")[0].childNodes[5].firstChild.nodeValue}function nsreadmaxME(){curMaxME=xmlDoc.getElementsByTagName("calculator")[0].childNodes[6].firstChild.nodeValue}function nsreadadj2MembersSingleParentFamily(){adj2MembersSingleParentFamily=$(xmlDoc).find("calculator adj2MembersSingleParentFamily").text()}function nsreadadj3MembersSingleParentFamily(){adj3MembersSingleParentFamily=$(xmlDoc).find("calculator adj3MembersSingleParentFamily").text()}function nsreadadj3MembersNonSingleParentFamily(){adj3MembersNonSingleParentFamily=$(xmlDoc).find("calculator adj3MembersNonSingleParentFamily").text()}function nsreadadj4MembersFamily(){adj4MembersFamily=$(xmlDoc).find("calculator adj4MembersFamily").text()}function getLang(){$(langDoc).find("property").each(function(){var cd=$(this).attr("cd");var eng=$(this).attr("eng");var chi=$(this).attr("chi");langEng[cd]=eng;langChi[cd]=chi})};
function initTsfsStep1(){initSelections()}function initSelections(){var langProps=isChinese()?langChi:langEng;with(document.calculator.INSTITUTION){options.length=1;for(var i=0;i<arrInst.length;i++){newItem=options.length;options[newItem]=new Option(langProps[arrInst[i].name]?langProps[arrInst[i].name]:arrInst[i].name);options[newItem].value=arrInst[i].type}}with(document.calculator.FULL_YEAR_TUITION_SELECT){options.length=0;for(i=0;i<arrTFee.length;i++){newItem=options.length;options[newItem]=new Option(arrTFee[i]);if(i==1){options[newItem].selected="selected"}options[newItem].value=arrTFee[i]}}$("span.max_me_holder").html(Number(curMaxME).toLocaleString())}function fillSelection(object){var langProps=isChinese()?langChi:langEng;var dataList=(object.name=="INSTITUTION")?"DISCIPLINE":"STUDY_LEVEL";var newItem;var src;var srcName="";for(var i=0;i<object.length;i++){if(object.options[i].selected){srcName=object.options[i].value}}if(srcName==""){return}src=arrAE[srcName];var data=eval("document.calculator."+dataList);with(data){options.length=1;for(var i=0;i<src.length;i++){newItem=options.length;options[newItem]=new Option(langProps[src[i].name]?langProps[src[i].name]:src[i].name);options[newItem].value=src[i].name}options[0].selected=true}document.calculator.AE.value=0}function mapInstToLevel(){var newItem;var arr=[];if(document.calculator.INSTITUTION.value=="APA"){arr=arrAPALevel}else{arr=arrULevel}with(document.calculator.STUDY_LEVEL){options.length=1;for(var i=0;i<arr.length;i++){newItem=options.length;options[newItem]=new Option(arr[i].label);options[newItem].value=arr[i].value}}document.calculator.DISCIPLINE.options[0].selected=true}function calculateFamilyMembers(){var maritalStatus=document.calculator.MARITAL_STATUS.value;var num;with(document.calculator){switch(maritalStatus){case"SINGLE":num=parseInt(RESIDING_PARENTS_NO.value)+parseInt(RESIDING_UNMARRIED_SIBLINGS_NO.value)+parseInt(STUDIED_ABROAD_SIBLINGS_NO.value)+parseInt(DEPENDENT_GRANDPARENTS_NO.value)+1;break;case"MARRIED":num=parseInt(DEPENDENT_CHILDREN_SPOUSE_NO.value)+1;break;case"DIVORCED":num=parseInt(DEPENDENT_CHILDREN_SPOUSE_NO.value)+1;break;case"WIDOWED":num=parseInt(DEPENDENT_CHILDREN_SPOUSE_NO.value)+1;break;default:num=0;break}}document.calculator.TOTAL_FAMILY_MEMBERS.value=num;MaxMedicalExpense=curMaxME*num;if(document.calculator.DEDUCTIBLE_MED_EXPENSES.value>MaxMedicalExpense){document.calculator.DEDUCTIBLE_MED_EXPENSES.value=MaxMedicalExpense}calculateAFI();calculatePCA()}function calculateAE(){document.calculator.AE.value=0;var disciplineIndex=$(calcForm.DISCIPLINE).prop("selectedIndex")-1;var levelIndex=$(calcForm.STUDY_LEVEL).find(":selected").val();if(disciplineIndex>=0&&levelIndex){var inst=document.calculator.INSTITUTION.value;document.calculator.AE.value=arrAE[inst][disciplineIndex][levelIndex]||0}}function calculateAFI(){var AFIvalue;var familyMembers=parseInt(document.calculator.TOTAL_FAMILY_MEMBERS.value);with(document.calculator){if(isNaN(TOTAL_PARENT_SPOUSE_INCOME.value)||isNaN(TOTAL_APPLICANT_INCOME.value)||isNaN(TOTAL_UNMARRIED_SIBLING_INCOME.value)||isNaN(DEDUCTIBLE_MED_EXPENSES.value)){document.calculator.AFI.value=0;return}if(TOTAL_PARENT_SPOUSE_INCOME.value<0||TOTAL_APPLICANT_INCOME.value<0||TOTAL_UNMARRIED_SIBLING_INCOME.value<0||DEDUCTIBLE_MED_EXPENSES.value<0){document.calculator.AFI.value=0;return}if(MARITAL_STATUS.value!="MARRIED"){if((IS_SINGLE_FAMILY[0].checked==true)&&(familyMembers==2||familyMembers==3)){familyMembers++;familyMembers++;if((MARITAL_STATUS.value=="DIVORCED")||(MARITAL_STATUS.value=="WIDOWED")){AFIvalue=(parseInt(TOTAL_PARENT_SPOUSE_INCOME.value)+parseInt(TOTAL_APPLICANT_INCOME.value)-parseInt(DEDUCTIBLE_MED_EXPENSES.value))/familyMembers}else{AFIvalue=(parseInt(TOTAL_PARENT_SPOUSE_INCOME.value)+(parseInt(TOTAL_UNMARRIED_SIBLING_INCOME.value)*0.3)+parseInt(TOTAL_APPLICANT_INCOME.value)-parseInt(DEDUCTIBLE_MED_EXPENSES.value))/familyMembers}}else{familyMembers++;if((MARITAL_STATUS.value=="DIVORCED")||(MARITAL_STATUS.value=="WIDOWED")){AFIvalue=(parseInt(TOTAL_PARENT_SPOUSE_INCOME.value)+parseInt(TOTAL_APPLICANT_INCOME.value)-parseInt(DEDUCTIBLE_MED_EXPENSES.value))/familyMembers}else{AFIvalue=(parseInt(TOTAL_PARENT_SPOUSE_INCOME.value)+(parseInt(TOTAL_UNMARRIED_SIBLING_INCOME.value)*0.3)+parseInt(TOTAL_APPLICANT_INCOME.value)-parseInt(DEDUCTIBLE_MED_EXPENSES.value))/familyMembers}}}else{familyMembers++;AFIvalue=(parseInt(TOTAL_PARENT_SPOUSE_INCOME.value)+parseInt(TOTAL_APPLICANT_INCOME.value)-parseInt(DEDUCTIBLE_MED_EXPENSES.value))/familyMembers}if(AFIvalue<0){AFIvalue=0}}document.calculator.AFI.value=Math.floor(AFIvalue);if((document.calculator.AFI.value=="Infinity")||(document.calculator.AFI.value=="NaN")){document.calculator.AFI.value=0}}function calculatePCA(){var PCAvalue;var familyMembers=parseInt(document.calculator.TOTAL_FAMILY_MEMBERS.value);with(document.calculator){if(isNaN(TOTAL_APPLICANT_ASSET.value)||isNaN(TOTAL_PARENT_SPOUSE_ASSET.value)){document.calculator.PER_CAPITA_ASSET.value=0;return}if(TOTAL_APPLICANT_ASSET.value<0||TOTAL_PARENT_SPOUSE_ASSET.value<0){document.calculator.PER_CAPITA_ASSET.value=0;return}if((MARITAL_STATUS.value=="DIVORCED")||(MARITAL_STATUS.value=="WIDOWED")){PCAvalue=parseInt(TOTAL_APPLICANT_ASSET.value)/familyMembers}else{PCAvalue=(parseInt(TOTAL_PARENT_SPOUSE_ASSET.value)+parseInt(TOTAL_APPLICANT_ASSET.value))/familyMembers}}if(PCAvalue<0){PCAvalue=0}document.calculator.PER_CAPITA_ASSET.value=Math.floor(PCAvalue);if((document.calculator.PER_CAPITA_ASSET.value=="Infinity")||(document.calculator.PER_CAPITA_ASSET.value=="NaN")){document.calculator.PER_CAPITA_ASSET.value=0}}function initTsfsStep2(){calculateResultGL()}function calculateGL(){var afi=parseInt(document.calculator.AFI.value);if(afi<0){afi=0}for(var i=arrGLBound.length-1;i>=0;i--){if(afi>=arrGLBound[i]){return i}}}function calculateAssetTest(){var pca=parseInt(document.calculator.PER_CAPITA_ASSET.value);if(pca<=0){pca=1}for(var i=0;i<arrAssetBound.length;i++){if(pca>arrAssetBound[i]){return i}}}var computedGrant;var computedLoan;var nlsLoan;function getTuitionFee(){if($("input:radio[name='TUITION_FEE_SELECTION']:checked").val()=="0"){return $("select[name='FULL_YEAR_TUITION_SELECT']").val()}else{return $("input[name='FULL_YEAR_TUITION_TEXTBOX']").val()}}function calculateResultGL(){var familyMembers=parseInt(document.calculator.TOTAL_FAMILY_MEMBERS.value);var afi=parseInt(document.calculator.AFI.value);var tuition=getTuitionFee();var isSingleFamily=($("input:radio[name='IS_SINGLE_FAMILY']:checked").val()=="Y");var currentMaxGrant=0;var currentMaxLoan=curMaxLoan;var tuitionFeeGrant=parseInt(tuition);var academicExpenseGrant=parseInt(document.calculator.AE.value);var GL=calculateGL();var assetTest=calculateAssetTest();if($("input:radio[name='TUITION_YEAR_TYPE']:checked").val()!="FULL"){academicExpenseGrant=Math.floor(academicExpenseGrant/2);currentMaxLoan=Math.floor(currentMaxLoan/2)}currentMaxGrant=tuitionFeeGrant+academicExpenseGrant;var grantPercent=arrGPer[GL]/100;var loanPercent=arrLPer[GL]/100;var assetPercent=arrAssetPer[assetTest]/100;if((familyMembers==2&&isSingleFamily&&afi<=adj2MembersSingleParentFamily)||(familyMembers==3&&isSingleFamily&&afi<=adj3MembersSingleParentFamily)||(familyMembers==3&&(!isSingleFamily)&&afi<=adj3MembersNonSingleParentFamily)||(familyMembers==4&&afi<=adj4MembersFamily)){grantPercent=arrGPer[0]/100;loanPercent=arrLPer[0]/100}computedTuitionFeeGrant=Math.floor(Math.floor(tuitionFeeGrant*grantPercent)*assetPercent);computedAcademicExpenseGrant=Math.floor(Math.floor(academicExpenseGrant*grantPercent)*assetPercent);computedGrant=Math.floor(computedTuitionFeeGrant+computedAcademicExpenseGrant);computedLoan=Math.floor(Math.floor(currentMaxLoan*loanPercent)*assetPercent);nlsLoan=(currentMaxGrant-computedGrant)+(currentMaxLoan-computedLoan);if(nlsLoan>tuition){nlsLoan=tuition}if(nlsLoan<1000&&nlsLoan>0){nlsLoan=0}document.result.EST_GRANT_FOR_FEES.value=toMoney(computedTuitionFeeGrant);document.result.EST_GRANT_FOR_ACAD.value=toMoney(computedAcademicExpenseGrant);document.result.EST_LOAN_ENTITLED.value=toMoney(computedLoan);document.nlsresult.EST_NLSFT_LOAN.value=toMoney(nlsLoan)};
LanguageOption.checkModified=function(){return $(document.forms).isModified()};LanguageOption.getConfirmMessage=function(){return LBJSWarningMsgs.CONFIRM_VAS_CHANGE_LANGUAGE};$(function(){$(document.forms).find("input[type!='submit'][type!='button'][type!='hidden'],textarea,select").setAsNotModified()});function toFormattedMoney(s){var money=toMoney(s);var split=money.split(".");var whole=split[0].length>0?split[0]:"0";var decimal=split.length>1?split[1]:"";return whole+"."+decimal.padEnd(2,"0")}function toMoney(s){if(!isNumber(s)){return 0}var rounded=""+(Math.round(s*100)/100);return addComma(rounded)}function isNumber(s){var numRegex=/^([0-9]*|\d*\.\d{1}?\d*)$/;return numRegex.test(s)}function addComma(input){var number=new String(input);number=number.replace(/\,/g,"");if(number==""){return number}var split=number.split(".");var whole=split[0].length>0?split[0]:"0";var decimal=split.length>1?"."+split[1]:"";var regex=/([\+\-]?\d+)(\d{3})/;while(regex.test(whole)){whole=whole.replace(regex,"$1,$2")}return whole+decimal};
