_undefined_='!!undefined!!';function $any(){for(var i=0;i<arguments.length;i++)
if($chk(arguments[i]))
return true;return false;};var $deepExtend=Object.deepExtend=function()
{var args=arguments;if(args.length==1)
args=[this,args[0]];else
{if(!args[0])
args[0]={};if(!args[1])
return args[0];}
for(var property in args[1])
{if($type(args[0][property])=='object'&&$type(args[1][property])=='object')
$deepExtend(args[0][property],args[1][property]);else if($type(args[0][property])=='array'&&$type(args[1][property])=='array')
args[0][property].extend(args[1][property]);else
args[0][property]=args[1][property];}
return args[0];};function $deepCopy(o)
{var t=$type(o);var rtn=o;if(t=='array')
{rtn=[];for(var i=0;i<o.length;i++)
rtn.push($deepCopy(o[i]));}
else if(t=='object')
{rtn={};for(var i in o)
rtn[i]=$deepCopy(o[i]);}
return rtn;}
function $fn(fn,bind)
{var fnType=$type(fn);if(fnType=='string')
{try{fn=eval(fn);fnType=$type(fn);}
catch(e){}}
if(fnType!='function'&&fnType!='class')
fn=function(){return arguments[0];};if(bind)
return fn.bind(bind);else
return fn;};
function checkValidJSON(check,keys)
{for(var i in keys)
{try
{var evald=false;if(!check[i].length)
continue;eval('evald = '+check[i]);if($type(evald)!='object')
{alert('Error: The '+keys[i]+' JSON could be parsed but is not an object ('+$type(evald)+').');$log(evald)
return false;}}
catch(e)
{alert('Error: The '+keys[i]+' JSON is invalid.');return false;}}
return true;}
function $processEval(o)
{var t=$type(o);if(t=='string')
return o.processEval();else if(t=='array')
{for(var i=0;i<o.length;i++)
o[i]=$processEval(o[i]);}
else if(t=='object')
{for(var i in o)
o[i]=$processEval(o[i]);}
return o;}
function $log(){if(!window.console)return;for(var i=0;i<arguments.length;i++)
console.log(arguments[i]);}
function isSimpleType(v){var t=$type(v);switch(t){case'string':case'number':case'boolean':return true;default:{if(v==null||v==undefined)return true;return false;}}}
function strictCompare(){if(!arguments.length)return false;if(arguments.length==1)return true;if(arguments.length==2&&arguments[0]!=arguments[1])return false;var i=1;var emptyString=false;var zeroNumber=false;if(typeof arguments[0]=='string'&&arguments[0]=='')emptyString=true;if(typeof arguments[0]=='number'&&arguments[0]==0)zeroNumber=true;while(i<arguments.length){if(arguments[i-1]!=arguments[i])return false;if(typeof arguments[i]=='string'&&arguments[i]=='')emptyString=true;if(typeof arguments[i]=='number'&&arguments[i]==0)zeroNumber=true;i++;}
if(emptyString&&zeroNumber)return false;return true;}
function isDefined(v)
{if(v==undefined)return false;else return true;}
function returnConstant(x)
{return x;}
function ignore()
{return true;}
function formatValue(value,format,incHTML,ifEmptyThenNBSP){format=format.split('-');switch(format[0]){case'$':case'dollars':if(value.to$)return value.to$(true,incHTML);return value;case'mins':if(isString(value))var value=parseFloat(value);if(!isNumeric(value))return value;return value.toHours(true);case'%':case'percent':if(value.toPercent)return value.toPercent();return value;case'date':if($type(value)!='date')return value;return value.format(format[1]||'short');case'datetime':if($type(value)!='date')return value;return value.format(format[1]||'short')+' '+value.format(format[2]||'12hr');case'time':if($type(value)!='date')return value;return value.format(format[1]||'12hr');case'day':if($type(value)!='date')return value;return value.format('day');case'boolean':if(value)return(format[1]||'Yes');else return(format[2]||'No');case'number':return String(value);case'url':if(value&&value!='')return'<a href="'+value+'">'+value+'</a>';case'url-popup':if(value&&value!='')return'<a href="'+value+'" target="_blank">'+value+'</a>';default:if(ifEmptyThenNBSP&&isString(value))return value||"&nbsp;";else return value;}}
function dataToHTML(data,fromRecur){var tag=(fromRecur)?'span':'div';switch($type(data))
{case'string':return'<'+tag+' style="color: #0e4889;">"'+data+'"</'+tag+'>';case'boolean':return'<'+tag+'><em>'+data+'</em></'+tag+'>';case'number':return'<'+tag+' style="color: #ca000a;">'+data+'</'+tag+'>';}
if($type(data)=='date')return'<'+tag+' style="color: #009f7b;">'+data.format('timestamp')+'</'+tag+'>';if(isArray(data)){var rtn='<'+tag+'>Array: [</'+tag+'><div style="padding-left: 20px;">';data.each(function(obj,i){rtn+=dataToHTML(obj,true);if(i<data.length-1)rtn+=',<br>';});return rtn+'</div>]</'+tag+'>';}
if(isIndexedStruct(data)){var rtn='<'+tag+'>Indexed Struct: [</'+tag+'><div style="padding-left: 20px;">';data.indexedEach(function(i,key){rtn+='<div><strong>'+key+':</strong> '+dataToHTML(i,true)+'</div>';});return rtn+'</div>]</'+tag+'>';}
if(isObject(data)){var rtn='';if(fromRecur)rtn+='<'+tag+'>Object: {</'+tag+'><div style="padding-left: 20px;">';for(var key in data){if(!isFunction(data[key])){rtn+='<div><strong>'+key+':</strong> '+dataToHTML(data[key],true)+'</div>';}}
if(fromRecur)rtn+='</div>}</'+tag+'>';return rtn;}
return'';}
var classFunctions={getLoader:function(data){if(!this.def.loader)return false;var rtn=this.getSendObject(this.def.loader,this.key);$extend(rtn,this.def.loaderParameters);rtn=$processEval($deepCopy(rtn));return rtn;},getSaver:function(data){if(!this.def.saver)return false;var rtn=this.getSendObject(this.def.saver,this.key);$extend(rtn,$deepCopy(this.def.saverParameters));rtn=$processEval(rtn);return rtn;},getSendObject:function(action,rtnKey){if(isString(action))var send={action:action};else if(isObject(action))var send=action;else return null;if(rtnKey)send.rtnKey=rtnKey;if(this.def.passScreenParameters)send.extend(thisScreen.parameters,true);if(this.def.passViewArguments)
{for(p in view.arguments)
{if(!(p in Object.prototype)&&(p in view.def.arguments))
send[p]=$deepCopy(view.arguments[p]);}}
return send;}}
Browser.Features.fadeSlicesWhileResizing=!(Browser.Engine=='gecko'&&version<=18);(function(){Browser.flashInstalled=false;var checkVersion=(Browser.Engine.ie)?function(v)
{try{var flash=new ActiveXObject(("ShockwaveFlash.ShockwaveFlash."+v));return true;}
catch(e){}
return false;}:function(v)
{var flash=navigator.plugins["Shockwave Flash"];if(flash)
{var flashVersion=navigator.plugins["Shockwave Flash"].description.replace(/.*(\d+\.\d+).*/,"$1");if(flashVersion>=v)
return true;}
return false;};Browser.flash9=checkVersion(9);if(Browser.flash9)
Browser.flashVersion=9;Browser.flash8=checkVersion(8);if(Browser.flash8&&!Browser.flashVersion)
Browser.flashVersion=8;Browser.flash7=checkVersion(7);if(Browser.flash7&&!Browser.flashVersion)
Browser.flashVersion=7;Browser.flash6=checkVersion(6);if(Browser.flash6&&!Browser.flashVersion)
Browser.flashVersion=6;Browser.flashInstalled=Browser.flashVersion>0;})();
Array.alias('erase','remove');Element.alias('dispose','remove');Element.implement({getText:function(){return this.get('text');},setText:function(text){return this.set('text',text);},setHTML:function(){return this.set('html',arguments);},getHTML:function(){return this.get('html');},getTag:function(){return this.get('tag');}});$E=document.getElement.bind(document);
Element.implement({setStyles:function(source)
{styles=$A(arguments).flatten().clean();if(styles.length>1)
{var types=[];var cssText='';for(var i=0;i<styles.length;i++)
{types[i]=$type(styles[i]);if(styles[i]===true)
cssText+=this.style.cssText;else if(types[i]=='string')
cssText+=arguments[i];}
if(cssText!=this.style.cssText)
this.style.cssText=cssText;for(var i=0;i<styles.length;i++)
{if(types[i]=='object')
{for(var style in styles[i])
this.setStyle(style,styles[i][style]);}}}
else if(source&&styles[i]!==true)
{switch($type(source))
{case'object':for(var style in source)
this.setStyle(style,source[style]);break;case'string':this.style.cssText=source;break;}}
return this;},unselectable:function()
{this.setStyle('-moz-user-select','none').setStyle('-khtml-user-select','none').setProperty('unselectable','on').onselectstart=function(){return false;};return this;},hideFocus:function()
{return this.setProperty('hideFocus',true).setStyle('outline','none');},isVisible:function()
{if(this.style.visibility=='hidden'||this.style.display=='none'||this.getStyle('opacity')==0||!this.offsetHeight)
return false;else
return true;},hide:function()
{if(this.style.display=='none')
return this;if(this.style.display&&this.style.display.length)
this._displayStyle=this.style.display;this.style.display='none';return this;},show:function()
{if(this.style.visibility!='visible')
this.style.visibility='visible';if(this.style.display!='none')
return this;if(this._displayStyle)
this.style.display=this._displayStyle;else
this.style.display='';return this;},showIf:function(b)
{if(b)return this.show();else return this.hide();},morphOnHover:function(normal,hover,options)
{if($type(options)!='object')
options={duration:300};this.set('morph',options).setStyles(normal).addEvent('mouseenter',function(){this.morph(hover);}).addEvent('mouseleave',function(){this.morph(normal);})
return this;},insertFlash:function(src,width,height,id,paramsObj,version)
{if(window.Browser.Plugins.Flash.version<=7)
{if(confirm("You don't have Adobe Flash Player version 8 (or above) installed. You need this player to watch the exercise videos. Would you like to download Flash Player now?\n\n"+"(the Adobe Flash Player download page will open in a new window if you click 'ok'. Follow the instructions, then when installation is successful close the window to return here.)"))
{window.open('http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash');}
return this;}
while(!id||!id.length||$(id))
id='flashmovie_'+new Date().getTime();var obj='<object'+((Browser.Engine.trident)?' id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="'+src+'"':'');obj+=' width="'+width+'"';obj+=' height="'+height+'"';obj+='>';var params='<param name="movie" value="'+src+'">';var wmode='';if(!Browser.Platform.mac){params+='<param name="wmode" value="opaque">';wmode='wmode="opaque"';}
var attributes='';for(var i in paramsObj)
{params+='<param name="'+i+'" value="'+paramsObj[i]+'">';attributes+=' '+i+'="'+paramsObj[i]+'"';}
var embed='<embed id="'+id+'" src="'+src+'" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"'+attributes+wmode+' ></embed>';var objEnd='</object>';return this.setHTML(obj+params+embed+objEnd);}});
Element.backgroundStub={show:$empty,hide:$empty,fade:$empty,remove:$empty,$el:new Element('div')};Element.implement({getBackground:function(key)
{return this.retrieve('backgrounds',{})[key||'_default']||Element.backgroundStub;},applyBackgroundMethod:function(key,m,arg)
{this.getBackground(key)[m](arg);return this;},applyBackgroundElMethod:function(key,m,arg)
{var bg=this.getBackground(key);if(bg)
bg.$el[m](arg);return this;},fadeBackground:function(how,key)
{return this.applyBackgroundMethod(key,'fade',how);},showBackground:function(key,how)
{return this.applyBackgroundMethod(key,'show',how);},hideBackground:function(key)
{return this.applyBackgroundMethod(key,'hide');}});
Element.implement({fade:function(how){var fade=this.get('tween'),o='opacity',toggle;how=$pick(how,'toggle');if($type(how)=='string'&&how.test(/[\w\.]+\:\d+/)){var d=Number(how.substr(how.indexOf(':')+1));how=how.substring(0,how.indexOf(':'));this.get('tween').options.duration=d;}
switch(how){case'in':fade.start(o,1);break;case'out':fade.start(o,0);break;case'show':fade.set(o,1);break;case'hide':fade.set(o,0);break;case'toggle':var flag=this.retrieve('fade:flag',this.get('opacity')==1);fade.start(o,(flag)?0:1);this.store('fade:flag',!flag);toggle=true;break;default:fade.start(o,arguments);}
if(!toggle)this.eliminate('fade:flag');return this;}});
function isArray()
{for(var i=0;i<arguments.length;i++)
{if($type(arguments[i])!='array')
return false;}
return true;}
function initArray(arr,defaultItem){if(isString(arr))arr=arr.split(',');if(isArray(arr))return arr;if(arr)return[arr];return defaultItem?[defaultItem]:[];}
Array.implement({remove:Array.erase,joinIf:function(s)
{var arr=[];this.each(function(i){if(i&&typeof i=='string'&&i.length>0)arr.push(i);});return arr.join(s);},toUL:function()
{if(!this.length)return"";if(this.length==1)return this[0];var ul="<ul>";for(var i=0;i<this.length;i++)
ul+="<li>"+this[i]+"</li>";ul+="</ul>";return ul;},toReadable:function()
{if(!this.length)return"";if(this.length==1)return this[0]+'.';var rtn='';for(var i=0;i<this.length;i++){rtn+=this[i];if(i==this.length-2)rtn+=' and ';else if(i<this.length-2)rtn+=', ';}
rtn+='.';return rtn;},getFirst:function(){return this[0]||false;},getObjectById:function(id,idKey)
{if(!idKey)idKey='id';for(var i=0;i<this.length;i++)
{if(isObject(this[i])&&this[i][idKey]==id)
return this[i];}
return null;},all:function(iterator){var result=true;for(var i=0;i<this.length;i++)
{if(!(iterator||returnConstant)(this[i],i))
{result=false;break;}}
return result;},any:function(iterator){var result=false;for(var i=0;i<this.length;i++)
{if((iterator||returnConstant)(this[i],i))
{result=true;break;}}
return result;},collect:function(iterator){var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator){var result;for(var i=0;i<this.length;i++)
{var thisIteration=iterator(this[i],i);if(thisIteration)
{result=thisIteration;break;}}
return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))results.push(value);});return results;},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},invoke:function(method){var args=$A(arguments).slice(1);return this.collect(function(value){return value[method].apply(value,args);});},injectArray:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},flatten:function(){return this.injectArray([],function(array,value){return array.concat(value&&value.constructor==Array?value.flatten():[value]);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||returnConstant)(value,index);if(result==undefined||value>=result)
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||returnConstant)(value,index);if(result==undefined||value<result)
result=value;});return result;}});
function isFunction(fn)
{for(var i=0;i<arguments.length;i++)
{if($type(arguments[i])!='function')
return false;}
return true;}
function doFunction(fn,scope,arg,parent){if(!fn)return;if(typeof fn=="string"){if(/eval:/.test(fn))return eval(fn.replace(/eval:/,''));else if(/[\(\s]/.test(fn))return eval(fn);else if(scope){if(typeof scope=='string')return eval(fn+'.call('+scope+',arg)');else{return eval(fn+'.call(scope,arg)');}}else return eval(fn+'(arg)');}
else{if(scope)return fn.call(scope,arg);else return fn(arg);}}
function tryFunction(fn,scope,arg){if(!fn)return false;try{doFunction(fn,scope,arg);}
catch(e){return false;}}
function isNumeric(n){if(typeof n=='number'&&!isNaN(n))return true;return false;}
function isNumericString(s){if(typeof s!='string')return false;var n=parseFloat(s);return isNumeric(n);}
Number.prototype.writePlural=function(singular,plural,prepSingular,prepPlural){if(!plural)plural=singular+"s";if(this==1){var rtn=this+" "+singular;if(prepSingular)rtn=prepSingular+" "+rtn;}else{var rtn=this+" "+plural;if(prepPlural)rtn=prepPlural+" "+rtn;}return rtn;}
Number.prototype.writePluralOnly=function(singular,plural,prepSingular,prepPlural){if(!plural)plural=singular+"s";if(this==1){var rtn=singular;if(prepSingular)rtn=prepSingular+" "+rtn;}else{var rtn=plural;if(prepPlural)rtn=prepPlural+" "+rtn;}return rtn;}
Number.prototype._or=function(str){str=str||'None';if(this==0)return str;return this;}
Number.prototype.toStrLen=function(i){var str=''+this;while(str.length<i)str='0'+str;return str;}
Number.prototype.roundToDecimalPlaces=function(i,exact){var asStr=''+this;rtn=asStr.split('.');rtnStr=rtn[0];if(rtn.length>1){if(rtn[1].length>i){var whole=rtn[1].substr(0,i);var dec=rtn[1].substr(i,1);rtnStr+='.'+Math.round(parseFloat(whole+'.'+dec));}
else if(exact&&rtn[1].length<i){rtnStr+='.'+rtn[1];for(var p=rtn[1].length;p<i;p++)rtnStr+='0';}
else rtnStr+='.'+rtn[1];}
return rtnStr;}
Number.prototype.toCommaFormat=function(decimalPlaces,exact){if(isNumeric(decimalPlaces))var asStr=this.roundToDecimalPlaces(decimalPlaces,exact);else var asStr=''+this;rtn=asStr.split('.');rtnInt=rtn[0];rtnDec=(rtn.length>1)?('.'+rtn[1]):'';var regex=/(\d+)(\d{3})/;while(regex.test(rtnInt))rtnInt=rtnInt.replace(regex,'$1'+','+'$2');return rtnInt+rtnDec;}
Number.prototype.to$=function(forceDecimal,incHTML){var negative=(this<0);var rtn="$"+this.toCommaFormat(2);var decimalIndex=rtn.indexOf(".");if(decimalIndex==-1){if(forceDecimal)rtn+=".00";}
else if(decimalIndex==rtn.length-2)rtn+="0";if(incHTML&&negative)rtn='<span class="negative">'+rtn+'</span>';return rtn;}
Number.prototype.toPercent=function(noDecimal){return this.roundToDecimalPlaces(2,true)+'%';}
Number.prototype.toOrdinal=function(m){return(this+
["th","st","nd","rd"][(!(((m=this%10)>3)||(Math.floor(this%100/10)==1)))*m]);}
Number.prototype.toTime=function(){var minutes=(this%60).toStrLen(2);var hours=(this-minutes)/60;var time='am';if(hours==0){hours=12;time='pm'}
else if(hours>12){hours=hours-12;time='pm';}
return hours+':'+minutes+' '+time;}
Number.prototype.to24hrs=function(){var minutes=(this%60).toStrLen(2);var hours=(this-minutes)/60;return hours+':'+minutes;}
Number.prototype.toHours=function(shortFormat){var minutes=this%60;var hours=(this-minutes)/60;var rtn="";if(hours&&shortFormat)rtn+=hours+'h';else if(hours)rtn+=hours+' hour'+((hours>1)?"s":"");if(hours&&minutes){if(shortFormat)rtn+=' ';else rtn+=", ";}
if(minutes&&shortFormat)rtn+=minutes+'m';else if(minutes)rtn+=minutes+' minute'+((minutes>1)?"s":"");if(!rtn.length)rtn=(shortFormat)?'0 mins':'0 minutes';return rtn;}
Number.prototype.toAlpha=function(){if(this>26)return'';return['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'][this];}
Number.prototype.toColorPart=function(){var digits=this.toString(16);if(this<16)return'0'+digits;return digits;}
function isString(s){if(!s)return false;if($type(s)=='string')return true;else return false;}
String.implement({parse:function(obj)
{if(!/\[\[[\w\s\.]+]]/.test(this))
{return this;}
var str=this;var replaceKeys=function(o,prep){for(var i in o)
{if(typeof o[i]=='string')
{str=str.replace(new RegExp("\\\[\\\[\\\s*"+prep+i+"\\\s*]]","gi"),o[i]);}
else if(typeof o[i]=='object')
{replaceKeys(o[i],prep+i+'\\\.');}}}
replaceKeys(obj,'');return str;}});String.prototype.removePrepKey=function(){if(this.indexOf('__')>=0)return this.substring(this.indexOf('__')+2,this.length);else return this+'';}
String.prototype.processEval=function(data){if(this.substr(0,5)=='eval:'){try{return eval(this.substr(5));}
catch(e){return this+'';}}
else return this+'';}
String.prototype.writePlural=function(singular,plural,prepSingular,prepPlural){var num=parseInt(this);return num.writePlural(singular,plural,prepSingular,prepPlural);}
String.prototype._or=function(s){if(this.length)return this+'';else return s;}
String.prototype.notBlank=function(){return this._or('&nbsp;');}
String.prototype.to$=function(forceDecimal,incHTML){try{if(/\$/.test(this))return this+'';return parseFloat(this).to$(forceDecimal,incHTML);}catch(e){return this;}}
String.prototype.toPercent=function(noDecimal){if(/%/.test(this))return this+'';var num=parseFloat(this);return num.toPercent(noDecimal);}
String.prototype.stripTags=function(){return this.replace(/<\/?[^>]+>/gi,'');}
String.prototype.escapeHTML=function(){var div=document.createElement('div');var text=document.createTextNode(this);div.appendChild(text);return div.innerHTML;}
String.prototype.unescapeHTML=function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0].nodeValue;}
String.prototype.addString=function(str,a,b){if(!$chk(str))return this+'';a=a||'';b=b||'';return this+a+str+b;}
String.prototype.addStringIf=function(str,a,b){if(!this.length)return'';else return this.addString(str,a,b);}
String.prototype.prepString=function(str,a,b){if(!$chk(str))return this+'';a=a||'';b=b||'';return a+str+b+this;}
String.prototype.prepStringIf=function(str,a,b){if(!this.length)return'';else return this.prepString(str,a,b);}
String.prototype.parseQuery=function(){var str=this;if(str.substring(0,1)=='?'){str=this.substring(1);}
var result={};var pairs=str.split('&');for(var i=0;i<pairs.length;i++){var pair=pairs[i].split('=');result[pair[0]]=pair[1];}
return result;}
String.prototype.splitName=function(){var rtn={firstName:'',lastName:'',salutation:''};var a=this.split(' ');for(var i=0;i<a.length;i++){if(!/[a-z]/.test(a[i]))a[i]=a[i].toLowerCase();a[i]=a[i].capitalize(true);}
if(a.length==1)rtn.firstName=a[0];else{var sal=a[0].toLowerCase();if(sal=='mr'||sal=='mrs'||sal=='miss'||sal=='ms'||sal=='sir'||sal=='dr')rtn.salutation=a.shift();rtn.lastName=a.pop();rtn.firstName=a.join(' ');}
return rtn;}
String.prototype.toHyphenCase=function(){var rtn='';for(i=0,len=this.length;i<len;++i){if(this.charAt(i)==this.charAt(i).toUpperCase()){rtn+='-'+this.charAt(i).toLowerCase;}else{rtn+=this.charAt(i);}}
return rtn;}
String.prototype.isEmail=function(){var checkTLD=1;var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;var emailPat=/^(.+)@(.+)$/;var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";var validChars="\[^\\s"+specialChars+"\]";var quotedUser="(\"[^\"]*\")";var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var atom=validChars+'+';var word="("+atom+"|"+quotedUser+")";var userPat=new RegExp("^"+word+"(\\."+word+")*$");var domainPat=new RegExp("^"+atom+"(\\."+atom+")*$");var matchArray=this.match(emailPat);if(matchArray==null)return false;var user=matchArray[1];var domain=matchArray[2];for(i=0;i<user.length;i++){if(user.charCodeAt(i)>127)return false;}
for(i=0;i<domain.length;i++){if(domain.charCodeAt(i)>127)return false;}
if(user.match(userPat)==null)return false;var IPArray=domain.match(ipDomainPat);if(IPArray!=null){for(var i=1;i<=4;i++){if(IPArray[i]>255)return false;}
return true;}
var atomPat=new RegExp("^"+atom+"$");var domArr=domain.split(".");var len=domArr.length;for(i=0;i<len;i++){if(domArr[i].search(atomPat)==-1)return false;}
if(checkTLD&&domArr[domArr.length-1].length!=2&&domArr[domArr.length-1].search(knownDomsPat)==-1)return false;if(len<2)return false;return true;}
function $date(str)
{if($type(str)=='date')
return str;if($type(str)=='undefined')
return new Date();if($type(str)!='string')
return null;if(str=='now'||str=='today')
return new Date();if(str=='tomorrow')
return(new Date()).addDatePart('d',1);if(str=='yesterday')
return(new Date()).addDatePart('d',-1);if(/\d{8}/.test(str))
return new Date(str.substr(0,4),str.substr(4,2),str.substr(6,2));var a=/^(\d{4})\s*([\/\\\-\s\.])\s*(\d{2})\s*\2(\s*\d{2})\s*,?(\s+(\d{1,2})\:(\d{1,2})(\:(\d{1,2}))?([\:\.](\d{1,4}))?)?(\s*([ap])m?)?$/.exec(str);if(a)
{$log("Matched date with regex: '2008-08-25', '2008-08-25 13:30:1200' and '2008-08-25 1:30 pm'.");var d={year:a[1],month:a[3],date:a[4],hour:a[6],mins:a[7],secs:a[9],ms:a[11],ampm:a[13]};if(d.month.substr(0,1)=='0')
d.month=d.month.substr(1,1);d.month=parseInt(d.month)-1;var rtn=new Date(d.year,d.month,d.date);if(d.hour)
rtn.setHours(d.hour);if(d.mins)
rtn.setMinutes(d.mins);if(d.secs)
rtn.setSeconds(d.secs);if(d.ms)
rtn.setMilliseconds(d.ms);if(d.ampm=='p'&&rtn.getHours()<12)
rtn.setHours(rtn.getHours()+12);else if(d.ampm=='a'&&d.hour=='12')
rtn.setHours(0);return rtn;}
return Date.parse(str);}
Date.dayNames=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');Date.monthNames=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');Date.prototype.daysInMonth=function(){var m=this.getMonth();var y=this.getFullYear();var isLeap=!(y%4)&&((y%100)||!(y%400));return[31,(isLeap?29:28),31,30,31,30,31,31,30,31,30,31][m];}
Date.prototype.getMinsDifference=function(compareDate){if(!isDate(compareDate))compareDate=new Date();var m1=this.getTime()/1000/60;var m2=compareDate.getTime()/1000/60;return m2-m1;}
Date.prototype.getDayName=function(bShort){var i=this.getDay();if(bShort)i+=7;return Date.dayNames[i];}
Date.prototype.getTimeIn=function(part){var rtn=this.getTime()/1000;part=part.toLowerCase();switch(part){case'mins':rtn=Math.round(rtn/60);break;case'hours':rtn=Math.round(rtn/60/60);break;case'days':rtn=Math.round(rtn/60/60/24);break;}
return rtn;}
Date.prototype.get12Hour=function(){var hours=this.getHours();if(hours>12)return hours-12;else if(hours==0)return 12;else return hours;}
Date.prototype.get12HourAdd=function(){var hours=this.getHours();if(hours>11)return 12;else return 0;}
Date.prototype.intToDayName=function(i,shortFormat){if(shortFormat)i+=7;return Date.dayNames[i];}
Date.prototype.getMonthName=function(shortFormat){var i=this.getMonth();if(shortFormat)i+=12;return Date.monthNames[i];}
Date.prototype.getMinutesString=function(){var mins=this.getMinutes();if(mins<10)return"0"+mins;else return""+mins;}
Date.prototype.addDatePart=function(datePart,n){if(typeof n=="string")n=parseInt(n);if(isNaN(n)){alert("Error adding date:\n\nThe second parameter must be a number. \n You passed: "+n);return false;}
switch(datePart.toLowerCase()){case"y":this.getFullYear(this.getFullYear()+n);break;case"m":var originalDate=new Date(this);this.setMonth(this.getMonth()+n);if(n>0&&this.getDate()<originalDate.getDate())this.setDate(0);break;case"f":this.setDate(this.getDate()+n*14);break;case"w":this.setDate(this.getDate()+n*7);break;case"d":this.setDate(this.getDate()+n);break;case"h":this.setHours(this.getHours()+n);break;case"n":this.setMinutes(this.getMinutes()+n);break;case"s":this.setSeconds(this.getSeconds()+n);break;case"ms":this.setMilliseconds(this.getMilliseconds()+n);break;default:alert("Error adding date:\n\nAccepted Date Parts: \ny, m, d, h, n, s, or ms.\nYou passed: "+p_Interval);}
return this;}
Date.prototype.copy=function(){return new Date(this.getTime());}
Date.prototype.format=function(sFormat,date2){sFormat=sFormat||"cf";var rtn="";switch(sFormat.toLowerCase()){case"cf":var thisMonth=this.getMonth()+1;if(thisMonth<10)thisMonth="0"+thisMonth;var thisDate=this.getDate();if(thisDate<10)thisDate="0"+thisDate;rtn=this.getFullYear()+"-"+thisMonth+"-"+thisDate;break;case"normal":var thisMonth=this.getMonth()+1;if(thisMonth<10)thisMonth="0"+thisMonth;var thisDate=this.getDate();if(thisDate<10)thisDate="0"+thisDate;rtn=thisDate+"/"+thisMonth+"/"+this.getFullYear();break;case"long":rtn=this.getDayName()+" "+this.format('date');break;case"month":rtn=this.getMonthName()+" "+this.getDate().toOrdinal();if(this.getFullYear()!=new Date().getFullYear())rtn+=", "+this.getFullYear();break;case"dob":rtn=this.getMonthName()+" "+this.getDate().toOrdinal();if(this.getFullYear()>1900)rtn+=", "+this.getFullYear();break;case"date":rtn=this.getDate().toOrdinal()+" "+this.getMonthName()+", "+this.getFullYear();break;case"daysago":var d=new Date();d.addDatePart('d',-1);for(var i=2;i<7;i++){d.addDatePart('d',-1);if(this.compare(d)){rtn=i+' days ago';break;}}
if(rtn.length)break;case"readable":var d=new Date();if(this.compare(d)){rtn='Today';break;}
d.addDatePart('d',1);if(this.compare(d)){rtn='Tomorrow';break;}
d.addDatePart('d',-2);if(this.compare(d)){rtn='Yesterday';break;}
rtn=this.getMonthName()+" "+this.getDate().toOrdinal();break;case"friendly":var d=new Date();if(this.compare(d)){rtn='Today';break;}
d.addDatePart('d',1);if(this.compare(d)){rtn='Tomorrow';break;}
d.addDatePart('d',-2);if(this.compare(d)){rtn='Yesterday';break;}
rtn=this.getDate().toOrdinal()+" "+this.getMonthName()+", "+this.getFullYear();break;case"on":rtn=this.format('readable');if(!['Today','Tomorrow','Yesterday'].contains(rtn))rtn='on '+rtn;break;case"short":rtn=this.getDate().toOrdinal()+" "+this.getMonthName(true)+", "+this.getFullYear();break;case"day":rtn=this.getDayName()+' '+this.getDate().toOrdinal();break;case"week":var date2=new Date(this.getFullYear(),this.getMonth(),this.getDate()+6);case"range":if(!isDate(date2))rtn=this.format('date');else{if(this.compare(date2,'month'))rtn=this.getDate().toOrdinal()+" to "+date2.getDate().toOrdinal()+" "+this.getMonthName()+", "+this.getFullYear();else if(this.compare(date2,'year'))rtn=this.getDate().toOrdinal()+" "+this.getMonthName()+" to "+date2.getDate().toOrdinal()+" "+date2.getMonthName()+", "+this.getFullYear();else rtn=this.format('date')+" to "+date2.format('date');}
break;case"at":rtn=this.getDayName()+" "+this.format('date')+' at '+this.format('12hr');break;case"12hr":var hrs=this.getHours();var mins=this.getMinutes();if(hrs==0){hrs=12;var time="am";}
else if(hrs==12){var time="pm";}
else if(hrs>12){hrs-=12;var time="pm";}
else var time="am";if(mins<10)mins="0"+mins;rtn=hrs+":"+mins+" "+time;break;case"24hr":var hrs=this.getHours();var mins=this.getMinutes();if(hrs<10)hrs='0'+hrs;if(mins<10)mins='0'+mins;return hrs+':'+mins;default:rtn='(invalid date format specified: '+sFormat+')';}
return rtn;}
Date.prototype.compare=function(c,a){c=c||new Date();a=a||"day";switch(a.toLowerCase()){case"year":return(this.getFullYear()==c.getFullYear());break;case"month":return(this.getFullYear()==c.getFullYear()&&this.getMonth()==c.getMonth());break;case"day":return(this.getFullYear()==c.getFullYear()&&this.getMonth()==c.getMonth()&&this.getDate()==c.getDate());break;case"hour":return(this.getFullYear()==c.getFullYear()&&this.getMonth()==c.getMonth()&&this.getDate()==c.getDate()&&this.getHours()==c.getHours());break;case"minute":return(this.getFullYear()==c.getFullYear()&&this.getMonth()==c.getMonth()&&this.getDate()==c.getDate()&&this.getHours()==c.getHours()&&this.getMinutes()==c.getMinutes());break;case"second":return(this.getFullYear()==c.getFullYear()&&this.getMonth()==c.getMonth()&&this.getDate()==c.getDate()&&this.getHours()==c.getHours()&&this.getMinutes()==c.getMinutes()&&this.getSeconds()==c.getSeconds());break;}}
Date.prototype.getFirstDayOfWeek=function(){if(this.getDay()==0)return this;return new Date(this.getFullYear(),this.getMonth(),(this.getDate()-this.getDay()));}
Date.prototype.getFirstDayOfMonth=function(){if(this.getDay()==0)return this;return new Date(this.getFullYear(),this.getMonth(),1);}
Date.prototype.getMonthArray=function(){var arr=new Array();for(var i=0;i<6;i++)arr.push(new Array(8));var dCalDate=new Date(this.getFullYear(),this.getMonth(),1);var dLastDayThisMonth=new Date(this.getFullYear(),this.getMonth()+1,0);var iDayOfFirst=dCalDate.getDay();var iDaysInMonth=dLastDayThisMonth.getDate();var iVarDate=1;for(var d=iDayOfFirst;d<7;d++){arr[0][d]=iVarDate;iVarDate++;}
for(var w=1;w<8;w++){for(var d=0;d<7;d++){try{if(iVarDate<=iDaysInMonth){arr[w][d]=iVarDate;iVarDate++;}}catch(e){alert("error getting month array. invalid day: "+iVarDate);break;}}}
return arr;}
String.implement({date:function(){return $date(this);}});Date.implement({date:function(){return this;}});
function isObject(o)
{return($type(o)=='object');}
function $hasAnyData(o)
{for(var i in o)
return true;return false;}
function isIndexedStruct(o)
{var is=(isObject(o)&&isArray(o.index));if(is)o=$indexedStruct(o);return is;}
function $indexedStruct(o)
{if(!o||o.indexedEach)
return o;$extend(o,new IndexedStruct());return o;}
function $dataObject(o)
{if(!o||o.getName)
return o;$extend(o,new IndexedStruct());return o;}
function getCaselessProperty(o,findProp)
{findProp=findProp.toLowerCase();for(var prop in o)
{if(prop.toLowerCase()==findProp)
return o[prop];}}
var DataObject=new Class({extend:$extend,initialize:function(obj)
{if(obj)
this.extend(obj);},getName:function()
{if(this.name)return this.name;var firstName=this.firstName||'';var lastName=this.lastName||'';return firstName.addString(lastName,' ');}});var IndexedStruct=new Class({initialize:function(obj)
{if(obj)
$extend(this,obj);},indexedEach:function(iterator,scope){for(var i=0;i<this.index.length;i++){if(scope)iterator.call(scope,this[this.index[i]],this.index[i],i);else iterator(this[this.index[i]],this.index[i],i);}},getFirst:function()
{return this[this.index[0]];},getLast:function()
{return this[this.index[this.index.length-1]];},remove:function(id)
{this.index.remove(id);this[id]=null;}});IndexedStruct.prototype.each=IndexedStruct.prototype.indexedEach;
Window.implement({getClientWidth:function()
{return(document.documentElement.offsetWidth||document.body.offsetWidth);},getClientHeight:function()
{return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);},setScrolling:function(available)
{if(available==false)
document.documentElement.style.overflow='hidden';else
document.documentElement.style.overflow='auto';},setScrollTop:function(y)
{y=isNumeric(y)?y:0;var propTarget=document.documentElement||document.body;propTarget.scrollTop=y;},setScrollBottom:function()
{var propTarget=document.documentElement||document.body;propTarget.scrollTop=window.getSize().scrollSize.y;}});