var ccms=window.ccms||{};ccms.object=function(o){function F(){}
F.prototype=o;return new F();};ccms.extend=ccms.update=function(destination,source){for(var property in source){if(YAHOO.lang.hasOwnProperty(source,property)){destination[property]=source[property];}}
return destination;};ccms.cloneOf=function(what){var o=ccms.object(what.prototype);for(var i in what){if(YAHOO.lang.hasOwnProperty(what,i)){o[i]=what[i];}}
return o;};ccms.namespace=function(name){if(!name||!name.length){return null;}
var parts=name.split(".");var ns=window;for(var i=0;i<parts.length;++i){ns[parts[i]]=ns[parts[i]]||{};ns=ns[parts[i]];}
return ns;};ccms.namespace('ccms.async');ccms.namespace('ccms.config');ccms.namespace('ccms.dom');ccms.namespace('ccms.event');ccms.namespace('ccms.log');ccms.namespace('ccms.css');ccms.namespace('ccms.date');ccms.extend(ccms,(function(){var scripts=[];return{detectScripts:function(evt){var src;var stags=ccms.arrayOf(document.getElementsByTagName('script'));for(var t=0;t<stags.length;++t){if((src=stags[t].getAttribute('src'))&&src.length){scripts[src]=true;}}},addScript:function(url){scripts[url]=true;},require:function(url,callback){var s=false;if(typeof scripts[url]==='undefined'){scripts[url]=true;if(navigator.userAgent.indexOf('MSIE')>0){ccms.require_sync(url);}
else{s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('src',url);document.getElementsByTagName('head')[0].appendChild(s);}}
if(typeof callback==='function'){if(s){ccms.event.attach(s,'load',function(){callback();});}
else{callback();}}
return scripts[url];},require_sync:function(url){var script=ccms.async.http({url:url});window.eval(script);},browser:{isIE:navigator.userAgent.indexOf('MSIE')>0,isSafari:navigator.userAgent.match(/safari/gi),isGecko:!navigator.userAgent.match(/safari/gi)&&navigator.userAgent.indexOf('Gecko')>0},push:function(a,value){a[a.length]=value;},indexOf:function(a,item){for(var i=0;i<a.length;++i){if(a[i]===item){return i;}}
return-1;},filter:function(a,callback){if(!callback){callback=function(e){return e;};}
var out=[];for(var i=0;i<a.length;++i){if(callback(a[i])){out[out.length]=a[i];}}
return out;},map:function(a,callback){if(!callback){callback=function(e){return e;};}
var out=[];for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)){out[i]=callback(a[i]);}}
return out;},contains:function(a,value){for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)&&a[i]===value){return true;}}
return false;},containsi:function(a,value){var valuei=value.toLowerCase();for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)&&(((typeof a[i]==='string')&&(a[i].toLowerCase()===valuei))||(a[i]===value))){return true;}}},remove:function(a,value){for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)&&a[i]===value){delete a[i];}}
return a;},removei:function(a,value){var valuei=value.toLowerCase();for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)&&(((typeof a[i]==='string')&&(a[i].toLowerCase()===valuei))||(a[i]===value))){delete a[i];}}
return a;},flip:function(a){var b=[];for(var i in a){if(YAHOO.lang.hasOwnProperty(a,i)){b[a[i]]=i;}}
return b;},shift:function(a){var result=a[0];for(var i=0;i<a.length-1;++i){a[i]=a[i+1];}
--a.length;return result;},keysOf:function(object){var r=[];for(var i in object){if(YAHOO.lang.hasOwnProperty(object,i)){r[r.length]=i;}}
return r;},valuesOf:function(object){var r=[];for(var i in object){if(YAHOO.lang.hasOwnProperty(object,i)){r[r.length]=object[i];}}
return r;},arrayOf:function(iterable){var results=[];if(!iterable){return results;}
if(iterable.toArray){return iterable.toArray();}
else{for(var i=0;i<iterable.length;i++){results[results.length]=iterable[i];}
return results;}},isCollection:function(o){return(o&&o.length&&(typeof o!=="string")&&!o.tagName&&!o.alert&&(typeof o[0]!=="undefined"));},bind:function(obj,method){return function(){var args=arguments;return method.apply(obj,args);};},chain:function(f1,f2){if(f1){if(f2){return function(){f1();return f2();};}
return f1;}
return f2;},html:{isAvailable:false,isWanted:false,use:function(){ccms.html.isAvailable=true;ccms.html.isWanted=true;ccms.html=ccms.DomBuilder.apply(ccms.html);ccms.html.use=function(){};}},widgets:{widgetlist:[],installers:{},add:function(widget,id){if(typeof id!=='string'||id===''){id=ccms.widgets.widgetlist.length;}
if(ccms.widgets.widgetlist[id]){id=ccms.dom.generateId();}
ccms.widgets.widgetlist[id]=widget;},get:function(id){return ccms.widgets.widgetlist[id];},each:function(callback){for(var i in ccms.widgets.widgetlist){if(YAHOO.lang.hasOwnProperty(ccms.widgets.widgetlist,i)){callback(ccms.widgets.widgetlist[i]);}}},addInstaller:function(name,callback,condition){ccms.widgets.installers[name]=callback;if(condition!==false){if(typeof condition==='undefined'){if(ccms.dom.ready){callback();}
else{ccms.event.onDOMReady(function(){callback();});}
return;}
if(!ccms.dom.ready){ccms.event.addLoadEvent(function(){ccms.async.when(condition,callback);});}
else{ccms.async.when(condition,callback);}}},runInstallers:function(block,optional_data){if(typeof block==='undefined'){block=document;}
else if(block.target||block.srcElement){block=document;}
var funx=ccms.widgets.installers;for(var name in funx){if(YAHOO.lang.hasOwnProperty(funx,name)){funx[name](block,optional_data);}}
return block;},addClassInstaller:function(WidgetConstructor,classname,tagname){var name=classname;var i=1;while(name in ccms.widgets.installers){name=classname+(++i);}
ccms.widgets.addInstaller(name,ccms.widgets.installNow.partial(WidgetConstructor,classname,tagname));},installNow:function(WidgetConstructor,classname,tagname,rootelement){if(typeof rootelement==='undefined'&&window.opera){rootelement=document.body;}
var elts=ccms.dom.getElementsByClassName(classname,tagname,rootelement);for(var i=0;i<elts.length;++i){var v=new WidgetConstructor(elts[i]);if(!WidgetConstructor.anonymouswidget){ccms.widgets.add(v,elts[i].id);}}},install:function(WidgetConstructor,classname,tagname,rootelement){ccms.log.debug('Replace Me...  ccms.widgets.install: '+classname+', '+tagname+', '+rootelement);ccms.log.debug(WidgetConstructor);if(typeof rootelement==='undefined'){if(window.opera){rootelement=document.body;}
else{rootelement=document;}}
if(typeof tagname==='undefined'){tagname='*';}
ccms.event.onDOMReady(function(){var elts=ccms.dom.getElementsByClassName(classname,tagname,rootelement);for(var i=0;i<elts.length;++i){var id=elts[i].id;if(id===''){id=ccms.dom.generateId();elts[i].setAttribute('id',id);}
ccms.widgets.add(new WidgetConstructor(elts[i]),id);}});}},repr:function(){var i;var out='';if(arguments.length===1){var a=arguments[0];out+=a+"\r\n";if(typeof a==='object'){for(i in a){if(YAHOO.lang.hasOwnProperty(a,i)){out+=i+": "+a[i]+"\r\n";}}}}
else{for(i in arguments){if(YAHOO.lang.hasOwnProperty(arguments,i)){out+=ccms.repr(arguments[i]);}}}
return out;}};})());ccms.extend(ccms.config,{get:function(name,default_value){return(typeof ccms.config[name]==='undefined')?default_value:ccms.config[name];},set:function(name,value){if(name!=='set'&&name!=='get'){return ccms.config[name]=value;}}});ccms.html.Module=function(options){if(!ccms.html.isAvailable)ccms.html.use();if(typeof options==='undefined')options={};if(typeof options.className==='undefined'){options.className='module';}
else{options.className='module '+options.className;}
if(typeof options.id==='undefined'){options.id=ccms.dom.generateId();}
var module=ccms.html.DIV({'class':options.className,'id':options.id});if(options.header!==false){if(typeof options.css_hd==='undefined'){options.css_hd='header';}
var head=ccms.html.DIV({'class':options.css_hd});head=module.appendChild(head);if(typeof options.header==='string'){head.innerHTML=options.header;}
else if(typeof options.header==='object'){head.appendChild(options.header);}}
if(options.body!==false){if(typeof options.css_bd==='undefined'){options.css_bd='body';}
var body=ccms.html.DIV({'class':options.css_bd});body=module.appendChild(body);if(typeof options.body==='string'){body.innerHTML=options.body;}
else if(typeof options.body==='object'){body.appendChild(options.body);}}
if(options.footer!==false){if(typeof options.css_ft==='undefined'){options.css_ft='footer';}
var foot=ccms.html.DIV({'class':options.css_ft});foot=module.appendChild(foot);if(typeof options.footer==='string'){foot.innerHTML=options.footer;}
else if(typeof options.footer==='object'){foot.appendChild(options.footer);}}
return module;};ccms.html.MessageBox=function(options){if(typeof YAHOO==='object'&&typeof YAHOO.widget==='object'&&typeof YAHOO.widget.SimpleDialog==='function'){var p={width:"300px",fixedcenter:true,visible:false,draggable:true,close:options.close,text:options.body,icon:YAHOO.widget.SimpleDialog.ICON_WARN,constraintoviewport:true,buttons:[]};for(var k in options.buttons){if(YAHOO.lang.hasOwnProperty(options.buttons,k)){var button=options.buttons[k];var callback=null;var isDefault=false;if(button!==null){if(typeof button==='object'){if(YAHOO.lang.hasOwnProperty(button,'onclick')){callback=button.onclick;}
if(YAHOO.lang.hasOwnProperty(button,'isDefault')){isDefault=button.isDefault;}}
else if(typeof button==='function'){callback=button;}}
if(callback===null){callback=function(){this.hide();};}
p.buttons.push({text:k,handler:callback,isDefault:isDefault});}}
var dlg=new YAHOO.widget.SimpleDialog("MessageBox",p);dlg.render('content');return dlg;}
else{ccms.html.MessageBox.close=function(e){this.parentNode.removeChild(this);};ccms.html.MessageBox.show=function(){var parent=document.body;if(typeof this.options.parent!=='undefined'){parent=$(this.options.parent);}
parent.appendChild(this);if(typeof this.options.center==='string'){var w=ccms.dom.getViewportWidth();var h=ccms.dom.getViewportHeight();var box=this;if(this.options.backing){ccms.dom.setXY(this,[0,0]);ccms.dom.setStyle(this,'width',''+w+'px');ccms.dom.setStyle(this,'height',''+h+'px');box=box.firstChild;}
if(this.options.center.indexOf('x')>-1){ccms.dom.setX(box,(w-box.offsetWidth)/2);}
if(this.options.center.indexOf('y')>-1){ccms.dom.setY(box,((h-box.offsetHeight)/2)-64);}
if(this.options.shadow){ccms.dom.setStyle(box,'height',''+box.firstChild.offsetHeight+'px');}}};if(!ccms.html.isAvailable){ccms.html.use();}
if(typeof options==='undefined'){options={};}
if(typeof options.className==='undefined'){options.className='ccmsMessageBox';}
if(typeof options.buttons==='undefined'){options.buttons={'Ok':null};}
var callback;var buttons=[];var ul=ccms.html.UL({'class':'buttons'}),li;for(var k in options.buttons){if(YAHOO.lang.hasOwnProperty(options.buttons,k)){var klass='button';var button=options.buttons[k];callback=null;if(button!==null){if(typeof button==='object'){if(YAHOO.lang.hasOwnProperty(button,'class')){klass+=' '+button['class'];}
if(YAHOO.lang.hasOwnProperty(button,'onclick')){callback=button.onclick;}}
else if(typeof button==='function')
callback=button;}
li=ccms.html.LI({'class':klass},ccms.html.SPAN(k));ul.appendChild(li);buttons.push([li,callback]);}}
options.footer=ccms.html.DIV(ul,ccms.html.DIV({'class':'clear'}));var module=ccms.html.Module(options);if(options.shadow){module=ccms.html.DIV({'class':'ccmsMessageBoxShadow'},module);}
if(options.backing){module=ccms.html.DIV({'class':'ccmsMessageBoxBacking'},module);}
var close=ccms.html.MessageBox.close.bind(module);for(var i=0;i<buttons.length;++i){li=buttons[i][0];callback=buttons[i][1];if(callback===null){callback=close;}
else if(typeof callback==='function'){callback=callback.chain(close);}
ccms.event.attach(li,'click',callback);}
module.show=ccms.html.MessageBox.show.bind(module);module.options=options;return module;}}
ccms.DomBuilder={IE_TRANSLATIONS:{'class':'className','for':'htmlFor'},ieAttrSet:function(a,i,el){var trans;if(trans=this.IE_TRANSLATIONS[i])el[trans]=a[i];else if(i==='style')el.style.cssText=a[i];else if(i.match(/^on/))el[i]=new Function(a[i]);else el.setAttribute(i,a[i]);},apply:function(o){o=o||{};var els=("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|"+"h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|"+"select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|"+"script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|"+"label|dfn|kbd|samp|var").split("|");var el,i=0;while(el=els[i++]){o[el.toUpperCase()]=ccms.DomBuilder.tagFunc(el);}
return o;},tagFunc:function(tag){return function(){var a=arguments,at,ch;a.slice=[].slice;if(a.length>0){if(a[0].nodeName||typeof a[0]==="string")ch=a;else{at=a[0];ch=a.slice(1);}}
return ccms.DomBuilder.elem(tag,at,ch);}},elem:function(e,a,c){a=a||{};c=c||[];var el=document.createElement(e),isIE=navigator.userAgent.match(/MSIE/);for(var i in a){if(typeof a[i]!=='function'){if(isIE)this.ieAttrSet(a,i,el);else el.setAttribute(i,a[i]);}}
for(var i=0;i<c.length;i++){if(typeof c[i]==='string')c[i]=document.createTextNode(c[i]);el.appendChild(c[i]);}
return el;}}
ccms.extend(ccms.log,(function(){var responders={};return{debugging:false,levels:{FATAL:50,ERROR:40,WARNING:30,INFO:20,DEBUG:10},output:function(){var args=ccms.arrayOf(arguments);var level=ccms.shift(args);if(typeof(responders[level])==='function'){responders[level].apply(this,args);}},setup:function(){for(var id in this.levels){var level=this.levels[id];responders[level]=this._debug;this[id.toLowerCase()]=this.output.partial(level);}},addListener:function(level,responder){responders[level]=responder;},_debug:function(){if(this.debugging){var body=document.getElementsByTagName('body');if(body.length){body=body[0];}
else{if(typeof console!=='undefined'&&console.debug){console.debug('%o',arguments);}
else if(typeof opera!=='undefined'&&opera.postError){opera.postError(ccms.repr(arguments));}
else{alert(ccms.repr(arguments));}
return;}
if(!this._debug.output){this._debug.output=document.createElement('pre');this._debug.output.className='debugoutput';body.appendChild(this._debug.output);}
this._debug.output.innerHTML+=this.stringify.apply(this,arguments);}},stringify:function(){var s='';for(var i=0;i<arguments.length;++i){if(typeof arguments[i]==='object'){s+=ccms.repr(arguments[i])+"\r\n";}
else{s+=arguments[i]+"\n";}}
return s;}};})());function intval(value){value=parseInt(value,10);if(isNaN(value)){value=0;}
return value;}
function floatval(value){value=parseFloat(value);if(isNaN(value)){value=0.0;}
return value;}
Function.prototype.method=function(name,fn){this.prototype[name]=fn;return this;};if(!Array.prototype.forEach){Array.method('forEach',function(fn,thisObj){var scope=thisObj||window;for(var i=0,j=this.length;i<j;++i){fn.call(scope,this[i],i,this);}}).method('every',function(fn,thisObj){var scope=thisObj||window;for(var i=0,j=this.length;i<j;++i){if(!fn.call(scope,this[i],i,this)){return false;}}
return true;}).method('some',function(fn,thisObj){var scope=thisObj||window;for(var i=0,j=this.length;i<j;++i){if(fn.call(scope,this[i],i,this)){return true;}}
return false;}).method('map',function(fn,thisObj){var scope=thisObj||window;var a=[];for(var i=0,j=this.length;i<j;++i){a.push(fn.call(scope,this[i],i,this));}
return a;}).method('filter',function(fn,thisObj){var scope=thisObj||window;var a=[];for(var i=0,j=this.length;i<j;++i){if(!fn.call(scope,this[i],i,this)){continue;}
a.push(this[i]);}
return a;}).method('indexOf',function(el,start){var start=start||0;for(var i=start,j=this.length;i<j;++i){if(this[i]===el){return i;}}
return-1;}).method('lastIndexOf',function(el,start){var start=start||this.length;if(start>=this.length){start=this.length;}
if(start<0){start=this.length+start;}
for(var i=start;i>=0;--i){if(this[i]===el){return i;}}
return-1;});}
Array.prototype.foreach=Array.prototype.forEach;if(!Array.prototype.reduce){Array.method('reduce',function(fn,initial){var i=0,r=initial;if(typeof initial==='undefined')r=this[i++];while(i<this.length){r=fn(r,this[i++]);}
return r;});}
if(!Array.prototype.findBy){Array.method('findBy',function(fn,start){var start=start||0;for(var i=start,j=this.length;i<j;++i){if(fn(this[i])){return i;}}
return-1;});}
String.prototype.startswith=function(text){return this.substring(0,text.length)===text;};String.prototype.endswith=function(text){return this.substring(this.length-text.length)===text;};String.prototype.trim=function(chars){if(typeof chars==='undefined')
chars='\\s';return this.ltrim(chars).rtrim(chars);};String.prototype.ltrim=function(chars){if(typeof chars==='undefined')
chars='\\s';var rx=new RegExp('^['+chars+']*(.*?)$');return this.replace(rx,'$1');};String.prototype.rtrim=function(chars){if(typeof chars==='undefined')
chars='\\s';var rx=new RegExp('^(.*?)['+chars+']*$');return this.replace(rx,'$1');};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]?div.childNodes[0].nodeValue:'';};String.prototype.parseJSON=function(){if(JSON)return JSON.parse(this);return eval('('+this+')');};Function.prototype.bind=function(){var __method=this;var args=ccms.arrayOf(arguments);var object=ccms.shift(args);return function(){return __method.apply(object,args.concat(ccms.arrayOf(arguments)));}}
Function.prototype.partial=function(){var __method=this;var args=ccms.arrayOf(arguments);return function(){return __method.apply(this,args.concat(ccms.arrayOf(arguments)));}}
Function.prototype.rpartial=function(){var __method=this;var args=ccms.arrayOf(arguments);return function(){return __method.apply(this,ccms.arrayOf(arguments).concat(args));}}
Function.prototype.chain=function(){var __method=this;var funcs=ccms.arrayOf(arguments);funcs.unshift(__method);return function(){var rv;var args=ccms.arrayOf(arguments);for(var i=0;i<funcs.length;++i){rv=funcs[i].apply(this,args);if(false===rv)return false;}
return rv;}}
function actsAsAspect(object){object.yield=null;object.rv={};object.before=function(method,f){var original=eval("this."+method);this[method]=function(){f.apply(this,arguments);return original.apply(this,arguments);};};object.after=function(method,f){var original=eval("this."+method);this[method]=function(){this.rv[method]=original.apply(this,arguments);return f.apply(this,arguments);}};object.around=function(method,f){var original=eval("this."+method);this[method]=function(){this.yield=original;return f.apply(this,arguments);}};return object;}
String.prototype.camelize=function(){var oStringList=this.split('-');if(oStringList.length===1)return oStringList[0];var camelizedString=this.indexOf('-')===0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i<len;i++){var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}
return camelizedString;};ccms.URL=function(url){this._fields={'username':4,'password':5,'port':7,'protocol':2,'scheme':2,'host':6,'path':8,'url':0,'query':9,'fragment':10};this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/;if(typeof url!=='undefined')
this.parse(url);}
ccms.URL.prototype.parse=function(url){var r=this._regex.exec(url);if(!r)throw"ccms.URL::parse -> Invalid URL";for(var f in this._fields){if(typeof r[this._fields[f]]==='undefined')this[f]='';else this[f]=r[this._fields[f]];}
this.parseQuery(this.query);}
ccms.URL.prototype.parseQuery=function(qs){this.query={};var params=qs.split('&');for(var i=0;i<params.length;++i){if(params[i].length){var kv=params[i].split("=");if(kv.length)this.query[kv[0]]=kv[1];}}}
ccms.URL.prototype.appendPath=function(path){this.path=this.path.rtrim('/')+'/'+path.ltrim('/');return this.path;}
ccms.URL.prototype.prependPath=function(path){this.path='/'+path.trim('/')+'/'+this.path.ltrim('/');return this.path;}
ccms.URL.prototype.pop=function(){this.path=this.path.replace(/\/[^\/]+\/?$/,'');}
ccms.URL.prototype.localURL=function(){var s='';if(this.path)s+=this.path;if(ccms.keysOf(this.query).length>0)s+='?'+urlencode(this.query);if(this.fragment!=='')s+='#'+this.fragment;return s;}
ccms.URL.prototype.toString=function(){var s='';if(this.protocol)s+=this.protocol+'://';if(this.username||this.password)s+=this.username+':'+this.password+'@';if(this.host)s+=this.host;if(this.port)s+=':'+this.port;return s+this.localURL();}
ccms.URL.open=function(url,new_window){if(typeof new_window==='undefined')new_window=false;if(typeof url==='object')url=url.toString();if(!url.match(/^(\w+:\/\/|[\/\.])/))url='http://'+url;if(new_window)return window.open(url);document.location.href=url;}
ccms.URL.stripHost=function(url){return url.replace(/^(\w+:\/\/[^\/]+)(.+)$/,'$2');}
function urlencode(){var output=[];for(var i=0;i<arguments.length;++i){var arg=arguments[i];if(typeof arg==='object'){for(var j in arg){if(YAHOO.lang.hasOwnProperty(arg,j)){if(typeof arg[j]==='object'){for(var k in arg[j]){if(YAHOO.lang.hasOwnProperty(arg[j],k)){output[output.length]=escape(j)+'='+escape(arg[j][k]);}}}
else{output[output.length]=escape(j)+'='+escape(arg[j]);}}}}
else{output[output.length]=escape(arg);}}
return output.join('&');}
function ccmsQS(args){return'?'+urlencode(args);}
function ccmsQSAppend(url,args){return url+(url.indexOf('?')>0?'&':'?')+urlencode(args);}
function ccmsFormData(formId,return_these_too){var oForm=$(formId);if(!oForm)return false;var oElement,oName,oValue,oDisabled;var hasSubmit=false;var out;if(typeof return_these_too==='undefined')out={};else out=ccms.cloneOf(return_these_too);for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;if(oForm.elements[i].name!==''){oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;}
if(!oDisabled)
{switch(oElement.type)
{case'select-one':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){out[oName]=oElement.options[j].value;break;}}
break;case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(typeof out[oName]==='undefined')out[oName]=[];out[oName][out[oName].length]=oElement.options[j].value;}}
break;case'radio':case'checkbox':if(oElement.checked){out[oName]=oValue;}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){hasSubmit=true;out[oName]=oValue;}
break;default:if(oName.substring(oName.length-2)==='[]'){if(typeof out[oName]==='undefined')out[oName]=[];out[oName][out[oName].length]=oValue;}
else
out[oName]=oValue;break;}}}
return out;}
ccms.async.when=function(condition,callback,timeout){return new ccms.async.Poller(condition,callback,timeout);}
ccms.async.Poller=ccmsWaiter=function(condition,callback,timeout){timeout=timeout||500;var interval=false;function test(){if(condition()){window.clearInterval(interval);interval=false;callback();}}
self.start=function(){if(interval===false)
interval=window.setInterval(test,timeout);}
self.cancel=function(){if(interval!==false){window.clearInterval(interval);interval=false;}}
self.start();}
ccms.extend(ccms.async,{getXMLHttpRequest:function(){var self=arguments.callee;if(!self.XMLHttpRequest){var tryThese=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject('Msxml2.XMLHTTP.6.0');},function(){return new ActiveXObject('Msxml2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');},function(){return new ActiveXObject('Msxml2.XMLHTTP.4.0');},function(){throw new Exception("Browser does not support XMLHttpRequest");}];for(var i=0;i<tryThese.length;i++){var func=tryThese[i];try{self.XMLHttpRequest=func;return func();}catch(e){}}}
return self.XMLHttpRequest();},CachingXMLHttpRequest:function(){return new ccms.async._CachingXMLHttpRequest();},http:function(args){var settings=ccms.extend({method:'GET',async:(args.onSuccess?true:false),onFailure:ccms.async.onHTTPError},args);settings.cancelled=false;settings.cancel=function(){settings.cancelled=true;};settings.method=settings.method.toUpperCase();var http;if(typeof settings.HttpFactory==='function')http=settings.HttpFactory();else http=this.getXMLHttpRequest();var postdata=null;var p;if((p=settings.url.indexOf('#'))!==-1){settings.url=settings.url.substring(0,p);}
if(settings.parameters){if(settings.method==='POST'){postdata=urlencode(settings.parameters);}
else if(settings.method==='GET'||settings.method==='HEAD'){settings.url+=(settings.url.indexOf('?')>0?'&':'?')+urlencode(settings.parameters);}}
if(settings.method==='GET'&&settings.url.length>2048){settings.method='POST';if(typeof settings.HttpFactory==='function')
http=this.getXMLHttpRequest();p=settings.url.indexOf('?');postdata=urlencode({'X-CCMS-TUNNELLED-GET':settings.url.substring(p+1)});http.open(settings.method,settings.url.substring(0,p),settings.async);}
else{http.open(settings.method,settings.url,settings.async);}
if(postdata){http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
http.send(postdata);if(settings.async){http.onreadystatechange=function(){if(settings.cancelled){try{http.onreadystatechange=null;}catch(e){;}
return;}
if(http.readyState===4){if(http.status===200||http.status===304){if(settings.onSuccess){if(settings.parseJSON)settings.onSuccess(http.responseText.parseJSON());else settings.onSuccess(http);}}
else{if(settings.onFailure)
settings.onFailure(http);}
try{http.onreadystatechange=null;}catch(e){;}}}}
else{return http.responseText;}
return settings;},submitForm:function(formid,args){var oForm=$(formid);if(typeof args==='undefined')args={};if(typeof args.parameters==='object')
args.parameters=ccms.extend(args.parameters,ccmsFormData(oForm));else
args.parameters=ccmsFormData(oForm);ccms.extend(args,{'url':oForm.action,'method':oForm.method});ccms.async.http(args);},onHTTPError:function(req){ccms.log.debug('HTTP Error: '+req.status+' '+req.statusText+"\n"+req.responseText);},after:function(timeout,callback){return setTimeout(callback,timeout);},cancelTimeout:function(timeout_id){return clearTimeout(timeout_id);},_cache:{},_CachingXMLHttpRequest:function(){var http=null,cache=null,asynchronous=false,key;var self=this;this.onreadystatechange=null;this.open=function(method,url,async){asynchronous=async;key=null;if(method==='GET'){key=method+url+async;if(typeof ccms.async._cache[key]==='object'){cache=ccms.async._cache[key];if(typeof console==='object'&&typeof console.log==='function'){if(typeof console.group==='function')console.group("GET (ccms cached) "+url);console.log(cache);if(typeof console.groupEnd==='function')console.groupEnd();}
return;}}
http=ccms.async.getXMLHttpRequest();http.open(method,url,async);};this.send=function(data){if(cache===null){if(asynchronous){http.onreadystatechange=_onreadystatechange.bind(this);http.send(data);}
else{cache=http.send(data);ccms.async._cache[key]=cache;return cache;}}
else if(asynchronous){ccms.async.after(1,_cached_onreadystatechange.bind(this));}
else{return cache;}}
function _cached_onreadystatechange(){ccms.extend(self,cache);self.onreadystatechange(cache);}
function _onreadystatechange(){if(http.readyState===4&&http.status===200){try{http.onreadystatechange=null;}
catch(e){;}
cache={status:http.status,statusText:http.statusText,readyState:http.readyState,responseText:http.responseText};ccms.extend(self,cache);ccms.async._cache[key]=cache;self.onreadystatechange(cache);}
else if(self.onreadystatechange!==null){self.onreadystatechange(http);}}}});ccms.async.jsr=(function(){var count=0;var head=document.getElementsByTagName("head").item(0);return{callbacks:{},create_cb:function(onSuccess){var c=count;this.callbacks[count]=function(json){var s=$("ccmsjsr"+c);s.parentNode.removeChild(s);delete ccms.async.jsr.callbacks[c];return onSuccess(json);}
return this.callbacks[count];},call:function(settings){if(settings.parameters){settings.url+=(settings.url.indexOf('?')>0?'&':'?')+urlencode(settings.parameters);}
this.create_cb(settings.onSuccess);settings.url+=(settings.url.indexOf('?')>0?'&':'?')+urlencode({callback:'ccms.async.jsr.callbacks['+count+']'})+'&noCacheIE='+(new Date()).getTime();var scriptObj=document.createElement("script");scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("src",settings.url);scriptObj.setAttribute("id","ccmsjsr"+count);head.appendChild(scriptObj);++count;if(typeof console!=='undefined'&&typeof console.log==='function')console.log(settings.url);}};})();ccms.async.processJSON=function(json){ccms.ApiLinks.addMany(json.links);if(typeof json.js!=='undefined'){json.js.foreach(ccms.require);}};ccms.async.trapMultipleSubmits=function(root_element){ccms.event.attach(root_element,'click',function(e){var target=ccms.event.getTarget(e);if(target.type==='submit'){ccms.dom.getElementsBy(function(node){return node.type==='submit'&&node.name!==target.name;},'input',root_element).foreach(function(node){node.value='';node.name='';});}});};if(typeof(YAHOO)==='undefined'){var _script=ccms.async.http({url:'/js/3rdparty/yui/yahoo/yahoo-min.js'});eval(_script);}
if(typeof YAHOO.util.Event==='undefined'){var _script=ccms.async.http({url:'/js/3rdparty/yui/event/event-min.js'});eval(_script);}
if(typeof YAHOO.util.Dom==='undefined'){var _script=ccms.async.http({url:'/js/3rdparty/yui/dom/dom-min.js'});eval(_script);}
if(typeof YAHOO!=='undefined'&&typeof YAHOO.util!=='undefined'){if(typeof YAHOO.util.Event!=='undefined'){ccms.event=YAHOO.util.Event;ccms.event.CustomEvent=YAHOO.util.CustomEvent;ccms.event.addLoadEvent=function(handler,oScope,bOverride){return YAHOO.util.Event.addListener(window,'load',handler,oScope,bOverride);};ccms.event.attach=ccms.event.addListener;ccms.event.detach=ccms.event.removeListener;ccms.event.killEvent=function(e){ccms.event.stopEvent(e);return false;}
ccms.event.YAHOO_onDOMReady=ccms.event.onDOMReady;ccms.event.onDOMReady=function(callback,data,scope){return YAHOO.util.Event.YAHOO_onDOMReady(function(){try{callback.apply(this,arguments);}
catch(ex){if(typeof console==='object'&&typeof console.error==='function'){console.error(ex);}
else ccms.debug.error(ex);throw ex;}},data,scope);}}
else{document.write('<b>ccms.event unavailable, because the YAHOO Event library has not been included before ccms.js</b>');}
if(typeof YAHOO.util.Dom!=='undefined'){ccms.dom=YAHOO.util.Dom;}}
else{document.write('<b>ccms.dom and ccms.event unavailable, because the YAHOO libraries have not been included</b>');}
ccms.events=(function(){var events={};var subs={};return{subscribe:function(p_type,p_fn,p_obj,p_override){var ce=events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}
else{if(!subs[p_type]){subs[p_type]=[];}
subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){var ce=events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}
else{return false;}},add:function(p_type,p_config){var opts=p_config||{};if(events[p_type]){;}
else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new ccms.event.CustomEvent(p_type,scope,silent);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
var qs=subs[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
return events[p_type];},fire:function(p_type,arg1,arg2,etc){var ce=events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);}
else{return null;}}}})();function $(){var elements=[];for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element==='string')
element=document.getElementById(element);if(arguments.length===1)
return element;elements[elements.length]=element;}
return elements;};if(!window.Node||!window.Node.ELEMENT_NODE){var Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};}
ccms.extend(ccms.dom,{toggle:function(e,style){if(typeof e==='string')
e=$(e);if(e.style.display!=='none'){e.style.display='none';}
else if(style)e.style.display=style;else{e.style.display='';}},isHidden:function(e){if(typeof e==='string')e=$(e);return(e.style.display==='none');},hide:function(e){if(typeof e==='string')
e=$(e);e.style.display='none';},show:function(e,style){if(typeof e==='string')
e=$(e);if(style)e.style.display=style;else e.style.display='';},refresh:function(e){if(typeof e==='undefined')
e=document.body;else if(typeof e==='string')
e=$(e);ccms.dom.hide(e);ccms.dom.show(e);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}
else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}
else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}
else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},insertAfter:function(nInsert,nPrevious){var nParent=nPrevious.parentNode;if(nPrevious.nextSibling){nInsert=nParent.insertBefore(nInsert,nPrevious.nextSibling)}
else{nInsert=nParent.appendChild(nInsert);}
return nInsert;},getParentByClassName:function(oElm,strTagName,strClassName){var tf=ccms.dom.hasTagName.rpartial(strTagName.toLowerCase());var f;if(typeof strClassName==='string'){var cf=ccms.dom.hasClass.rpartial(strClassName);f=function(n){return tf(n)&&cf(n);};}
else{f=function(n){return tf(n);};}
return ccms.dom.getAncestor(oElm,f);},getSelfOrAncestorBy:function(callback,node){while(node){if(node.nodeType===Node.ELEMENT_NODE){if(callback(node))
break;}
node=node.parentNode;}
return node;},getElementByClassName:function(strClassName,strTagName,oElm){if(window.opera){if(typeof oElm==='undefined')oElm=document;if(oElm.nodeType===Node.DOCUMENT_NODE)oElm=oElm.body;}
return ccms.dom.getElementsByClassName(strClassName,strTagName,oElm)[0];},getChildrenBy:function(callback,parent,elements_only){if(typeof elements_only==='undefined')elements_only=true;var kids=[];var n=parent.firstChild;while(n){if((!elements_only||ccms.dom.isElementNode(n))&&callback(n))
kids.push(n);n=n.nextSibling;}
return kids;},getChildrenByTagName:function(tagName,parent){return ccms.dom.getChildrenBy(ccms.dom.hasTagName.rpartial(tagName),parent);},getChildrenByClassName:function(className,tagName,parent){var cf=ccms.dom.hasClass.rpartial(className);var f;if(typeof tagName==='string'){var tf=ccms.dom.hasTagName.rpartial(strTagName.toLowerCase());f=function(n){return tf(n)&&cf(n);};}
else{f=function(n){return cf(n);};}
return ccms.dom.getChildrenBy(f,parent);},getElementPosition:function(element){if(element.offsetParent){for(var posX=0,posY=0;element.offsetParent;element=element.offsetParent){posX+=element.offsetLeft;posY+=element.offsetTop;}
return[posX,posY];}
else{return[element.x,element.y];}},getDocumentScroll:function(){return[ccms.dom.getDocumentScrollLeft,ccms.dom.getDocumentScrollTop];},getWidth:function(o){if(typeof o.innerWidth==='number'){return o.innerWidth;}
else if(o.clientWidth){return o.clientWidth;}
return 0;},getHeight:function(o){if(typeof o.innerHeight==='number'){return o.innerHeight;}
else if(o.clientHeight){return o.clientHeight;}
return 0;},isSubnodeOf:function(parent,subnode){if(subnode){var n=subnode.parentNode;while(n){if(n===parent){return true;}
n=n.parentNode;}}
return false;},hasMovedOutOf:function(eventobj,element){var src=ccms.event.getTarget(eventobj);if(element!==src&&src&&!ccms.dom.isSubnodeOf(element,src)){return true;}
var rel=ccms.event.getRelatedTarget(eventobj);return rel!==element&&!ccms.dom.isSubnodeOf(element,rel);},setStyleObject:function(element,styles){element=$(element);if(element)for(var name in styles)ccms.dom.setStyle(element,name,styles[name]);},setStyleByClass:function(t,c,p,v,root){ccms.dom.getElementsByClassName(c,t,root).foreach(function(node){ccms.dom.setStyle(node,p,v);});},toggleClass:function(element,className){if(ccms.dom.hasClass(element,className))
ccms.dom.removeClass(element,className);else
ccms.dom.addClass(element,className);},swapClass:function(element,removeClass,addClass){if(ccms.dom.hasClass(element,removeClass))
ccms.dom.removeClass(element,removeClass);ccms.dom.addClass(element,addClass);},getElementIndex:function(node,includeNonElementNodes){var n=node.parentNode.firstChild;var i=0;if(typeof includeNonElementNodes==='undefined')
includeNonElementNodes=false;while(n){if(n===node)return i;if(includeNonElementNodes||n.nodeType===Node.ELEMENT_NODE)
++i;n=n.nextSibling;}
return-1;},removeChildren:function(el){var prev;var node=el.lastChild;while(node){prev=node.previousSibling;el.removeChild(node);node=prev;}},getNext:function(node,callback,oData){var cb=callback;if(!cb)cb=ccms.dom.isElementNode;var n=node.nextSibling;while(n&&!cb(n,oData)){n=n.nextSibling;}
return n;},getPrevious:function(node,callback,oData){var cb=callback;if(!cb)cb=ccms.dom.isElementNode;var n=node.previousSibling;while(n&&!cb(n,oData)){n=n.previousSibling;}
return n;},getAncestor:function(node,callback,oData){var cb=callback;if(!cb)cb=ccms.dom.isElementNode;var n=node.parentNode;while(n&&!cb(n,oData)){n=n.parentNode;}
return n;},getChild:function(node,callback,oData){var cb=callback;if(!cb)cb=ccms.dom.isElementNode;var n=node.firstChild;while(n&&!cb(n,oData)){n=n.nextSibling;}
return n;},isElementNode:function(node){return node.nodeType===Node.ELEMENT_NODE;},hasTagName:function(node,sTagName){return sTagName==='*'||(typeof node.tagName!=='undefined'&&node.tagName.toUpperCase()===sTagName.toUpperCase());},_waiting:0,pushWaitingClass:function(){++ccms.dom._waiting;ccms.dom.addClass(document.body,'waiting');},popWaitingClass:function(){if(--ccms.dom._waiting<=0){ccms.dom.removeClass(document.body,'waiting');}},fixDuplicateIDs:function(html){var bits=html.match(/id=('.+?'|".+?")/g);bits.foreach(function(attr){var id=attr.match(/('.+?'|".+?")/);id=id[1].substring(1,id[1].length-1);if($(id)){var new_attr='id="'+id+'-'+ccms.dom.generateId()+'"';html=html.replace(attr,new_attr);}});return html;},setSelectedIndexByValue:function(select,value){for(var i=0;i<select.options.length;++i){if(value==select.options[i].value){select.selectedIndex=i;break;}}},ready:false});ccms.event.onDOMReady(function(){ccms.dom.ready=true;});ccms.dom.updatePopupLinks=function(root){ccms.dom.getElementsByClassName('external','a',document.body).foreach(function(node){node.setAttribute('target','_blank');});}
ccms.dom.updateExternalLinks=function(root){ccms.dom.getElementsBy(function(node){return node.getAttribute('rel')==='external';},'a',document.body).foreach(function(node){node.setAttribute('target','_blank');});}
ccms.dom.updateHumanoids=function(root){var humanoids=document.getElementsByTagName('input');var d=new Date();for(var i=0;i<humanoids.length;i++){if(humanoids[i].name=='humanoid'){humanoids[i].value=d.getTime();}}}
ccms.extend(ccms.css,{styleSheets:[],require:function(url)
{if(this.styleSheets[url])return;this.styleSheets[url]=true;if(navigator.userAgent.indexOf('MSIE')>0)
{document.write('<link rel="stylesheet" type="text/css" href="'+url+'" />');}
else
{var s=document.createElement('link');s.setAttribute('rel','stylesheet');s.setAttribute('type','text/css');s.setAttribute('href',url);document.getElementsByTagName('head')[0].appendChild(s);}}});ccms.namespace('ccms.screen');ccms.extend(ccms.screen,(function(){var classes=[];var widths=[];var current_class='';return{setScreenClass:function(){var width=document.documentElement.clientWidth;var new_class=classes[widths[0]];for(var i in widths){var w=widths[i];if(w<=width)new_class=classes[w];}
if(current_class!==new_class){if(current_class!=='')
ccms.dom.removeClass(document.body,current_class);ccms.dom.addClass(document.body,current_class=new_class);ccms.require('/js/ccmsBrowserCapabilities.js');ccms.require('/js/3rdparty/JSONstring.js');ccms.async.when(function(){return(typeof ccms.browser.getCapabilities==='function')&&(typeof JSONstring==='object')},function(){ccms.async.http({url:'/browsercaps',method:'POST',parameters:{'json':JSONstring.make(ccms.browser.getCapabilities())},onSuccess:function(req){},onFailure:function(req){ccms.log.debugging=true;ccms.log.debug('ccmsBrowserCapabilities: '+req.status+' '+req.statusText+"\n"+req.responseText);}});});}},setupMonitor:function(dat,current){var sorter=function sortNumber(a,b){return a-b}
if(current)current_class=current;var i=0;for(var w in dat){widths[i++]=w;classes[w]=dat[w];}
widths.sort(sorter);if(widths.length>0){ccms.event.addLoadEvent(ccms.screen.setScreenClass);ccms.event.addListener(window,'resize',ccms.screen.setScreenClass);}}};})());ccms.cookie={get:function(cookieName,default_value){var cookieNameStart,valueStart,valueEnd,value;cookieNameStart=document.cookie.indexOf(cookieName+'=');if(cookieNameStart<0){if(typeof default_value==='undefined')return null;return default_value;}
valueStart=document.cookie.indexOf(cookieName+'=')+cookieName.length+1;valueEnd=document.cookie.indexOf(";",valueStart);if(valueEnd===-1){valueEnd=document.cookie.length;}
value=document.cookie.substring(valueStart,valueEnd);value=unescape(value);if(value===''){if(typeof default_value==='undefined')return null;return default_value;}
return value;},set:function(cookieName,value,hoursToLive,path,domain,secure){var expireString,timerObj,expireAt,pathString,domainString,secureString,setCookieString;if(!hoursToLive||typeof hoursToLive!=='number'||parseInt(hoursToLive)==='NaN'){expireString='';}
else{timerObj=new Date();timerObj.setTime(timerObj.getTime()+(parseInt(hoursToLive,10)*60*60*1000));expireAt=timerObj.toGMTString();expireString=";expires="+expireAt;}
pathString=";path=";(!path||path==='')?pathString+="/":pathString+=path;domainString="; domain=";(!domain||domain==='')?domainString+=window.location.hostname:domainString+=domain;(secure===true)?secureString=";secure":secureString='';value=escape(value);setCookieString=cookieName+"="+(value)+expireString+pathString+domainString;document.cookie=setCookieString;},del:function(cookieName,path,domain){(!path||!path.length)?path='':path=path;(!domain||!domain.length)?domain='':domain=domain;ccms.cookie.set(cookieName,'',-8760,path,domain);},test:function(){ccms.cookie.set('cT','acc');var runTest=ccms.cookie.get('cT');if(runTest==='acc'){ccms.cookies.del('cT');testStatus=true;}
else{testStatus=false;}
return testStatus;}};ccms.flash=function(html)
{if(typeof html!=='undefined'){var block=html;if(html.constructor.prototype===String.prototype)
{if(html===''){block=false;}
else{block=document.createElement('div');block.innerHTML=html;block=block.childNodes[0];}}
if(block){if(content=$('content')){if(content.childNodes.length>0){content.insertBefore(block,content.childNodes.item(0))}
else{content.appendChild(block);}}}}
var flashes=ccms.arrayOf(ccms.dom.getElementsByClassName('flash','div'));if(flashes.length>0){flash=flashes[0];if(flashes.length>1){for(var f=1;f<flashes.length;++f){var kids=ccms.arrayOf(flashes[f].getElementsByTagName('p'));for(var k=0;k<kids.length;++k){flash.appendChild(kids[k]);}
flashes[f].parentNode.removeChild(flashes[f]);}}
ccms.flash.attachFlash(flash);}}
ccms.flash.attachFlash=function(root_element){}
ccms.event.attach(window,'load',function(e){ccms.flash()});ccms.log.setup();ccms.event.addLoadEvent(ccms.detectScripts);ccms.event.addLoadEvent(ccms.dom.updateHumanoids);ccms.widgets.addInstaller('updatePopupLinks',ccms.dom.updatePopupLinks);if(!Array.prototype.indexOf)
{Array.prototype.indexOf=function(elt)
{var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0)
from+=len;for(;from<len;from++)
{if(from in this&&this[from]===elt)
return from;}
return-1;};}
ccms.ApiLinks=(function(){var links=[];var have_document=false;var _boundcall=function(config){config.api=this;return ccms.ApiLinks.call(config);};ccms.event.onDOMReady(function(){ccms.ApiLinks.extract();});return{extract:function(root_element){if(typeof root_element==='undefined'){if(have_document)return true;have_document=true;root_element=document;}
ccms.arrayOf(root_element.getElementsByTagName('link')).foreach(function(node){links.push({'href':node.getAttribute('href'),'rel':node.getAttribute('rel'),'title':node.getAttribute('title'),'type':node.getAttribute('type'),'parameters':{},'call':_boundcall});});},add:function(link){if(typeof link.parameters==='undefined')link.parameters={};link.call=_boundcall;links.push(link);},addMany:function(links){if(typeof links==='object'&&typeof links.foreach==='function')
links.foreach(this.add);},findByRel:function(rel){return links[links.findBy(function(link){if(typeof rel=='string')return link.rel==rel;return link.rel.match(rel);})];},findWithRel:function(rel){return links.filter(function(link){if(typeof rel=='string')return link.rel==rel;return link.rel.match(rel);});},call:function(config){var api;if(YAHOO.lang.isObject(api=config.api)||(api=this.findByRel(config.api))){config.parseJSON=true;if(typeof config.url==='undefined')config.url=api.href;if(typeof config.parameters==='undefined')config.parameters=api.parameters;else config.parameters=ccms.update(ccms.cloneOf(api.parameters),config.parameters);if(typeof config.parameters.jsi!=='string')config.parameters.jsi='content';return ccms.async.http(config);}}};})();if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
return'\\u'+('0000'+
(+(a.charCodeAt(0))).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
return{stringify:function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+
(+(a.charCodeAt(0))).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');}};}();}
ccms.extend(ccms.date,{monthNames:"January February March April May June July August September October November December".split(" "),weekdayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")});Date.prototype.setISO8601=function(string){var regexp="([0-9]{4})(-([0-9]{2})(-([0-9]{2})"+"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?"+"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";var d=string.match(new RegExp(regexp));var offset=0;var date=new Date(d[1],0,1);if(d[3]){date.setMonth(d[3]-1);}
if(d[5]){date.setDate(d[5]);}
if(d[7]){date.setHours(d[7]);}
if(d[8]){date.setMinutes(d[8]);}
if(d[10]){date.setSeconds(d[10]);}
if(d[12]){date.setMilliseconds(Number("0."+d[12])*1000);}
if(d[14]){offset=(Number(d[16])*60)+Number(d[17]);offset*=((d[15]=='-')?1:-1);}
offset-=date.getTimezoneOffset();time=(Number(date)+(offset*60*1000));this.setTime(Number(time));}