
var dw=function(text1,text2){if(text2!=null){document.writeln('<b>'+text1+'</b>: \''+text2+'\'<br>');}else{document.writeln(text1+'<br>');}};var Class=function(properties){var klass=function(){for(var p in this){if(this[p])this[p]._proto_=this;}
if(arguments[0]!='noinit'&&this.initialize)return this.initialize.apply(this,arguments);};klass.extend=this.extend;klass.implement=this.implement;klass.prototype=properties;return klass;};Class.empty=function(){};Class.create=function(properties){return new Class(properties);};Class.prototype={extend:function(properties){var pr0t0typ3=new this('noinit');for(var property in properties){var previous=pr0t0typ3[property];var current=properties[property];if(previous&&previous!=current)current=previous.parentize(current)||current;pr0t0typ3[property]=current;}
return new Class(pr0t0typ3);},implement:function(properties){for(var property in properties)this.prototype[property]=properties[property];}};Object.extend=function(){var args=arguments;if(args[1])args=[args[0],args[1]];else args=[this,args[0]];for(var property in args[1])args[0][property]=args[1][property];return args[0];};Object.Native=function(){for(var i=0;i<arguments.length;i++)arguments[i].extend=Class.prototype.implement;};new Object.Native(Function,Array,Number,Date,String);Function.extend({parentize:function(current){var previous=this;return function(){this.parent=previous;return current.apply(this,arguments);};}});registerNamespace=function(ns){var nameSpace=ns.split(".");var root=window;for(var i=0;i<nameSpace.length;i++){if(typeof(root[nameSpace[i]])=="undefined"){root[nameSpace[i]]={};}
root=root[nameSpace[i]];}};var Encoder={encodeHTML:function(value){return value.replace(/&(?!\w{3,4};)/gi,"&amp;").replace(/"/gi,"&quot;").replace(/</gi,"&lt;").replace(/>/gi,"&gt;").replace(/\x0D\x0A/gi,"<br>").replace(/\x0A/gi,"<br>").replace(/\x0D/gi,"<br>").replace(/ /gi,"&nbsp;");},decodeHTML:function(value){return value.replace(/&amp;/gi,"&").replace(/&quot;/gi,"\"").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/<br>/gi,"\n").replace(/&nbsp;/gi," ");},encodeURL:function(value){return(encodeURIComponent)?encodeURIComponent(value):escape(value);},decodeURL:function(value){return(decodeURIComponent)?decodeURIComponent(value):unescape(value);}};var Timer={DEFAULT_TIMER:"_default",_timers:{},start:function(profile){profile=(profile||this.DEFAULT_TIMER);this._timers[profile]={started:new Date().getTime(),stopped:false};},stop:function(profile){profile=(profile||this.DEFAULT_TIMER);if(!this._timers.hasOwnProperty(profile))return;this._timers[profile].stopped=new Date().getTime();},reset:function(profile){this.start(profile);},elapsed:function(profile){profile=(profile||this.DEFAULT_TIMER);if(!this._timers.hasOwnProperty(profile))return;var startTime=this._timers[profile].started;var endTime=(this._timers[profile].stopped||new Date().getTime());return(endTime-startTime)/1000;},toString:function(profile){profile=(profile||this.DEFAULT_TIMER);if(!this._timers.hasOwnProperty(profile))return"";return"Elapsed: "+this.elapsed(profile)+" sec.";}};Function.extend({pass:function(args,bind){var fn=this;if($type(args)!='array')args=[args];return function(){return fn.apply(bind||fn._proto_||fn,args);};},bind:function(bind){var fn=this;return function(){return fn.apply(bind,arguments);};},bindAsEventListener:function(bind){var fn=this;return function(event){fn.call(bind,event||window.event);return false;};},delay:function(ms,bind){return setTimeout(this.bind(bind||this._proto_||this),ms);},periodical:function(ms,bind){return setInterval(this.bind(bind||this._proto_||this),ms);}});function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;};function $type(obj){if(!obj)return false;var type=false;if(obj instanceof Function)type='function';else if(obj.nodeName){if(obj.nodeType==3&&!/\S/.test(obj.nodeValue))type='textnode';else if(obj.nodeType==1)type='element';}
else if(obj instanceof Array)type='array';else if(typeof(obj)=='object')type='object';else if(typeof(obj)=='string')type='string';else if(typeof(obj)=='number'&&isFinite(obj))type='number';return type;};var Chain=new Class({chain:function(fn){this.chains=this.chains||[];this.chains.push(fn);return this;},callChain:function(){if(this.chains&&this.chains.length)this.chains.splice(0,1)[0].delay(10,this);},clearChain:function(){this.chains=[];}});if(!Array.prototype.forEach){Array.prototype.forEach=function(fn,bind){for(var i=0;i<this.length;i++)fn.call(bind,this[i],i);};}
Array.extend({each:Array.prototype.forEach,copy:function(){var newArray=[];for(var i=0;i<this.length;i++)newArray.push(this[i]);return newArray;},remove:function(item){for(var i=0;i<this.length;i++){if(this[i]==item)this.splice(i,1);}
return this;},test:function(item){for(var i=0;i<this.length;i++){if(this[i]==item)return true;};return false;},extend:function(newArray){for(var i=0;i<newArray.length;i++)this.push(newArray[i]);return this;},associate:function(keys){var newArray=[];for(var i=0;i<this.length;i++)newArray[keys[i]]=this[i];return newArray;},clear:function(){this.length=0;return this;},first:function(){return this[0];},beforeLast:function(){return this[this.length-2];},last:function(){return this[this.length-1];},addNonEmpty:function(value){if(value==undefined||value==null||value==""){return this;}
this.push(value);},addQueryString:function(name,value){if(name&&value){this.push(Encoder.encodeURL(name)+"="+Encoder.encodeURL(value));}
return this;}});Object.toQueryArray=function(o){var qs=[];for(var property in o){qs.addQueryString(property,o[property]);}
return qs;};Object.toQueryString=function(o){Object.toQueryString(o).join('&');};function $A(array){return Array.prototype.copy.call(array);};var Hashtable=new Class({initialize:function(o){this.length=0;this._h={};if($type(o)=="object"){for(var key in o){this.add(key,o[key]);}}
return this;},each:function(fn,bind){for(var key in this._h){if(this.contains(key)){fn.call(bind,key,this._h[key]);}}},addArray:function(keys,values){for(var i=0;i<keys.length;i++){this.add(keys[i],values[i]);}},add:function(key,value){if(this.contains(key)&&$type(this._h[key])!="array"){currentValue=this._h[key];this._h[key]=[currentValue];}
if(this.contains(key)&&$type(this._h[key])=="array"){this._h[key].push(value);}else{this._h[key]=value;}
this.length++;},remove:function(key){if(!this.contains(key))return;delete this._h[key];this.length--;},contains:function(key){return this._h.hasOwnProperty(key);},isEmpty:function(){return(this.length==0);},item:function(key){if(!this.contains(key))return;return this._h[key];},getKeys:function(){var keys=[];for(var key in this._h){if(this.contains(key)){keys.push(key);}}
return keys;},getValues:function(){var values=[];for(var key in this._h){if(this.contains(key)){values.push(this._h[key].toString());}}
return values;},toQueryString:function(){var s="";var delim1="=",delim2="&";for(var key in this._h){if(!this.contains(key)){continue;}
var values=this._h[key];if($type(values)=="array"){values.each(function(value){s+=key.encodeURL()+delim1+value.encodeURL()+delim2;});}
else{s+=key.encodeURL()+delim1+values.encodeURL()+delim2;}}
return s;},format:function(pattern){var s="";this.each(function(key,value){s+=String.format(pattern,key,value);});return s;}});function $H(o){return new Hashtable(o);}
Number.toArray=function(first,last){var a=[];if(first<last){for(var i=first;i<=last;i++){a.push(i);}}else{for(var i=first;i>=last;i--){a.push(i);}}
return a;};Number.toChr=function(ascii){return String.fromCharCode(ascii);};Number.extend({toChr:function(){return Number.toChr(this);},toInt:function(){return this;},toFloat:function(){return this;},isInteger:function(){return this.toString().test("^-?\\d+$")?true:false;},isPositiveInteger:function(){return(this>0);},equals:function(){return $A(arguments).test(this);},between:function(a,b){return(this>=a&&this<=b);},isOdd:function(){return(this%2==1);},isEven:function(){return(this%2==0);}});Date.now=function(){return new Date();};Date.getCentury=function(yy){return(yy>=30)?19:20;};Date.timer=function(){return new Date().getTime();};if(!Date.lastDayOfMonth){Date.lastDayOfMonth=function(yyyy,mm){var d=new Date(yyyy,mm+1,0);return d.getDate();};}
Date.format=function(dateString){var parts,mm,dd,yyyy;parts=dateString.match(/^(\d{2})(\d{2})$/);if(parts){mm=parts[1];dd=parts[2];yyyy=Date.now().getFullYear();return[mm,dd,yyyy].join("/");}
parts=dateString.match(/^(\d{2})(\d{2})(\d{2}|\d{4})$/);if(parts){mm=parts[1];dd=parts[2];yyyy=parts[3];if(yyyy.length==2){yyyy=Date.getCentury(yyyy)+yyyy;}
return[mm,dd,yyyy].join("/");}
parts=dateString.match(/^(\d{1,2})[/-](\d{2,4})$/);if(parts){mm=parts[1].padLeft(2,"0");yyyy=parts[2];if(yyyy.length==2){yyyy=Date.getCentury(yyyy)+yyyy;}
dd=Date.lastDayOfMonth(yyyy,mm.toInt()-1);return[mm,dd,yyyy].join("/");}
parts=dateString.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{2,4})$/);if(parts){mm=parts[1].padLeft(2,"0");dd=parts[2].padLeft(2,"0");yyyy=parts[3];if(yyyy.length==2){yyyy=Date.getCentury(yyyy)+yyyy;}
return[mm,dd,yyyy].join("/");}
parts=dateString.match(/^(\d{1,2})[/-](\d{1,2})$/);if(parts){mm=parts[1].padLeft(2,"0");dd=parts[2].padLeft(2,"0");yyyy=Date.now().getFullYear();return[mm,dd,yyyy].join("/");}
return dateString;};Date.formatMY=function(dateString){var parts,mm,yyyy;parts=dateString.match(/^(\d{1,2})[-/]?(\d{2}|\d{4})$/);if(parts){mm=parts[1].padLeft(2,"0");yyyy=parts[2];if(yyyy.length==2){yyyy=Date.getCentury(yyyy)+yyyy;}
return[mm,yyyy].join("/");}
return dateString;};Date.extend({lastDayOfMonth:function(){return Date.lastDayOfMonth(this.getFullYear(),this.getMonth());},getCentury:function(){if(isNaN(this.getFullYear()))return NaN;return this.getFullYear().toString().substr(0,2).toInt();}});String.format=function(pattern){for(var i=1;i<arguments.length;i++){var re=new RegExp("\\\{"+(i-1)+"\\\}","g");pattern=pattern.replace(re,arguments[i]);}
return pattern;};String.replicate=function(c,n){var s="";for(var i=0;i<n;i++){s+=c;}
return s;};String.isEmpty=function(text){if(text==null){return true;}
if(text.length==0){return true;}
return(text.trim().length==0);};String.allEmpty=function(){for(var i=0,count=arguments.length;i<count;i++){if(!String.isEmpty(arguments[i])){return false;}}
return true;};String.ascii=function(text,charPos){return text.charCodeAt(charPos);};String.chr=function(ascii){return Number.toChr(ascii);};String.extend({ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',isEmpty:function(){return String.isEmpty(this);},replicate:function(n){return String.replicate(this,n);},test:function(regex,params){return this.match(new RegExp(regex,params));},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);},camelCase:function(){return this.replace(/-\D/gi,function(match){return match.charAt(match.length-1).toUpperCase();});},capitalize:function(){return this.toLowerCase().replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},startsWith:function(s){if(this.length==0||this.length<s.length){return false;}
return(this.substr(0,s.length)==s);},endsWith:function(s){if(this.length==0||this.length<s.length){return false;}
return(this.substr(this.length-s.length)==s);},trimLeft:function(){return this.replace(/^\s*/,"");},trimRight:function(){return this.replace(/\s*$/,"");},trim:function(){return this.replace(/^\s*|\s*$/g,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(this.ScriptFragment,'img'),'');},encodeHTML:function(){return Encoder.encodeHTML(this);},decodeHTML:function(){return Encoder.decodeHTML(this);},encodeURL:function(){return Encoder.encodeURL(this);},decodeURL:function(){return Encoder.decodeURL(this);},parseFullPath:function(){var parts=this.match(/^(.*[\/\\])([^\/\\]+?)(\.(\w+))?$/);if(!parts)return null;return{path:parts[1],name:parts[2],ext:(parts[4]||"").toLowerCase()};},parseURL:function(){var parts=this.match(/^((https?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+\.[^#?\s]+)(#([\w\-]+))?(\?(.*))?/);if(!parts)return null;return{protocol:parts[2],host:parts[3],path:parts[4],file:parts[6],hash:parts[8],querystring:parts[10]};},parseQueryString:function(){var hash=new Hashtable();var match=this.trim().match(/\?(.*)$/);if(!match)return hash;var querystring=match[1];querystring.split('&').each(function(item){var keypos=item.indexOf("=");if(keypos<0){return;}
var key=item.substr(0,keypos).decodeURL();var value=item.substr(keypos+1).decodeURL();hash.add(key,value);});return hash;},toCharArray:function(){return this.split('');},padRight:function(padLength,padChar){if(!padLength||padLength<1||this.isEmpty()){return this;}
var c=(padChar==undefined||padChar==null||padChar=="")?" ":padChar;if(c.length>1){c=c.substring(0,1);}
return this+String.replicate(c,padLength-this.length);},padLeft:function(padLength,padChar){if(!padLength||padLength<1||this.isEmpty()){return this;}
var c=(typeof(padChar)=="undefined"||padChar==null||padChar=="")?" ":padChar;if(c.length>1){c=c.substring(0,1);}
return String.replicate(c,padLength-this.length)+this;},clean:function(){return this.replace(/\s\s/g,' ').trim();},replaceWith:function(findString,replaceString){var s=this;var i=-1*replaceString.length;while((i=s.indexOf(findString,i+replaceString.length))>-1){s=s.substring(0,i)+replaceString+s.substring(i+findString.length);}
return s;},equals:function(){return $A(arguments).test(this);},rgbToHex:function(array){var rgb=this.test('([\\d]{1,3})','g');if(rgb[3]==0)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(rgb[i]-0).toString(16);hex.push(bit.length==1?'0'+bit:bit);}
var hexText='#'+hex.join('');if(array)return hex;else return hexText;},hexToRgb:function(array){var hex=this.test("^[#]{0,1}([\\w]{1,2})([\\w]{1,2})([\\w]{1,2})$");var rgb=[];for(var i=1;i<hex.length;i++){if(hex[i].length==1)hex[i]+=hex[i];rgb.push(parseInt(hex[i],16));}
var rgbText='rgb('+rgb.join(',')+')';if(array)return rgb;else return rgbText;},toAscii:function(charPos){return String.ascii(this.charAt((!!charPos?charPos:0)));},toChr:function(){return String.chr(this.toInt());},isInteger:function(){return this.test("^-?\\d+$")?true:false;},isPositiveInteger:function(){if(!this.isInteger()){return false;}
return(this.toInt()>0);},isFloat:function(){var f=parseFloat(this);return(!isNaN(f));},isPositiveFloat:function(){if(!this.isFloat()){return false;}
return(this.toFloat()>0);},isSSN:function(){var area=this.substring(0,3).toInt();var group=this.substring(3,5).toInt();var serial=this.substring(5,9).toInt();if(!this.isPositiveInteger()){return false;}
if(this.length!=9){return false;}
if(isNaN(area)||isNaN(group)||isNaN(serial)){return false;}
if(area.equals(0,666)||area>=773){return false;}
if(area>=734&&area<=749){return false;}
if(group==0||serial==0){return false;}
return true;},toDate:function(){var parts=this.test("^(\\d{1,2})/(\\d{1,2})/(\\d{4})$");if(!parts){return null;}
var mm=parts[1].toInt()-1;var dd=parts[2].toInt();var yyyy=parts[3].toInt();var dt=new Date(yyyy,mm,dd);if(isNaN(dt.getDay()))return null;if(yyyy==dt.getFullYear()&&mm==dt.getMonth()&&dd==dt.getDate()){return dt;}else{return null;}},isDate:function(){var dt=this.toDate();return(dt!=null);},isDateMY:function(){var parts=this.test("^(\\d{1,2})/(\\d{4})$");if(!parts){return false;}
var mm=parts[1].toInt(),yyyy=parts[2].toInt();if(!mm.between(1,12)){return false;}
if(yyyy<1900){return false;}
return true;},toTime:function(){var parts=this.test("^(\\d{1,2}):(\\d{1,2})(:(\\d{1,2}))?\\s?(AM|PM)?$","i");if(!parts)return null;var hh=parts[1].toInt();var mi=parts[2].toInt();var ss=(parts[4])?parts[4].toInt():0;var ampm=(parts[5])?parts[5].toUpperCase():null;if(ampm!=null&&!hh.between(1,12)){return null;}
if(ampm==null&&!hh.between(0,23)){return null;}
if(!mi.between(0,59)){return null;}
if(!ss.between(0,59)){return null;}
if(ampm=="AM"&&hh==12){hh=0;}
else if(ampm=="PM"&&hh<12){hh+=12;}
return new Date(0,0,1,hh,mi,ss);},isTime:function(){return(this.toTime())?true:false;}});window.extend=Object.extend;window.extend({disableImageCache:function(){if(window.ActiveXObject)document.execCommand("BackgroundImageCache",false,true);},setFocus:function(control,message){var o=$(control);if(o&&o.setFocus){o.setFocus(message);}
return false;},getWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;},getHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;},getScrollHeight:function(){return(document.all)?document.body.clientHeight:document.documentElement.scrollHeight;},getScrollWidth:function(){return(document.all)?document.body.clientWidth:document.documentElement.scrollWidth;},getScrollTop:function(){return document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset||0;},getScrollLeft:function(){return document.body.scrollLeft||document.documentElement.scrollLeft||window.pageXOffset||0;},onDomReady:function(init){var state=document.readyState;if(state&&document.childNodes&&!document.all&&!navigator.taintEnabled){if(state.test(/loaded|complete/))return init();else return Window.onDomReady.pass(init).delay(100);}else if(state&&window.ActiveXObject){var script=$('_ie_ready_');if(!script)document.write("<script id='_ie_ready_' defer='true' src='://'></script>");$('_ie_ready_').addEvent('readystatechange',function(){if(this.readyState=='complete')init();});return;}else{var myInit=function(){if(arguments.callee.done)return;arguments.callee.done=true;init();};window.addEvent("load",myInit);document.addEvent("DOMContentLoaded",myInit);}}});var Element=new Class({initialize:function(el){if($type(el)=='string')el=document.createElement(el);return $(el);},hasClass:function(className){return!!this.className.test("\\b"+className+"\\b");},addClass:function(className){if(!this.hasClass(className)){this.className=(this.className+' '+className).clean();}
return this;},removeClass:function(className){if(this.hasClass(className)){var re=new RegExp("\\b"+className.trim()+"\\b");this.className=this.className.replace(re,"").clean();}
return this;},toggleClass:function(className){if(this.hasClass(className)){return this.removeClass(className);}
else{return this.addClass(className);}},setStyle:function(property,value){if(property=='opacity'){this.setOpacity(parseFloat(value));}
else{this.style[property.camelCase()]=value;}
return this;},setStyles:function(source){if($type(source)=='object'){for(var property in source)this.setStyle(property,source[property]);}else if($type(source)=='string'){if(window.ActiveXObject){this.cssText=source;}
else{this.setAttribute('style',source);}}
return this;},setOpacity:function(opacity){if(opacity==0){if(this.style.visibility!="hidden")this.style.visibility="hidden";}else{if(this.style.visibility!="visible")this.style.visibility="visible";}
if(window.ActiveXObject)this.style.filter="alpha(opacity="+opacity*100+")";this.style.opacity=opacity;return this;},getStyle:function(property){var proPerty=property.camelCase();var style=this.style[proPerty]||false;if(!style){if(document.defaultView)style=document.defaultView.getComputedStyle(this,null).getPropertyValue(property);else if(this.currentStyle)style=this.currentStyle[proPerty];}
if(style&&['color','backgroundColor','borderColor'].test(proPerty)&&style.test('rgb'))style=style.rgbToHex();return style;},addEvent:function(action,fn){this[action+fn]=fn.bind(this);if(this.addEventListener){this.addEventListener(action,fn,false);}
else{if(action=="click"){this.onclick=fn;}else{this.attachEvent('on'+action,this[action+fn]);}}
var el=this;if(this!=window)Unload.functions.push(function(){el.removeEvent(action,fn);el[action+fn]=null;});return this;},removeEvent:function(action,fn){if(this.removeEventListener)this.removeEventListener(action,fn,false);else this.detachEvent('on'+action,this[action+fn]);return this;},setProperty:function(property,value){var el=false;switch(property){case'class':this.className=value;break;case'style':this.setStyles(value);break;case'name':if(window.ActiveXObject&&this.getTag()=='input'){el=$(document.createElement('<input name="'+value+'" />'));$A(this.attributes).each(function(attribute){if(attribute.name!='name')el.setProperty(attribute.name,attribute.value);});if(this.parentNode)this.replaceWith(el);};default:this.setAttribute(property,value);}
return el||this;},setProperties:function(source){for(var property in source)this.setProperty(property,source[property]);return this;},setHTML:function(html){this.innerHTML=html;return this;},getText:function(){return this.textContent||this.innerText;},getProperty:function(property){return this.getAttribute(property);},getTag:function(){return this.tagName.toLowerCase();},getOffset:function(what){what=what.capitalize();var el=this;var offset=0;do{offset+=el['offset'+what]||0;el=el.offsetParent;}while(el);return offset;},getTop:function(){return this.getOffset('top');},getLeft:function(){return this.getOffset('left');},getWidth:function(){var w=parseInt(this.getStyle('width'),10);if(isNaN(w)){w=this.offsetWidth||this.clientWidth;}
return w;},visible:function(){if(typeof(this.style)!="undefined"){if(typeof(this.style.display)!="undefined"){return this.style.display!='none';}
if(typeof(this.style.visibility)!="undefined"){return this.style.visibility!='hidden';}}
return true;},toggle:function(){this[this.visible()?'hide':'show']();return this;},hide:function(){if(typeof(this.style)!="undefined"){if(typeof(this.style.display)!="undefined"){this.style.display='none';}
if(typeof(this.style.visibility)!="undefined"){this.style.visibility='hidden';}}
return this;},show:function(){if(typeof(this.style)!="undefined"){if(typeof(this.style.display)!="undefined"){this.style.display='';}
if(typeof(this.style.visibility)!="undefined"){this.style.visibility='visible';}}
var opacity=this.getStyle("opacity");if(typeof(opacity)!="undefined"&&opacity!=1){this.setOpacity(1);}
return this;}});new Object.Native(Element);Element.extend({hasClassName:Element.prototype.hasClass,addClassName:Element.prototype.addClass,removeClassName:Element.prototype.removeClass,toggleClassName:Element.prototype.toggleClass});Element.isInVisibleContainer=function(control){if(typeof(control.style)!="undefined"&&((typeof(control.style.display)!="undefined"&&control.style.display=="none")||(typeof(control.style.visibility)!="undefined"&&control.style.visibility=="hidden"))){return false;}
else if(typeof(control.parentNode)!="undefined"&&control.parentNode!=null&&control.parentNode!=control){return Element.isInVisibleContainer(control.parentNode);}
return true;};function $Element(el,method,args){if($type(args)!='array')args=[args];return Element.prototype[method].apply(el,args);};window.addEvent=document.addEvent=Element.prototype.addEvent;window.removeEvent=document.removeEvent=Element.prototype.removeEvent;var Unload={elements:[],functions:[],vars:[],unload:function(){Unload.functions.each(function(fn){fn();});window.removeEvent('unload',window.removeFunction);Unload.elements.each(function(el){try{for(var p in Element.prototype){window[p]=null;document[p]=null;el[p]=null;}
el.extend=null;}catch(e){}});}};window.removeFunction=Unload.unload;window.addEvent('unload',window.removeFunction);var FormElement=new Class({getValue:function(){var value;switch(this.getTag()){case'select':value="";if(this.type=="select-one"){if(this.selectedIndex!=-1){value=this.options[this.selectedIndex].value;}}else{var values=[];for(var i=0,len=this.options.length;i<len;i++){var o=this.options[i];if(o.selected){values.push(o.value);}}
if(values.length==1){value=values[0];}
else if(values.length>1){value=values;}}
break;case'input':if(this.type.equals("file","hidden","password","text")||(this.type.equals("checkbox","radio")&&this.checked))
{value=this.value;}
break;case'textarea':value=this.value;break;}
return value;},toQueryString:function(sendEmptyValues){var name=this.name;var value=this.getValue();var qs=[];if(!(name&&value)&&!sendEmptyValues){return"";}
if($type(value)=="array"){value.each(function(item){qs.push(name.encodeURL()+"="+item.encodeURL());});}else{qs.push(name.encodeURL()+"="+value.encodeURL());}
return qs.join("&");},setFocus:function(message){if(this.type=="hidden"){return;}
if(typeof(this.disabled)!="undefined"&&this.disabled==true){return;}
if(!Element.isInVisibleContainer(this)){return;}
if(this.select){this.select();}
if(this.focus){this.focus();}
if(message){var isTextBox=(this.type=="text"||this.type=="password");if(isTextBox){this.removeEvent("blur",Type.onBlur);}
alert(message);if(isTextBox){this.addEvent("blur",Type.onBlur);}}},isEmpty:function(){return this.getValue().isEmpty();},isInteger:function(){return this.getValue().isInteger();},isPositiveInteger:function(){return this.getValue().isPositiveInteger();},isFloat:function(){return this.getValue().isFloat();},isPositiveFloat:function(){return this.getValue().isPositiveFloat();},isSSN:function(){return this.getValue().isSSN();}});var Form=new Class({toQueryArray:function(sendEmptyValues){var qs=[];var a=this.elements;for(var i=0,count=a.length;i<count;i++){var o=$(a[i]);if(!o.name||o.tagName=="FIELDSET"||o.name=="__ACTION"){continue;}
qs.addNonEmpty(o.toQueryString(sendEmptyValues));}
return qs;},toQueryString:function(requestData){return toQueryArray.join("&");},toUpperCase:function(){var a=this.elements;for(var i=0,count=a.length;i<count;i++){var o=$(a[i]);if(!o.name||o.tagName=="FIELDSET"||o.name=="__ACTION"){continue;}
if(o.className.search(/UpperCase/i)>=0){o.value=o.value.toUpperCase();}}}});Form.doGet=function(url,fields,target){Form.doMethod("GET",url,fields,target);};Form.doPost=function(url,fields,target){Form.doMethod("POST",url,fields,target);};Form.doMethod=function(method,url,fields,target){var i,f=document.createElement("FORM");f.action=url;f.method=method;if(target){f.target=target;}
if(fields){var h=[];for(var item in fields){h.push(Form.buildInputHidden(item,fields[item]));}
f.innerHTML=h.join("\n");}
else if((i=url.indexOf('?'))>=0){fields=url.substr(url.indexOf('?')+1);f.innerHTML=Form.toInputHidden(fields);}
document.body.appendChild(f);f.submit();};Form.buildInputHidden=function(name,value){function encodeValue(value){if(typeof(value)=="undefined"){value="";}
if(typeof(value)!="string"){value=value.toString();}
return value.replace(/"/g,'&quot;').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
return'<input type=hidden name="'+encodeValue(name)+'" value="'+encodeValue(value)+'">';};Form.toInputHidden=function(requestData){var qs=requestData.split("&");var h=[];for(var i=0,count=qs.length;i<count;i++){var o=qs[i].split('=');var name=o[0]?o[0].decodeURL():null;var value=o[1]?o[1].decodeURL():null;if(!(name||value)){continue;}
if($type(value)!="array"){h.push(Form.buildInputHidden(name,value));}
else{for(var j=0;j<value.length;j++)
{h.push(Form.buildInputHidden(name,value[j]));}}}
return h.join("\n");};Form.ListBoxToString=function(list){var o=list.options;var h=[];for(var i=0,count=o.length;i<count;i++){h.push(o[i].value);}
return h.join(",");};function $(el){if($type(el)=='string')el=document.getElementById(el);if($type(el)=='element'){if(!el.extend){Unload.elements.push(el);el.extend=Object.extend;el.extend(Element.prototype);if(el.getTag().equals("select","input","textarea")){el.extend(FormElement.prototype);}
else if(el.getTag().equals("form")){el.extend(Form.prototype);}}
return el;}
else if($type(el)=='object'){return el;}
else{return null;}};Element.extend({getElements:function(selector){var filters=[];selector.clean().split(' ').each(function(sel,i){var bits=sel.test('^(\\w*|\\*)(?:#([\\w_-]+)|\\.([\\w_-]+))?(?:\\[["\']?(\\w+)["\']?(?:([\\*\\^\\$]?=)["\']?(\\w*)["\']?)?\\])?$');if(!bits)return;if(!bits[1])bits[1]='*';var param=bits.remove(bits[0]).associate(['tag','id','class','attribute','operator','value']);if(i==0){if(param['id']){var el=this.getElementById(param['id']);if(!el||((param['tag']!='*')&&($Element(el,'getTag')!=param['tag'])))return;filters=[el];}else{filters=$A(this.getElementsByTagName(param['tag']));}}else{filters=$Elements(filters).filterByTagName(param['tag']);if(param['id'])filters=$Elements(filters).filterById(param['id']);}
if(param['class'])filters=$Elements(filters).filterByClassName(param['class']);if(param['attribute'])filters=$Elements(filters).filterByAttribute(param['attribute'],param['value'],param['operator']);},this);filters.each(function(el){$(el);});return $Elements(filters);},getElementById:function(id){var el=document.getElementById(id);if(!el)return false;for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent)return false;}
return el;},getElement:function(selector){return this.getElementsBySelector(selector)[0];},getElementsBySelector:function(selector){var els=[];selector.split(',').each(function(sel){els.extend(this.getElements(sel));},this);return $Elements(els);}});document.extend=Object.extend;document.extend({getElementsByClassName:function(className){return document.getElements('.'+className);},getElement:Element.prototype.getElement,getElements:Element.prototype.getElements,getElementsBySelector:Element.prototype.getElementsBySelector});function $S(){var els=[];$A(arguments).each(function(sel){if($type(sel)=='string')els.extend(document.getElementsBySelector(sel));else if($type(sel)=='element')els.push($(sel));});return $Elements(els);};var $$=$S;function $E(selector,filter){return($(filter)||document).getElement(selector);};function $ES(selector,filter){return($(filter)||document).getElementsBySelector(selector);};function $Elements(elements){return Object.extend(elements,new Elements);};var Elements=new Class({action:function(actions){this.each(function(el){el=$(el);if(actions.initialize)actions.initialize.apply(el);for(var action in actions){var evt=false;if(action.test('^on[\\w]{1,}'))el[action]=actions[action];else if(evt=action.test('([\\w-]{1,})event$'))el.addEvent(evt[1],actions[action]);}});},filterById:function(id){var found=[];this.each(function(el){if(el.id==id)found.push(el);});return found;},filterByClassName:function(className){var found=[];this.each(function(el){if($Element(el,'hasClass',className))found.push(el);});return found;},filterByTagName:function(tagName){var found=[];this.each(function(el){found.extend($A(el.getElementsByTagName(tagName)));});return found;},filterByAttribute:function(name,value,operator){var found=[];this.each(function(el){var att=el.getAttribute(name);if(!att)return;if(!operator)return found.push(el);switch(operator){case'*=':if(att.test(value))found.push(el);break;case'=':if(att==value)found.push(el);break;case'^=':if(att.test('^'+value))found.push(el);break;case'$=':if(att.test(value+'$'))found.push(el);}});return found;}});new Object.Native(Elements);var Effects={};Effects.Effect=function(){this.init();this.chain=null;}
Effects.Effect.prototype={init:function(){var this_=this;this._timeoutFunction=function(){this_.run();};this.reset();},run:function(){var timeout=this.processStep();if(timeout)
setTimeout(this._timeoutFunction,timeout);else if(this.chain)
this.chain();},processStep:function(){},reset:function(){},setAfter:function(afterFunc){this.chain=afterFunc;},getAfter:function(){return this.chain;}}
Effects.SteppedChangeEffect=function(steps,interval,speed){Effects.Effect.call(this);this._maxSteps=steps;this._interval=interval;this._speed=speed||Effects.Speed.constant;}
Effects.SteppedChangeEffect.prototype=new Effects.Effect();Effects.SteppedChangeEffect.prototype.reset=function(){this._currentStep=0;}
Effects.SteppedChangeEffect.prototype.run=function(){if(this._currentStep>=this._maxSteps)
return;var ret=this.processStep(this._currentStep);if(ret===false)
return;this._currentStep++;if(this._currentStep<this._maxSteps)
setTimeout(this._timeoutFunction,this._interval);else
if(this.chain)
this.chain();}
Effects.SteppedChangeEffect.prototype.getCurrentStep=function(){return this._currentStep;}
Effects.SteppedChangeEffect.prototype.getInterval=function(){return this._interval;}
Effects.SteppedChangeEffect.prototype.getSteps=function(){return this._maxSteps;}
Effects.SteppedChangeEffect.prototype.setSpeed=function(speed){this._speed=speed||Effects.speed.constant;}
Effects.UP=0;Effects.DOWN=1;Effects.LEFT=2;Effects.RIGHT=3;Effects.Horizontal=0;Effects.Vertical=1;Effects.Speed=new Object();Effects.Speed.constant=function(x){return x;}
Effects.Speed.sineFull=function(x){return(Math.sin(Math.PI*(x-0.5))+1)/2;}
Effects.Speed.sineUp=function(x){return Math.sin(Math.PI*(x-1)/2)+1;}
Effects.Speed.sineDown=function(x){return Math.sin(Math.PI*x/2);}
Effects.FadeEffect=function(steps,interval,speed){Effects.SteppedChangeEffect.call(this,steps,interval,speed||Effects.Speed.constant);}
Effects.FadeEffect.prototype=new Effects.SteppedChangeEffect();Effects.FadeEffect.prototype.processStep=function(step){var pct=this._speed((step+1)/this.getSteps());var o=this.fadeFrom+(this.fadeTo-this.fadeFrom)*pct;if(this.element.stopEffect){return;}
this.element.style.opacity=""+o;this.element.style.filter="alpha(opacity="+o*100+")";}
Effects.FadeEffect.prototype.setElement=function(element){this.element=element;}
Effects.FadeEffect.prototype.getElement=function(){return this.element;}
Effects.FadeEffect.prototype.apply=function(element,fadeFrom,fadeTo){this.setElement(element);this.fadeFrom=fadeFrom;this.fadeTo=fadeTo;this.reset();this.run();}
Effects.ScrollEffect=function(steps,interval,speed){Effects.SteppedChangeEffect.call(this,steps,interval,speed||Effects.Speed.sineDown);}
Effects.ScrollEffect.prototype=new Effects.SteppedChangeEffect();Effects.ScrollEffect.prototype.apply=function(element,direction,distance){this.setElement(element);this.setDistance(distance);this.setDirection(direction);this.reset();this.run();}
Effects.ScrollEffect.prototype.setElement=function(element){this.element=element;}
Effects.ScrollEffect.prototype.setDirection=function(direction){this.direction=direction;}
Effects.ScrollEffect.prototype.setDistance=function(distance){this.distance=distance;}
Effects.ScrollEffect.prototype.getElement=function(){return this.element;}
Effects.ScrollEffect.prototype.getDirection=function(){return this.direction;}
Effects.ScrollEffect.prototype.getDistance=function(){return this.distance;}
Effects.ScrollEffect.prototype.isVertical=function(){return this.getDirection()==Effects.UP||this.getDirection()==Effects.DOWN;}
Effects.ScrollEffect.prototype.isPositive=function(){return this.getDirection()==Effects.DOWN||this.getDirection()==Effects.RIGHT;}
Effects.ScrollEffect.prototype.processStep=function(step){if(step==0){this.initialPosition=this.isVertical()?this.getElement().scrollTop:this.getElement().scrollLeft;}
var pctComplete=(step+1)/this.getSteps();pctComplete=this._speed(pctComplete);var newPos=this.initialPosition+Math.round((this.isPositive()?1:-1)*this.getDistance()*pctComplete);if(this.isVertical()){this.getElement().scrollTop=newPos;}
else{this.getElement().scrollLeft=newPos;}}
Effects.MoveEffect=function(steps,interval,speed){Effects.SteppedChangeEffect.call(this,steps,interval,speed||Effects.Speed.sineFull);}
Effects.MoveEffect.prototype=new Effects.SteppedChangeEffect();Effects.MoveEffect.prototype.setElement=function(element){this.element=element;}
Effects.MoveEffect.prototype.getElement=function(){return this.element;}
Effects.MoveEffect.prototype.apply=function(element,fromLeft,fromTop,toLeft,toTop){this.setElement(element);this.fromLeft=fromLeft;this.fromTop=fromTop;this.toLeft=toLeft;this.toTop=toTop;this.reset();this.run();}
Effects.MoveEffect.prototype.processStep=function(step){var pct=this._speed((step+1)/this.getSteps());var newLeft=this.fromLeft+Math.round((this.toLeft-this.fromLeft)*pct);var newTop=this.fromTop+Math.round((this.toTop-this.fromTop)*pct);this.getElement().style.left=newLeft+"px";this.getElement().style.top=newTop+"px";}
function SampleEffect(){Effects.SteppedChangeEffect.call(this,10,500);}
SampleEffect.prototype=new Effects.SteppedChangeEffect();SampleEffect.prototype.processStep=function(step){alert(this._speed(step));}
Element.extend({fadeIn:function(steps){this.stopEffect=false;if(!steps)steps=20;var interval=50,min=1,max=0;var ef=new Effects.FadeEffect(steps,interval);var el=this;ef.setAfter(function(){el.hide();});ef.apply(this,min,max);return this;},fadeOut:function(steps){this.stopEffect=false;if(!steps)steps=20;var interval=50,min=0,max=0.88;this.show();new Effects.FadeEffect(steps,interval).apply(this,min,max);return this;}});var Page={targetDiv:null,adjustHelp:false,DIV_HELP:"_HELP_DIV_POPUP",divHelp:null,helpDisplay:false,labels:null,showHelp:function(){var o=$(this.DIV_HELP);this.divHelp=o;o.stopEffect=true;o.show();this.adjustHelp=true;this.adjustHelpPosition();},hideHelp:function(){this.adjustHelp=false;},adjustHelpPosition:function(){if(!this.adjustHelp){return;}
var o=this.divHelp;if(!o){return;}
var dx,dy;if(document.all){dx=0;dy=0;}else{dx=0;dy=7;}
var top=window.getScrollTop()-dx;var left=window.getScrollLeft()+window.getScrollWidth()-o.getWidth()-dy;o.style.top=top + "px";o.style.left=left + "px";window.setTimeout("Page.adjustHelpPosition();",10);},resizeHelp:function(){var o=this.divHelp;if(!o){return;}
o.fadeOut(25);o.stopEffect=false;var dx,dy;if(document.all){dx=0;dy=0;}else{dx=0;dy=5;}
if(this.helpDisplay){o.style.width="55px";o.style.height = "14px";$("_POPUP_HELP_CONTENT").hide();$("_POPUP_HELP_TITLE").innerHTML="Help <span style='writing-mode: tb-rl;'>&raquo;</span>";this.helpDisplay=false;}else{o.style.width="450px";o.style.height="120px";$("_POPUP_HELP_CONTENT").show();this.helpDisplay=true;$("_POPUP_HELP_TITLE").innerHTML="Help <span style='writing-mode: tb-rl;'>&laquo;</span>";}},hideDropDowns:function(){if(!N&&version<7){$$("select").each(function(select){select.hide()});}},showDropDowns:function(){if(!N&&version<7){$$("select").each(function(select){select.show()});}},closeLayerWindow:function(windowName){$(windowName).hide();this.showDropDowns();},showLayerWindow:function(linkClicked,windowName){__ID_LAYER_WINDOW=windowName;this.hideDropDowns();var windowM=$(windowName)
windowM.show();this.activeWindowLayer(windowName);},activeWindowLayer:function(windowName){__ID_LAYER_WINDOW=windowName;$S("div.containerPopup").each(function(winPopup){if(winPopup.id!=__ID_LAYER_WINDOW){winPopup.style.zIndex=0;$S("#"+winPopup.id+" table.windowPopupCE").each(function(tablec){tablec.className="iwindowPopupCE";})
$S("#"+winPopup.id+" table.iwindowPopupCE").each(function(tablec){tablec.className="iwindowPopupCE";})}else{$S("#"+__ID_LAYER_WINDOW+" table.windowPopupCE").each(function(tablec){tablec.className="windowPopupCE";})
$S("#"+__ID_LAYER_WINDOW+" table.iwindowPopupCE").each(function(tablec){tablec.className="windowPopupCE";})}});},getLabelCaption:function(obj){if(!this.labels){this.labels=this.getLabels();}
return this.labels.item(obj.id);},getLabels:function(){var a=document.getElementsByTagName("label");var h=new Hashtable();for(var i=0,count=a.length;i<count;i++){var o=a[i];var id=o.htmlFor;var value=o.textContent||o.innerText;if(id&&value){h.add(id,value);}}
return h;},loadMaxLength:function(){var objects=document.getElementsByTagName("textarea");if(!(objects&&objects.length>0)){return;}
for(var i=0,count=objects.length;i<count;i++){var o=objects[i],maxl;if((maxl=o.getAttribute("maxlength"))!=null){o.maxlength=maxl;o=$(o);o.addEvent("keydown",Type.enforceMaxLength);o.addEvent("keyup",Type.enforceMaxLength);}}},validateDBPR:function(sPage,sNameControl){var ObjAjax;var ObjControl,sUrl;var f=document.frmCETrainingDtl;ObjControl=document.getElementById(sNameControl);ObjAjax=false;if(ObjControl.value!=""){if(window.XMLHttpRequest){ObjAjax=new XMLHttpRequest();}else if(window.ActiveXObject){ObjAjax=new ActiveXObject("Microsoft.XMLHTTP");}
if(ObjAjax!=null){sUrl=sPage+'_ajax.axd';ObjAjax.open('POST',sUrl,false);ObjAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');ObjAjax.send(sNameControl+'='+ObjControl.value);if(ObjAjax.status==200&&ObjAjax.readyState==4&&ObjAjax.responseText=='False'){alert("The DBPR Number "+ObjControl.value+" is Invalid");ObjControl.focus();return}}}}};var __ID_LAYER_WINDOW="";
