/* * Web Forms 2.0 Cross-browser Implementation * Version: 0.5.4 (2008-07-29) * Copyright: 2007, Weston Ruter * License: GNU General Public License, Free Software Foundation * * * The comments contained in this code are largely quotations from the * WebForms 2.0 specification: * * Usage: */ if(!window.$wf2){var $wf2={};if(document.implementation&&document.implementation.hasFeature&&!document.implementation.hasFeature('WebForms','2.0')){$wf2={version:'0.5.4',_5c:false,_6f:'',_7b:(window.HTMLElement&&HTMLElement.prototype),_7c:($wf2.__defineGetter__&&$wf2.__defineSetter__),onDOMContentLoaded:function(){if($wf2._5c)return;$wf2._5c=true;var i,j,k,node;var style=document.createElement('link');style.setAttribute('type','text/css');style.setAttribute('rel','stylesheet');style.setAttribute('href',$wf2._6f+'webforms2.css');var _2=document.getElementsByTagName('head')[0];if(!_2)_2=document.getElementsByTagName('*')[0];_2.insertBefore(style,_2.firstChild);$wf2._43={};$wf2._43.datetime=$wf2._56("1970-01-01T00:00:00.0Z");$wf2._43['datetime-local']=$wf2._56("1970-01-01T00:00:00.0");$wf2._43.date=$wf2._43.datetime;$wf2._43.month=$wf2._43.datetime;$wf2._43.week=$wf2._56("1970-W01");$wf2._43.time=$wf2._43.datetime;$wf2._0=null;if(window.XMLHttpRequest)$wf2._0=new XMLHttpRequest();else if(window.ActiveXObject){try{$wf2._0=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{$wf2._0=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}if($wf2._0){$wf2._79();$wf2._7a()}$wf2.initRepetitionBlocks();$wf2.initRepetitionTemplates();$wf2.initRepetitionButtons('add');$wf2.initRepetitionButtons('remove');$wf2.initRepetitionButtons('move-up');$wf2.initRepetitionButtons('move-down');$wf2._72();$wf2._73();if(document.addEventListener){document.addEventListener('mousedown',$wf2._49,false);document.addEventListener('keydown',$wf2._49,false)}else if(document.attachEvent){document.attachEvent('onmousedown',$wf2._49);document.attachEvent('onkeydown',$wf2._49)}$wf2.initNonRepetitionFunctionality()},_79:function(){var select,selects=$wf2._50.apply(document.documentElement,['select','datalist']);for(var i=0;select=selects[i];i++){var _23=$wf2._62(select);if(_23&&_23.documentElement&&/:?\bselect$/i.test(_23.documentElement.nodeName)&&_23.documentElement.namespaceURI=='http://www.w3.org/1999/xhtml'){var root=_23.documentElement;if(root.getAttribute('type')!='incremental'){while(select.lastChild)select.removeChild(select.lastChild)}node=root.firstChild;while(node){select.appendChild($wf2._7d(node));node=node.nextSibling}}}},_7a:function(){var frm,frms=document.getElementsByTagName('form');for(var i=0;frm=frms[i];i++){var _23=$wf2._62(frm);if(_23&&_23.documentElement&&/:?\bformdata$/.test(_23.documentElement.nodeName)&&_23.documentElement.namespaceURI=='http://n.whatwg.org/formdata'){var rt;var root=_23.documentElement;if(root.getAttribute('type')!='incremental')frm.reset();var clr,clrs=root.getElementsByTagName('clear');for(j=0;clr=clrs[j];j++){if(clr.namespaceURI=='http://n.whatwg.org/formdata'&&clr.parentNode==root&&!clr.firstChild&&(rt=document.getElementById(clr.getAttribute('template')))&&rt.getAttribute('repeat')=='template'){var _4,node,next;node=rt.parentNode.firstChild;while(node){if(node.nodeType==1&&(_4=node.getAttributeNode('repeat'))&&_4.value!='template'){next=node.nextSibling;node.parentNode.removeChild(node);node=next}else node=node.nextSibling}}}var index,rpt,rpts=root.getElementsByTagName('repeat');for(j=0;rpt=rpts[j];j++){if(rpt.namespaceURI=='http://n.whatwg.org/formdata'&&rpt.parentNode==root&&!rpt.firstChild&&(rt=document.getElementById(rpt.getAttribute('template')))&&rt.getAttribute('repeat')=='template'&&/^-?\d+$/.test(index=rpt.getAttribute('index'))){var _3c,_4,node,next;node=rt.parentNode.firstChild;while(node){if(node.nodeType==1&&(_4=node.getAttributeNode('repeat'))&&_4.value==index){_3c=true;break}node=node.nextSibling}if(!_3c){$wf2._80.apply(rt,[null,index])}}}var fld,flds=root.getElementsByTagName('field');var _17=$wf2._4f.apply(frm);for(j=0;fld=flds[j];j++){var _1b=fld.getAttributeNode('index');var name=fld.getAttribute('name');if(!name||(_1b&&!/^\d+$/.test(_1b.value)))continue;var value='';for(k=0;node=fld.childNodes[k];k++){if(node.nodeType==3||node.nodeType==4)value+=node.data;else break}var ctrl,_33=0;for(k=0;ctrl=_17[k];k++){if(ctrl.type=='image'){if(ctrl.name?(ctrl.name+'.x'==name||ctrl.name+'.y'==name):(name=='x'||name=='y')){if(!_1b||++_33-1>=_1b.value)break}}else if(ctrl.name==name){if(_1b){if(++_33-1<_1b.value)continue}else if((ctrl.type=='radio'||ctrl.type=='checkbox')&&(value&&ctrl.value!=value))continue;break}}if(ctrl.type=='file'||ctrl.type=='button'||ctrl.type=='image')continue;if(!ctrl.getAttributeNode('multiple')||!ctrl.wf2Prefilled){if(ctrl.type=='checkbox'||ctrl.type=='radio'){if(!value)ctrl.checked=false;else if(ctrl.value==value)ctrl.checked=true;else break}else if(ctrl.nodeName.toLowerCase()=='select'){ctrl.selectedIndex=-1;for(var opt,k=0;opt=ctrl.options[k];k++){if(opt.value?opt.value==value:opt.text==value){opt.selected=true;break}}}else{ctrl.value=value;$wf2._6a(ctrl);if(!ctrl.validity.valid){ctrl.value=ctrl.defaultValue;$wf2._6a(ctrl)}}ctrl.wf2Prefilled=true}else if(ctrl.getAttributeNode('multiple')){for(var opt,k=0;opt=ctrl.options[k];k++){if(!opt.selected&&(opt.value?opt.value==value:opt.text==value)){opt.selected=true;break}}}}var _17=$wf2._4f.apply(frm);for(j=0;j<_17.length;j++){}}}},_13:[],_68:function(){if(this.wf2Initialized)return;this.wf2Initialized=true;this.style.display='none';this.repetitionType=1;if(!this.repetitionIndex)this.repetitionIndex=0;this.repetitionTemplate=null;if(!this.repetitionBlocks)this.repetitionBlocks=[];var _attr;this.repeatStart=/^\d+$/.test(_attr=this.getAttribute('repeat-start'))?parseInt(_attr):1;this.repeatMin=/^\d+$/.test(_attr=this.getAttribute('repeat-min'))?parseInt(_attr):0;this.repeatMax=/^\d+$/.test(_attr=this.getAttribute('repeat-max'))?parseInt(_attr):Number.MAX_VALUE;if(!this.addRepetitionBlock)this.addRepetitionBlock=function(_c,index){return $wf2._7f.apply(this,[_c,index])};if(!this.addRepetitionBlockByIndex)this.addRepetitionBlockByIndex=this.addRepetitionBlock;var frm=this;while(frm=frm.parentNode){if(frm.nodeName.toLowerCase()=='form')break}var _templateElements;if(frm&&(_templateElements=$wf2._50.apply(this,['button','input','select','textarea','isindex'])).length){for(var el,i=0;el=_templateElements[i];i++)el.disabled=true}var _4,_f=this.parentNode.firstChild;while(_f&&_f!=this){if(_f.nodeType==1&&(_4=_f.getAttributeNode('repeat'))&&/^-?\d+$/.test(_4.value)&&!_f.getAttribute('repeat-template')){_f.repetitionTemplate=this;_f.setAttribute('repeat-template',this.id);this.repetitionBlocks.push(_f)}_f=_f.nextSibling}for(var i=0;(ithis.repetitionIndex)this.repetitionIndex=index;var _22=this.getAttribute('id')?'id':this.getAttribute('name')?'name':'';var _16=this.getAttribute(_22);var block;var replaceValue=this.repetitionIndex;var _1d,_1;if(_16&&!/\u005B|\u02D1|\u005D|\u00B7/.test(_16)){_1d=new RegExp("(\\[|\u02D1)"+_16+"(\\]|\u00B7)",'g');_1=function(_1c){if(!_1c)return _1c;_1c=_1c.toString();if(_1c.indexOf("\uFEFF")===0)return _1c.replace(/^\uFEFF/,'');return _1c.replace(_1d,replaceValue)}}block=$wf2._7d(this,_1);block.wf2Initialized=false;_1d=null;block.setAttribute('repeat',this.repetitionIndex);block.removeAttribute('repeat-min');block.removeAttribute('repeat-max');block.removeAttribute('repeat-start');if(_22){block.setAttribute('repeat-template',_16);block.removeAttribute(_22)}if(!_c){_c=this;while(_c.previousSibling&&_c.previousSibling.repetitionType!=2)_c=_c.previousSibling;this.parentNode.insertBefore(block,_c);this.repetitionBlocks.push(block)}else{_c.parentNode.insertBefore(block,_c.nextSibling);this.repetitionBlocks.push(block);if($wf2._69)this.repetitionBlocks.sort($wf2._69)}this.repetitionIndex++;$wf2._65.apply(block);$wf2.initRepetitionTemplates(block);$wf2.initRepetitionButtons('add',block);$wf2.initRepetitionButtons('remove',block);$wf2.initRepetitionButtons('move-up',block);$wf2.initRepetitionButtons('move-down',block);if($wf2._5c){$wf2._72(this);$wf2._73(this.parentNode)}$wf2.initNonRepetitionFunctionality(block);var _9;try{if(document.createEvent)_9=document.createEvent('UIEvents');else if(document.createEventObject)_9=document.createEventObject();RepetitionEvent._upgradeEvent.apply(_9);_9.initRepetitionEvent('added',true,false,block);if(this.dispatchEvent)this.dispatchEvent(_9);else if(this.fireEvent){}}catch(err){_9=new Object();RepetitionEvent._upgradeEvent.apply(_9);_9.initRepetitionEvent('added',true,false,block)}var _2d;if((_2d=this.getAttribute('onadded'))&&(!this.onadded||typeof this.onadded!='function')){this.onadded=new Function('event',_2d)}else if((_2d=this.getAttribute('onadd'))&&(!this.onadd||typeof this.onadd!='function')){this.onadd=new Function('event',_2d)}try{if(this.onadded){this.onadded.apply(this,[_9])}else if(this.onadd){this.onadd.apply(this,[_9])}}catch(err){setTimeout(function(){throw err},0)}return block},_80:function(_c,index){$wf2._7f.apply(this,[_c,index])},_81:function(){if(this.repetitionType!=2)throw $wf2._70(9);var parentNode=this.parentNode;var block=parentNode.removeChild(this);$wf2._73(parentNode);if(this.repetitionTemplate!=null){for(var i=0;i=t.repeatMax){_40[i].disabled=true}}}},_73:function(_2){var i;var rbs=[];if(!_2){var _75=[];rbs=$wf2._51.apply(document.documentElement,[['*'],'repeat','template',true]);for(i=0;block=rbs[i];i++){if(!$wf2._52(_75,block.parentNode)){$wf2._73(block.parentNode);_75.push(block.parentNode)}}return}var j,btn,block;var child=_2.firstChild;while(child){if(child.repetitionType==2)rbs.push(child);child=child.nextSibling}for(i=0;block=rbs[i];i++){var moveUpBtns=$wf2._51.apply(block,[['button'],'type','move-up']);for(j=0;btn=moveUpBtns[j];j++){btn.disabled=!(rb=$wf2._4d(btn))||(i==0)}var moveDownBtns=$wf2._51.apply(block,[['button'],'type','move-down']);for(j=0;btn=moveDownBtns[j];j++){btn.disabled=!(rb=$wf2._4d(btn))||(i==rbs.length-1)}}},initNonRepetitionFunctionality:function(_2){_2=(_2||document.documentElement);var i,j,frm,frms=_2.getElementsByTagName('form');for(i=0;frm=frms[i];i++){if(frm.checkValidity)continue;frm.checkValidity=$wf2._60;if(frm.addEventListener)frm.addEventListener('submit',$wf2._64,false);else frm.attachEvent('onsubmit',$wf2._64)}var ctrl,ctrls=$wf2._50.apply(_2,['input','select','textarea']);for(i=0;ctrl=ctrls[i];i++){$wf2._5d(ctrl);$wf2._6a(ctrl)}var els=$wf2._51.apply(document.documentElement,[['*'],'autofocus']);if(_2.getAttribute('autofocus'))els.unshift(_2);for(i=0;inode.max)}else if(type=='file'){if(_10&&/^\d+$/.test(_10.value))node.min=Number(_10.value);else node.min=0;if(_11&&/^\d+$/.test(_11.value))node.max=Number(_11.value);else node.max=1}else{if(_10){node.min=$wf2._56(_10.value,type);node.validity.rangeUnderflow=(node.min&&node.wf2Valuenode.max)}}}if(_20&&!node.validity.rangeUnderflow&&!node.validity.rangeOverflow){var stepAttrNode=node.getAttributeNode('step');if(!stepAttrNode){node.step=_15?60:1}else if(stepAttrNode.value=='any')node.step='any';else if($wf2._63.test(stepAttrNode.value)&&stepAttrNode.value>0)node.step=Number(stepAttrNode.value);else node.step=_15?60:1;if(node.step!='any'){node.wf2StepDatum=null;if(_10)node.wf2StepDatum=node.min;else if(_11)node.wf2StepDatum=node.max;else node.wf2StepDatum=$wf2._43[type]?$wf2._43[type]:0;var _step=node.step;if(type=='month'){var month1=node.wf2StepDatum.getUTCFullYear()*12+node.wf2StepDatum.getUTCMonth();var month2=node.wf2Value.getUTCFullYear()*12+node.wf2Value.getUTCMonth();node.validity.stepMismatch=(month2-month1)%_step!=0}else{switch(type){case'datetime':case'datetime-local':case'time':_step=parseInt(_step*1000);break;case'date':_step=parseInt(_step*24*60*60*1000);break;case'week':_step=parseInt(_step*7*24*60*60*1000);break}node.validity.stepMismatch=(Math.round((node.wf2Value-node.wf2StepDatum)*1000)%Math.round(_step*1000))!=0}}}}if(_2b&&node.maxLength>=0&&node.value!=node.defaultValue){var shortNewlines=0;var v=node.value;node.wf2ValueLength=v.length;for(var i=1;inode.maxLength}}node.validity.valid=!$wf2._6e(node.validity)},_5d:function(node){if(node.validity&&node.validity.typeMismatch!==undefined)return node;node.validationMessage="";node.validity=$wf2._61();node.willValidate=true;var nodeName=node.nodeName.toLowerCase();if(nodeName=='button'||nodeName=='fieldset'){node.setCustomValidity=function(error){throw $wf2._70(9)};node.checkValidity=function(){return true};return node}node.setCustomValidity=$wf2._5f;node.checkValidity=$wf2._5e;var type=(node.getAttribute('type')?node.getAttribute('type').toLowerCase():node.type);if(/(hidden|button|reset|add|remove|move-up|move-down)/.test(type)||!node.name||node.disabled)node.willValidate=false;else if(window.RepetitionElement){var _2=node;while(_2=_2.parentNode){if(_2.repetitionType==1){node.willValidate=false;break}}}return node},_64:function(event){var frm=event.currentTarget||event.srcElement;if(!frm.checkValidity()){if(event.preventDefault)event.preventDefault();event.returnValue=false;return false}event.returnValue=true;return true},_5f:function(error){if(error){this.validationMessage=String(error);this.validity.customError=true}else{this.validationMessage="";this.validity.customError=false}this.validity.valid=!$wf2._6e(this.validity)},_6e:function(validity){return validity.typeMismatch||validity.rangeUnderflow||validity.rangeOverflow||validity.stepMismatch||validity.tooLong||validity.patternMismatch||validity.valueMissing||validity.customError},_61:function(){return{typeMismatch:false,rangeUnderflow:false,rangeOverflow:false,stepMismatch:false,tooLong:false,patternMismatch:false,valueMissing:false,customError:false,valid:true}},_44:[],_45:null,_46:null,stepUnits:{'datetime':'second','datetime-local':'second','time':'second','date':'day','week':'week','month':'month'},invalidMessages:{valueMissing:'A value must be supplied or selected.',typeMismatch:'The value is invalid for %s type.',rangeUnderflow:'The value must be equal to or greater than %s.',rangeOverflow:'The value must be equal to or less than %s.',stepMismatch:'The value has a step mismatch; it must be a certain number multiples of %s from %s.',tooLong:'The value is too long. The field may have a maximum of %s characters but you supplied %s. Note that each line-break counts as two characters.',patternMismatch:'The value does not match the required pattern: %s'},_6c:function(value,type){switch(String(type).toLowerCase()){case'datetime':case'datetime-local':case'date':case'month':case'week':case'time':return $wf2._59(value,type);default:return value}},_47:function(target){var msg=document.createElement('div');msg.className='wf2_errorMsg';msg.id=(target.id||target.name)+'_wf2_errorMsg';msg.onmousedown=function(){this.parentNode.removeChild(this)};var type=(target.getAttribute('type')?target.getAttribute('type').toLowerCase():target.type);var isDateTimeRelated=(type=='datetime'||type=='datetime-local'||type=='time'||type=='date'||type=='month'||type=='week');var ol=document.createElement('ol');if(target.validity.valueMissing)ol.appendChild($wf2._48($wf2.invalidMessages.valueMissing));if(target.validity.typeMismatch)ol.appendChild($wf2._48($wf2.invalidMessages.typeMismatch.replace(/%s/,type)));if(target.validity.rangeUnderflow)ol.appendChild($wf2._48($wf2.invalidMessages.rangeUnderflow.replace(/%s/,$wf2._6c(target.min,type))));if(target.validity.rangeOverflow)ol.appendChild($wf2._48($wf2.invalidMessages.rangeOverflow.replace(/%s/,$wf2._6c(target.max,type))));if(target.validity.stepMismatch)ol.appendChild($wf2._48($wf2.invalidMessages.stepMismatch.replace(/%s/,target.step+($wf2.stepUnits[type]?' '+$wf2.stepUnits[type]+'(s)':'')).replace(/%s/,$wf2._6c(target.wf2StepDatum,type))));if(target.validity.tooLong)ol.appendChild($wf2._48($wf2.invalidMessages.tooLong.replace(/%s/,target.maxLength).replace(/%s/,target.wf2ValueLength?target.wf2ValueLength:target.value.length)));if(target.validity.patternMismatch)ol.appendChild($wf2._48($wf2.invalidMessages.patternMismatch.replace(/%s/,target.title?target.title:' "'+target.getAttribute('pattern')+'"')));if(target.validity.customError)ol.appendChild($wf2._48(target.validationMessage));if(ol.childNodes.length==1)ol.className='single';msg.appendChild(ol);var _2=document.body?document.body:document.documentElement;if($wf2._44.length)_2.insertBefore(msg,$wf2._44[$wf2._44.length-1].errorMsg);else _2.insertBefore(msg,null);var el=target;while(el&&(el.nodeType!=1||(el.style.display=='none'||el.style.visibility=='hidden'||!el.offsetParent)))el=el.parentNode;var top=left=0;var cur=el;if(cur&&cur.offsetParent){left=cur.offsetLeft;top=cur.offsetTop;while(cur=cur.offsetParent){left+=cur.offsetLeft;top+=cur.offsetTop}top+=el.offsetHeight}msg.style.top=top+'px';msg.style.left=left+'px';$wf2._44.push({target:target,errorMsg:msg});if(!target.className.match(/\bwf2_invalid\b/))target.className+=" wf2_invalid";if($wf2._46==null){$wf2._46=setInterval(function(){var _1f;for(var i=0;_1f=$wf2._44[i];i++){if(!_1f.target.className.match(/\bwf2_invalid\b/)){_1f.target.className+=" wf2_invalid"}else{_1f.target.className=_1f.target.className.replace(/\s?wf2_invalid/,"")}}},500);$wf2._45=setTimeout($wf2._49,4000)}},_49:function(){clearTimeout($wf2._45);$wf2._45=null;clearInterval($wf2._46);$wf2._46=null;var _1f;while(_1f=$wf2._44[0]){if(_1f.errorMsg&&_1f.errorMsg.parentNode)_1f.errorMsg.parentNode.removeChild(_1f.errorMsg);var target=_1f.target;target.className=target.className.replace(/\s?wf2_invalid/,"");$wf2._44.shift()}},_4a:{'type':1,'template':1,'repeat':1,'repeat-template':1,'repeat-min':1,'repeat-max':1,'repeat-start':1,'value':1,'class':1,'required':1,'pattern':1,'form':1,'autocomplete':1,'autofocus':1,'inputmode':1,'max':1,'min':1,'step':1,onmoved:1,onadded:1,onremoved:1,onadd:1,onremove:1,onmove:1},_4b:{'name':1,'class':1,'for':1,'style':1,'checked':1,addRepetitionBlock:1,addRepetitionBlockByIndex:1,moveRepetitionBlock:1,removeRepetitionBlock:1,repetitionBlocks:1,setCustomValidity:1,checkValidity:1,validity:1,validationMessage:1,willValidate:1,wf2StepDatum:1,wf2Value:1,wf2Initialized:1,wf2ValueLength:1},_4c:{onmoved:1,onadded:1,onremoved:1,onadd:1,onremove:1,onmove:1},_7d:function(node,_1,_12){if(!_12)_12=0;var clone,i,_4;switch(node.nodeType){case 1:var _37=node.getAttribute('repeat')=='template';if(_37)_12++;var _e=[];if(node.name)_e.name=_1?_1(node.name):node.name;if(node.type=='radio')_e.type=node.type;if(node.checked)_e.checked='checked';clone=$wf2._7e(node.nodeName,_e);for(i=0;_4=node.attributes[i];i++){if((_4.specified||$wf2._4a[_4.name])&&!$wf2._4b[_4.name]&&((!_37||(_12>1||!$wf2._4c[_4.name])))){if(_12<2&&(_4.name.indexOf('on')===0)&&(typeof node[_4.name]=='function')){var _19=_1(node[_4.name].toString().match(/{((?:.|\n)+)}/)[1]);_19=_1(_19);clone[_4.name]=new Function('event',_19)}else{var _8=node.getAttribute(_4.name);_8=(_1?_1(_8):_8);clone.setAttribute(_4.name,_8)}}}if(node.className){var _className=(_1?_1(node.className):node.className);if(clone.getAttributeNode('class')){for(i=0;i');if(el.tagName.toLowerCase()!='div'||el.name!='foo')throw'create element error';return function(tag,_e){var html='<'+tag;for(var name in _e)html+=' '+name+'="'+_e[name]+'"';html+='>';if(tag.toLowerCase()!='input')html+='';return document.createElement(html)}}catch(err){return function(tag,_e){var el=document.createElement(tag);for(var name in _e)el.setAttribute(name,_e[name]);return el}}})(),_69:(function(){var n=document.documentElement.firstChild;if(n.sourceIndex){return function(a,b){return a.sourceIndex-b.sourceIndex}}else if(n.compareDocumentPosition){return function(a,b){return 3-(a.compareDocumentPosition(b)&6)}}})(),_48:function(text){var li=document.createElement('li');li.appendChild(document.createTextNode(text));return li},_55:/^(?:(\d\d\d\d)-(W(0[1-9]|[1-4]\d|5[0-2])|(0\d|1[0-2])(-(0\d|[1-2]\d|3[0-1])(T(0\d|1\d|2[0-4]):([0-5]\d)(:([0-5]\d)(\.(\d+))?)?(Z)?)?)?)|(0\d|1\d|2[0-4]):([0-5]\d)(:([0-5]\d)(\.(\d+))?)?)$/,_56:function(str,type){var d=$wf2._57(str,type);if(!d)return null;var date=new Date(0);var _timePos=8;if(d[15]){if(type&&type!='time')return null;_timePos=15}else{date.setUTCFullYear(d[1]);if(d[3]){if(type&&type!='week')return null;date.setUTCDate(date.getUTCDate()+((8-date.getUTCDay())%7)+(d[3]-1)*7);return date}else{date.setUTCMonth(d[4]-1);if(d[6])date.setUTCDate(d[6])}}if(d[_timePos+0])date.setUTCHours(d[_timePos+0]);if(d[_timePos+1])date.setUTCMinutes(d[_timePos+1]);if(d[_timePos+2])date.setUTCSeconds(d[_timePos+3]);if(d[_timePos+4])date.setUTCMilliseconds(Math.round(Number(d[_timePos+4])*1000));if(d[4]&&d[_timePos+0]&&!d[_timePos+6])date.setUTCMinutes(date.getUTCMinutes()+date.getTimezoneOffset());return date},_57:function(value,type){var _b=false;var d=$wf2._55.exec(value);if(!d||!type)return d;type=type.toLowerCase();if(type=='week')_b=(d[2].toString().indexOf('W')===0);else if(type=='time')_b=!!d[15];else if(type=='month')_b=!d[5];else{if(d[6]){var date=new Date(d[1],d[4]-1,d[6]);if(date.getMonth()!=d[4]-1)_b=false;else switch(type){case'date':_b=(d[4]&&!d[7]);break;case'datetime':_b=!!d[14];break;case'datetime-local':_b=(d[7]&&!d[14]);break}}}return _b?d:null},_58:function(num,pad){if(!pad)pad=2;var str=num.toString();while(str.length<"+"/script>");document.write("<\/script>");var script=document.getElementById('__wf2_ie_onload');script.onreadystatechange=function(){if(this.readyState=='complete'){this.parentNode.removeChild(this);$wf2.onDOMContentLoaded();if($wf2._13.length==0)$wf2._5c=false}};script=null;_14=1}if(!_14){if(window.onload){var oldonload=window.onload;window.onload=function(){$wf2.onDOMContentLoaded();oldonload()}}else window.onload=function(){$wf2.onDOMContentLoaded()}}})()}else if(document.addEventListener&&($wf2.oldRepetitionEventModelEnabled===undefined||$wf2.oldRepetitionEventModelEnabled)){$wf2.oldRepetitionEventModelEnabled=true;(function(){var _1a={added:'onadd',removed:'onremove',moved:'onmove'};function _18(_6){if(!$wf2.oldRepetitionEventModelEnabled)return;if(!_6.element&&_6.relatedNode)_6.element=_6.relatedNode;if(!_6.element||!_6.element.repetitionTemplate)return;var rt=_6.element.repetitionTemplate;var _3='on'+_6.type;var _2d=rt.getAttribute(_3)||rt.getAttribute(_1a[_6.type]);if(_2d&&(!rt[_3]||typeof rt[_3]!='function'))rt[_3]=new Function('event',_2d);if(_6.element.repetitionTemplate[_3])_6.element.repetitionTemplate[_3](_6);else if(_6.element.repetitionTemplate[_1a[_6.type]])_6.element.repetitionTemplate[_1a[_6.type]](_6)}document.addEventListener('added',_18,false);document.addEventListener('removed',_18,false);document.addEventListener('moved',_18,false)})()}}