
var Prototype={Version:'1.4.0',ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
var Abstract=new Object();Object.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;}
Object.inspect=function(object){try{if(object==undefined)return'undefined';if(object==null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}}
Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}}
Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){return __method.call(object,event||window.event);}}
Object.extend(Number.prototype,{toColorPart:function(){var digits=this.toString(16);if(this<16)return'0'+digits;return digits;},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;}});var Try={these:function(){var returnValue;for(var i=0;i<arguments.length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}}
var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}}
function $(){var elements=new Array();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.push(element);}
return elements;}
Object.extend(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(eval);},escapeHTML:function(){var div=document.createElement('div');var text=document.createTextNode(this);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:'';},toQueryParams:function(){var pairs=this.match(/^\??(.*)$/)[1].split('&');return pairs.inject({},function(params,pairString){var pair=pairString.split('=');params[pair[0]]=pair[1];return params;});},toArray:function(){return this.split('');},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;},inspect:function(){return"'"+this.replace('\\','\\\\').replace("'",'\\\'')+"'";}});String.prototype.parseQuery=String.prototype.toQueryParams;var $break=new Object();var $continue=new Object();var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){try{iterator(value,index++);}catch(e){if(e!=$continue)throw e;}});}catch(e){if(e!=$break)throw e;}},all:function(iterator){var result=true;this.each(function(value,index){result=result&&!!(iterator||Prototype.K)(value,index);if(!result)throw $break;});return result;},any:function(iterator){var result=true;this.each(function(value,index){if(result=!!(iterator||Prototype.K)(value,index))
throw $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;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(pattern,iterator){var results=[];this.each(function(value,index){var stringValue=value.toString();if(stringValue.match(pattern))
results.push((iterator||Prototype.K)(value,index));})
return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.collect(function(value){return value[method].apply(value,args);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value>=(result||value))
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value<=(result||value))
result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator){return this.collect(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.collect(Prototype.K);},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){iterator(value=collections.pluck(index));return value;});},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}}
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0;i<iterable.length;i++)
results.push(iterable[i]);return results;}}
Object.extend(Array.prototype,Enumerable);Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0;i<this.length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=undefined||value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(value.constructor==Array?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},indexOf:function(object){for(var i=0;i<this.length;i++)
if(this[i]==object)return i;return-1;},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},shift:function(){var result=this[0];for(var i=0;i<this.length-1;i++)
this[i]=this[i+1];this.length--;return result;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';}});var Hash={_each:function(iterator){for(key in this){var value=this[key];if(typeof value=='function')continue;var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},merge:function(hash){return $H(hash).inject($H(this),function(mergedHash,pair){mergedHash[pair.key]=pair.value;return mergedHash;});},toQueryString:function(){return this.map(function(pair){return pair.map(encodeURIComponent).join('=');}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';}}
function $H(object){var hash=Object.extend({},object||{});Object.extend(hash,Enumerable);Object.extend(hash,Hash);return hash;}
ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;do{iterator(value);value=value.succ();}while(this.include(value));},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);}
var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return new XMLHttpRequest()})||false;},activeRequestCount:0}
Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responderToAdd){if(!this.include(responderToAdd))
this.responders.push(responderToAdd);},unregister:function(responderToRemove){this.responders=this.responders.without(responderToRemove);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(responder[callback]&&typeof responder[callback]=='function'){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(options){this.options={method:'post',asynchronous:true,parameters:''}
Object.extend(this.options,options||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return!this.responseIsSuccess();}}
Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){var parameters=this.options.parameters||'';if(parameters.length>0)parameters+='&_=';try{this.url=url;if(this.options.method=='get'&&parameters.length>0)
this.url+=(this.url.match(/\?/)?'&':'?')+parameters;Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1)}).bind(this),10);}
this.setRequestHeaders();var body=this.options.postBody?this.options.postBody:parameters;this.transport.send(this.options.method=='post'?body:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var requestHeaders=['X-Requested-With','XMLHttpRequest','X-Prototype-Version',Prototype.Version];if(this.options.method=='post'){requestHeaders.push('Content-type','application/x-www-form-urlencoded');if(this.transport.overrideMimeType)
requestHeaders.push('Connection','close');}
if(this.options.requestHeaders)
requestHeaders.push.apply(requestHeaders,this.options.requestHeaders);for(var i=0;i<requestHeaders.length;i+=2)
this.transport.setRequestHeader(requestHeaders[i],requestHeaders[i+1]);},onStateChange:function(){var readyState=this.transport.readyState;if(readyState!=1)
this.respondToReadyState(this.transport.readyState);},header:function(name){try{return this.transport.getResponseHeader(name);}catch(e){}},evalJSON:function(){try{return eval(this.header('X-JSON'));}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(readyState){var event=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(event=='Complete'){try{(this.options['on'+this.transport.status]||this.options['on'+(this.responseIsSuccess()?'Success':'Failure')]||Prototype.emptyFunction)(transport,json);}catch(e){this.dispatchException(e);}
if((this.header('Content-type')||'').match(/^text\/javascript/i))
this.evalResponse();}
try{(this.options['on'+event]||Prototype.emptyFunction)(transport,json);Ajax.Responders.dispatch('on'+event,this,transport,json);}catch(e){this.dispatchException(e);}
if(event=='Complete')
this.transport.onreadystatechange=Prototype.emptyFunction;},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options){this.containers={success:container.success?$(container.success):$(container),failure:container.failure?$(container.failure):(container.success?null:$(container))}
this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,object){this.updateContent();onComplete(transport,object);}).bind(this);this.request(url);},updateContent:function(){var receiver=this.responseIsSuccess()?this.containers.success:this.containers.failure;var response=this.transport.responseText;if(!this.options.evalScripts)
response=response.stripScripts();if(receiver){if(this.options.insertion){new this.options.insertion(receiver,response);}else{Element.update(receiver,response);}}
if(this.responseIsSuccess()){if(this.onComplete)
setTimeout(this.onComplete.bind(this),10);}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(container,url,options){this.setOptions(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(request){if(this.options.decay){this.decay=(request.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=request.responseText;}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});document.getElementsByClassName=function(className,parentElement){var children=($(parentElement)||document.body).getElementsByTagName('*');return $A(children).inject([],function(elements,child){if(child.className.match(new RegExp("(^|\\s)"+className+"(\\s|$)")))
elements.push(child);return elements;});}
if(!window.Element){var Element=new Object();}
Object.extend(Element,{visible:function(element){return $(element).style.display!='none';},toggle:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);Element[Element.visible(element)?'hide':'show'](element);}},hide:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='none';}},show:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='';}},remove:function(element){element=$(element);element.parentNode.removeChild(element);},update:function(element,html){$(element).innerHTML=html.stripScripts();setTimeout(function(){html.evalScripts()},10);},getHeight:function(element){element=$(element);return element.offsetHeight;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).include(className);},addClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).add(className);},removeClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).remove(className);},cleanWhitespace:function(element){element=$(element);for(var i=0;i<element.childNodes.length;i++){var node=element.childNodes[i];if(node.nodeType==3&&!/\S/.test(node.nodeValue))
Element.remove(node);}},empty:function(element){return $(element).innerHTML.match(/^\s*$/);},scrollTo:function(element){element=$(element);var x=element.x?element.x:element.offsetLeft,y=element.y?element.y:element.offsetTop;window.scrollTo(x,y);},getStyle:function(element,style){element=$(element);var value=element.style[style.camelize()];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css.getPropertyValue(style):null;}else if(element.currentStyle){value=element.currentStyle[style.camelize()];}}
if(window.opera&&['left','top','right','bottom'].include(style))
if(Element.getStyle(element,'position')=='static')value='auto';return value=='auto'?null:value;},setStyle:function(element,style){element=$(element);for(name in style)
element.style[name.camelize()]=style[name];},getDimensions:function(element){element=$(element);if(Element.getStyle(element,'display')!='none')
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;els.visibility='hidden';els.position='absolute';els.display='';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display='none';els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}},makeClipping:function(element){element=$(element);if(element._overflow)return;element._overflow=element.style.overflow;if((Element.getStyle(element,'overflow')||'visible')!='hidden')
element.style.overflow='hidden';},undoClipping:function(element){element=$(element);if(element._overflow)return;element.style.overflow=element._overflow;element._overflow=undefined;}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(adjacency){this.adjacency=adjacency;}
Abstract.Insertion.prototype={initialize:function(element,content){this.element=$(element);this.content=content.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){if(this.element.tagName.toLowerCase()=='tbody'){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);}
setTimeout(function(){content.evalScripts()},10);},contentFromAnonymousTable:function(){var div=document.createElement('div');div.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(div.childNodes[0].childNodes[0].childNodes);}}
var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(fragments){fragments.reverse(false).each((function(fragment){this.element.insertBefore(fragment,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.appendChild(fragment);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set(this.toArray().concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set(this.select(function(className){return className!=classNameToRemove;}).join(' '));},toString:function(){return this.toArray().join(' ');}}
Object.extend(Element.ClassNames.prototype,Enumerable);var Field={clear:function(){for(var i=0;i<arguments.length;i++)
$(arguments[i]).value='';},focus:function(element){$(element).focus();},present:function(){for(var i=0;i<arguments.length;i++)
if($(arguments[i]).value=='')return false;return true;},select:function(element){$(element).select();},activate:function(element){element=$(element);element.focus();if(element.select)
element.select();}}
var Form={serialize:function(form){var elements=Form.getElements($(form));var queryComponents=new Array();for(var i=0;i<elements.length;i++){var queryComponent=Form.Element.serialize(elements[i]);if(queryComponent)
queryComponents.push(queryComponent);}
return queryComponents.join('&');},getElements:function(form){form=$(form);var elements=new Array();for(tagName in Form.Element.Serializers){var tagElements=form.getElementsByTagName(tagName);for(var j=0;j<tagElements.length;j++)
elements.push(tagElements[j]);}
return elements;},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)
return inputs;var matchingInputs=new Array();for(var i=0;i<inputs.length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(input);}
return matchingInputs;},disable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.blur();element.disabled='true';}},enable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.disabled='';}},findFirstElement:function(form){return Form.getElements(form).find(function(element){return element.type!='hidden'&&!element.disabled&&['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){Field.activate(Form.findFirstElement(form));},reset:function(form){$(form).reset();}}
Form.Element={serialize:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter){var key=encodeURIComponent(parameter[0]);if(key.length==0)return;if(parameter[1].constructor!=Array)
parameter[1]=[parameter[1]];return parameter[1].map(function(value){return key+'='+encodeURIComponent(value);}).join('&');}},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter)
return parameter[1];}}
Form.Element.Serializers={input:function(element){switch(element.type.toLowerCase()){case'submit':case'hidden':case'password':case'text':return Form.Element.Serializers.textarea(element);case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element);}
return false;},inputSelector:function(element){if(element.checked)
return[element.name,element.value];},textarea:function(element){return[element.name,element.value];},select:function(element){return Form.Element.Serializers[element.type=='select-one'?'selectOne':'selectMany'](element);},selectOne:function(element){var value='',opt,index=element.selectedIndex;if(index>=0){opt=element.options[index];value=opt.value;if(!value&&!('value'in opt))
value=opt.text;}
return[element.name,value];},selectMany:function(element){var value=new Array();for(var i=0;i<element.length;i++){var opt=element.options[i];if(opt.selected){var optValue=opt.value;if(!optValue&&!('value'in opt))
optValue=opt.text;value.push(optValue);}}
return[element.name,value];}}
var $F=Form.Element.getValue;Abstract.TimedObserver=function(){}
Abstract.TimedObserver.prototype={initialize:function(element,frequency,callback){this.frequency=frequency;this.element=$(element);this.callback=callback;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}}}
Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){}
Abstract.EventObserver.prototype={initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){var elements=Form.getElements(this.element);for(var i=0;i<elements.length;i++)
this.registerCallback(elements[i]);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;case'password':case'text':case'textarea':case'select-one':case'select-multiple':Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}}
Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(event){return event.target||event.srcElement;},isLeftClick:function(event){return(((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));},pointerX:function(event){return event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){return event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},findElement:function(event,tagName){var element=Event.element(event);while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
element=element.parentNode;return element;},observers:false,_observeAndCache:function(element,name,observer,useCapture){if(!this.observers)this.observers=[];if(element.addEventListener){this.observers.push([element,name,observer,useCapture]);element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){this.observers.push([element,name,observer,useCapture]);element.attachEvent('on'+name,observer);}},unloadCache:function(){if(!Event.observers)return;for(var i=0;i<Event.observers.length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}
Event.observers=false;},observe:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';this._observeAndCache(element,name,observer,useCapture);},stopObserving:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){element.detachEvent('on'+name,observer);}}});Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},clone:function(source,target){source=$(source);target=$(target);target.style.position='absolute';var offsets=this.cumulativeOffset(source);target.style.top=offsets[1]+'px';target.style.left=offsets[0]+'px';target.style.width=source.offsetWidth+'px';target.style.height=source.offsetHeight+'px';},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';;element.style.left=left+'px';;element.style.width=width+'px';;element.style.height=height+'px';;},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}}
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return[valueL,valueT];}}
Array.prototype.toJSONString=function(){var a=['['],b,i,l=this.length,v;function p(s){if(b){a.push(',');}
a.push(s);b=true;}
for(i=0;i<l;i+=1){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString());}}else{p("null");}
break;default:p(v.toJSONString());}}
a.push(']');return a.join('');};Boolean.prototype.toJSONString=function(){return String(this);};Date.prototype.toJSONString=function(){function f(n){return n<10?'0'+n:n;}
return'"'+this.getFullYear()+'-'+
f(this.getMonth()+1)+'-'+
f(this.getDate())+'T'+
f(this.getHours())+':'+
f(this.getMinutes())+':'+
f(this.getSeconds())+'"';};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):"null";};Object.prototype.toJSONString=function(){var a=['{'],b,i,v;function p(s){if(b){a.push(',');}
a.push(i.toJSONString(),':',s);b=true;}
for(i in this){if(this.hasOwnProperty(i)){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString());}}else{p("null");}
break;default:p(v.toJSONString());}}}
a.push('}');return a.join('');};(function(s){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};s.parseJSON=function(){try{if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(this)){return eval('('+this+')');}}catch(e){}
throw new SyntaxError("parseJSON");};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"';}
return'"'+this+'"';};})(String.prototype);var agent=navigator.userAgent.toLowerCase();var is_ie=(agent.indexOf("msie")!=-1);var is_ie_4=(is_ie&&(agent.indexOf("msie 4")!=-1));var is_ie_5=(is_ie&&(agent.indexOf("msie 5.0")!=-1));var is_ie_5_up=(is_ie&&!is_ie_4);var is_ie_5_5=(is_ie&&(agent.indexOf("msie 5.5")!=-1));var is_ie_5_5_up=(is_ie&&!is_ie_4&&!is_ie_5);var is_ie_6=(is_ie&&(agent.indexOf("msie 6.0")!=-1));var is_ie_7=(is_ie&&(agent.indexOf("msie 7.0")!=-1));var is_mozilla=((agent.indexOf("mozilla")!=-1)&&(agent.indexOf("spoofer")==-1)&&(agent.indexOf("compatible")==-1)&&(agent.indexOf("opera")==-1)&&(agent.indexOf("webtv")==-1)&&(agent.indexOf("hotjava")==-1));var is_mozilla_1_3_up=(is_mozilla&&(navigator.productSub>20030210));var is_ns_4=(!is_ie&&(agent.indexOf("mozilla/4.")!=-1));var is_rtf=(is_ie_5_5_up||is_mozilla_1_3_up);var is_safari=(agent.indexOf("safari")!=-1);var submitCountdown=0;function check(form,name,checked){for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.name==name)&&(e.type=="checkbox")){e.checked=checked;}}}
function checkAll(form,name,allBox){if(isArray(name)){for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if(e.type=="checkbox"){for(var j=0;j<name.length;j++){if(e.name==name[j]){e.checked=allBox.checked;}}}}}
else{for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.name==name)&&(e.type=="checkbox")){e.checked=allBox.checked;}}}}
function checkAllBox(form,name,allBox){var totalBoxes=0;var totalOn=0;if(isArray(name)){for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.name!=allBox.name)&&(e.type=="checkbox")){for(var j=0;j<name.length;j++){if(e.name==name[j]){totalBoxes++;if(e.checked){totalOn++;}}}}}}
else{for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.name!=allBox.name)&&(e.name==name)&&(e.type=="checkbox")){totalBoxes++;if(e.checked){totalOn++;}}}}
if(totalBoxes==totalOn){allBox.checked=true;}
else{allBox.checked=false;}}
function checkMaxLength(box,maxLength){if((box.value.length)>=maxLength){box.value=box.value.substring(0,maxLength-1);}}
function checkTab(box){if((document.all)&&(event.keyCode==9)){box.selection=document.selection.createRange();setTimeout("processTab(\""+box.id+"\")",0);}}
function cloneObject(obj,recurse){for(i in obj){if(typeof obj[i]=='object'&&recurse){this[i]=new cloneObject(obj[i],true);}
else
this[i]=obj[i];}}
var Cookie={create:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else{var expires="";}
document.cookie=name+"="+value+expires+"; path=/";},read:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length);}}
return null;},erase:function(name){createCookie(name,"",-1);}}
document.createInputElement=function(name){if(is_ie){var entry=document.createElement("<input name='"+name+"'></input>");}
else{var entry=document.createElement("input");entry.name=name;}
return entry;}
function disableEsc(){if((document.all)&&(event.keyCode==27)){event.returnValue=false;}}
if(!Element)Element=new Object();Element.disable=function(element){element=$(element);var items=element.getElementsByTagName("*");for(var i=0;i<items.length;i++){var item=items[i];var nodeName=item.nodeName.toLowerCase();item.onclick=function(){};item.onmouseover=function(){};item.onmouseout=function(){};if(is_ie){item.onmouseenter=function(){};item.onmouseleave=function(){};}
if(nodeName=="a"){item.href="javascript: void(0)";}
else if(nodeName=="input"||nodeName=="select"||nodeName=="script"){item.disabled="true";}
else if(nodeName=="form"){item.action="";item.onsubmit=function(){return false;};}
item.style.cursor="default";}}
Element.changeOpacity=function(object,opacity){opacity=(opacity>=100)?99.999:opacity;opacity=(opacity<0)?0:opacity;object.style.opacity=(opacity/100);object.style.MozOpacity=(opacity/100);object.style.KhtmlOpacity=(opacity/100);object.style.filter="alpha(opacity="+opacity+")";}
if(!Event)Event=new Object();Event.addHandler=function(obj,type,func){if(type.indexOf("on")!=0){type="on"+type;}
var temp=obj[type];if(typeof obj[type]!="function"){obj[type]=func;}
else{obj[type]=function(){if(temp){temp();}
func();}}}
Event.enterPressed=function(event){if(!event){event=window.event;}
var keycode=event.keyCode;if(keycode==13){return true;}
else{return false;}}
function getSelectedIndex(col){for(var i=0;i<col.length;i++){if(col[i].checked==true){return i;}}
return-1;}
function getSelectedRadioName(col){var i=getSelectedIndex(col);if(i==-1){var radioName=col.name;if(radioName==null){radioName="";}
return radioName;}
else{return col[i].name;}}
function getSelectedRadioValue(col){var i=getSelectedIndex(col);if(i==-1){var radioValue=col.value;if(radioValue==null){radioValue="";}
return radioValue;}
else{return col[i].value;}}
function isArray(object){if(!window.Array){return false;}
else{return object.constructor==window.Array;}}
function LinkedList(){this.head=null;this.tail=null;}
LinkedList.prototype.add=function(obj){obj.listInfo=new Object();var tail=this.tail;var head=this.head;if(this.head==null){this.head=obj;this.tail=obj;}
else{this.tail.listInfo.next=obj;obj.listInfo.prev=this.tail;this.tail=obj;}}
LinkedList.prototype.remove=function(obj){if(this.head){var next=obj.listInfo.next;var prev=obj.listInfo.prev;if(next){next.listInfo.prev=prev;}
if(prev){prev.listInfo.next=next;}
if(this.head=obj){this.head=next;}
if(this.tail=obj){this.tail=prev;}}}
LinkedList.prototype.each=function(func){var cur=this.head;var count=0;while(cur){count++;var next=cur.listInfo.next;if(func){func(cur);}
cur=next;}
return count;}
LinkedList.prototype.size=function(){return this.each();}
function listChecked(form){var s="";for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.type=="checkbox")&&(e.checked==true)&&(e.value>"")){s+=e.value+",";}}
return s;}
function listCheckedExcept(form,except){var s="";for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.type=="checkbox")&&(e.checked==true)&&(e.value>"")&&(e.name.indexOf(except)!=0)){s+=e.value+",";}}
return s;}
function listSelect(box,delimeter){var s="";if(delimeter==null){delimeter=",";}
if(box==null){return"";}
for(var i=0;i<box.length;i++){if(box.options[i].value>""){s+=box.options[i].value+delimeter;}}
if(s==".none,"){return"";}
else{return s;}}
function listUnchecked(form){var s="";for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.type=="checkbox")&&(e.checked==false)&&(e.value>"")){s+=e.value+",";}}
return s;}
function listUncheckedExcept(form,except){var s="";for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.type=="checkbox")&&(e.checked==false)&&(e.value>"")&&(e.name.indexOf(except)!=0)){s+=e.value+",";}}
return s;}
function moveItem(fromBox,toBox,sort){var newText=null;var newValue=null;var newOption=null;if(fromBox.selectedIndex>=0){for(var i=0;i<fromBox.length;i++){if(fromBox.options[i].selected){newText=fromBox.options[i].text;newValue=fromBox.options[i].value;newOption=new Option(newText,newValue);toBox[toBox.length]=newOption;}}
for(var i=0;i<toBox.length;i++){for(var j=0;j<fromBox.length;j++){if(fromBox[j].value==toBox[i].value){fromBox[j]=null;break;}}}}
if(newText!=null){if(sort==true){sortBox(toBox);}}}
function processTab(id){document.all[id].selection.text=String.fromCharCode(9);document.all[id].focus();}
function reelHome(id,startPosX,startPosY,duration,count,c){if(isNaN(startPosX)||isNaN(startPosY)){return;}
var obj=document.getElementById(id);if(obj==null){return;}
var top=parseInt(obj.style.top);var left=parseInt(obj.style.left);if(count==null){count=1;}
if(duration==null){duration==20;}
if(c==null){c=Math.PI/(2*duration);obj.style.zIndex=10;}
if(count<duration){var ratio=1-Math.sin(count*c);obj.style.left=(startPosX*ratio)+"px";obj.style.top=(startPosY*ratio)+"px";setTimeout("reelHome(\""+id+"\","+startPosX+","+startPosY+","+duration+","+(++count)+","+c+")",16);}
else{obj.style.top="0px";obj.style.left="0px";obj.style.zIndex=0;}}
function removeItem(box,value){if(value==null){for(var i=box.length-1;i>=0;i--){if(box.options[i].selected){box[i]=null;}}}
else{for(var i=box.length-1;i>=0;i--){if(box.options[i].value==value){box[i]=null;}}}}
function reorder(box,down){var si=box.selectedIndex;if(si==-1){box.selectedIndex=0;}
else{sText=box.options[si].text;sValue=box.options[si].value;if((box.options[si].value>"")&&(si>0)&&(down==0)){box.options[si].text=box.options[si-1].text;box.options[si].value=box.options[si-1].value;box.options[si-1].text=sText;box.options[si-1].value=sValue;box.selectedIndex--;}
else if((si<box.length-1)&&(box.options[si+1].value>"")&&(down==1)){box.options[si].text=box.options[si+1].text;box.options[si].value=box.options[si+1].value;box.options[si+1].text=sText;box.options[si+1].value=sValue;box.selectedIndex++;}
else if(si==0){for(var i=0;i<(box.length-1);i++){box.options[i].text=box.options[i+1].text;box.options[i].value=box.options[i+1].value;}
box.options[box.length-1].text=sText;box.options[box.length-1].value=sValue;box.selectedIndex=box.length-1;}
else if(si==(box.length-1)){for(var j=(box.length-1);j>0;j--){box.options[j].text=box.options[j-1].text;box.options[j].value=box.options[j-1].value;}
box.options[0].text=sText;box.options[0].value=sValue;box.selectedIndex=0;}}}
function resubmitCountdown(formName){if(submitCountdown>0){submitCountdown--;setTimeout("resubmitCountdown('"+formName+"')",1000);}
else{submitCountdown=0;if(!is_ns_4){document.body.style.cursor="auto";}
var form=document.forms[formName];for(var i=0;i<form.length;i++){var e=form.elements[i];if(e.type&&(e.type.toLowerCase()=="button"||e.type.toLowerCase()=="reset"||e.type.toLowerCase()=="submit")){e.disabled=false;}}}}
function selectAndCopy(el){el.focus();el.select();if(document.all){var textRange=el.createTextRange();textRange.execCommand("copy");}}
function setBox(oldBox,newBox){for(var i=oldBox.length-1;i>-1;i--){oldBox.options[i]=null;}
for(var i=0;i<newBox.length;i++){oldBox.options[i]=new Option(newBox[i].value,i);}
oldBox.options[0].selected=true;}
function setCursorPosition(oInput,oStart,oEnd){if(oInput.setSelectionRange){oInput.setSelectionRange(oStart,oEnd);}
else if(oInput.createTextRange){var range=oInput.createTextRange();range.collapse(true);range.moveEnd('character',oEnd);range.moveStart('character',oStart);range.select();}}
function setSelectedValue(col,value){for(var i=0;i<col.length;i++){if((col[i].value!="")&&(col[i].value==value)){col.selectedIndex=i;break;}}}
function setSelectVisibility(mode,obj){if(is_ie){if(obj){obj=$(obj);}
else{obj=document.getElementsByTagName("body")[0];}
selectList=obj.getElementsByTagName("select");for(var i=0;i<selectList.length;i++){selectList[i].style.visibility=mode;}}}
function slideMaximize(id,height,speed){var obj=document.getElementById(id);var reference=obj.getElementsByTagName("DIV")[0];height+=speed;if(height<(reference.offsetHeight)){obj.style.height=height+"px";setTimeout("slideMaximize(\""+id+"\","+height+","+speed+")",10);}
else{obj.style.overflow="";obj.style.height="";}}
function slideMinimize(id,height,speed){var obj=document.getElementById(id);height-=speed;if(height>0){obj.style.height=height+"px";setTimeout("slideMinimize(\""+id+"\","+height+","+speed+")",10);}
else{obj.style.display="none";}}
function sortBox(box){var newBox=new Array();for(var i=0;i<box.length;i++){newBox[i]=new Array(box[i].value,box[i].text);}
newBox.sort(sortByAscending);for(var i=box.length-1;i>-1;i--){box.options[i]=null;}
for(var i=0;i<newBox.length;i++){box.options[box.length]=new Option(newBox[i][1],newBox[i][0]);}}
function sortByAscending(a,b){if(a[1].toLowerCase()>b[1].toLowerCase()){return 1;}
else if(a[1].toLowerCase()<b[1].toLowerCase()){return-1;}
else{return 0;}}
function sortByDescending(a,b){if(a[1].toLowerCase()>b[1].toLowerCase()){return-1;}
else if(a[1].toLowerCase()<b[1].toLowerCase()){return 1;}
else{return 0;}}
function submitForm(form,action,singleSubmit){if(submitCountdown==0){submitCountdown=10;setTimeout("resubmitCountdown('"+form.name+"')",1000);if(singleSubmit==null||singleSubmit){submitCountdown++;for(var i=0;i<form.length;i++){var e=form.elements[i];if(e.type&&(e.type.toLowerCase()=="button"||e.type.toLowerCase()=="reset"||e.type.toLowerCase()=="submit")){e.disabled=true;}}}
if(action!=null){form.action=action;}
if(!is_ns_4){document.body.style.cursor="wait";}
form.submit();}
else{if(this.submitFormAlert!=null){submitFormAlert(submitCountdown);}}}
if(is_ns_4){encodeURIComponent=new function(uri){return escape(uri);};decodeURIComponent=new function(uri){return unescape(uri);};}
function startsWith(str,x){if(str.indexOf(x)==0){return true;}
else{return false;}}
function endsWith(str,x){if(str.lastIndexOf(x)==str.length-x.length){return true;}
else{return false;}}
function toHTML(s){s=s.replace(/\&/g,"&amp;");s=s.replace(/</g,"&lt;");s=s.replace(/>/g,"&gt;");s=s.replace(/\n/g,"<br>");s=s.replace(/  /g," &nbsp;");return s;}
function toText(s){s=s.replace(/\&nbsp;/gi," ");s=s.replace(/<br>/gi,"\n");s=s.replace(/&gt;/gi,">");s=s.replace(/\&lt;/gi,"<");s=s.replace(/\&amp;/gi,"&");return s;}
function toggleById(id,returnState,displayType){var obj=document.getElementById(id);if(returnState){return toggleByObject(obj,returnState,displayType);}
else{toggleByObject(obj,null,displayType);}}
function toggleByIdSpan(obj,id){var hidden=toggleById(id,true);var spanText=obj.getElementsByTagName("span");if(hidden){spanText[0].style.display="none";spanText[1].style.display="";}
else{spanText[0].style.display="";spanText[1].style.display="none";}}
function toggleByObject(obj,returnState,displayType){var hidden=false;var display="block";if(displayType!=null){display=displayType;}
if(obj!=null){if(!obj.style.display||!obj.style.display.toLowerCase().match("none")){obj.style.display="none";}
else{obj.style.display=display;hidden=true;}}
if(returnState){return hidden;}}
function trimString(str){str=str.replace(/^\s+/g,"").replace(/\s+$/g,"");var charCode=str.charCodeAt(0);while(charCode==160){str=str.substring(1,str.length);charCode=str.charCodeAt(0);}
charCode=str.charCodeAt(str.length-1);while(charCode==160){str=str.substring(0,str.length-1);charCode=str.charCodeAt(str.length-1);}
return str;}
String.prototype.trim=trimString;var Viewport={frame:function(){var x,y;if(self.innerHeight)
{x=self.innerWidth;y=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight)
{x=document.documentElement.clientWidth;y=document.documentElement.clientHeight;}
else if(document.body)
{x=document.body.clientWidth;y=document.body.clientHeight;}
return(new Coordinate(x,y));},scroll:function(){var x,y;if(self.pageYOffset)
{x=self.pageXOffset;y=self.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop)
{x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}
else if(document.body)
{x=document.body.scrollLeft;y=document.body.scrollTop;}
return(new Coordinate(x,y));},page:function(){var x,y;var test1=document.body.scrollHeight;var test2=document.body.offsetHeight
if(test1>test2)
{x=document.body.scrollWidth;y=document.body.scrollHeight;}
else
{x=document.body.offsetWidth;y=document.body.offsetHeight;}
return(new Coordinate(x,y));}}
var ZINDEX={ALERT:100,CHAT_BOX:11,DRAG_ITEM:10,DRAG_ARROW:9}
function changeBackground(path,extension){var bodyWidth;if(is_safari){bodyWidth=self.innerWidth;}
else{bodyWidth=document.body.clientWidth;}
if(extension!=null){if(bodyWidth<=1024){document.body.style.backgroundImage="url("+path+"."+extension+")";}
else if(bodyWidth>1024&&bodyWidth<=1280){document.body.style.backgroundImage="url("+path+"-1280."+extension+")";}
else if(bodyWidth>1280){document.body.style.backgroundImage="url("+path+"-1600."+extension+")";}}}
var DragLink={create:function(item,dragId){item.dragId=$(dragId);item.clickLink=item.href;item.href="javascript:void(0)";item.onclick=DragLink.onLinkClick;},onLinkClick:function(){if(this.dragId.wasClicked){if(is_ie){setTimeout("window.location = \""+this.clickLink+"\";",0);}
else{window.location=this.clickLink;}}}}
var DynamicSelect={create:function(url,source,target,callback,query){var returnObj=new Object();returnObj["callback"]=callback;returnObj["target"]=target;source.onchange=function(){loadPage(url,(query?(query+"&"):"")+"sourceValue="+this.value,DynamicSelect.returnFunction,returnObj);}},returnFunction:function(xmlHttpReq,returnObj){var select;var target=returnObj["target"];var callback=returnObj["callback"];try{select=eval("("+xmlHttpReq.responseText+")");}
catch(err){}
target.length=0;if(select.options.length>0){target.disabled=false;var options=select.options;for(var i=0;i<options.length;i++){target.options[i]=new Option(options[i].name,options[i].value);}}
else{target.disabled=true;}
if(callback!=null){callback();}}}
var LiferayDock={MODE:{EXPAND:0,COLLAPSE:1},ORDER:[0,1,4,5,2,8,6,9,3,12,10,7,13,11,14,15],FRAME_C:0.08,cached:null,count:0,constants:null,defaultText:"",defaultTimer:0,defaultTimeout:0,dock:null,dockIcons:null,modeTimer:0,dockCoords:new Array(),debug:function(){$("dock_debug").innerHTML=this.dockCoords.toSource();},initialize:function(defaultText){var constants=new Array();this.dockCoords[0]=new Array();this.dockCoords[1]=new Array();for(var i=0;i<4;i++){for(var j=0;j<4;j++){var box=new Object();var x=j*(-54);var y=i*(54);var h=Math.sqrt(x*x+y*y);box.h=h;box.x=x;box.y=y;box.lastFrame=h*this.FRAME_C;if(h){box.sin=y/h;box.cos=x/h;}
constants.push(box);}}
for(var i=0;i<16;i++){LiferayDock.dockCoords[0][i]=new Array();LiferayDock.dockCoords[1][i]=new Array();}
var self=this;var dock=$("portal-dock");var dockIcons=document.getElementsByClassName("portal-dock-box",dock);var size=dockIcons.length;this.dock=dock;this.dockIcons=dockIcons;this.constants=constants;this.defaultText=defaultText||"";dock.onmouseover=this.expand.bindAsEventListener(this);dock.onmouseout=this.collapse.bindAsEventListener(this);dockIcons.each(function(item,index){item.onmouseout=self.collapse.bindAsEventListener(self);item.constants=self.constants[self.ORDER[index]];item.style.zIndex=size-index;});var myPlaces=$("portal-dock-my-places");myPlaces.getElementsByTagName("table")[0].onmouseover=function(){MyPlaces.show();this.onmouseover=function(){};};this.cached=LiferayDockCached;},setMode:function(mode){this.direction=mode;if(!this.timer){this.timer=setTimeout("LiferayDock.animate()",1);clearTimeout(this.defaultTimer);if(mode==LiferayDock.MODE.COLLAPSE){this.defaultTimer=setTimeout("LiferayDock.showText(\""+this.defaultText+"\", 0)",this.defaultTimeout);}}},showText:function(text,defaultTimeout){var textBox=$("portal-dock-text");this.showObject(textBox);textBox.innerHTML=text;this.defaultTimeout=(defaultTimeout||1)*1000;},showObject:function(item,defaultTimeout){item=$(item);var helpItems=new Array();helpItems.push($("portal-dock-text"));helpItems.push($("portal-dock-my-places"));helpItems.push($("portal-dock-search"));helpItems.each(function(helpItem){if(item.id==helpItem.id){helpItem.style.display="";}
else{helpItem.style.display="none";}});if(item.id=="portal-dock-my-places"){item.getElementsByTagName("table")[0].onmouseover=function(){MyPlaces.show();this.onmouseover=function(){};};}
this.defaultTimeout=(defaultTimeout||0)*1000;},collapse:function(){if(this.modeTimer){clearTimeout(this.modeTimer);}
this.modeTimer=setTimeout("LiferayDock.setMode(LiferayDock.MODE.COLLAPSE)",200);},expand:function(event){if(this.modeTimer){clearTimeout(this.modeTimer);}
this.modeTimer=setTimeout("LiferayDock.setMode(LiferayDock.MODE.EXPAND)",100);},animate:function(obj){var collapse=(this.direction==this.MODE.COLLAPSE);var count=this.count;var updated=false;var cached=this.cached;this.dockIcons.each(function(item,index){if(item.constants.h){if(count<=item.constants.lastFrame){if(!cached){var ratio=count/item.constants.lastFrame;var dist=item.constants.h*ratio;var maxRad;}
if(collapse){if(cached){item.style.left=cached[1][index][count][0]+"px";item.style.top=cached[1][index][count][1]+"px";}
else{maxRad=Math.PI/2;distRatio=1+Math.sin((ratio*maxRad)-(Math.PI/2));item.style.left=(distRatio*(item.constants.x))+"px";item.style.top=(distRatio*(item.constants.y))+"px";}}
else{if(cached){item.style.left=cached[0][index][count][0]+"px";item.style.top=cached[0][index][count][1]+"px";}
else{maxRad=Math.PI/2+Math.PI/8;distRatio=Math.sin(ratio*maxRad);item.style.left=(distRatio*(item.constants.x/Math.sin(maxRad)))+"px";item.style.top=(distRatio*(item.constants.y/Math.sin(maxRad)))+"px";}}
updated=true;}
else{item.style.left=item.constants.x+"px";item.style.top=item.constants.y+"px";}}});if(collapse&&count>0){this.count--;this.timer=setTimeout("LiferayDock.animate()",30);}
else if(!collapse&&updated){this.count++;this.timer=setTimeout("LiferayDock.animate()",30);}
else{this.timer=0;}}}
var LayoutColumns={columns:new Array(),highlight:"transparent",layoutMaximized:"",plid:"",doAsUserId:"",arrow:null,displayArrow:function(mode,left,top){var arrow=LayoutColumns.arrow
if(!arrow){arrow=new Object();var arrowUp=document.createElement("div");arrowUp.style.zIndex=ZINDEX.DRAG_ARROW;arrowUp.style.display="none";arrowUp.className="layout-column-arrow-up";var arrowDown=document.createElement("div");arrowDown.style.zIndex=ZINDEX.DRAG_ARROW;arrowDown.style.display="none";arrowDown.className="layout-column-arrow-down";document.body.appendChild(arrowUp);document.body.appendChild(arrowDown);arrow.up=arrowUp;arrow.down=arrowDown;LayoutColumns.arrow=arrow;}
if(mode=="up"){arrow.up.style.top=top+"px";arrow.up.style.left=left+"px";arrow.up.style.display="";arrow.down.style.display="none";}
else if(mode=="down"){arrow.down.style.top=top+"px";arrow.down.style.left=left+"px";arrow.down.style.display="";arrow.up.style.display="none";}
else if(mode=="none"){arrow.down.style.display="none";arrow.up.style.display="none";}},init:function(colArray){for(var i=0;i<colArray.length;i++){var column=$("layout-column_"+colArray[i]);if(column){column.columnId=colArray[i];DropZone.add(column,{accept:["portlet-boundary"],onDrop:LayoutColumns.onDrop,onHoverOver:LayoutColumns.onHoverOver,onHoverOut:function(){LayoutColumns.displayArrow("none");},inheritParent:true});LayoutColumns.columns.push(column,{onDrop:LayoutColumns.onDrop});var boxes=document.getElementsByClassName("portlet-boundary",column);boxes.each(function(item,index){if(!item.isStatic){LayoutColumns.initPortlet(item);}});}}},initPortlet:function(portlet){portlet=$(portlet);var handle=document.getElementsByClassName("portlet-header-bar",portlet)[0]||document.getElementsByClassName("portlet-title-default",portlet)[0];if(handle){handle.style.cursor="move";DragDrop.create(portlet,{revert:true,handle:handle,ghosting:true,highlightDropzones:LayoutColumns.highlight});}},onDrop:function(item){var dropOptions=this;var container=dropOptions.dropItem;var childList=container.childNodes;var insertBox=null;item.dragOptions.clone.isStatic="yes";for(var i=0;i<childList.length;i++){var box=childList[i];if(box.className&&Element.hasClassName(box,"portlet-boundary")){if(!box.isStatic){var nwOffset=Coordinates.northwestOffset(box,true);var midY=nwOffset.y+(box.offsetHeight/2);if(mousePos.y<midY){insertBox=box;break;}}
else if(box.isStatic.match("end")){insertBox=box;break;}}}
Element.remove(item);container.insertBefore(item,insertBox);item.dragOptions.revert=false;item.style.position="";item.style.left="";item.style.top="";item.style.height="";item.style.width="100%";var newPosition=0;for(var i=0;i<childList.length;i++){var box=childList[i];if(box.className&&Element.hasClassName(box,"portlet-boundary")){if(!box.isStatic){if(box==item){break;}
newPosition++;}}}
LayoutColumns.displayArrow("none");movePortlet(LayoutColumns.plid,item.portletId,container.columnId,newPosition,LayoutColumns.doAsUserId);},onHoverOver:function(item){var dropOptions=this;var container=dropOptions.dropItem;var childList=container.childNodes;var insertBox=null;var bottom=true;var inside;var lastBox;for(var i=0;i<childList.length;i++){var box=childList[i];if(box.className&&Element.hasClassName(box,"portlet-boundary")){if(!box.isStatic){lastBox=box;inside=mousePos.insideObject(box,true);if(inside){var midY=box.offsetHeight/2;if(inside.y<=midY||box==item.dragOptions.clone){bottom=false;}
else{bottom=true;}
insertBox=box;break;}}
else if(box.isStatic.match("end")){insertBox=box;break;}}}
var top;var left;if(insertBox){left=inside.nwOffset.x+20;if(bottom){top=inside.nwOffset.y+insertBox.offsetHeight-50;LayoutColumns.displayArrow("down",left,top);}
else{top=inside.nwOffset.y;LayoutColumns.displayArrow("up",left,top);}}
else{if(lastBox){var nwOffset=Coordinates.northwestOffset(lastBox,true);top=nwOffset.y+lastBox.offsetHeight-50;left=nwOffset.x+20;LayoutColumns.displayArrow("down",left,top);}
else{var nwOffset=Coordinates.northwestOffset(container,true);top=nwOffset.y;left=nwOffset.x+20;LayoutColumns.displayArrow("up",left,top);}}}}
var Navigation={params:new Object(),lastMoved:null,reordered:null,addPage:function(){var params=Navigation.params;var url=themeDisplay.getPathMain()+"/layout_management/update_page?cmd=add"+"&groupId="+params.groupId+"&private="+params.isPrivate+"&parent="+params.parent+"&mainPath="+encodeURIComponent(themeDisplay.getPathMain())+"&doAsUserId="+themeDisplay.getDoAsUserIdEncoded();AjaxUtil.request(url,{onComplete:function(xmlHttpReq){var jo=$J(xmlHttpReq.responseText);window.location=jo.url+"&newPage=1";}});},removePage:function(){var tab=$("layout-tab-selected");var tabText=$("layout-tab-text-edit").innerHTML;var params=Navigation.params;if(confirm("Remove "+tabText+"\"?")){var url=themeDisplay.getPathMain()+"/layout_management/update_page?cmd=delete"+"&ownerId="+params.ownerId+"&layoutId="+params.layoutId;AjaxUtil.request(url,{onComplete:function(){window.location=themeDisplay.getPathMain()+"/portal/layout?p_l_id="+params.ownerId+".1";}});}},init:function(params){Navigation.params=params;QuickEdit.create("layout-tab-text-edit",{dragId:"layout-tab-selected",fixParent:true,onEdit:function(input,textWidth){var parent=input.parentNode;var delLink=document.createElement("a");delLink.innerHTML="X";delLink.href="javascript:Navigation.removePage()";delLink.className="layout-tab-close";parent.className="layout-tab-text-editing";input.style.width=(textWidth+20)+"px";Element.addClassName(input,"layout-tab-input");parent.insertBefore(delLink,input);},onComplete:function(newTextObj,oldText){var parent=newTextObj.parentNode;var delLinks=document.getElementsByClassName("layout-tab-close",parent);var delLink=delLinks[delLinks.length-1];var newText=newTextObj.innerHTML;parent.className="layout-tab-text";if(newText==""){newTextObj.innerHTML=newText="(UNTITLED)";}
delLink.style.display="none";if(oldText!=newText){var params=Navigation.params;var url=themeDisplay.getPathMain()+"/layout_management/update_page?cmd=title&title="+encodeURIComponent(newText)+"&ownerId="+params.ownerId+"&language="+params.language+"&layoutId="+params.layoutId;AjaxUtil.request(url);}}});DropZone.add("layout-nav-container",{accept:["layout-tab"],onHoverOver:Navigation.onDrag,onDrop:Navigation.onDrop});var tabs=document.getElementsByClassName("layout-tab",$("layout-nav-container"));tabs.each(function(item,index){var link=item.getElementsByTagName("a");if(link.length>0){link[0].style.cursor="pointer";}
DragDrop.create(item,{forceDrop:true,revert:true});item.layoutId=Navigation.params.layoutIds[index];item.style.cursor="move";var links=item.getElementsByTagName("a");if(links.length>0){DragLink.create(links[0],item);}});if(Navigation.params.newPage){var opts=$("layout-tab-text-edit").editOptions;$(opts.dragId).wasClicked=true;QuickEdit.edit($("layout-tab-text-edit"));}},move:function(obj,from,to){var tabs=document.getElementsByClassName("layout-tab",$("layout-nav-container"));var selectedTab=obj;var nav=document.getElementById("layout-nav-container");var target;Element.remove(selectedTab);if(from>to){target=tabs[to];}
else{if(to==tabs.length-1){target=$("layout-tab-add");}
else{target=tabs[to+1];}}
nav.insertBefore(selectedTab,target);},onDrag:function(item){var dragOptions=item.dragOptions;var clone=dragOptions.clone;var fromIndex=-1;var toIndex=-1;clone.layoutId=item.layoutId;var tabs=document.getElementsByClassName("layout-tab","layout-nav-container");tabs.each(function(tab,index){if(tab==clone){fromIndex=index;}
if(mousePos.insideObject(tab,true)){if(tab!=clone){if(tab!=Navigation.lastMoved){toIndex=index;Navigation.lastMoved=tab;}}
else{Navigation.lastMoved=null;}}});if(fromIndex>=0&&toIndex>=0){Navigation.move(clone,fromIndex,toIndex);}},onDrop:function(item){tabs=document.getElementsByClassName("layout-tab",$("layout-nav-container"));var reordered=new Array();for(var i=0;i<tabs.length;i++){reordered[i]=tabs[i].layoutId;}
Navigation.reordered=reordered;if(Navigation.reordered){var reordered=Navigation.reordered;var params=Navigation.params;var url=themeDisplay.getPathMain()+"/layout_management/update_page?cmd=reorder"+"&ownerId="+params.ownerId+"&parent="+params.parent+"&layoutIds="+reordered.concat(Navigation.params.hiddenIds);AjaxUtil.request(url);}}}
var PortletHeaderBar={fadeIn:function(id){var bar=document.getElementById(id);if(bar==null)
return;if(bar.startOut){clearTimeout(bar.timerOut);bar.timerOut=0;}
bar.startOut=false;bar.startIn=true;bar.opac+=20;for(var i=0;i<bar.iconList.length;i++){Element.changeOpacity(bar.iconList[i],bar.opac);}
bar.iconBar.style.display="block";if(bar.opac<100){bar.timerIn=setTimeout("PortletHeaderBar.fadeIn(\""+id+"\")",50);}
else{bar.timerIn=0;bar.startIn=false;}},fadeOut:function(id){var bar=document.getElementById(id);if(bar==null)
return;if(bar.startIn){clearTimeout(bar.timerIn);bar.timerIn=0;}
bar.startIn=false;bar.startOut=true;bar.opac-=20;for(var i=0;i<bar.iconList.length;i++){Element.changeOpacity(bar.iconList[i],bar.opac);}
bar.iconBar.style.display="block";if(bar.opac>0){bar.timerOut=setTimeout("PortletHeaderBar.fadeOut(\""+id+"\")",50);}
else{bar.iconBar.style.display="none";bar.timerOut=0;bar.startOut=false;}},init:function(bar){if(!bar.iconBar){bar.iconBar=document.getElementsByClassName("portlet-small-icon-bar",bar)[0];}
if(!bar.iconList){bar.iconList=bar.iconBar.getElementsByTagName("img");}},hide:function(id){var bar=document.getElementById(id);if(bar.timerIn&&!bar.startIn){clearTimeout(bar.timerIn);bar.timerIn=0;}
if(!bar.startOut&&bar.opac>0){if(bar.timerOut){clearTimeout(bar.timerOut);bar.timerOut=0;}
this.init(bar);bar.timerOut=setTimeout("PortletHeaderBar.fadeOut(\""+id+"\")",150);}},show:function(id){var bar=document.getElementById(id);if(bar.timerOut&&!bar.startOut){clearTimeout(bar.timerOut);bar.timerOut=0;}
if(!bar.startIn&&(!bar.opac||bar.opac<100)){if(!bar.opac){bar.opac=0;}
if(bar.timerIn){clearTimeout(bar.timerIn);bar.timerIn=0;}
this.init(bar);bar.timerIn=setTimeout("PortletHeaderBar.fadeIn(\""+id+"\")",150);}}}
var PhotoSlider=Class.create();PhotoSlider.prototype={initialize:function(slidingWindow,windowWidth,photos,totalPages,varName){this.TOTAL_FRAMES=20;this.count=0;this.page=0;this.timer=0;this.start=0;this.photos=$(photos);this.photos.style.position="relative";this.photos.style.left="0px";this.slidingWindow=$(slidingWindow);this.windowWidth=windowWidth;this.totalPages=totalPages;this.varName=varName;},animate:function(){if(this.count<=this.TOTAL_FRAMES){var ratio=this.count/this.TOTAL_FRAMES;var ratio2=Math.sin(ratio*(Math.PI/2))
var delta=-(this.page*this.windowWidth)-this.start;this.photos.style.left=this.start+(delta*ratio2);this.count++;this.timer=setTimeout(this.varName+".animate()",30);}
else{this.timer=0;}},left:function(){this.start=parseInt(this.photos.style.left);if(this.page>0){this.page--;this.count=0;if(!this.timer){this.timer=setTimeout(this.varName+".animate()",30);}}},right:function(){this.start=parseInt(this.photos.style.left);if(this.page<(this.totalPages-1)){this.page++
this.count=0;if(!this.timer){this.timer=setTimeout(this.varName+".animate()",30);}}}}
var Tabs={show:function(namespace,names,id){var el=document.getElementById(namespace+id+"TabsId");if(el){el.className="current";}
el=document.getElementById(namespace+id+"TabsSection");if(el){el.style.display="block";}
for(var i=0;(names.length>1)&&(i<names.length);i++){if(id!=names[i]){el=document.getElementById(namespace+names[i]+"TabsId");if(el){el.className="none";}
el=document.getElementById(namespace+names[i]+"TabsSection");if(el){el.style.display="none";}}}}}
var QuickEdit={inputList:new LinkedList(),create:function(id,options){var item=$(id);item.editOptions=options;item.onclick=function(){QuickEdit.edit(this);};item.style.cursor="text";},edit:function(textObj){var opts=textObj.editOptions||new Object();var wasClicked=true;var isTextarea=false;if(opts.dragId){wasClicked=$(opts.dragId).wasClicked;}
if(opts.inputType&&opts.inputType=="textarea"){isTextarea=true;}
if(!textObj.editing&&wasClicked){var input;var textDiv=textObj.parentNode;if(isTextarea){input=document.createElement("textarea");}
else{input=document.createElement("input");}
if(opts.fixParent){textDiv.style.width=textDiv.offsetWidth+"px";}
input.className="portlet-form-input-field";input.value=toText(textObj.innerHTML);input.textObj=textObj;input.onmouseover=function(){document.onclick=function(){};}
input.onmouseout=function(){document.onclick=function(){QuickEdit.inputList.each(QuickEdit.onDone)};}
input.onkeydown=function(event){if(!isTextarea&&Event.enterPressed(event)){QuickEdit.inputList.each(QuickEdit.onDone);}}
var textWidth=textObj.offsetWidth;var textHeight=textObj.offsetHeight;textObj.style.display="none";textDiv.appendChild(input);if(opts.onEdit){opts.onEdit(input,textWidth,textHeight);}
input.focus();QuickEdit.inputList.add(input);if(opts.dragId){$(opts.dragId).disableDrag=true;}
textObj.editing=true;}},onDone:function(input){if(input){document.onclick=function(){};var textObj=input.textObj;var textDiv=textObj.parentNode;var newText=toHTML(input.value);var oldText=textObj.innerHTML;var opts=textObj.editOptions;textObj.innerHTML=newText;if(opts.onComplete){opts.onComplete(textObj,oldText);}
Element.remove(input);textObj.style.display="";textObj.editing=false;if(opts.dragId){$(opts.dragId).disableDrag=false;}
if(opts.fixParent){textDiv.style.width="auto";}
QuickEdit.inputList.remove(input);}}}
var StarRating=Class.create();StarRating.prototype={initialize:function(item,options){this.options=options||new Object();this.rating=this.options.rating||0;item=$(item);this.stars=$A(item.getElementsByTagName("img"));var self=this
if(!this.options.displayOnly){item.onmouseout=this.onHoverOut.bindAsEventListener(this);this.stars.each(function(image,index){image.index=index+1;image.onclick=self.onClick.bindAsEventListener(self);image.onmouseover=self.onHoverOver.bindAsEventListener(self);})}
this.display(this.rating,"rating");},display:function(rating,mode){var self=this;rating=rating==null?this.rating:rating;var whole=Math.floor(rating);var fraction=rating-whole;this.stars.each(function(image,index){if(index<whole){if(mode=="hover"){image.src=image.src.replace(/\bstar_.*\./,"star_hover.");}
else{image.src=image.src.replace(/\bstar_.*\./,"star_on.");}}
else{if(fraction<0.25){image.src=image.src.replace(/\bstar_.*\./,"star_off.");}
else if(fraction<0.50){image.src=image.src.replace(/\bstar_.*\./,"star_on_quarter.");}
else if(fraction<0.75){image.src=image.src.replace(/\bstar_.*\./,"star_on_half.");}
else if(fraction<1.00){image.src=image.src.replace(/\bstar_.*\./,"star_on_threequarters.");}
fraction=0;}});},onHoverOver:function(event){var target=Event.element(event);this.display(target.index,"hover");},onHoverOut:function(event){this.display();},onClick:function(event){var target=Event.element(event);var newRating=target.index;this.rating=newRating;if(this.options.onComplete){this.options.onComplete(newRating);}
this.display(newRating);}}
var ToolTip={current:null,opacity:100,show:function(event,obj,text){event=event||window.event;var target=obj;var tip=ToolTip.current;target.onmouseout=ToolTip.hide;if(!tip){var tip=document.createElement("div");tip.className="portal-tool-tip";tip.style.position="absolute";tip.style.cursor="default";document.body.appendChild(tip);ToolTip.current=tip;}
tip.innerHTML=text;tip.style.display="";tip.style.top=(Event.pointerY(event)-15)+"px";tip.style.left=(Event.pointerX(event)+15)+"px";},hide:function(event){if(ToolTip.current){ToolTip.current.style.display="none";}},fadeOut:function(){if(ToolTip.current){var tip=ToolTip.current;var opacity=ToolTip.opacity;if(opacity>0&&opacity<100){ToolTip.opacity-=20;Element.changeOpacity(tip,ToolTip.opacity);ToolTip.timeout=setTimeout("ToolTip.fadeOut()",30);}
else{Element.changeOpacity(tip,100);if(opacity<=0){ToolTip.current.style.display="none";}}}}}
var LiferayDockCached=[[[],[[-0,0],[-26,0],[-46,0],[-57,0],[-57,0]],[[-0,0],[-0,26],[-0,46],[-0,57],[-0,57]],[[-0,0],[-18,18],[-35,35],[-48,48],[-56,56],[-58,58],[-55,55]],[[-0,0],[-26,0],[-51,0],[-74,0],[-92,0],[-106,0],[-114,0],[-117,0],[-113,0]],[[-0,0],[-0,26],[-0,51],[-0,74],[-0,92],[-0,106],[-0,114],[-0,117],[-0,113]],[[-0,0],[-24,12],[-46,23],[-67,33],[-85,42],[-99,50],[-110,55],[-116,58],[-117,58],[-113,57]],[[-0,0],[-12,24],[-23,46],[-33,67],[-42,85],[-50,99],[-55,110],[-58,116],[-58,117],[-57,113]],[[-0,0],[-26,0],[-52,0],[-77,0],[-100,0],[-120,0],[-138,0],[-153,0],[-164,0],[-172,0],[-175,0],[-175,0],[-170,0]],[[-0,0],[-0,26],[-0,52],[-0,77],[-0,100],[-0,120],[-0,138],[-0,153],[-0,164],[-0,172],[-0,175],[-0,175],[-0,170]],[[-0,0],[-19,19],[-37,37],[-54,54],[-70,70],[-84,84],[-96,96],[-105,105],[-112,112],[-116,116],[-117,117],[-115,115],[-110,110]],[[-0,0],[-25,8],[-50,17],[-73,24],[-95,32],[-115,38],[-133,44],[-148,49],[-160,53],[-169,56],[-174,58],[-175,58],[-173,58],[-168,56]],[[-0,0],[-8,25],[-17,50],[-24,73],[-32,95],[-38,115],[-44,133],[-49,148],[-53,160],[-56,169],[-58,174],[-58,175],[-58,173],[-56,168]],[[-0,0],[-22,15],[-44,29],[-65,43],[-85,56],[-103,69],[-120,80],[-135,90],[-148,99],[-159,106],[-167,111],[-172,115],[-175,117],[-175,117],[-172,115],[-166,111]],[[-0,0],[-15,22],[-29,44],[-43,65],[-56,85],[-69,103],[-80,120],[-90,135],[-99,148],[-106,159],[-111,167],[-115,172],[-117,175],[-117,175],[-115,172],[-111,166]],[[-0,0],[-19,19],[-37,37],[-55,55],[-73,73],[-89,89],[-105,105],[-120,120],[-133,133],[-144,144],[-154,154],[-162,162],[-168,168],[-173,173],[-175,175],[-175,175],[-174,174],[-170,170],[-164,164]]],[[],[[-0,0],[-4,0],[-14,0],[-29,0],[-48,0]],[[-0,0],[-0,4],[-0,14],[-0,29],[-0,48]],[[-0,0],[-2,2],[-7,7],[-15,15],[-26,26],[-39,39],[-52,52]],[[-0,0],[-2,0],[-7,0],[-16,0],[-27,0],[-42,0],[-58,0],[-76,0],[-95,0]],[[-0,0],[-0,2],[-0,7],[-0,16],[-0,27],[-0,42],[-0,58],[-0,76],[-0,95]],[[-0,0],[-1,1],[-6,3],[-13,6],[-22,11],[-34,17],[-47,24],[-63,31],[-79,40],[-96,48]],[[-0,0],[-1,1],[-3,6],[-6,13],[-11,22],[-17,34],[-24,47],[-31,63],[-40,79],[-48,96]],[[-0,0],[-1,0],[-5,0],[-11,0],[-19,0],[-29,0],[-41,0],[-55,0],[-70,0],[-87,0],[-105,0],[-124,0],[-143,0]],[[-0,0],[-0,1],[-0,5],[-0,11],[-0,19],[-0,29],[-0,41],[-0,55],[-0,70],[-0,87],[-0,105],[-0,124],[-0,143]],[[-0,0],[-1,1],[-4,4],[-8,8],[-14,14],[-22,22],[-31,31],[-41,41],[-52,52],[-65,65],[-78,78],[-91,91],[-105,105]],[[-0,0],[-1,0],[-4,1],[-10,3],[-17,6],[-26,9],[-37,12],[-50,17],[-64,21],[-79,26],[-96,32],[-113,38],[-131,44],[-150,50]],[[-0,0],[-0,1],[-1,4],[-3,10],[-6,17],[-9,26],[-12,37],[-17,50],[-21,64],[-26,79],[-32,96],[-38,113],[-44,131],[-50,150]],[[-0,0],[-1,1],[-3,2],[-7,5],[-13,9],[-20,13],[-29,19],[-39,26],[-50,33],[-62,42],[-76,50],[-90,60],[-105,70],[-120,80],[-136,91],[-153,102]],[[-0,0],[-1,1],[-2,3],[-5,7],[-9,13],[-13,20],[-19,29],[-26,39],[-33,50],[-42,62],[-50,76],[-60,90],[-70,105],[-80,120],[-91,136],[-102,153]],[[-0,0],[-1,1],[-2,2],[-5,5],[-9,9],[-15,15],[-21,21],[-28,28],[-37,37],[-46,46],[-56,56],[-67,67],[-78,78],[-91,91],[-103,103],[-116,116],[-130,130],[-144,144],[-157,157]]]];function AjaxRequest(url,options){var xmlHttpReq;var opts=options;var returnArgs=opts.returnArgs;var method=opts.method;var ajaxId=opts.ajaxId;if(window.XMLHttpRequest){xmlHttpReq=new XMLHttpRequest();if(xmlHttpReq.overrideMimeType){xmlHttpReq.overrideMimeType("text/html");}}
else if(window.ActiveXObject){try{xmlHttpReq=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){try{xmlHttpReq=new XMLHttpRequest();}
catch(e){}}}}
var onComplete=opts.onComplete;var returnFunction=function(){if(xmlHttpReq.readyState==4){try{if(xmlHttpReq.status==200){var ajaxId=xmlHttpReq.getResponseHeader("Ajax-ID");if(onComplete){onComplete(xmlHttpReq,returnArgs);}
if(ajaxId&&ajaxId!=""){AjaxUtil.remove(parseInt(ajaxId));}}}
catch(e){}}}
var send=function(url){var urlArray=url.split("?");var path=urlArray[0];var query=urlArray[1];try{if(method=="get"){xmlHttpReq.open("GET",url,true);xmlHttpReq.onreadystatechange=returnFunction;xmlHttpReq.send("");}
else{xmlHttpReq.open("POST",path,true);xmlHttpReq.setRequestHeader("Method","POST "+path+" HTTP/1.1");xmlHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttpReq.setRequestHeader("Ajax-ID",ajaxId);xmlHttpReq.onreadystatechange=returnFunction;xmlHttpReq.send(query);}}
catch(e){}}
send(url);this.resend=function(url,options){opts=options;onComplete=opts.onComplete;send(url);};this.getId=function(){return ajaxId;};this.cleanUp=function(){xmlHttpReq.onreadystatechange=function(){};returnFunction=null;returnArgs=null;xmlHttpReq=null;};}
var AjaxUtil={counter:1,requests:new Array(),request:function(url,options){var opts=(options==null)?(new Object()):options;var ajaxId=(opts.reverseAjax)?0:AjaxUtil.getNextId();opts.ajaxId=ajaxId;var request;if(ajaxId==0&&AjaxUtil.requests[0]){request=AjaxUtil.requests[0];request.resend(url,opts);}
else{request=new AjaxRequest(url,opts);AjaxUtil.requests[ajaxId]=request;}
if(!opts.onComplete){AjaxUtil.remove(ajaxId);}},update:function(url,id,options){var element=$(id);if(element){if(options==null){options=new Object();}
var origOnComplete=options.onComplete;options.onComplete=function(xmlHttpReq,returnArgs){element.innerHTML=xmlHttpReq.responseText;executeLoadedScript(element);if(origOnComplete){origOnComplete();}}
AjaxUtil.request(url,options);}},getNextId:function(){var id=AjaxUtil.counter++;if(AjaxUtil.counter>20){AjaxUtil.counter=1;}
return id;},remove:function(id){if(id){var request=AjaxUtil.requests[id];if(request){request.cleanUp();request=null;}}}}
var ReverseAjax={initialize:function(){Event.observe(window,"unload",function(){ReverseAjax.release();});ReverseAjax.request();},request:function(){AjaxUtil.request(themeDisplay.getPathMain()+"/portal/reverse_ajax",{onComplete:ReverseAjax.response,reverseAjax:true});},response:function(xmlHttpRequest){var res=$J(xmlHttpRequest.responseText);var status=res.status;if(status&&status!="failure"){if(status=="success"){if(res.chatMessages){Messaging.getChatsReturn(res.chatMessages);}
if(res.chatRoster){MessagingRoster.getEntriesReturn(res.chatRoster);}}
ReverseAjax.request();}},release:function(){AjaxUtil.request(themeDisplay.getPathMain()+"/portal/reverse_ajax?release=1",{reverseAjax:true});}}
function $J(JSONText){return eval("("+JSONText+")");}
function executeLoadedScript(el){var scripts=el.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if(scripts[i].src){var head=document.getElementsByTagName("head")[0];var scriptObj=document.createElement("script");scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("src",scripts[i].src);head.appendChild(scriptObj);}
else{try{if(is_safari){eval(scripts[i].innerHTML);}
else if(is_mozilla){eval(scripts[i].textContent);}
else{eval(scripts[i].text);}}
catch(e){}}}}
function loadForm(form,action,elId,returnFunction){var pos=action.indexOf("?");var path=action;var queryString="";if(pos!=-1){path=action.substring(0,pos);queryString=action.substring(pos+1,action.length);}
if(!endsWith(queryString,"&")){queryString+="&";}
for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if((e.name!=null)&&(e.value!=null)){queryString+=e.name+"="+encodeURIComponent(e.value)+"&";}}
if(elId!=null){document.body.style.cursor="wait";pos=path.indexOf("/portal/layout");path=path.substring(0,pos)+"/portal/render_portlet";returnFunction=function(xmlHttpReq){document.getElementById(elId).innerHTML=xmlHttpReq.responseText;document.body.style.cursor="default";};}
loadPage(path,queryString,returnFunction);}
function loadPage(path,queryString,returnFunction,returnArgs){AjaxUtil.request(path+"?"+queryString,{onComplete:returnFunction,returnArgs:returnArgs});}
function printJSON(data){if(data&&data.id){var target=document.getElementById(data.id);if(target){target.innerHTML=data.toString();}}}
var Alerts={background:null,message:null,messageArray:new Array(),fadeTimer:0,OPACITY:51,STEPS:3,bgFadeIn:function(max,steps,opacity){var background=Alerts.background;var delta=max/steps
if(opacity==null){opacity=delta;}
if(background&&opacity<=max){Element.changeOpacity(background,opacity);opacity+=delta;setTimeout("Alerts.bgFadeIn("+max+","+steps+","+opacity+")",0);}},bgFadeOut:function(max,steps,opacity){var background=Alerts.background;if(background){var delta=max/steps
if(opacity==null){opacity=max-delta;}
if(opacity>=0){Element.changeOpacity(background,opacity);opacity-=delta;setTimeout("Alerts.bgFadeOut("+max+","+steps+","+opacity+")",0);}
else{background.parentNode.removeChild(background);setSelectVisibility("visible",Alerts.message);Alerts.background=null;}}},createWrapper:function(message,title){var outer=document.createElement("div");var inner=document.createElement("div");var heading=document.createElement("table");var close=document.createElement("a");outer.className="pop-up-outer";outer.align="center";inner.className="pop-up-inner";close.innerHTML="Close";close.href="javascript:Alerts.killAlert()";heading.className="pop-up-header";heading.border=0;heading.width="100%";heading.cellSpacing=0;heading.cellPadding=0;heading.insertRow(0);var row=heading.rows[0];row.insertCell(0);row.insertCell(1);var cell0=row.cells[0];var cell1=row.cells[1];cell0.className="pop-up-title";cell0.width="99%";if(title){cell0.innerHTML=title;}
cell1.className="pop-up-close";cell1.width="1%";cell1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"Alerts.killAlert(this)\"><img border=\"0\" src=\""+themeDisplay.getPathThemeImage()+"/portlet/close.gif\"/></a>"
inner.appendChild(heading);inner.appendChild(message);outer.appendChild(inner);message.wrapper=outer;Drag.makeDraggable(outer,cell0);return outer;},killAlert:function(oLink){if(oLink){var wrapper=oLink;while(wrapper.parentNode){if(wrapper.className&&wrapper.className.match("pop-up-outer")){break;}
wrapper=wrapper.parentNode;}
var body=document.getElementsByTagName("body")[0];var options=wrapper.options;var background=null;var showSelects=false;Alerts.remove(wrapper);body.removeChild(wrapper);if(Alerts.messageArray.length>0){Alerts.message=Alerts.messageArray[Alerts.messageArray.length-1];Alerts.message.style.zIndex=ZINDEX.ALERT+1;setSelectVisibility("visible",Alerts.message);background=wrapper.background;}
else{Alerts.message=null;background=Alerts.background;}
if(background){Alerts.bgFadeOut(Alerts.OPACITY,Alerts.STEPS);}
if(options&&options.onClose)options.onClose();}},fireMessageBox:function(options){var body=document.body;if(!options)options=new Object();var modal=options.modal;var myMessage=options.message;var msgHeight=options.height;var msgWidth=options.width;var noCenter=options.noCenter;var title=options.title;var message=document.createElement("div");message.align="left";var wrapper=Alerts.createWrapper(message,title);wrapper.style.position="absolute";wrapper.style.top=0;wrapper.style.left=0;wrapper.style.zIndex=ZINDEX.ALERT+1;wrapper.options=options;if(myMessage){message.innerHTML=myMessage;}
else{message.innerHTML="<div class=\"portlet-loading\"></div>";}
if(msgHeight){if(is_ie){message.style.height=msgHeight+"px";}
else{message.style.minHeight=msgHeight+"px";}}
if(msgWidth){wrapper.style.width=msgWidth+"px";}
if(!Alerts.background&&modal){var background=document.createElement("div");background.id="alert-message";background.style.position="absolute";background.style.top="0";background.style.left="0";background.style.zIndex=ZINDEX.ALERT;Alerts.background=background;wrapper.background=background;background.style.backgroundColor="#000000";Element.changeOpacity(background,0);body.appendChild(background);Alerts.bgFadeIn(Alerts.OPACITY,Alerts.STEPS);}
setSelectVisibility("hidden");if(Alerts.messageArray.length>0){var lastMsg=Alerts.messageArray[Alerts.messageArray.length-1];lastMsg.style.zIndex=ZINDEX.ALERT-1;setSelectVisibility("hidden",lastMsg);}
setSelectVisibility("visibile",message);Alerts.message=message;Alerts.messageArray.push(wrapper);Alerts.resize();Event.observe(window,"resize",Alerts.resize)
if(noCenter){Alerts.center();}
else{Alerts.center(msgHeight,msgWidth);}
Event.observe(window,"resize",Alerts.center)
body.appendChild(wrapper);window.focus();return message;},popupIframe:function(url,options){var msgHeight=options.height;var msgWidth=options.width;var message=Alerts.fireMessageBox(options);var iframe=document.createElement("iframe");message.height="";iframe.src=url;iframe.frameBorder=0;if(msgWidth)iframe.style.width="100%";message.appendChild(iframe);if(!options.noCenter){Alerts.center(msgHeight,msgWidth);}
return message;},center:function(height,width){if(Alerts.message){var message=Alerts.message.wrapper;var body=document.getElementsByTagName("body")[0];var mode=message.centerMode;if(!mode){if(height&&width){mode=message.centerMode="xy";}
else if(height&&!width){mode=message.centerMode="y";}
else if(!height&&width){mode=message.centerMode="x";}
else{mode=message.centerMode="none";}}
width=width||message.offsetWidth;height=height||message.offsetHeight;var centerLeft;var centerTop;if(!is_safari){var centerLeft=(body.clientWidth-width)/2;var centerTop=body.scrollTop+((body.clientHeight-height)/2);}
else{var centerLeft=(body.offsetWidth-width)/2;var centerTop=(body.offsetHeight-height)/2;}
if(mode=="xy"||mode=="y"){message.style.top=centerTop+"px";}
else{message.style.top=(body.scrollTop+20)+"px";}
if(mode=="xy"||mode=="x"){message.style.left=centerLeft+"px";}
else{message.style.left="20px";}}},resize:function(){if(Alerts.background){var background=Alerts.background;var body=document.getElementsByTagName("body")[0];if(!is_safari){var scrollHeight=body.scrollHeight;var clientHeight=body.clientHeight;background.style.height=(scrollHeight>clientHeight?scrollHeight:clientHeight)+"px";background.style.width="100%";}
else{background.style.height=body.offsetHeight+"px";background.style.width=body.offsetWidth+"px";}}},resizeIframe:function(options){if(Alerts.message&&options){var iframe=Alerts.message.getElementsByTagName("iframe")[0];var loading=document.getElementsByClassName("portlet-loading",Alerts.message);if(loading.length>0){loading[0].parentNode.removeChild(loading[0]);}
if(iframe){if(options.height){iframe.height=options.height;}
if(options.width){iframe.width=options.width;}}}
Alerts.resize();},remove:function(obj){var msgArray=Alerts.messageArray;for(var i=0;i<msgArray.length;i++){if(msgArray[i]==obj){msgArray.splice(i,1);break;}}}}
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a);}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};deconcept.PlayerVersion=function(_27){this.major=_27[0]!=null?parseInt(_27[0]):0;this.minor=_27[1]!=null?parseInt(_27[1]):0;this.rev=_27[2]!=null?parseInt(_27[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_29){var q=document.location.search||document.location.hash;if(q){var _2b=q.substring(1).split("&");for(var i=0;i<_2b.length;i++){if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload=="function"){var _30=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();_30();};}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};if(typeof window.onbeforeunload=="function"){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload();};}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){Array.prototype.push=function(_31){this[this.length]=_31;return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break;}switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case"%d":case"%e":d=parseInt(a[i],10);break;case"%m":m=parseInt(a[i],10)-1;break;case"%Y":case"%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case"%b":case"%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case"%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};function ColorPicker(src,func){var cp=document.createElement("div");var image=document.createElement("img");var body=document.getElementsByTagName("body")[0];var textInput=null;var originalValue="";var self=this;cp.id="color-picker-div";cp.style.height="192px";cp.style.width="100px";cp.style.position="absolute";cp.style.display="none";cp.style.cursor="crosshair";cp.style.zIndex=1;image.style.height="192px";image.style.width="100px";image.src=src;cp.appendChild(image);body.insertBefore(cp,body.childNodes[0]);this.hide=function(){cp.style.display="none";if(func!=null){func();}}
this.toggle=function(obj){if(cp.style.display=="none"){var nwOffset=Coordinates.northwestOffset(obj,true);cp.style.left=nwOffset.x+25+"px";cp.style.top=nwOffset.y+"px";cp.style.display="block";textInput=obj.parentNode.getElementsByTagName("INPUT")[0];originalValue=textInput.value;}
else{self.hide();}};var getColor=function(event,obj){var nwOffset=Coordinates.northwestOffset(obj,true);mousePos.update(event);var x=mousePos.x-nwOffset.x;var y=mousePos.y-nwOffset.y;var rmax=0;var gmax=0;var bmax=0;if(y<=32){rmax=255;gmax=(y/32.0)*255;bmax=0;}else if(y<=64){y=y-32;rmax=255-(y/32.0)*255;gmax=255;bmax=0;}else if(y<=96){y=y-64;rmax=0;gmax=255;bmax=(y/32.0)*255;}else if(y<=128){y=y-96;rmax=0;gmax=255-(y/32.0)*255;bmax=255;}else if(y<=160){y=y-128;rmax=(y/32.0)*255;gmax=0;bmax=255;}else{y=y-160;rmax=255;gmax=0;bmax=255-(y/32.0)*255;}
if(x<=50){var r=Math.abs(Math.floor(rmax*x/50.0));var g=Math.abs(Math.floor(gmax*x/50.0));var b=Math.abs(Math.floor(bmax*x/50.0));}else{x-=50;var r=Math.abs(Math.floor(rmax+(x/50.0)*(255-rmax)));var g=Math.abs(Math.floor(gmax+(x/50.0)*(255-gmax)));var b=Math.abs(Math.floor(bmax+(x/50.0)*(255-bmax)));}
return rgb2hex(r,g,b);};var rgb2hex=function(r,g,b){color='#';color+=hex(Math.floor(r/16));color+=hex(r%16);color+=hex(Math.floor(g/16));color+=hex(g%16);color+=hex(Math.floor(b/16));color+=hex(b%16);return color;};var hex=function(dec){return(dec).toString(16);};var onEnd=function(event){var color=getColor(event,image);originalValue=color;textInput.value=color;self.hide();};var onMove=function(event){var color=getColor(event,image);textInput.value=color;textInput.onchange();};var reset=function(){textInput.value=originalValue;textInput.onchange();};image.onmousemove=onMove;image.onclick=onEnd;image.onmouseout=reset;}
var Coordinates={ORIGIN:new Coordinate(0,0),northwestPosition:function(element){var x=parseInt(element.style.left);var y=parseInt(element.style.top);return new Coordinate(isNaN(x)?0:x,isNaN(y)?0:y);},southeastPosition:function(element){return Coordinates.northwestPosition(element).plus(new Coordinate(element.offsetWidth,element.offsetHeight));},northwestOffset:function(element,isRecursive){var offset=new Coordinate(element.offsetLeft,element.offsetTop);if(!isRecursive)return offset;var parent=element.offsetParent;while(parent){offset=offset.plus(new Coordinate(parent.offsetLeft,parent.offsetTop));parent=parent.offsetParent;}
return offset;},southeastOffset:function(element,isRecursive){return Coordinates.northwestOffset(element,isRecursive).plus(new Coordinate(element.offsetWidth,element.offsetHeight));},fixEvent:function(event){if(typeof event=='undefined'){event=window.event;}
event.windowCoordinate=new Coordinate(event.clientX,event.clientY);return event;}};function Coordinate(x,y){this.x=x;this.y=y;}
Coordinate.prototype.toString=function(){return"("+this.x+","+this.y+")";}
Coordinate.prototype.plus=function(that){return new Coordinate(this.x+that.x,this.y+that.y);}
Coordinate.prototype.minus=function(that){return new Coordinate(this.x-that.x,this.y-that.y);}
Coordinate.prototype.distance=function(that){var deltaX=this.x-that.x;var deltaY=this.y-that.y;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2));}
Coordinate.prototype.max=function(that){var x=Math.max(this.x,that.x);var y=Math.max(this.y,that.y);return new Coordinate(x,y);}
Coordinate.prototype.constrain=function(min,max){if(min.x>max.x||min.y>max.y)return this;var x=this.x;var y=this.y;if(min.x!=null)x=Math.max(x,min.x);if(max.x!=null)x=Math.min(x,max.x);if(min.y!=null)y=Math.max(y,min.y);if(max.y!=null)y=Math.min(y,max.y);return new Coordinate(x,y);}
Coordinate.prototype.reposition=function(element){element.style["top"]=this.y+"px";element.style["left"]=this.x+"px";}
Coordinate.prototype.equals=function(that){if(this==that)return true;if(!that||that==null)return false;return this.x==that.x&&this.y==that.y;}
Coordinate.prototype.inside=function(northwest,southeast){if((this.x>=northwest.x)&&(this.x<=southeast.x)&&(this.y>=northwest.y)&&(this.y<=southeast.y)){return true;}
else{return false;}}
Coordinate.prototype.insideObject=function(obj,recurse){var nwOffset=Coordinates.northwestOffset(obj,recurse);var seOffset=nwOffset.plus(new Coordinate(obj.offsetWidth,obj.offsetHeight));var rt=null
if(this.inside(nwOffset,seOffset)){rt=this.minus(nwOffset);rt.nwOffset=nwOffset;rt.seOffset=seOffset;}
return rt;}
function getMousePos(event){mousePos.update(event);}
function MousePos(){};MousePos.prototype=new Coordinate(0,0);MousePos.prototype.update=function(event){event=Coordinates.fixEvent(event);var position=event.windowCoordinate;this.x=position.x;this.y=position.y;if(is_safari){}
else{this.x+=document.body.scrollLeft;this.y+=document.body.scrollTop;}
if(this.x<0)
this.x=0;if(this.y<0)
this.y=0;return event;}
var mousePos=new MousePos(0,0);var Drag={group:null,isDragging:false,makeDraggable:function(group,handle){if(handle==null)
group.handle=group;else
group.handle=handle;group.handle.group=group;group.minX=null;group.minY=null;group.maxX=null;group.maxY=null;group.threshold=1;group.thresholdY=0;group.thresholdX=0;group.disableDrag=false;group.onDragStart=new Function();group.onDragEnd=new Function();group.onDrag=new Function();group.setAutoCorrect=function(){this.autoCorrect=true};group.setDragHandle=Drag.setDragHandle;group.setDragThreshold=Drag.setDragThreshold;group.setDragThresholdX=Drag.setDragThresholdX;group.setDragThresholdY=Drag.setDragThresholdY;group.constrain=Drag.constrain;group.constrainVertical=Drag.constrainVertical;group.constrainHorizontal=Drag.constrainHorizontal;group.handle.onmousedown=Drag.onMouseDown;},constrainVertical:function(){var nwOffset=Coordinates.northwestOffset(this,true);this.minX=nwOffset.x;this.maxX=nwOffset.x;},constrainHorizontal:function(){var nwOffset=Coordinates.northwestOffset(this,true);this.minY=nwOffset.y;this.maxY=nwOffset.y;},constrain:function(nwPosition,sePosition){this.minX=nwPosition.x;this.minY=nwPosition.y;this.maxX=sePosition.x;this.maxY=sePosition.y;},setDragHandle:function(handle){if(handle&&handle!=null)
this.handle=handle;else
this.handle=this;this.handle.group=this;this.onmousedown=null;this.handle.onmousedown=Drag.onMouseDown;},setDragThreshold:function(threshold){if(isNaN(parseInt(threshold)))return;this.threshold=threshold;},setDragThresholdX:function(threshold){if(isNaN(parseInt(threshold)))return;this.thresholdX=threshold;},setDragThresholdY:function(threshold){if(isNaN(parseInt(threshold)))return;this.thresholdY=threshold;},onMouseDown:function(event){event=mousePos.update(event);Drag.group=this.group;var group=this.group;if(group.disableDrag){return;}
var mouse=mousePos;var nwPosition=Coordinates.northwestPosition(group);var nwOffset=Coordinates.northwestOffset(group,true);var sePosition=Coordinates.southeastPosition(group);var seOffset=Coordinates.southeastOffset(group,true);group.originalZIndex=group.style.zIndex;group.mouseNwOffset=mouse.minus(nwOffset);group.mouseSeOffset=mouse.minus(seOffset);group.mouseStart=new Coordinate(mousePos.x,mousePos.y);group.onDragStart(nwPosition,sePosition,nwOffset,seOffset);var minMouseX;var minMouseY;var maxMouseX;var maxMouseY;if(group.minX!=null)
minMouseX=group.minX+group.mouseNwOffset.x;if(group.minY!=null)
minMouseY=group.minY+group.mouseNwOffset.y;if(group.maxX!=null)
maxMouseX=group.maxX+group.mouseSeOffset.x;if(group.maxY!=null)
maxMouseY=group.maxY+group.mouseSeOffset.y;if(minMouseX&&maxMouseX&&minMouseX>maxMouseX)
maxMouseX=minMouseX;if(minMouseY&&maxMouseY&&minMouseY>maxMouseY)
maxMouseY=minMouseY;group.mouseMin=new Coordinate(minMouseX,minMouseY);group.mouseMax=new Coordinate(maxMouseX,maxMouseY);document.onmousemove=Drag.onMouseMove;document.onmouseup=Drag.onMouseUp;return false;},showStatus:function(mouse,nwPosition,sePosition,nwOffset,seOffset){window.status="mouse: "+mouse.toString()+" "+"NW pos: "+nwPosition.toString()+" "+"SE pos: "+sePosition.toString()+" "+"NW offset: "+nwOffset.toString()+" "+"SE offset: "+seOffset.toString();},onMouseMove:function(event){event=mousePos.update(event);var group=Drag.group;var mouse=mousePos;var nwOffset=Coordinates.northwestOffset(group,true);var nwPosition=Coordinates.northwestPosition(group);var sePosition=Coordinates.southeastPosition(group);var seOffset=Coordinates.southeastOffset(group,true);var scrollZone=20;var scrollSpeed=5;var scrollTop=Viewport.scroll().y;var pageHeight=Viewport.page().y;var clientHeight=Viewport.frame().y;if((scrollTop+clientHeight+2*scrollZone)<pageHeight&&mousePos.y>(scrollTop+clientHeight-scrollZone)){window.scroll(0,scrollTop+scrollSpeed);nwPosition.y+=scrollSpeed;}
if(scrollTop>0&&mousePos.y<(scrollTop+scrollZone)){window.scroll(0,scrollTop-scrollSpeed);nwPosition.y-=scrollSpeed;}
var adjusted=mouse.constrain(group.mouseMin,group.mouseMax);nwPosition=nwPosition.plus(adjusted.minus(nwOffset).minus(group.mouseNwOffset));if(!Drag.isDragging){if(group.threshold>0){var distance=group.mouseStart.distance(mouse);if(distance<group.threshold)return true;}else if(group.thresholdY>0){var deltaY=Math.abs(group.mouseStart.y-mouse.y);if(deltaY<group.thresholdY)return true;}else if(group.thresholdX>0){var deltaX=Math.abs(group.mouseStart.x-mouse.x);if(deltaX<group.thresholdX)return true;}
Drag.isDragging=true;}
nwPosition.reposition(group);if(group.autoCorrect){var offsetBefore=Coordinates.northwestOffset(group,true);group.onDrag(nwPosition,sePosition,nwOffset,seOffset);var offsetAfter=Coordinates.northwestOffset(group,true);if(!offsetBefore.equals(offsetAfter)){var errorDelta=offsetBefore.minus(offsetAfter);nwPosition=Coordinates.northwestPosition(group).plus(errorDelta);nwPosition.reposition(group);}}
else{nwPosition.reposition(group);group.onDrag(nwPosition,sePosition,nwOffset,seOffset);}
return false;},onMouseUp:function(event){event=mousePos.update(event);var group=Drag.group;var mouse=event.windowCoordinate;var nwOffset=Coordinates.northwestOffset(group,true);var nwPosition=Coordinates.northwestPosition(group);var sePosition=Coordinates.southeastPosition(group);var seOffset=Coordinates.southeastOffset(group,true);document.onmousemove=null;document.onmouseup=null;group.onDragEnd(nwPosition,sePosition,nwOffset,seOffset);Drag.group=null;Drag.isDragging=false;return false;}};var DropZone={layerArray:new Array(),dropList:new Array(),initialized:false,checkInit:function(){if(!DropZone.initialized){DropZone.init();DropZone.initialized=true;};},add:function(itemId,dropOptions){DropZone.checkInit();var item=$(itemId);if(item){item.dropOptions=dropOptions||new Object();item.dropOptions.dropItem=item;if(typeof(dropOptions.accept)=="string"){dropOptions.accept=dropOptions.accept.split(" ");}
DropZone.dropList.push(item);}},init:function(){this.layerArray[0]=new Array();this.layerArray[1]=new Array();this.dropList=this.layerArray[0];},switchLayer:function(layer){DropZone.checkInit();if(layer==0||layer==1){this.dropList=this.layerArray[layer];}}}
var DragDrop={clone:null,currentContainer:null,insertIndex:-1,instance:0,lastContainer:null,track:null,lastOnDrop:null,lastSelected:null,accepts:function(item,dropItem){var dropOptions=dropItem.dropOptions;var rt=false;if(dropOptions.accept){var accepts=dropOptions.accept;for(var i=0;i<accepts.length;i++){var re=new RegExp("\\b"+accepts[i]+"\\b");if(Element.hasClassName(item,accepts[i])){rt=true;break;}}}
else{rt=true;}
return rt;},create:function(itemId,dragOptions){var item;if(typeof(itemId)=="string"){item=document.getElementById(itemId);}
else if(typeof(itemId)=="object"){item=itemId;}
else{return;}
item.dragOptions=dragOptions?dragOptions:new Object();item.dragOptions.scrollOffset=new Coordinate(0,0);Drag.makeDraggable(item,item.dragOptions.handle);item.onDragStart=DragDrop.onDragStart;item.onDrag=DragDrop.onDrag;item.onDragEnd=DragDrop.onDragEnd;item.threshold=3;},onDragStart:function(nwPosition,sePosition,nwOffset,seOffset){var item=this;},onDrag:function(nwPosition,sePosition,nwOffset,seOffset){var item=this;var opts=item.dragOptions;if(!item.initialized){var body=document.getElementsByTagName("body")[0];var itemContainer=item.parentNode;var clone=DragDrop.clone;if(is_ie){setSelectVisibility("hidden");}
opts.origWidth=item.style.width;opts.origHeight=item.style.height;opts.origPosition=item.style.position;opts.origRevert=opts.revert;opts.scrollOffset=new Coordinate(0,0);if(opts.container){var container=$(opts.container);opts.scrollOffset.x=container.scrollLeft;opts.scrollOffset.y=container.scrollTop;}
clone=DragDrop.clone=item.cloneNode(opts.showClone?true:false);if(!opts.showClone){clone.style.backgroundColor="transparent";}
clone.dragOptions=new cloneObject(opts);clone.style.left="";clone.style.top="";clone.style.zIndex=0;if(!opts.showClone){clone.style.height=item.offsetHeight+"px";clone.style.width=item.offsetWidth+"px";}
item.dragOptions.clone=clone;item.style.width=item.offsetWidth+"px";item.style.height=item.offsetHeight+"px";itemContainer.insertBefore(clone,item);itemContainer.removeChild(item);if(opts.showClone||opts.ghosting){Element.changeOpacity(item,75);}
item.style.position="absolute";item.style.zIndex=ZINDEX.DRAG_ITEM;item.style.left=(nwOffset.x-opts.scrollOffset.x)+"px";item.style.top=(nwOffset.y-opts.scrollOffset.y)+"px";body.appendChild(item);var dropList=DropZone.dropList;dropList.each(function(item){if(item.dropOptions.inheritParent){item.style.height=item.parentNode.offsetHeight;}});DragDrop.lastOnDrop=null;item.initialized=true;}
else{item.style.left=(parseInt(item.style.left)-opts.scrollOffset.x)+"px";item.style.top=(parseInt(item.style.top)-opts.scrollOffset.y)+"px";var dropList=DropZone.dropList;DragDrop.currentContainer=null;for(var i=0;i<dropList.length;i++){var dropContainer=dropList[i];if(!dropContainer.parentNode||typeof(dropContainer)=="undefined"){dropList.splice(i,1);i--;continue;}
var isInsideContainer=mousePos.insideObject(dropContainer,true);if(DragDrop.accepts(item,dropContainer)){if(opts.highlightDropzones){dropContainer.style.backgroundColor=opts.highlightDropzones;}
if(isInsideContainer){DragDrop.currentContainer=dropContainer;DragDrop.lastOnDrop=dropContainer.dropOptions.onDrop;}}}
var cur=DragDrop.currentContainer;var last=DragDrop.lastContainer;if(cur){if(typeof(cur.dropOptions.onHoverOver)!="undefined"){cur.dropOptions.onHoverOver(item);}}
if(cur!=last){if(last){Element.removeClassName(last,last.dropOptions.hoverclass);if(typeof(last.dropOptions.onHoverOut)!="undefined"){last.dropOptions.onHoverOut(item);}}
if(cur){if(cur.dropOptions.hoverclass&&cur!=item&&DragDrop.accepts(item,cur)){Element.addClassName(cur,cur.dropOptions.hoverclass);}}}
DragDrop.lastContainer=DragDrop.currentContainer;}},onDragEnd:function(nwPosition,sePosition,nwOffset,seOffset){var item=this;var opts=item.dragOptions;if(item.initialized){var dropItem=DragDrop.currentContainer;if(dropItem&&typeof(dropItem.dropOptions.onDrop)!="undefined"){var dropOptions=dropItem.dropOptions;if(DragDrop.accepts(item,dropItem)){dropOptions.onDrop(item,nwPosition,sePosition,nwOffset,seOffset);dropItem.className=dropOptions.origClassName;Element.removeClassName(dropItem,dropItem.dropOptions.hoverclass);}}
else if(opts.forceDrop&&DragDrop.lastOnDrop){DragDrop.lastOnDrop();}
var clone=DragDrop.clone;var container=clone.parentNode;if(opts.keepClone){DragDrop.create(clone,clone.dragOptions);item.style.zIndex="";}
else{if(opts.revert){item.parentNode.removeChild(item);item.style.width=opts.origWidth;item.style.height=opts.origHeight;item.style.position=opts.origPosition;item.style.left="";item.style.top="";clone.style.display="none";container.insertBefore(item,clone);}
container.removeChild(clone);}
Element.changeOpacity(item,100);item.style.zIndex="";opts.scrollOffset=new Coordinate(0,0);if(is_ie){setSelectVisibility("visible");}
DropZone.dropList.each(function(item){item.style.backgroundColor="transparent";if(item.dropOptions.inheritParent){item.style.height="";}});opts.revert=opts.origRevert;item.initialized=false;item.wasClicked=false;}
else{item.wasClicked=true;}}}
function ResizeRule(element,direction,mode){this.element=element;this.direction=direction;this.next=null;this.origWidth=null;this.origHeight=null;this.mode=mode;}
var Resize={BIG_Z_INDEX:100,group:null,isResizeing:false,HORIZONTAL:0,VERTICAL:1,ADD:0,SUBTRACT:1,addRule:function(resizeRule){var group=this;if(group.listHead==null){group.listHead=resizeRule;group.listTail=group.listHead;}
else{group.listTail.next=resizeRule;group.listTail=resizeRule;}},createHandle:function(group,disableStop,func){group.onmousedown=Resize.onMouseDown;group.addRule=Resize.addRule;group.listHead=null;group.listTail=null;group.disableStop=disableStop==null?false:true;group.onResizeStart=new Function();group.onResize=new Function();group.onResizeEnd=new Function();group.func=func;return group;},getHeight:function(obj){var debugDiv=document.getElementById("debug_div");if(obj.style&&obj.style.height&&obj.style.height!=""){return parseInt(obj.style.height);}
else{return obj.offsetHeight;}},getWidth:function(obj){if(obj.style&&obj.style.width&&obj.style.width!=""){return parseInt(obj.style.width);}
else{return obj.offsetWidth;}},onMouseDown:function(event){event=mousePos.update(event);Resize.group=this;var group=Resize.group;var mouse=mousePos;group.mouseStart=new Coordinate(mousePos.x,mousePos.y);var resizeRule=group.listHead;while(resizeRule){resizeRule.origWidth=Resize.getWidth(resizeRule.element);resizeRule.origHeight=Resize.getHeight(resizeRule.element);resizeRule=resizeRule.next;}
document.onmousemove=Resize.onMouseMove;document.onmouseup=Resize.onMouseUp;document.getElementsByTagName("body")[0].style.cursor=group.style.cursor;group.onResizeStart();return false;},onMouseMove:function(event){event=mousePos.update(event);var group=Resize.group;var mouse=mousePos;var mouseDelta=mousePos.minus(group.mouseStart);var resizeRule=group.listHead;var newLength;var lengthCorrection=0;var noChange=false;while(resizeRule){if(resizeRule.direction==Resize.HORIZONTAL){resizeRule.prevLength=Resize.getWidth(resizeRule.element);if(resizeRule.mode==Resize.ADD){newLength=resizeRule.origWidth+mouseDelta.x;}
else{newLength=resizeRule.origWidth-mouseDelta.x}}
else if(resizeRule.direction==Resize.VERTICAL){resizeRule.prevLength=Resize.getHeight(resizeRule.element);if(resizeRule.mode==Resize.ADD){newLength=resizeRule.origHeight+mouseDelta.y;}
else{newLength=resizeRule.origHeight-mouseDelta.y;}}
resizeRule.newLength=newLength;if(newLength<1){lengthCorrection=Math.max(-newLength+1,lengthCorrection);newLength=1;}
if(newLength==resizeRule.prevLength){noChange=true;}
resizeRule=resizeRule.next;}
resizeRule=group.listHead;while(resizeRule){if(!group.disableStop&&noChange){newLength=resizeRule.prevLength;}
else if(resizeRule.newLength<1){newLength=resizeRule.newLength+lengthCorrection;}
else{newLength=resizeRule.newLength-lengthCorrection;}
if(resizeRule.direction==Resize.HORIZONTAL){resizeRule.element.style.width=newLength+"px";}
else if(resizeRule.direction==Resize.VERTICAL){resizeRule.element.style.height=newLength+"px";}
resizeRule=resizeRule.next;}
group.onResize();return false;},onMouseUp:function(event){event=mousePos.update(event);var group=Resize.group;var mouse=event.windowCoordinate;group.mouseEnd=new Coordinate(mousePos.x,mousePos.y);group.onResizeEnd();document.onmousemove=null;document.onmouseup=null;document.getElementsByTagName("body")[0].style.cursor="auto";Resize.group=null;if(group.func!=null){group.func();}
return false;}};var LayoutConfiguration={categories:new Array(),initialized:false,loadingImage:null,menu:null,menuDiv:null,menuIframe:null,portlets:new Array(),showTimer:0,init:function(){var arrow1=new Image();var arrow2=new Image();arrow1.src=themeDisplay.getPathThemeImage()+"/arrows/01_down.gif";arrow2.src=themeDisplay.getPathThemeImage()+"/arrows/01_right.gif";var menu=document.getElementById("portal_add_content");LayoutConfiguration.menu=menu;if(menu!=null){var list=menu.childNodes;for(var i=0;i<list.length;i++){if(list[i].className!=null&&list[i].className.match("portal-add-content")){LayoutConfiguration.menuDiv=list[i];}
if(list[i].nodeName!=null&&list[i].nodeName.toLowerCase().match("iframe")){LayoutConfiguration.menuIframe=list[i];}}
var elems=menu.getElementsByTagName("div");for(var i=0;i<elems.length;i++){if(elems[i].className=="layout_configuration_portlet"){LayoutConfiguration.portlets.push(elems[i]);}
else if(elems[i].className=="layout_configuration_category"){LayoutConfiguration.categories.push(elems[i]);}}
LayoutConfiguration.initialized=true;if(is_ie){document.getElementById("layout_configuration_content").focus();}}},toggle:function(plid,ppid,doAsUserId){if(!LayoutConfiguration.menu){var url=themeDisplay.getPathMain()+"/portal/render_portlet?p_l_id="+plid+"&p_p_id="+ppid+"&doAsUserId="+doAsUserId;var popup=Alerts.fireMessageBox({width:250,noCenter:true,title:"Add Content",onClose:function(){LayoutConfiguration.menu=null;}});AjaxUtil.update(url,popup,{onComplete:LayoutConfiguration.init});}},startShowTimer:function(word){if(this.showTimer){clearTimeout(this.showTimer);this.showTimer=0;}
this.showTimer=setTimeout("LayoutConfiguration.showMatching(\""+word+"\")",250);},showMatching:function(word){var portlets=this.portlets;var categories=this.categories;if(word=="*"){for(var i=0;i<portlets.length;i++){portlets[i].style.display="block";}
for(var i=0;i<categories.length;i++){categories[i].style.display="block";this.toggleCategory(categories[i].getElementsByTagName("table")[0],"block");}}
else if(word==""){for(var i=0;i<categories.length;i++){categories[i].style.display="block";this.toggleCategory(categories[i].getElementsByTagName("table")[0],"none");}
for(var i=0;i<portlets.length;i++){portlets[i].style.display="block";}}
else{word=word.toLowerCase();for(var i=0;i<categories.length;i++){categories[i].style.display="none";}
for(var i=0;i<portlets.length;i++){if(portlets[i].id.toLowerCase().match(word)){portlets[i].style.display="block";this.showCategories(categories,portlets[i].id);}
else{portlets[i].style.display="none";}}}},showCategories:function(categories,name){var colon=name.lastIndexOf(":");while(colon!=-1){name=name.substr(0,colon);for(var i=0;i<categories.length;i++){if(name.match(categories[i].id)){categories[i].style.display="block";this.toggleCategory(categories[i].getElementsByTagName("table")[0],"block");}}
colon=name.lastIndexOf(":");}},toggleCategory:function(obj,display){var parent=obj;while(parent.nodeName.toLowerCase()!="table"){parent=parent.parentNode;}
var data=parent.rows[1].cells[0];var pane=document.getElementsByClassName("layout_configuration_category_pane",data)[0];var image=obj.getElementsByTagName("img")[0];var imagePath=themeDisplay.getPathThemeImage();if(display){pane.style.display=display;if(display.toLowerCase().match("block")){image.src=imagePath+"/arrows/01_down.gif";}
else{image.src=imagePath+"/arrows/01_right.gif";}}
else{if(toggleByObject(pane,true)){image.src=imagePath+"/arrows/01_down.gif";}
else{image.src=imagePath+"/arrows/01_right.gif";}}}};var Messaging={checkRoster:false,currentChatBox:null,initialized:false,inputCount:1,mainDiv:null,msgQueue:new Array(),userId:null,windowCount:0,zIndex:1,chat:function(msgObj){if(!msgObj&&Messaging.msgQueue.length==0)return;var msg=msgObj||Messaging.msgQueue.shift();var chatBox=$("msg-chat-box"+msg.toId);if(!chatBox){var url=themeDisplay.getPathMain()+"/messaging/action?cmd=chatbox"+"&toId="+msg.toId+"&toName="+encodeURIComponent(msg.toName)+"&top="+(msg.top||15*this.windowCount)+"&left="+(msg.left||15*this.windowCount++)+"&zIndex="+(ZINDEX.CHAT_BOX+this.zIndex++);if(msg.status&&msg.status=="unavailable"){url+="&addUser=1";}
if(msg.messages){url+="&messages="+encodeURIComponent(msg.messages);}
AjaxUtil.request(url,{returnArgs:msg,onComplete:function(xmlHttpReq,returnArgs){var chatBox=Messaging.createChatBox(xmlHttpReq.responseText);Messaging.populateChatBox(chatBox,returnArgs);}});}
else{this.populateChatBox(chatBox,msg);}},populateChatBox:function(chatBox,msg){var typeArea=document.getElementsByClassName("msg-type-area",chatBox)[0];var chatArea=document.getElementsByClassName("msg-chat-area",chatBox)[0];if(msg.body!=null){var name=msg.toName.split(/[ ,.-]/);var initials="";for(var i=0;i<name.length;i++){initials+=name[i].charAt(0);}
chatArea.innerHTML+="<span style='color: #FF0000'>"+initials+": </span>"+msg.body+"<br/>";}
this.saveCookie();chatArea.scrollTop=chatArea.scrollHeight;typeArea.focus();if(is_ie){typeArea.focus();}
Messaging.chat();},getChats:function(){var url=themeDisplay.getPathMain()+"/messaging/action?cmd=getChats";AjaxUtil.request(url,{onComplete:function(xmlHttpReq){var msg=eval("("+xmlHttpReq.responseText+")");Messaging.getChatsReturn(msg);}});},getChatsReturn:function(msg){var status=msg.status;if(status=="success"){var chatMsg=msg.chat;if(chatMsg&&chatMsg.length>0){for(var i=0;i<chatMsg.length;i++){var tmpName=chatMsg[i].fromName;var tmpId=chatMsg[i].fromId;chatMsg[i].fromName=chatMsg[i].toName;chatMsg[i].fromId=chatMsg[i].toId;chatMsg[i].toName=tmpName;chatMsg[i].toId=tmpId;Messaging.msgQueue.push(chatMsg[i]);}
Messaging.chat();window.focus();}}},createChatBox:function(boxHTML){var chatDiv=document.createElement("div");chatDiv.innerHTML=boxHTML;var chatBox=document.getElementsByClassName("msg-chat-box",chatDiv)[0];var chatTitle=document.getElementsByClassName("msg-chat-title",chatBox)[0];Drag.makeDraggable(chatBox,chatTitle);chatBox.onDragEnd=function(){Messaging.saveCookie();};chatDiv.removeChild(chatBox);this.mainDiv.appendChild(chatBox);return chatBox;},error:function(){alert("User does not exist");},init:function(userId){var body=document.getElementsByTagName("body")[0];var mainDiv=$("messaging-main-div");this.userId=userId;if(mainDiv==null){mainDiv=document.createElement("div");mainDiv.id="messaging-main-div";Element.setStyle(mainDiv,{left:0,position:"absolute",textAlign:"left",top:0,width:"100%",zIndex:ZINDEX.CHAT_BOX});body.insertBefore(mainDiv,body.childNodes[0]);}
this.mainDiv=mainDiv;var msgJSON=Cookie.read(this.userId+"_chats");if(msgJSON){var chatArray=$J(decodeURIComponent(msgJSON));chatArray.each(function(item){Messaging.msgQueue.push(item);});Messaging.chat();}
this.initialized=true;Messaging.getChats();},maximizeChat:function(id){var chatBox=$(id);var widthDiv=document.getElementsByClassName("msg-chat-box-width")[0];var chatArea=document.getElementsByClassName("msg-chat-area")[0];chatBox.style.left=Viewport.scroll().x+"px";chatBox.style.top=Viewport.scroll().y+"px";widthDiv.style.width=(Viewport.frame().x-30)+"px";chatArea.style.height=(Viewport.frame().y-100)+"px";},minimizeChat:function(id){var chatBox=$(id);var widthDiv=document.getElementsByClassName("msg-chat-box-width")[0];var chatArea=document.getElementsByClassName("msg-chat-area")[0];widthDiv.style.width=250+"px";chatArea.style.height=100+"px";},removeChat:function(id){var chatBox=$(id);Element.remove(chatBox);this.saveCookie();},saveCookie:function(){var chatList=document.getElementsByClassName("msg-chat-box",this.mainDiv);var chatArray=new Array();chatList.each(function(item){var msgObj=new Object();msgObj.toName=document.getElementsByClassName("msg-to-name",item)[0].innerHTML;msgObj.toId=document.getElementsByClassName("msg-to-input-id",item)[0].value;msgObj.top=parseInt(item.style.top);msgObj.left=parseInt(item.style.left);msgObj.messages=document.getElementsByClassName("msg-chat-area",item)[0].innerHTML;chatArray.push(msgObj);})
Cookie.create(this.userId+"_chats",encodeURIComponent(chatArray.toJSONString()),99);},sendChat:function(obj,e){var keycode;var chatBox=obj.parentNode;var toInput;var toAddr;var typeArea;var chatArea;var query="cmd=sendChat";if(window.event)keycode=window.event.keyCode;else if(e)keycode=e.which;else return;if(keycode==13){var inputList=chatBox.getElementsByTagName("input");for(var i=0;i<inputList.length;i++){if(inputList[i].className){if(inputList[i].className.match("msg-to-input-id"))toInput=inputList[i];if(inputList[i].className.match("msg-to-input-addr"))toAddr=inputList[i];if(inputList[i].className.match("msg-type-area"))typeArea=inputList[i];}}
if(typeArea.value=="")return;var divList=chatBox.getElementsByTagName("div");for(var i=0;i<divList.length;i++){if(divList[i].className&&divList[i].className.match("msg-chat-area"))chatArea=divList[i];}
query+="&text="+encodeURIComponent(typeArea.value);if(toAddr!=null){query+="&tempId="+toInput.value+"&toAddr="+toAddr.value;}
else{query+="&toId="+toInput.value;}
loadPage(themeDisplay.getPathMain()+"/messaging/action",query,Messaging.sendChatReturn);chatArea.innerHTML+="<span style='color: #0000FF'>Me: </span>"+typeArea.value+"<br/>";chatArea.scrollTop=chatArea.scrollHeight;typeArea.value="";Messaging.saveCookie();}},sendChatReturn:function(xmlHttpReq){var msg=eval("("+xmlHttpReq.responseText+")");if(msg.status=="success"){Messaging.populateChatBox(msg);}
else{Messaging.error();}}}
var MessagingRoster={highlightColor:"",lastSelected:null,addEntry:function(userId){var url;if(userId){url=themeDisplay.getPathMain()+"/chat/roster?cmd=addEntry&userId="+userId;}
else{var email=$("portlet-chat-roster-email").value;url=themeDisplay.getPathMain()+"/chat/roster?cmd=addEntry&email="+email}
AjaxUtil.request(url,{onComplete:MessagingRoster.addEntryReturn});},addEntryReturn:function(xmlHttpReq){try{var msg=eval("("+xmlHttpReq.responseText+")");if(msg.status=="failure"){alert("No such user exists");}
else{var rosterDiv=$("portlet-chat-roster-list");if(rosterDiv){var entries=document.getElementsByClassName("portlet-chat-roster-entry");var userId=msg.user;var userExists=entries.any(function(item){return(item.userId==userId);});if(!userExists||entries.length==0){var entryRow=MessagingRoster.createEntryRow(msg.user,msg.name);rosterDiv.appendChild(entryRow);}
MessagingRoster.toggleEmail();}}}
catch(err){}},createEntryRow:function(userId,userName,online){var tempDiv=document.createElement("div");var tempImg=document.createElement("img");var tempLink=document.createElement("a");tempImg.align="absmiddle";tempImg.style.marginRight="5px";if(online){tempImg.src=themeDisplay.getPathThemeImage()+"/chat/user_online.gif";}
else{tempImg.src=themeDisplay.getPathThemeImage()+"/chat/user_offline.gif";}
tempLink.innerHTML=userName;tempLink.href="javascript: void(0)";tempLink.onclick=MessagingRoster.onEntryLinkClick;tempDiv.appendChild(tempImg);tempDiv.appendChild(tempLink);tempDiv.onclick=MessagingRoster.onEntryClick;tempDiv.userId=userId;tempDiv.userName=userName;tempDiv.style.cursor="pointer";tempDiv.className="portlet-chat-roster-entry";return tempDiv;},deleteEntries:function(){if(MessagingRoster.lastSelected){var userId=MessagingRoster.lastSelected.userId;var lastSelected=MessagingRoster.lastSelected;lastSelected.parentNode.removeChild(lastSelected);MessagingRoster.lastSelected=null;loadPage(themeDisplay.getPathMain()+"/chat/roster","cmd=deleteEntries&entries="+userId,MessagingRoster.deleteEntriesReturn);}},deleteEntriesReturn:function(xmlHttpReq){try{var msg=eval("("+xmlHttpReq.responseText+")");}
catch(err){}},getEntries:function(){var url=themeDisplay.getPathMain()+"/chat/roster?cmd=getEntries";AjaxUtil.request(url,{onComplete:function(xmlHttpReq){var msg=eval("("+xmlHttpReq.responseText+")");MessagingRoster.getEntriesReturn(msg);}});},getEntriesReturn:function(msg){MessagingRoster.updateEntries(msg.roster);},updateEntries:function(roster){var rosterDiv=$("portlet-chat-roster-list");if(rosterDiv!=null){rosterDiv.innerHTML="";}
else{Messaging.checkRoster=false;return;}
for(var i=0;i<roster.length;i++){var entry=roster[i];var tempDiv=MessagingRoster.createEntryRow(entry.user,entry.name,entry.status=="available");rosterDiv.appendChild(tempDiv);}},onEmailKeypress:function(obj,event){var keyCode;if(window.event)keyCode=window.event.keyCode;else if(event)keyCode=event.which;else return;if(keyCode==13){MessagingRoster.addEntry();}},onEntryClick:function(){if(MessagingRoster.lastSelected!=null){MessagingRoster.lastSelected.style.backgroundColor="transparent";}
this.style.backgroundColor=MessagingRoster.highlightColor;MessagingRoster.lastSelected=this;},onEntryLinkClick:function(){var parent=this.parentNode;Messaging.chat({toId:parent.userId,toName:parent.userName});},toggleEmail:function(){emailDiv=$("portlet-chat-roster-email-div");if(emailDiv.style.display=="none"){emailDiv.style.display="block";emailInput=$("portlet-chat-roster-email");emailInput.value="";emailInput.focus();}
else{emailDiv.style.display="none";}}}