WordPress.org

Plugin Directory

Changeset 493314


Ignore:
Timestamp:
01/21/12 19:56:44 (2 years ago)
Author:
MrWiblog
Message:

Updated to PerformerJS 1.0.4

Location:
performerjs/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • performerjs/trunk/index.php

    r418393 r493314  
    33 * @package PerformerJS 
    44 * @author Chris Taylor 
    5  * @version 1.0.3 
     5 * @version 1.0.4 
    66 */ 
    77/* 
     
    1010Description: Performer is a JavaScript class that works with your favourite library (jQuery, Prototype, Scriptaculous and MooTools are currently supported) giving you simple JavaScript features in your web pages without having to write any JavaScript code. Using standard element attributes such as 'class' you can do AJAX requests, toggle the visibility of elements, check form inputs and much more. A full list of the features available, with documentation, <a href="http://performerjs.org/docs">is available here</a>. 
    1111Author: Chris Taylor 
    12 Version: 1.0.3 
     12Version: 1.0.4 
    1313Author URI: http://www.stillbreathing.co.uk/ 
    1414*/ 
  • performerjs/trunk/performer-min.js

    r418393 r493314  
    33Created by Chris Taylor (http://www.stillbreathing.co.uk) 
    44Additional work by kourge and Danny Linkov 
    5 Version 1.0.2 
     5Version 1.0.4 
    66 
    77This work is released under any of the following licenses, please choose the one you wish to use: 
     
    1212- BSD License (http://www.opensource.org/licenses/bsd-license.php) 
    1313*/ 
    14 var Performer={version:'1.0.3',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start()}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.Effects=['slideup','slidedown','blinddown','blindup','fadein','fadeout'];P.Init()})},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled')},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true)},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false}if(el===undefined){el=''}P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit)},DoTransformers:function(el,reinit){if(reinit===undefined){reinit=false}if(el===undefined||el==='performerjsdebugwrapper'){el=''}P.Transformers(el,'.hider','Hide',reinit);P.Transformers(el,'.shower','Show',reinit);P.Transformers(el,'.focusser','Focus',reinit);P.Transformers(el,'.limiter','LimitNotifier',reinit);P.Transformers(el,'.reloader','Reload',reinit);P.Transformers(el,'.preloader','Preload',reinit);P.Transformers(el,'.prompter','SetPrompt',reinit);P.Transformers(el,'.truncator','Truncate',reinit);P.Transformers(el,'ul.looper,ol.looper','InitLoop',reinit);P.Transformers(el,'.tab','InitTabs',reinit);P.Transformers(el,'.contextmenuer','DisableContextMenu',reinit);P.Transformers(el,'.pager','Page',reinit);P.Transformers(el,'.loadmorpher','Morph',reinit);P.Transformers(el,'.loadtoggler','Toggle',reinit);P.Transformers(el,'.loadgrouptoggler','GroupToggle',reinit);P.Transformers(el,'.loadstyler','Style',reinit);P.Transformers(el,'.loadmodalwindower','ModalWindow',reinit)},Listeners:function(el,classNames,f,event,reinit){var b=P.bind;var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' '}var els=d('body '+el+className);if(els){dbg('Performer.Listeners('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){fe(event.split(','),function(event){b(element,event,P[f])})}})}})},Transformers:function(el,classNames,f,reinit){var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' '}var els=d('body '+el+className);if(els){dbg('Performer.Transformers('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){P[f](element)}})}})},CheckDebug:function(){P.Debug('Performer.CheckDebug','function');var d=P.$$('.performer-debug');if(d){P.Debugging=true;P.PrepareDebug()}},classParam:function(classNames,paramName,defaultValue){var cls=null;var val=defaultValue;var i=classNames.length;while(i--){cls=classNames[i];if(cls&&cls.substring(0,paramName.length+1)==paramName+'-'){val=cls.replace(paramName+'-','')}}return val},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)')}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector)}else{children=P.children(el)}var pagesize=P.classParam(cls,"pagesize",10);var startpage=P.classParam(cls,"startpage",1);if(children.length>pagesize){var page=1;var i=0;var acn=P.addClassName;var h=P.Hide;P.forEach(children,function(el){if(i<page*pagesize&&i>=(page-1)*pagesize){}else{page++}acn(el,'pageelement');acn(el,'page'+page);h(el);i++});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el)});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage)})}},BuildPageMenu:function(elid,page,startpage){var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage"}menu+='<li><a href="#'+elid+'-page'+x+'" class="'+elid+'pagerlink'+currentpage+'" id="'+elid+'-page'+x+'">'+x+'</a></li>';currentpage=""}menu+='</ul>';return menu},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el)});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el)});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage")});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e)},ContextMenu:function(e){var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el)});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false}}return false},DisableContextMenu:function(el){P.disableContext(el)},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el)})},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e)}},InitLoop:function(elid){P.Debug('Performer.InitLoop','function');var el=P.$(elid);var shown=0;var i=0;var n=P.nodeName;var h=P.Hide;var hcn=P.hasClassName;var id=P.identify;var hsh=P.Hash;P.forEach(P.children(el),function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i}i++}});P.Show(P.children(el)[shown])},Loop:function(e){r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el);var loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel'));if(P.$(loop)){var i=0;var toshow=0;var nowshowing=0;var n=P.nodeName;var v=P.visible;var dbg=P.Debug;var h=P.Hide;P.forEach(P.children(P.$(loop)),function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i}h(child);i++});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=(P.children(P.$(loop)).length-1)}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=P.children(P.$(loop)).length){toshow=0}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=P.children(P.$(loop)).length-1}P.Debug('- Showing item '+toshow,'subfunction');P.Show(P.children(P.$(loop))[toshow],"fadein");P.stopEvent(e)}}},Tooltip:function(e,cssClass){var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip"}var id=P.identify(el);if(el&&P.nodeName(el)&&!P.$(id+'_performertooltip')){var cls=P.classNames(el);var text=false;var originaltext="";if(P.getAttribute(el,"title")&&P.getAttribute(el,"title")!=""){originaltext=P.getAttribute(el,"title");text='<p>'+originaltext.replace(/\r/g,"<br />\n")+'</p>'}else{var targetEl=P.$(P.classParam(cls,"targetEl",false));if(targetEl){text=targetEl.innerHTML}}var position=false;if(e.type=='mouseover'){position=P.cursorPosition(e)}else{position=P.elementPosition(el);position[1]=position[1]+el.offsetHeight}if(position&&text){var className=P.classParam(cls,"className",cssClass);var width=P.classParam(cls,"width",300);var leftoffset=position[0]-(width/2);var topoffset=position[1]+16;if(leftoffset<0){leftoffset=25}if(document.body.scrollWidth&&((leftoffset+width)>document.body.scrollWidth)){leftoffset=(document.body.scrollWidth-width-25)}P.setAttribute(el,"title","");P.setAttribute(el,"temptitle",originaltext);if(P.getAttribute(el,"alt")){P.setAttribute(el,"tempalt",originaltext);P.setAttribute(el,"alt","")}var parent=P.up(el,"");if(parent.getAttribute("title")){P.setAttribute(parent,"temptitle",originaltext);P.setAttribute(parent,"title","")}var tooltip=document.createElement('div');var tooltipinner=document.createElement('div');tooltipinner.className=cssClass+'inner';tooltipinner.innerHTML=text;tooltip.id=id+'_performertooltip';tooltip.className=className;tooltip.style.position='absolute';tooltip.style.zIndex='10000';tooltip.style.width=width+'px';tooltip.style.top=topoffset+'px';tooltip.style.left=leftoffset+'px';tooltip.appendChild(tooltipinner);P.bind(el,'mouseout',P.HideTooltip);P.bind(el,'blur',P.HideTooltip);document.getElementsByTagName('body')[0].appendChild(tooltip)}}},HideTooltip:function(e){var el=P.eventElement(e);var id=P.identify(el);if(el&&P.$(id+'_performertooltip')){P.remove(P.$(id+'_performertooltip'));var originaltext=P.getAttribute(el,"temptitle");P.setAttribute(el,"title",originaltext);P.removeAttribute(el,"temptitle");if(P.getAttribute(el,"tempalt")){P.setAttribute(el,"alt",originaltext);P.removeAttribute(el,"tempalt")}var parent=P.up(el,"");if(parent.getAttribute("temptitle")){P.setAttribute(parent,"title",originaltext);P.removeAttribute(parent,"temptitle")}}},ModalWindow:function(e){var eve=P.eventOrElement(e);var el=eve.el;if(el){var id=P.identify(el);var cls=P.classNames(el);var delay=P.classParam(cls,'delay',0)*1000;var outerClassName=P.classParam(cls,'outerClassName','performermodalouter');var innerClassName=P.classParam(cls,'innerClassName','performermodalinner');var lightBox=P.classParam(cls,'lightBox',true);var closer=P.classParam(cls,'closer',true);var targetPage=P.classParam(cls,'targetPage',false);var horizontalPadding=P.classParam(cls,'horizontalPadding',100);var verticalPadding=P.classParam(cls,'verticalPadding',100);var screenDim=P.classParam(cls,'screenDim',6);if(delay===0){P.DoModalWindow(targetPage,lightBox,screenDim,outerClassName,innerClassName,horizontalPadding,verticalPadding,closer)}else{setTimeout(function(){P.DoModalWindow(targetPage,lightBox,screenDim,outerClassName,innerClassName,horizontalPadding,verticalPadding,closer)},delay)}if(eve.stop){P.stopEvent(e)}}},DoModalWindow:function(targetPage,lightBox,screenDim,outerClassName,innerClassName,horizontalPadding,verticalPadding,closer){if(P.createModal(targetPage,lightBox,screenDim,outerClassName,innerClassName,horizontalPadding,verticalPadding,closer)){P.addClassName(P.$('performer_modal'),'performerloading');P.DoLoad(targetPage,'performer_modal','get','fillandinit')}},createModal:function(targetPage,lightBox,screenDim,outerClassName,innerClassName,horizontalPadding,verticalPadding,closer){if(targetPage&&!P.$('performer_modal')){var lb=false;if(lightBox){lb=document.createElement('div');lb.className=outerClassName;lb.style.zIndex=100000;lb.style.position='fixed';lb.style.left='0px';lb.style.right='0px';lb.style.bottom='0px';lb.style.top='0px';lb.style.opacity='0.'+screenDim;lb.style.filter='alpha(opacity='+screenDim+'0)';lb.id='performer_modal_outer'}var inner=document.createElement('div');inner.className=innerClassName;inner.id='performer_modal';inner.style.overflow='auto';inner.style.zIndex=100001;inner.style.position='fixed';inner.style.left=horizontalPadding+'px';inner.style.right=horizontalPadding+'px';inner.style.bottom=verticalPadding+'px';inner.style.top=verticalPadding+'px';if(lightBox){document.getElementsByTagName('body')[0].appendChild(lb)}document.getElementsByTagName('body')[0].appendChild(inner);if(closer){var closelink=document.createElement('div');closelink.id='performer_modal_closer';closelink.style.zIndex=100001;closelink.style.position='fixed';closelink.style.right=horizontalPadding+'px';closelink.style.top=(verticalPadding-20)+'px';closelink.innerHTML='<a href="#" class="modalwindowcloser">Close</a>';document.getElementsByTagName('body')[0].appendChild(closelink);P.bind(P.$$('a.modalwindowcloser')[0],'keypress',P.CloseModal);P.bind(P.$$('a.modalwindowcloser')[0],'click',P.CloseModal)}P.bind(document,'keyup',P.CloseModal)}return true},CloseModal:function(e){var el=P.eventElement(e);if((e.type=='keyup'&&P.keyCode(e)==27)||(el&&P.hasClassName(el,'modalwindowcloser'))){if(P.$('performer_modal_outer')){document.getElementsByTagName('body')[0].removeChild(P.$('performer_modal_outer'))}if(P.$('performer_modal_closer')){document.getElementsByTagName('body')[0].removeChild(P.$('performer_modal_closer'))}if(P.$('performer_modal')){document.getElementsByTagName('body')[0].removeChild(P.$('performer_modal'))}P.stopEvent(e)}},Truncate:function(el){var cls=P.classNames(el);var limit=P.classParam(cls,'limit',50);var openText=P.classParam(cls,'openText','...more');var closeText=P.classParam(cls,'closeText','...less');if(el&&limit){var c=el.innerHTML;var l=c.length;if(limit<l){var id=P.identify(el);el.innerHTML='<span id="'+id+'_truncated">'+c.substring(0,limit)+' <a href="#" class="switcher targetEl1-'+id+'_truncated targetEl2-'+id+'_full">'+openText+'</a></span><span class="hider" id="'+id+'_full">'+c+' <a href="#" class="switcher targetEl1-'+id+'_truncated targetEl2-'+id+'_full">'+closeText+'</a></span>';P.ReInit(id)}}},Duplicate:function(e){var el=P.eventElement(e);var cls=P.classNames(el);var sourceEl=P.classParam(cls,"sourceElement",false);var sourceElement=P.$(sourceEl);var targetEl=P.classParam(cls,"targetElement",false);var targetElement=P.$(targetEl);var start=(parseInt(Performer.classParam(cls,"start",1)))-1;if(el&&P.nodeName(el)&&sourceElement&&P.nodeName(sourceElement)&&targetElement&&P.nodeName(targetElement)){var newel=targetElement.appendChild(sourceElement.cloneNode(true));if(typeof(P.Duplicators[targetEl])==='undefined'){P.Duplicators[targetEl]=(start+1)}var items=P.Duplicators[targetEl]+1;P.Duplicators[targetEl]=items;newel.innerHTML=newel.innerHTML.replace(/_1/g,'_'+items);newel.innerHTML=newel.innerHTML.replace(/[1]/g,items);newel.id=newel.id.replace(/_1/g,'_'+items);if(P.getAttribute(newel,'class')!=''){P.setAttribute(newel,'class',P.getAttribute(newel,'class').replace(/_1/g,'_'+items))}var countEl=P.classParam(cls,"countElement",false);var countElement=P.$(countEl);if(countElement){P.setValue(countElement,items)}P.stopEvent(e)}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled')}})}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success')});P.stopEvent(e)}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.findEventElement(e,'FORM');var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true}else{fnr(identity)}if(field.type=='radio'&&radiogroups.PerformerIndexOf(field.name)==-1){radiogroups[radiogroups.length]=field.name;var radiofail=true;var radiobuttons=el[field.name];for(var i=0;i<radiobuttons.length;i++){if(radiobuttons[i].checked){radiofail=false;break}}var lastbutton=radiobuttons[radiobuttons.length-1];if(radiofail){fn(lastbutton,'error','This field is required');fail=true}else{fnr(lastbutton)}}}if(hcn(field,'field-required-email')||hcn(field,'field-optional-email')){var validemail=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if((hcn(field,'field-required-email')&&val=="")||(val!=""&&!validemail.test(val))){fn(identity,'error','This field must be a valid email address');fail=true}else{fnr(identity)}}if(hcn(field,'field-required-number')||hcn(field,'field-optional-number')){var num=val.replace(",","").replace("&pound;","").replace("£","");if((hcn(field,'field-required-number')&&num=="")||(num!=""&&isNaN(parseFloat(num)))){fn(identity,'error','This field must be a number');fail=true}else{if(num!=""){field.value=parseFloat(num)}fnr(identity)}}if(hcn(field,'field-required-date')||hcn(field,'field-optional-date')){var validdate=/^([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})$/;if((hcn(field,'field-required-date')&&val=="")||(val!=""&&!validdate.test(val))){fn(identity,'error','This field must be a date (dd/mm/yyyy)');fail=true}else{fnr(identity)}}P.Debug('-> Field '+input.name,'subfunction')});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');P.stopEvent(e)}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>')}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className=""}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit')}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit')}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak')}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak')}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok')}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong')}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok')}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl)}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A')}if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13||P.keyCode(e)==32)||!eve.stop)){var cls=P.classNames(el);var showeffect=P.classParam(cls,'showeffect','slidedown');var hideeffect=P.classParam(cls,'hideeffect','slideup');var toggleid=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));if(!toggleid){toggleid=P.identify(el)}var move=P.classParam(cls,'move',false);var delay=P.classParam(cls,'delay',0)*1000;var targetEl=P.$(toggleid);if(targetEl&&P.nodeName(targetEl)){if(delay===0){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect)}else{setTimeout(function(){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect)},delay)}if(!move||!r){if(P.nodeName(el).toLowerCase()=='a'&&eve.stop){P.stopEvent(e)}}else{window.location.hash=P(el,"href").replace(new RegExp('^[#]+','g'),'')}return r}}},DoToggle:function(toggleid,targetEl,el,showeffect,hideeffect){if(!P.visible(targetEl)){if(toggleid!='performerjsdebugbox'){P.Debug('Performer.Toggle -> Show \'#'+toggleid+'\'','subfunction')}P.addClassName(el,'toggleropen');var n=P.nodeName;var s=P.Show;var v=P.visible;s(targetEl,showeffect);P.forEach(P.ancestors(P.$(targetEl)),function(ancestor){if(ancestor.tagName!='body'&&ancestor.tagName!='html'&&n(ancestor)&&!v(ancestor)){s(ancestor)}});r=true}else{if(toggleid!='performerjsdebugbox'){P.Debug('Performer.Toggle -> Hide \'#'+toggleid+'\'','subfunction')}P.removeClassName(el,'toggleropen');P.Hide(targetEl,hideeffect);r=false}if(P.nodeName(el).toLowerCase()=='input'&&el.type&&el.type=='checkbox'){el.checked=r}return r},GroupToggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A')}if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13||P.keyCode(e)==32)||!eve.stop)){var cls=P.classNames(el);var targetClass=P.classParam(cls,'targetClass',P.getAttribute(el,'rel'));var showeffect=P.classParam(cls,'showeffect','slidedown');var hideeffect=P.classParam(cls,'hideeffect','slideup');var move=P.classParam(cls,'move',false);var delay=P.classParam(cls,'delay',0)*1000;var foundEls=P.$$('.'+targetClass);P.Debug('Performer.GroupToggle -> Toggle '+foundEls.length+' elements with class '+targetClass,'subfunction');if(delay===0){r=P.DoGroupToggle(targetClass,foundEls,showeffect,hideeffect)}else{setTimeout(function(){r=P.DoGroupToggle(targetClass,foundEls,showeffect,hideeffect)},delay)}if(P.nodeName(el).toLowerCase()=='input'&&el.type&&el.type=='checkbox'){el.checked=r}if(!move||!r){if(P.nodeName(el).toLowerCase()=='a'&&eve.stop){P.stopEvent(e)}}else{window.location.hash=P(el,"href").replace(new RegExp('^[#]+','g'),'')}return r}},DoGroupToggle:function(targetClass,foundEls,showeffect,hideeffect){var acn=P.addClassName;var rcn=P.removeClassName;var s=P.Show;var h=P.Hide;var r=false;P.forEach(foundEls,function(element){if(!P.visible(element)){acn(element,'toggleropen');s(element,showeffect);r=true}else{rcn(element,'toggleropen');h(element,hideeffect);r=false}});return r},Switch:function(e,c){P.Debug('Performer.Switch','function');var r=false;var el=P.eventElement(e);if(!el){el=P.findEventElement(e,'A')}if(el&&P.nodeName(el)&&(e.type=='click'||e.keyCode==P.keyCode(e)==13)){var cls=P.classNames(el);var t1=P.classParam(cls,'targetEl1',P.getAttribute(el,'rel'));var targetEl1=P.$(t1);var t2=P.classParam(cls,'targetEl2',P.getAttribute(el,'rev'));var targetEl2=P.$(t2);if(targetEl1&&targetEl2){if(!P.visible(targetEl1)){P.Debug('-> Show \'#'+t1+'\', hide \'#'+t2+'\'','subfunction');P.Show(targetEl1);P.Hide(targetEl2);r=true}else{P.Debug('-> Show \'#'+t2+'\', hide \'#'+t1+'\'','subfunction');P.Show(targetEl2);P.Hide(targetEl1);r=false}}if(!c&&P.nodeName(el).toLowerCase()=='a'){P.stopEvent(e)}}return r},Focus:function(e){P.Debug('Performer.Focus','function');var el=P.$(e);if(el&&P.nodeName(el)){P.Debug('-> Focus on \'#'+P.identify(el)+'\'','subfunction');P.$(el).focus()}},Style:function(e){P.Debug('Performer.Style','function');var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A')}if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13)||!eve.stop)){var cls=P.classNames(el);var delay=P.classParam(cls,'delay',0)*1000;var targetEl=P.$(P.classParam(cls,'targetEl',P.getAttribute(el,'rel')));if(!targetEl){targetEl=el}if(targetEl){if(delay===0){P.DoStyle(targetEl,el,cls)}else{setTimeout(function(){P.DoStyle(targetEl,el,cls)},delay)}if(eve.stop){P.stopEvent(e)}}}},DoStyle:function(targetEl,el,cls){var cssstyle=P.classParam(cls,"style","");targetEl.className=cssstyle},Size:function(e){P.Debug('Performer.Size','function');var el=P.findEventElement(e,'a');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.$(P.classParam(cls,'targetEl',P.getAttribute(el,'rel')));if(targetEl){var sizes=P.classParam(cls,'sizes',P.getAttribute(el,'rev'));var sizeParts,height,width;if(sizes.indexOf(',')>=0){sizeParts=sizes.split(',');height=sizeParts[0];width=sizeParts[1]}else{height=sizes;width=0}if(height==''){height=0}if(width==''){width=0}var dimensions=P.getDimensions(targetEl);var currentHeight=dimensions.height;var currentWidth=dimensions.width;if(height!==0){var newHeight=(parseFloat(height)+parseFloat(currentHeight))+'px';P.Debug('-> Change height of \'#'+P.identify(targetEl)+'\' to '+newHeight,'subfunction');P.setStyle(targetEl,{height:newHeight})}if(width!==0){var newWidth=(parseFloat(width)+parseFloat(currentWidth))+'px';P.Debug('-> Change width of \'#'+P.identify(targetEl)+'\' to '+newWidth,'subfunction');P.setStyle(targetEl,{width:newWidth})}P.stopEvent(e)}}},Resize:function(e){P.Debug('Performer.Resize','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var m=P.classParam(cls,'maxHeight',500);var s=el.scrollHeight;var d=P.getDimensions(el);var h=d.height;if((s+5)>h&&h<m){el.style.height=(s+10)+'px'}}},ToggleLoad:function(e){P.Debug('Performer.ToggleLoad','function');var el=P.eventElement(e);var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(el&&P.nodeName(el)&&targetEl&&targetPage&&(e.type=='click'||P.keyCode(e)==13)){if(P.Toggle(e)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');P.Load(e,true,false)}P.stopEvent(e)}},InitTabs:function(el){var elid=P.identify(el);el=P.$(P.identify(el));if(P.Hash==elid){P.addClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.removeClassName(el,'hider');P.Show(el)}if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el)}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev'));var openTab=P.$(otab);var tablinks=P.$$('.tabber');var i=tablinks.length;var hcn=P.hasClassName;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent')}}var tabs=P.$$('#'+tabGroup+' .tab');i=tabs.length;var h=P.Hide;while(i--){h(tabs[i])}P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');P.Show(openTab,'fadein');P.stopEvent(e)}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent')}}var accordianitems=P.$$('#'+accordianGroup+' .accordianitem');i=accordianitems.length;var h=P.Hide;while(i--){h(accordianitems[i])}P.addClassName(el,'accordiancurrent');P.Debug('-> Showing accordianitem \'#'+oitem+'\'','subfunction');P.Show(openItem,'slidedown');P.stopEvent(e)}}},Load:function(e,c,s){P.Debug('Performer.Load','function');var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var rel=P.$(targetEl);var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(targetEl&&rel&&P.nodeName(rel)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');if(!s){P.DoLoad(targetPage,targetEl,'get','fillandinit')}else{P.DoLoad(targetPage,targetEl,'get','fill')}}if(!c){P.stopEvent(e)}}},Delete:function(e){P.Debug('Performer.Delete','function');var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var rel=P.$(targetEl);var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));var confirmDelete=P.classParam(cls,"confirmDelete",false);if(targetEl&&rel&&P.nodeName(rel)){P.Debug('-> Deleting \'#'+targetEl+'\'','subfunction');if((confirmDelete&&P.getAttribute(el,'title')&&confirm(P.getAttribute(el,'title')+' - are you sure?'))||!confirmDelete){P.DoLoad(targetPage,targetEl,'get','deleteandreplace')}}P.stopEvent(e)}},DoLoad:function(targetPage,targetElement,requestMethod,onCompleteFunction){P.Debug('Performer.DoLoad('+targetPage+' -> #'+targetElement+')','function');var target=P.$(targetElement);var d=P.$;var rcn=P.removeClassName;var dbg=P.Debug;var ri=P.ReInit;if(targetPage&&targetElement&&target&&P.nodeName(target)){P.addClassName(d(targetElement),'performerloading');P.Request(targetPage,requestMethod,'',function(request){var text=P.getRequestText(request);if(onCompleteFunction=='fill'){d(targetElement).innerHTML=text;rcn(d(targetElement),'performerloading');dbg('-> Filled \'#'+targetElement+'\'','success')}if(onCompleteFunction=='fillandinit'){d(targetElement).innerHTML=text;rcn(d(targetElement),'performerloading');dbg('-> Filled \'#'+targetElement+'\'','success');ri('#'+targetElement)}if(onCompleteFunction=='deleteandreplace'){P.insertAfter(d(targetElement),text);P.remove(d(targetElement))}if(onCompleteFunction=='setvalue'){d(targetElement).value=text;rcn(d(targetElement),'performerloading');dbg('-> Value set \'#'+targetElement+'\'','success')}if(onCompleteFunction=='setvalueandinit'){d(targetElement).value=text;rcn(d(targetElement),'performerloading');dbg('-> Set value \'#'+targetElement+'\'','success');ri('#'+targetElement)}})}},Reload:function(e){var el=P.$(e);var elid=P.identify(el);if(P.Reloaders.PerformerIndexOf(elid)==-1){var cls=P.classNames(el);var delay=P.classParam(cls,"delay",0)*1000;var targetPage=P.classParam(cls,"targetPage",false);if(delay===0){delay=60000}if(el&&P.nodeName(el)&&delay&&targetPage){P.Reloaders[P.Reloaders.length]=elid;P.Debug('Performer.Reload -> Added \'#'+elid+'\' to Performer.Reloaders (now '+P.Reloaders.length+' items): '+delay+' seconds','subfunction');P.DoLoad(targetPage,elid,'get','fillandinit');var func=function(){var d=new Date();var t=d.getTime();if(targetPage.indexOf('?')!=-1){t='&'+t}else{t='?'+t}P.DoLoad(targetPage+t,elid,'get','fillandinit')};window.setInterval(func,delay)}}},Preload:function(e){P.Debug('Performer.Preload','function');var el=P.$(e);var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);if(el&&P.nodeName(el)&&targetPage){var elid=P.identify(el);P.Debug('-> Loading content into \'#'+elid+'\'','subfunction');P.DoLoad(targetPage,elid,'get','fillandinit')}},Hide:function(el,effect){var elid=P.identify(el);if(el&&P.nodeName(el)){if(P.Hash!=elid){P.Debug('Performer.Hide -> Hiding \'#'+elid+'\' (effect: '+effect+')','subfunction');P.doHide(el,effect);if(!P.hasClassName(el,'hider')){P.addClassName(el,'hider')}if(P.hasClassName(el,'shower')){P.removeClassName(el,'shower')}}else{P.removeClassName(el,'hider')}}else{P.Debug('Performer.Hide -> Could not hide \'#'+elid+'\'','subfunction')}},Show:function(el,effect){var elid=P.identify(el);if(el&&P.nodeName(el)){P.doShow(el,effect);if(P.hasClassName(el,'hider')){P.removeClassName(el,'hider')}if(P.hasClassName(el,'shower')){P.removeClassName(el,'shower')}P.Debug('Performer.Show -> Showing \'#'+elid+'\' (effect: '+effect+')','subfunction')}else{P.Debug('Performer.Show -> Could not show \'#'+elid+'\'','subfunction')}},Limit:function(e){P.Debug('Performer.Limit','function');var el=P.eventElement(e);var cls=P.classNames(el);var lengthLimit=P.classParam(cls,"lengthLimit",false);var targetEl=P.$(P.classParam(cls,"targetEl",false));if(el&&lengthLimit&&targetEl){var currentLength=P.getValue(el).length;if(parseFloat(currentLength)>=parseFloat(lengthLimit)){P.$(el).value=P.getValue(el).substr(0,lengthLimit);P.update(targetEl,"Limit reached");var key=P.keyCode(e)||e.code;if(key!=8&&key!=46&&key!=37&&key!=39){P.stopEvent(e)}}else{P.update(P.$(targetEl),(lengthLimit-currentLength)+" characters left")}}},LimitNotifier:function(e){P.Debug('Performer.LimitNotifier','function');var el=P.$(e);if(el&&(P.nodeName(el)=='input'||P.nodeName(el)=='textarea')){var cls=P.classNames(el);var lengthLimit=P.classParam(cls,"lengthLimit",false);var targetEl=P.$(P.classParam(cls,"targetEl",false));if(!P.hasClassName(el,'prompter')&&lengthLimit&&targetEl){var currentLength=P.getValue(el).length;P.update(targetEl,(lengthLimit-currentLength)+" characters left")}}},Edit:function(e){P.Debug('Performer.Edit','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.classNames(el)&&(e.type=='click'||P.keyCode(e)==13)){P.removeClassName(el,'editor');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetElement=P.classParam(cls,"targetElement",false);var inputType=P.classParam(cls,"inputType","input");var autosave=P.classParam(cls,"autosave",false);if(targetPage&&inputType){var id=P.identify(el);el.innerHTML=P.BuildEditForm(el,targetPage,inputType,targetElement,autosave);P.unBind(el,'click',P.Edit);P.unBind(el,'keypress',P.Edit);var form=P.$(id+'-editor');if(autosave!==false){P.bind(P.$(id+'-value'),'blur',function(){var vars=P.serialize(form);P.addClassName(P.$(id+'-value'),"performerloading");P.Request(targetPage,'post',vars,function(){P.HideEditForm(el,true)})})}else{P.bind(form,'submit',function(e){var vars=P.serialize(form);P.addClassName(form,"performerloading");P.$(id+'-originaltext').innerHTML=P.$(id+'-value').value;P.Request(targetPage,'post',vars,function(){P.HideEditForm(el,true)});P.stopEvent(e)})}P.$(id+'-value').focus();P.ReInit('#'+id)}}},BuildEditForm:function(el,targetPage,inputType,targetElement,autosave){P.Debug('Performer.BuildEditForm('+targetPage+')','function');if(el&&P.nodeName(el)&&P.$(el)&&targetPage){var id=P.identify(el);var value=P.$(el).innerHTML;var editForm;editForm='<form id="'+id+'-editor" class="performer-editor" action="'+targetPage+'" method="post">\n';if(inputType==""||inputType=="input"){editForm+='<input type="text" id="'+id+'-value" name="'+id+'" value="'+value+'" />\n'}if(inputType=="textarea"){editForm+='<textarea id="'+id+'-value" name="'+id+'" rows="6" cols="30">'+value+'</textarea>\n'}if(autosave===false){editForm+='<input type="submit" id="'+id+'-save" name="'+id+'-save" value="Save" />\n<a href=\"#\" class="uneditor targetEl-'+id+'">Cancel</a>\n';if(targetElement!=""){editForm+='<span id="'+targetElement+'"></span>\n'}}editForm+='</form>\n<span style="display:none" id="'+id+'-originaltext">'+value+'</span>';P.Debug('-> Built form with action: '+targetPage,'function');return editForm}},HideEditForm:function(el,val){P.Debug('Performer.HideEditForm','function');var id=P.identify(el);if(val){el.innerHTML=P.$(id+'-value').value}else{el.innerHTML=P.$(id+'-originaltext').innerHTML}P.bind(P.$(id),'click',P.Edit);P.bind(P.$(id),'keypress',P.Edit)},UnEdit:function(e){P.Debug('Performer.UnEdit','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var rel=P.classParam(cls,'targetEl',false);var targetEl=P.$(rel);if(targetEl){P.bind(targetEl,'click',P.Edit);P.bind(targetEl,'keypress',P.Edit);targetEl.innerHTML=P.$(rel+'-originaltext').innerHTML;P.stopEvent(e)}}},SetPrompt:function(el){P.Debug('Performer.SetPrompt','function');var placeHolderSupport=('placeholder'in document.createElement('input'));var id=P.identify(el);var title=P.getAttribute(el,'title');if(!placeHolderSupport){if(el&&P.nodeName(el)&&title&&el.value==""&&(el.type=='textarea'||el.type=='text')){P.Debug('-> Setting prompt: '+title,'function');P.addClassName(el,"performer-prompter");el.value=P.getAttribute(el,'title');var form=P.up('#'+id,'form');if(form){P.bind(form,'submit',function(){P.ClearPrompt(el)},false)}}}else{P.setAttribute(el,'placeholder',title)}},RemovePrompt:function(e){P.Debug('Performer.RemovePrompt','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){P.ClearPrompt(el)}},ClearPrompt:function(el){P.Debug('Performer.ClearPrompt','function');var title=P.getAttribute(el,"title");if(el&&P.nodeName(el)&&title&&(el.value==title)&&(el.type=='textarea'||el.type=='text')){el.value="";P.removeClassName(el,"performer-prompter")}},CheckPrompt:function(e){P.Debug('Performer.CheckPrompt','function');var el=P.eventElement(e);var title=P.getAttribute(el,"title");var id=P.identify(el);if(el&&P.nodeName(el)&&title&&(el.value=="")&&(el.type=='textarea'||el.type=='text')){P.SetPrompt(el);el.value=P.getAttribute(el,'title')}},Pop:function(e){P.Debug('Performer.Popper','function');var el=P.findEventElement(e,'A');var cls=P.classNames(el);var targetName=P.classParam(cls,'targetName',P.getAttribute(el,'rel'))?'':'popupwindow_'+P.increment();var pageOptions=P.classParam(cls,'options',P.getAttribute(el,'rev'))?'':'scrollbars=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=yes';if(el&&P.nodeName(el)&&P.getAttribute(el,'href')&&(e.type=='click'||P.keyCode(e)==13)){var targetURL=P.getAttribute(el,'href');P.Debug('-> Opening: '+targetURL+' with '+pageOptions,'function');var win=window.open(targetURL,targetName,pageOptions);if(window.focus){win.focus()}P.stopEvent(e)}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration)},delay);if(eve.stop){P.stopEvent(e)}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e)}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e)}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper")}},Debug:function(str,status){if(P.Debugging){var col='#000';if(status=='function'){col='#333'}else if(status=='subfunction'){col='#AAA'}else if(status=='error'){col='#900'}else if(status=='success'){col='#090'}else if(status=='warning'){col='#FFA800'}else if(status=='ajax'){col='#4937DF'}if(P.$('performerjsdebugbox')){P.$('performerjsoutput').innerHTML+='<p style="margin:0.1em 0;padding:0;color:'+col+'">'+str+'</p>\n'}}},eventOrElement:function(e){var o={};o.stop=false;o.el=e;if(!e.innerHTML){o.el=P.eventElement(e);o.stop=true}return o},hasClassName:function(el,cls){if(!el||typeof el=='undefined'){return false}if(P.Prototype||P.Scriptaculous){return el.hasClassName(cls)}if(P.jQuery){return jQuery(el).hasClass(cls)}if(P.MooTools){return $(el).hasClass(cls)}},$:function(el){if(typeof el=='object'){return el}if(typeof el=='undefined'){return false}if(P.Prototype||P.Scriptaculous){return $(el)}if(P.MooTools){return $(el)}if(P.jQuery){return jQuery('#'+el)[0]}},$$:function(cls){var els;if(P.Prototype||P.Scriptaculous){els=$$(cls)}if(P.MooTools){els=$$(cls)}if(P.jQuery){els=jQuery(cls)}if(els&&els.length>0){return els}else{return false}},$F:function(el){var elid=P.identify(el);var fields;if(P.Prototype||P.Scriptaculous){fields=el.getElements()}if(P.jQuery){fields=jQuery('#'+elid+' :input')}if(P.MooTools){fields=$$("#"+elid+" input","#"+elid+" textarea","#"+elid+" select","#"+elid+" button")}return fields},nodeName:function(el){var nn=false;if(P.Prototype||P.Scriptaculous){nn=el.nodeName.toLowerCase()}if(P.MooTools){nn=el.nodeName.toLowerCase()}if(P.jQuery){nn=el.tagName.toLowerCase()}if(!nn||typeof nn=='undefined'||nn=='#document'){return false}else{return nn}},getElementsByAttribute:function(type,attr,value){var s;if(value){s=type+"["+attr+"='"+value+"']";if(P.Prototype||P.Scriptaculous){return document.getElementsBySelector(s)}if(P.jQuery){return jQuery(s)}if(P.MooTools){return document.getElements(s)}}else{s=type+"["+attr+"]";if(P.Prototype||P.Scriptaculous){return document.getElementsBySelector(s)}if(P.jQuery){return jQuery(s)}if(P.MooTools){return document.getElements(s)}}},getValue:function(el){if(P.Prototype||P.Scriptaculous){return el.getValue()}if(P.jQuery){return jQuery(el).val()}if(P.MooTools){return el.get('value')}},setValue:function(el,value){if(P.Prototype||P.Scriptaculous){el.value=value;return el}if(P.jQuery){return jQuery(el).val(value)}if(P.MooTools){return el.set('value',value)}},up:function(el,filter){if(P.Prototype||P.Scriptaculous){return el.up(filter)}if(P.jQuery){return jQuery(el).parent(filter)[0]}if(P.MooTools){return el.getParent(filter)}},serialize:function(el){if(P.Prototype||P.Scriptaculous){return el.serialize(true)}if(P.jQuery){return jQuery(el).serialize()}if(P.MooTools){return el.toQueryString()}},update:function(el,html){if(P.Prototype||P.Scriptaculous){return el.update(html)}if(P.jQuery){return jQuery(el).html(html)}if(P.MooTools){return el.set('text',html)}},insertAfter:function(el,html){if(P.Prototype||P.Scriptaculous){return new Insertion.After(el,html)}if(P.jQuery){return jQuery(el).after(html)}if(P.MooTools){if(html.trim().substr(0,1)!=='<'){html='<span>'+html+'</span>'}var i=new Element('div',{'html':html});return i.inject(el,'after')}},increment:function(){P.Counter++;return P.Counter},identify:function(el){if(typeof(el)=='string'){el=P.$(el)}var id=P.getAttribute(el,'id');if(!id||id==''){id='anonymous_element_'+P.increment();P.setAttribute(el,'id',id)}return id},getAttribute:function(el,attr){if(P.Prototype||P.Scriptaculous){return el.readAttribute(attr)}if(P.jQuery){return jQuery(el).attr(attr)}if(P.MooTools){return el.get(attr)}},setAttribute:function(el,attr,val){if(P.Prototype||P.Scriptaculous){return el.writeAttribute(attr,val)}if(P.jQuery){return jQuery(el).attr(attr,val)}if(P.MooTools){return el.set(attr,val)}},removeAttribute:function(el,attr){return el.removeAttribute(attr)},remove:function(el){if(P.Scriptaculous){Effect.Fade(el,{duration:0.5})}if(P.Prototype||P.Scriptaculous){return el.remove()}if(P.jQuery){jQuery(el).fadeOut("normal");return jQuery(el).remove()}if(P.MooTools){el.fade('out');return el.destroy()}},children:function(el,selector){if(typeof selector!='undefined'){selector=selector.replace('-',' ');el=P.$$(selector)}if(P.Prototype||P.Scriptaculous){return el.childElements()}if(P.jQuery){return jQuery(el).children()}if(P.MooTools){return el.getChildren()}},ancestors:function(el){if(P.Prototype||P.Scriptaculous){return el.ancestors()}if(P.jQuery){return jQuery(el).parents()}if(P.MooTools){return el.getParents()}},classNames:function(el){var cls=P.getAttribute(el,"class");if(cls&&cls.length>0){var classes=[];var names=cls.split(/\s+/);var i=names.length;while(i--){if(names[i].length>0){classes[classes.length]=names[i]}}return classes}else{return[]}},visible:function(el){if(typeof(el)!='object'){el=P.$(el)}if(P.Prototype||P.Scriptaculous){return el.visible()}if(P.jQuery){return jQuery(el).is(":visible")}if(P.MooTools){if(el.getStyle('display')=='none'){return false}else{return true}}},addClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el)}if(P.Prototype||P.Scriptaculous){return el.addClassName(cls)}if(P.jQuery){return jQuery(el).addClass(cls)}if(P.MooTools){return $(el).addClass(cls)}},removeClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el)}if(P.Prototype||P.Scriptaculous){return el.removeClassName(cls)}if(P.jQuery){return jQuery(el).removeClass(cls)}if(P.MooTools){return $(el).removeClass(cls)}},className:function(el,cls){if(typeof(el)!='object'){el=P.$(el)}el.className=cls},disableContext:function(el){if(P.Prototype||P.Scriptaculous){P.bind(el,'contextmenu',function(e){e.stop()})}if(P.jQuery){P.bind(el,'contextmenu',function(e){return false})}if(P.MooTools){return P.bind(el,'contextmenu',function(e){e.stop()})}},doHide:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el))}if(P.Prototype){return el.hide()}if(P.Scriptaculous){if(!effect||P.Effects.PerformerIndexOf(effect)==-1){return el.hide()}else{if(effect=='slideup'){return Effect.Fade(el,{duration:0.5})}if(effect=='slidedown'){return Effect.Appear(el,{duration:0.5})}if(effect=='blinddown'){return Effect.BlindDown(el,{duration:0.5})}if(effect=='blindup'){return Effect.BlindUp(el,{duration:0.5})}if(effect=='fadein'){return Effect.Appear(el,{duration:0.5})}if(effect=='fadeout'){return Effect.Fade(el,{duration:0.5})}}}if(P.jQuery){if(!effect||P.Effects.PerformerIndexOf(effect)==-1){return jQuery(el).hide()}else{if(effect=='slideup'||effect=='blindup'){return jQuery(el).slideUp("normal")}if(effect=='slidedown'||effect=='blinddown'){return jQuery(el).slideDown("normal")}if(effect=='fadein'){return jQuery(el).fadeIn("normal")}if(effect=='fadeout'){return jQuery(el).fadeOut("normal")}}}if(P.MooTools){el.fade('out');el.setStyle('display','none');return el}return false},doShow:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el))}if(P.Prototype){return el.show()}if(P.Scriptaculous){if(!effect||P.Effects.PerformerIndexOf(effect)==-1){return el.show()}else{if(effect=='slideup'){return Effect.Fade(el,{duration:0.5})}if(effect=='slidedown'){return Effect.Appear(el,{duration:0.5})}if(effect=='blinddown'){return Effect.BlindDown(el,{duration:0.5})}if(effect=='blindup'){return Effect.BlindUp(el,{duration:0.5})}if(effect=='fadein'){return Effect.Appear(el,{duration:0.5})}if(effect=='fadeout'){return Effect.Fade(el,{duration:0.5})}}}if(P.jQuery){if(!effect||P.Effects.PerformerIndexOf(effect)==-1){return jQuery(el).show()}else{if(effect=='slideup'||effect=='blindup'){return jQuery(el).slideUp("normal")}if(effect=='slidedown'||effect=='blinddown'){return jQuery(el).slideDown("normal")}if(effect=='fadein'){return jQuery(el).fadeIn("normal")}if(effect=='fadeout'){return jQuery(el).fadeOut("normal")}}}if(P.MooTools){el.setStyle('display','block');el.fade('in');return el}return false},Request:function(targetPage,requestMethod,params,successFunction){if(P.Prototype||P.Scriptaculous){new Ajax.Request(targetPage,{method:requestMethod,parameters:params,onSuccess:successFunction})}if(P.jQuery){return jQuery.ajax({type:requestMethod,url:targetPage,data:params,success:successFunction})}if(P.MooTools){var myRequest=new Request({method:requestMethod,url:targetPage,data:params,onSuccess:successFunction});myRequest.send();return myRequest}},getRequestText:function(request){var text=request;if(request.responseText){text=request.responseText}return text},eventElement:function(e){var targ;if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.nodeType==3){return targ.parentNode}return targ},findEventElement:function(e,tag){var target;if(P.Prototype||P.Scriptaculous){return Event.findElement(e,tag)}if(P.jQuery){target=P.eventElement(e);if(target&&target.nodeName&&target.nodeName.toLowerCase()==tag.toLowerCase()){return target}else{return jQuery(target).parents(tag)[0]}}if(P.MooTools){target=P.eventElement(e);if(target&&target.nodeName&&target.nodeName.toLowerCase()==tag.toLowerCase()){return target}else{return $(target).getParent(tag)}}},domLoaded:function(func){if(P.Prototype||P.Scriptaculous){P.bind(document,"dom:loaded",func)}if(P.jQuery){return jQuery(document).ready(func)}if(P.MooTools){return P.bind(window,'domready',func)}},bind:function(el,event,func){if(P.Prototype||P.Scriptaculous){Event.observe(el,event,func)}if(P.jQuery){return jQuery(el).bind(event,func)}if(P.MooTools){return $(el).addEvent(event,func)}},unBind:function(el,event,func){if(P.Prototype||P.Scriptaculous){Event.stopObserving(el,event,func)}if(P.jQuery){return jQuery(el).unbind(event,func)}if(P.MooTools){return $(el).removeEvent(event,func)}},stopEvent:function(e){if(P.Prototype||P.Scriptaculous){e.preventDefault();e.stopPropagation();Event.stop(e);return false}if(P.jQuery){e.preventDefault();e.stopPropagation();return false}if(P.MooTools){e.stop();return false}return false},stopPropagation:function(e){e.stopPropagation();return false},getDimensions:function(el){var size,getsize;if(P.Prototype||P.Scriptaculous){return el.getDimensions()}size={};if(P.jQuery){size.height=jQuery(el).outerHeight();size.width=jQuery(el).outerWidth()}if(P.MooTools){getsize=el.getSize();size.height=getsize.y;size.width=getsize.x}return size},setStyle:function(el,style){if(P.Prototype||P.Scriptaculous){return el.setStyle(style)}if(P.jQuery){jQuery(el).css(style)}if(P.MooTools){$(el).setStyles(style)}},animate:function(el,params,duration){var elid=P.identify(el);if(typeof(el)!='object'){el=P.$(elid)}if(P.Scriptaculous){$(elid).morph(params,{duration:duration})}if(P.Prototype){$(elid).setStyle(params)}if(P.jQuery){duration=duration*1000;jQuery(el).animate(params,duration)}if(P.MooTools){duration=duration*1000;var fx=new Fx.Morph(elid,{duration:duration,transition:Fx.Transitions.Sine.easeOut});fx.start(params)}},setupMorphProperties:function(props,cls){var param,params,i,j;var cp=P.classParam;if(P.Scriptaculous||P.Prototype){params='';for(i=0,j=props.length;i<j;i++){param=cp(cls,props[i],false);var name=props[i];name=name.replace('backgroundColor','background');name=name.replace('fontSize','font-size');name=name.replace('borderWidth','border-width');name=name.replace('lineHeight','line-height');param=P.fixCSSParam(name,param);params+=name+': '+param+'; '}}else{params={};for(i=0,j=props.length;i<j;i++){param=cp(cls,props[i],false);if(param!==false){params[props[i]]=param.replace("px","")}}}return params},fixCSSParam:function(name,param){if((name=='line-height'||name=='border-width'||name=='font-size'||name=='padding'||name=='margin')&&typeof param=='string'){var len=param.length;var last2=param.substring(len-2).toLowerCase();if(last2!='px'&&last2!='em'&&last2!='pt'){return param+'px'}}return param},keyCode:function(e){if(window.event){return window.event.keyCode}else if(e){return e.which}else{return false}},cursorPosition:function(e){if(P.MooTools){var event=new Event(e);return[event.page.x,event.page.y]}else{var posx=0;var posy=0;if(!e){e=window.event}if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY}else if(e.clientX||e.clientY){var de=document.documentElement;var db=document.body;posx=e.clientX+db.scrollLeft+de.scrollLeft;posy=e.clientY+db.scrollTop+de.scrollTop}return[posx,posy]}},elementPosition:function(obj){var curleft=0;var curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent);return[curleft,curtop]}},forEach:function(object,callback){for(var i=0,j=object.length;i<j;i++){callback.call(object[i],object[i],object)}},trim:function(str){return str.replace(/^\s\s*/,'').replace(/\s\s*$/,'')},alertProperties:function(a){var o='';var name;for(name in a){o+=name+': '+a[name]+'\n'}P.createModal(true,true,6,'performermodalouter','performermodalinner',100,100,true);P.$('performer_modal').innerHTML='<pre style="width: 100%; height: 100%">'+o+'</pre>'}};if(typeof(Array.prototype.indexOf)=='function'){Array.prototype.PerformerIndexOf=Array.prototype.indexOf}else{Array.prototype.PerformerIndexOf=function(item,i){i||(i=0);var length=this.length;if(i<0){i=length+i}for(;i<length;i++){if(this[i]===item){return i}}return-1}}var P=Performer;P.Performer();if(P.jQuery){(function(jQuery){jQuery.each(['backgroundColor','color'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end)}fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")"}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[P.trim(color).toLowerCase()]}function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))break;attr="backgroundColor"}while(elem=elem.parentNode);return getRGB(color)};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery)}document.write('<style type="text/css">.hider { display: none; } .performertooltip { display: absolute; }.performerlightboxouter { position: fixed; z-index: 10000; top: 0px; right: 0px; bottom: 0px; left: 0px; background: #000; opacity: 0.6; } .performertooltip { background: #FFF;   padding: 6px; } .performertooltip div.performertooltipinner { border: 1px solid #000; background: #FFFCDF; padding: 1em; } .performermodalouter { background: #000; } .performermodalinner { background: #FFF; border: 1px solid #000; padding: 1em; } * html .performermodalinner { position: relative; } .performermenu:hover { display: absolute; } a.modalwindowcloser { background: #000; color: #FFF; padding: 0 2em; text-decoration: none; } .performerloading { background: #EFE4B3; } .performercontextmenu { background: #D4DBED; padding: 0.6em; list-style: none; border: 1px solid #CCC; } .password-weak { color: #C00; } .password-ok { color: #EFAD3B; }   .password-strong { color: #0C0; } .performer-pagination { text-align: right; } .performer-pagination li { display: inline; } .performer-pagination li a { padding: 0.3em; } .performer-pagination .currentpage { font-weight: bold; } .performer-error { color: #C00; }</style>'); 
     14var Performer={version:"1.0.4",Scriptaculous:!1,Prototype:!1,jQuery:!1,MooTools:!1,Counter:0,LooperFuncs:[],LooperCurrentItem:[],Performer:function(){P.DetectLibrary();(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools)&&P.Start()},DetectLibrary:function(){if(window.Scriptaculous&&"undefined"!=typeof window.Scriptaculous)P.Scriptaculous=!0;else if(window.Prototype&&"undefined"!=typeof window.Prototype&&window.Prototype.Version)P.Prototype=!0;else if(window.MooTools&&"undefined"!=typeof window.MooTools&& 
     15window.MooTools.version)P.MooTools=!0;else if(window.jQuery&&"undefined"!=typeof window.jQuery)P.jQuery=!0},Start:function(){P.domLoaded(function(){P.Debugging=!1;P.Debug("Performer.Performer","function");P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(RegExp("^[#]+","g"),"");P.ShowEffects=["slidedown","blinddown","fadein"];P.HideEffects=["slideup","blindup","fadeout"];P.Effects=P.ShowEffects.concat(P.HideEffects);P.Init()})}, 
     16Init:function(){P.CheckDebug();P.Debug("Performer.Init","function");P.DoTransformers();P.DoListeners();P.addClassName(P.$$("body")[0],"performer-enabled")},ReInit:function(a){P.Debug("Performer.ReInit","function");P.DoTransformers(a,!0);P.DoListeners(a,!0)},DoListeners:function(a,b){void 0===b&&(b=!1);void 0===a&&(a="");P.Listeners(a,"form.formchecker","CheckForm","submit",b);P.Listeners(a,".toggler","Toggle","click,keypress",b);P.Listeners(a,".switcher","Switch","click,keypress",b);P.Listeners(a, 
     17".loader","Load","click,keypress",b);P.Listeners(a,".deleter","Delete","click,keypress",b);P.Listeners(a,".toggleloader","ToggleLoad","click,keypress",b);P.Listeners(a,".sizer","Size","click,keypress",b);P.Listeners(a,".resizer","Resize","keypress",b);P.Listeners(a,".tabber","Tab","click,keypress",b);P.Listeners(a,".accordianer","Accordian","click,keypress",b);P.Listeners(a,".selector","Select","change,keypress",b);P.Listeners(a,".limiter","Limit","keyup,keydown",b);P.Listeners(a,".editor","Edit", 
     18"click,keypress",b);P.Listeners(a,".uneditor","UnEdit","click,keypress",b);P.Listeners(a,".setter","Set","click,keypress",b);P.Listeners(a,".prompter","RemovePrompt","focus",b);P.Listeners(a,".prompter","CheckPrompt","blur",b);P.Listeners(a,".popper","Pop","click,keypress",b);P.Listeners(a,".passwordchecker","CheckPassword","keyup",b);P.Listeners(a,".matcher","Match","keyup",b);P.Listeners(a,".grouptoggler","GroupToggle","click,keypress",b);P.Listeners(a,".submitter","Submit","submit",b);P.Listeners(a, 
     19".looperforward","Loop","click,keypress",b);P.Listeners(a,".looperback","Loop","click,keypress",b);P.Listeners(a,".looperfirst","Loop","click,keypress",b);P.Listeners(a,".looperlast","Loop","click,keypress",b);P.Listeners(a,".looperitem","Loop","click,keypress",b);P.Listeners(a,".looperstart","Loop","click,keypress",b);P.Listeners(a,".looperpause","Loop","click,keypress",b);P.Listeners(a,".tooltipper","Tooltip","mouseover,focus",b);P.Listeners(a,".popup","Tooltip","mouseover,focus",b);P.Listeners(a, 
     20".modalwindower","ModalWindow","click,keypress",b);P.Listeners(a,".modalwindowcloser","CloseModal","click,keypress",b);P.Listeners(a,".contextmenuer","ContextMenu","mouseup",b);P.Listeners(a,".styler","Style","click,keypress",b);P.Listeners(a,".duplicator","Duplicate","click,keypress",b);P.Listeners(a,".morpher","Morph","click,keypress",b);P.Listeners(a,"form.submitlocker","SubmitLock","submit",b);P.Listeners(a,"a.toggle-performer-debug","ToggleDebug","click,keypress",b);P.Listeners(a,".hooker-click", 
     21"Hooker","click,keypress",b);P.Listeners(a,".hooker-keypress","Hooker","keypress",b);P.Listeners(a,".hooker-change","Hooker","change",b);P.Listeners(a,".hooker-mouseover","Hooker","mouseover",b);P.Listeners(a,".hooker-mouseout","Hooker","mouseout",b);P.Listeners(a,".hooker-submit","Hooker","submit",b);P.Listeners(a,".hooker-focus","Hooker","focus",b);P.Listeners(a,".hooker-blur","Hooker","blur",b)},DoTransformers:function(a,b){P.Debug("Performer.DoTransformers","function");void 0===b&&(b=!1);if(void 0=== 
     22a||"performerjsdebugwrapper"===a)a="";P.Transformers(a,".hider","Hide",b);P.Transformers(a,".shower","Show",b);P.Transformers(a,".focusser","Focus",b);P.Transformers(a,".limiter","LimitNotifier",b);P.Transformers(a,".reloader","Reload",b);P.Transformers(a,".preloader","Preload",b);P.Transformers(a,".prompter","SetPrompt",b);P.Transformers(a,".truncator","Truncate",b);P.Transformers(a,"ul.looper,ol.looper","InitLoop",b);P.Transformers(a,".tab","InitTabs",b);P.Transformers(a,".contextmenuer","DisableContextMenu", 
     23b);P.Transformers(a,".pager","Page",b);P.Transformers(a,".loadmorpher","Morph",b);P.Transformers(a,".loadtoggler","Toggle",b);P.Transformers(a,".loadgrouptoggler","GroupToggle",b);P.Transformers(a,".loadstyler","Style",b);P.Transformers(a,".loadmodalwindower","ModalWindow",b)},Listeners:function(a,b,c,d){var e=P.bind,f=P.nodeName,g=P.forEach,h=P.$$,i=P.Debug,b=b.split(",");g(b,function(b){void 0!==a&&(a+=" ");var k=h("body "+a+b);k&&(i("Performer.Listeners("+a+b+") - "+k.length+" elements found", 
     24"function"),g(k,function(a){f(a)&&g(d.split(","),function(b){e(a,b,P[c])})}))})},Transformers:function(a,b,c){var d=P.nodeName,e=P.forEach,f=P.$$,g=P.Debug,b=b.split(",");e(b,function(b){void 0!==a&&(a+=" ");var i=f("body "+a+b);i&&(g("Performer.Transformers("+a+b+") - "+i.length+" elements found","function"),e(i,function(a){if(d(a))P[c](a)}))})},CheckDebug:function(){P.Debug("Performer.CheckDebug","function");if(P.$$(".performer-debug"))P.Debugging=!0,P.PrepareDebug()},classParam:function(a,b,c){for(var d= 
     25null,e=a.length;e--;)(d=a[e])&&d.substring(0,b.length+1)==b+"-"&&(c=d.replace(b+"-",""));return c},Hooker:function(a){if((a=P.eventElement(a))&&P.getAttribute(a,"id")&&P.getAttribute(a,"class"))P.Debug("Performer.Hooker("+P.getAttribute(a,"id")+")","function"),a=P.classParam(P.classNames(a),"func",null),"function"==eval("typeof("+a+")")&&eval(a+"(el,e)")},Page:function(a){var b=P.identify(a),a=P.$(b),c=P.classNames(a),d=P.classParam(c,"selector",""),d=0<d.length?P.children(a,"#"+b+"-"+d):P.children(a), 
     26e=P.classParam(c,"pagesize",10),c=P.classParam(c,"startpage",1);if(d.length>e){var f=1,g=0,h=P.addClassName,i=P.Hide;P.forEach(d,function(a){g<f*e&&g>=(f-1)*e||f++;h(a,"pageelement");h(a,"page"+f);i(a);g++});var j=P.Show;P.forEach(P.$$("#"+b+" .page"+c),function(a){j(a)});c=P.BuildPageMenu(b,f,c);P.insertAfter(a,c);var a=P.$$("."+b+"pagerlink"),k=P.bind;P.forEach(a,function(a){k(a,"click",P.ShowPage);k(a,"keypress",P.ShowPage)})}},BuildPageMenu:function(a,b,c){P.Debug("Performer.BuildPageMenu("+a+ 
     27")","function");for(var d='<ul class="performer-pagination">',e="",f=1;f<=b;f++)f==c&&(e=" currentpage"),d+='<li><a href="#'+a+"-page"+f+'" class="'+a+"pagerlink"+e+'" id="'+a+"-page"+f+'">'+f+"</a></li>",e="";return d+"</ul>"},ShowPage:function(a){var b=P.eventElement(a),b=P.identify(b),c=b.split("-page"),d=P.forEach;P.Debug("Performer.ShowPage("+b+")","function");var e=P.Hide;d(P.$$("#"+c[0]+" .pageelement"),function(a){e(a)});var f=P.Show;d(P.$$("#"+c[0]+" .page"+c[1]),function(a){f(a)});var g= 
     28P.removeClassName;d(P.$$("."+c[0]+"pagerlink"),function(a){g(a,"currentpage")});P.addClassName(P.$(b),"currentpage");P.stopEvent(a)},ContextMenu:function(a){P.Debug("Performer.ContextMenu()","function");var b=P.eventElement(a),c=P.Hide,d=P.bind;P.forEach(P.$$(".performercontextmenu"),function(a){c(a)});if(b&&(a.which&&3==a.which||a.button&&3==a.button||a.rightClick)){var e=P.classParam(P.classNames(b),"targetEl",!1),f=P.cursorPosition(a);if(f&&e&&P.$(e))P.identify(b),e=P.$(e),P.addClassName(e,"performercontextmenu"), 
     29e.style.position="absolute",e.style.zIndex="10000",e.style.top=f[1]+"px",e.style.left=f[0]+"px",P.Show(e),a.preventDefault(),d(P.$$("body")[0],"click",P.HideContextMenu),d(P.$$("body")[0],"keypress",P.HideContextMenu),P.stopEvent(a)}return!1},DisableContextMenu:function(a){P.disableContext(a)},HideContextMenu:function(){var a=P.$$(".performercontextmenu"),b=P.removeClassName,c=P.Hide;P.forEach(a,function(a){b(a,"performercontextmenu");c(a)})},Set:function(a){var b=P.eventElement(a);if(b&&P.nodeName(b)){P.Debug("Performer.Set", 
     30"function");var c=P.classNames(b),d=unescape(P.classParam(c,"value","")),b=P.classParam(c,"targetEl",P.getAttribute(b,"rel"));P.setValue(P.$(b),d);P.stopEvent(a)}},InitLoop:function(a){P.Debug("Performer.InitLoop","function");var b=P.identify(a),c=0,d=0,e=P.classNames(a),f=P.classParam(e,"delay",0),e=P.classParam(e,"effect","fadein"),e=P.getShowEffect(e),g=P.nodeName,h=P.Hide,i=P.hasClassName,j=P.identify,k=P.Hash,a=P.children(a);P.forEach(a,function(a){if(g(a)){h(a);if(i(a,"looperdefault")||k==j(a))c= 
     31d;d++}});P.Show(a[c]);P.LooperCurrentItem[b]=c;0<f&&P.StartLoop(b,a,f,e)},StartLoop:function(a,b,c,d){P.LooperFuncs[a]=window.setInterval(function(){var c=P.LooperCurrentItem[a]+1;c>=b.length&&(c=0);P.LooperCurrentItem[a]=c;P.forEach(b,function(a){P.Hide(a)});P.Show(b[c],d)},1E3*c)},Loop:function(a){P.Debug("Performer.Loop","function");r=!1;var b=P.findEventElement(a,"A");if("click"==a.type||13==P.keyCode(a)){var c=P.classNames(b),d=P.classParam(c,"targetEl",P.getAttribute(b,"rel")),e=P.$(d);if(e){e= 
     32P.children(e);window.clearInterval(P.LooperFuncs[d]);if(P.hasClassName(b,"looperpause"))return P.Debug("Performer.Loop (pause auto-loop)","function"),P.stopEvent(a),!1;if(P.hasClassName(b,"looperstart")){P.Debug("Performer.Loop (start auto-loop)","function");var f=P.classNames(P.$(d)),g=P.classParam(f,"delay",0),f=P.classParam(f,"effect","fadein"),f=P.getShowEffect(f),h=P.LooperCurrentItem[d];if(0<g)return P.Hide(e[h]),h++,h>=e.length&&(h=0),P.LooperCurrentItem[d]=h,P.Show(e[h],f),P.StartLoop(d,e, 
     33g,f),P.stopEvent(a),!1}var i=0,h=-1,j=0,k=P.nodeName,m=P.visible,l=P.Debug,o=P.Hide,g=e.length,f=P.classParam(c,"effect","fadein"),f=P.getShowEffect(f);P.forEach(e,function(a){k(a)&&m(a)&&(l("- Currently showing item "+i,"subfunction"),j=i);o(a);i++});P.hasClassName(b,"looperback")?(P.Debug("Performer.Loop (back)","function"),h=j-1,0>h&&(h=g-1)):P.hasClassName(b,"looperforward")?(P.Debug("Performer.Loop (forward)","function"),h=j+1,h>=g&&(h=0)):P.hasClassName(b,"looperfirst")?(P.Debug("Performer.Loop (first)", 
     34"function"),h=0):P.hasClassName(b,"looperlast")?(P.Debug("Performer.Loop (last)","function"),h=g-1):P.hasClassName(b,"looperitem")&&(h=P.classParam(c,"item",1),h>=g&&(h=g-1),P.Debug("Performer.Loop ("+h+")","function"));P.LooperCurrentItem[d]=h;P.Debug("- Showing item "+h,"subfunction");P.Show(e[h],f);P.stopEvent(a)}}},Tooltip:function(a,b){P.Debug("Performer.Tooltip","function");var c=P.eventElement(a);b||(b="performertooltip");var d=P.identify(c);if(c&&P.nodeName(c)&&!P.$(d+"_performertooltip")){var e= 
     35P.classNames(c),f=!1,g="";if(P.getAttribute(c,"title")&&""!=P.getAttribute(c,"title"))g=P.getAttribute(c,"title"),f="<p>"+g.replace(/\r/g,"<br />\n")+"</p>";else{var h=P.$(P.classParam(e,"targetEl",!1));if(h)f=h.innerHTML}var i=!1;"mouseover"==a.type?i=P.cursorPosition(a):(i=P.elementPosition(c),i[1]+=c.offsetHeight);if(i&&f){var h=P.classParam(e,"className",b),e=P.classParam(e,"width",300),j=i[0]-e/2,i=i[1]+16;0>j&&(j=25);document.body.scrollWidth&&j+e>document.body.scrollWidth&&(j=document.body.scrollWidth- 
     36e-25);P.setAttribute(c,"title","");P.setAttribute(c,"temptitle",g);P.getAttribute(c,"alt")&&(P.setAttribute(c,"tempalt",g),P.setAttribute(c,"alt",""));var k=P.up(c,"");k.getAttribute("title")&&(P.setAttribute(k,"temptitle",g),P.setAttribute(k,"title",""));g=document.createElement("div");k=document.createElement("div");k.className=b+"inner";k.innerHTML=f;g.id=d+"_performertooltip";g.className=h;g.style.position="absolute";g.style.zIndex="10000";g.style.width=e+"px";g.style.top=i+"px";g.style.left= 
     37j+"px";g.appendChild(k);P.bind(c,"mouseout",P.HideTooltip);P.bind(c,"blur",P.HideTooltip);document.getElementsByTagName("body")[0].appendChild(g)}}},HideTooltip:function(a){var a=P.eventElement(a),b=P.identify(a);a&&P.$(b+"_performertooltip")&&(P.remove(P.$(b+"_performertooltip")),b=P.getAttribute(a,"temptitle"),P.setAttribute(a,"title",b),P.removeAttribute(a,"temptitle"),P.getAttribute(a,"tempalt")&&(P.setAttribute(a,"alt",b),P.removeAttribute(a,"tempalt")),a=P.up(a,""),a.getAttribute("temptitle")&& 
     38(P.setAttribute(a,"title",b),P.removeAttribute(a,"temptitle")))},ModalWindow:function(a){var b=P.eventOrElement(a),c=b.el;if(c){P.identify(c);var c=P.classNames(c),d=1E3*P.classParam(c,"delay",0),e=P.classParam(c,"outerClassName","performermodalouter"),f=P.classParam(c,"innerClassName","performermodalinner"),g=P.classParam(c,"lightBox",!0),h=P.classParam(c,"closer",!0),i=P.classParam(c,"targetPage",!1),j=P.classParam(c,"horizontalPadding",100),k=P.classParam(c,"verticalPadding",100),m=P.classParam(c, 
     39"screenDim",6);0===d?P.DoModalWindow(i,g,m,e,f,j,k,h):setTimeout(function(){P.DoModalWindow(i,g,m,e,f,j,k,h)},d);b.stop&&P.stopEvent(a)}},DoModalWindow:function(a,b,c,d,e,f,g,h){P.createModal(a,b,c,d,e,f,g,h)&&(P.addClassName(P.$("performer_modal"),"performerloading"),P.DoLoad(a,"performer_modal","get","fillandinit"))},createModal:function(a,b,c,d,e,f,g,h){if(a&&!P.$("performer_modal")){a=!1;if(b)a=document.createElement("div"),a.className=d,a.style.zIndex=1E5,a.style.position="fixed",a.style.left= 
     40"0px",a.style.right="0px",a.style.bottom="0px",a.style.top="0px",a.style.opacity="0."+c,a.style.filter="alpha(opacity="+c+"0)",a.id="performer_modal_outer";c=document.createElement("div");c.className=e;c.id="performer_modal";c.style.overflow="auto";c.style.zIndex=100001;c.style.position="fixed";c.style.left=f+"px";c.style.right=f+"px";c.style.bottom=g+"px";c.style.top=g+"px";b&&document.getElementsByTagName("body")[0].appendChild(a);document.getElementsByTagName("body")[0].appendChild(c);if(h)b=document.createElement("div"), 
     41b.id="performer_modal_closer",b.style.zIndex=100001,b.style.position="fixed",b.style.right=f+"px",b.style.top=g-20+"px",b.innerHTML='<a href="#" class="modalwindowcloser">Close</a>',document.getElementsByTagName("body")[0].appendChild(b),P.bind(P.$$("a.modalwindowcloser")[0],"keypress",P.CloseModal),P.bind(P.$$("a.modalwindowcloser")[0],"click",P.CloseModal);P.bind(document,"keyup",P.CloseModal)}return!0},CloseModal:function(a){var b=P.eventElement(a);if("keyup"==a.type&&27==P.keyCode(a)||b&&P.hasClassName(b, 
     42"modalwindowcloser"))P.$("performer_modal_outer")&&document.getElementsByTagName("body")[0].removeChild(P.$("performer_modal_outer")),P.$("performer_modal_closer")&&document.getElementsByTagName("body")[0].removeChild(P.$("performer_modal_closer")),P.$("performer_modal")&&document.getElementsByTagName("body")[0].removeChild(P.$("performer_modal")),P.stopEvent(a)},Truncate:function(a){var b=P.classNames(a),c=P.classParam(b,"limit",50),d=P.classParam(b,"openText","...more"),b=P.classParam(b,"closeText", 
     43"...less");if(a&&c){var e=a.innerHTML;if(c<e.length){var f=P.identify(a);a.innerHTML='<span id="'+f+'_truncated">'+e.substring(0,c)+' <a href="#" class="switcher targetEl1-'+f+"_truncated targetEl2-"+f+'_full">'+d+'</a></span><span class="hider" id="'+f+'_full">'+e+' <a href="#" class="switcher targetEl1-'+f+"_truncated targetEl2-"+f+'_full">'+b+"</a></span>";P.ReInit(f)}}},Duplicate:function(a){var b=P.eventElement(a),c=P.classNames(b),d=P.classParam(c,"sourceElement",!1),e=P.$(d),d=P.classParam(c, 
     44"targetElement",!1),f=P.$(d),g=parseInt(Performer.classParam(c,"start",1))-1;if(b&&P.nodeName(b)&&e&&P.nodeName(e)&&f&&P.nodeName(f))e=f.appendChild(e.cloneNode(!0)),"undefined"===typeof P.Duplicators[d]&&(P.Duplicators[d]=g+1),b=P.Duplicators[d]+1,P.Duplicators[d]=b,e.innerHTML=e.innerHTML.replace(/_1/g,"_"+b),e.innerHTML=e.innerHTML.replace(/[1]/g,b),e.id=e.id.replace(/_1/g,"_"+b),""!=P.getAttribute(e,"class")&&P.setAttribute(e,"class",P.getAttribute(e,"class").replace(/_1/g,"_"+b)),c=P.classParam(c, 
     45"countElement",!1),(c=P.$(c))&&P.setValue(c,b),P.stopEvent(a)},SubmitLock:function(a){if(a=P.findEventElement(a,"FORM")){var a=P.$F(a),b=P.addClassName;P.forEach(a,function(a){a=P.$(P.identify(a));if("submit"==a.type.toLowerCase())a.disabled=!0,b(a,"performer-disabled")})}},Submit:function(a){var b=P.findEventElement(a,"FORM"),c=P.classNames(b),d=P.classParam(c,"targetPage",!1),e=P.classParam(c,"targetEl",P.classParam(c,"targetElement",!1)),f=P.$(e);d&&b&&P.nodeName(b)&&f&&P.nodeName(f)&&(b=P.serialize(b), 
     46P.addClassName(f,"performerloading"),P.Request(d,"POST",b,function(a){a=P.getRequestText(a);P.update(f,a);P.removeClassName(f,"performerloading");P.Debug("-> Filled '#"+e+"'","success")}),P.stopEvent(a))},CheckForm:function(a){P.Debug("Performer.CheckForm","function");var b=P.eventElement(a),b=P.classNames(b),b=P.classParam(b,"targetEl",P.findEventElement(a,"FORM"));(b=P.DoCheckForm(b))||P.stopEvent(a);return b},DoCheckForm:function(a){var b=!1,c=[],d=P.$F(a),e=P.identify,f=P.$,g=P.hasClassName,h= 
     47P.FieldNotify,i=P.FieldNotifyRemove,j=P.getValue;P.forEach(d,function(d){var m=e(d),l=f(m),o=j(l);if(g(l,"field-required")&&("radio"!=l.type&&("checkbox"==l.type&&!1===l.checked||""==l.value)?(h(m,"error","This field is required"),b=!0):i(m),"radio"==l.type&&-1==c.PerformerIndexOf(l.name))){c[c.length]=l.name;for(var n=!0,p=a[l.name],q=0;q<p.length;q++)if(p[q].checked){n=!1;break}p=p[p.length-1];n?(h(p,"error","This field is required"),b=!0):i(p)}if(g(l,"field-required-email")||g(l,"field-optional-email"))n= 
     48/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,g(l,"field-required-email")&&""==o||""!=o&&!n.test(o)?(h(m,"error","This field must be a valid email address"),b=!0):i(m);if(g(l,"field-required-number")||g(l,"field-optional-number"))if(n=o.replace(",","").replace("&pound;","").replace("\u00a3",""),g(l,"field-required-number")&&""==n||""!=n&&isNaN(parseFloat(n)))h(m,"error","This field must be a number"),b=!0;else{if(""!=n)l.value=parseFloat(n);i(m)}if(g(l,"field-required-date")|| 
     49g(l,"field-optional-date"))n=/^([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})$/,g(l,"field-required-date")&&""==o||""!=o&&!n.test(o)?(h(m,"error","This field must be a date (dd/mm/yyyy)"),b=!0):i(m);P.Debug("-> Field "+d.name,"subfunction")});return b?(h(P.identify(a),"error","There are errors with some fields. Please check the form and try again."),!1):!0},FieldNotify:function(a,b,c){P.$(a+"-notification")?(P.$(a+"-notification").innerHTML=c,P.$(a+"-notification").className="performer-"+b):P.insertAfter(P.$(a), 
     50'<span id="'+a+'-notification" class="performer-'+b+'">'+c+"</span>")},FieldNotifyRemove:function(a){if(P.$(a+"-notification"))P.$(a+"-notification").innerHTML="",P.$(a+"-notification").className=""},Select:function(a){P.Debug("Performer.Select","function");if((a=P.eventElement(a))&&P.nodeName(a)&&P.getAttribute(a,"id")&&P.getAttribute(a,"name")&&P.getAttribute(a,"class")){var b=P.classNames(a),c=P.classParam(b,"targetPage",!1),d=P.classParam(b,"targetEl",!1),b=P.classParam(b,"targetValue",!1);c&& 
     51P.$(d)&&("true"==b?P.DoLoad(c+"?selection="+P.getValue(a),d,"post","setvalueandinit"):P.DoLoad(c+"?selection="+P.getValue(a),d,"post","fillandinit"))}},CheckPassword:function(a){P.Debug("Performer.CheckPassword","function");if((a=P.eventElement(a))&&P.nodeName(a)&&P.getAttribute(a,"id")&&P.getAttribute(a,"name")&&P.getAttribute(a,"class")){var b=P.classNames(a);if(b=P.$(P.classParam(b,"notifyEl",!1)))if(P.Show(b),a=a.value,6>a.length)P.update(b,"Your password must be at least 6 characters long"), 
     52P.className(b,"password-weak");else if(P.update(b,""),a.match(/^([a-zA-Z]{6,10})$/)||a.match(/^([0-9]{6,10})$/))P.update(b,"Weak password"),P.className(b,"password-weak");else if(a.match(/^([a-zA-Z]{10,})$/)||a.match(/^([0-9]{10,})$/))P.update(b,"Acceptable password"),P.className(b,"password-ok");else if(a.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/))P.update(b,"Strong password"),P.className(b,"password-strong");else if(a.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||a.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)|| 
     53a.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/))P.update(b,"Acceptable password"),P.className(b,"password-ok")}},Match:function(a){P.Debug("Performer.Match","function");if((a=P.eventElement(a))&&P.nodeName(a)&&P.getAttribute(a,"id")&&P.getAttribute(a,"name")&&P.getAttribute(a,"class")){var b=P.classNames(a),c=P.$(P.classParam(b,"notifyEl",!1)),b=P.$(P.classParam(b,"matchEl",!1));c&&b&&(P.Show(c),a.value==b.value&&P.Hide(c))}},Toggle:function(a){var b=!1,c=P.eventOrElement(a),d=c.el;d||(d=P.findEventElement(a, 
     54"A"));if(d&&P.nodeName(d)&&("click"==a.type||13==P.keyCode(a)||32==P.keyCode(a)||!c.stop)){var e=P.classNames(d),f=P.classParam(e,"showeffect","slidedown"),g=P.classParam(e,"hideeffect","slideup"),h=P.classParam(e,"targetEl",P.getAttribute(d,"rel"));h||(h=P.identify(d));var i=P.classParam(e,"move",!1),e=1E3*P.classParam(e,"delay",0),j=P.$(h);if(j&&P.nodeName(j))return 0===e?b=P.DoToggle(h,j,d,f,g):setTimeout(function(){b=P.DoToggle(h,j,d,f,g)},e),!i||!b?"a"==P.nodeName(d).toLowerCase()&&c.stop&&P.stopEvent(a): 
     55window.location.hash=P(d,"href").replace(RegExp("^[#]+","g"),""),b}},DoToggle:function(a,b,c,d,e){if(P.visible(b))"performerjsdebugbox"!=a&&P.Debug("Performer.Toggle -> Hide '#"+a+"'","subfunction"),P.removeClassName(c,"toggleropen"),P.Hide(b,e),r=!1;else{"performerjsdebugbox"!=a&&P.Debug("Performer.Toggle -> Show '#"+a+"'","subfunction");P.addClassName(c,"toggleropen");var f=P.nodeName,g=P.Show,h=P.visible;g(b,d);P.forEach(P.ancestors(P.$(b)),function(a){"body"!=a.tagName&&"html"!=a.tagName&&f(a)&& 
     56!h(a)&&g(a)});r=!0}if("input"==P.nodeName(c).toLowerCase()&&c.type&&"checkbox"==c.type)c.checked=r;return r},GroupToggle:function(a){var b=!1,c=P.eventOrElement(a),d=c.el;d||(d=P.findEventElement(a,"A"));if(d&&P.nodeName(d)&&("click"==a.type||13==P.keyCode(a)||32==P.keyCode(a)||!c.stop)){var e=P.classNames(d),f=P.classParam(e,"targetClass",P.getAttribute(d,"rel")),g=P.classParam(e,"showeffect","slidedown"),h=P.classParam(e,"hideeffect","slideup"),i=P.classParam(e,"move",!1),e=1E3*P.classParam(e,"delay", 
     570),j=P.$$("."+f);P.Debug("Performer.GroupToggle -> Toggle "+j.length+" elements with class "+f,"subfunction");0===e?b=P.DoGroupToggle(f,j,g,h):setTimeout(function(){b=P.DoGroupToggle(f,j,g,h)},e);if("input"==P.nodeName(d).toLowerCase()&&d.type&&"checkbox"==d.type)d.checked=b;!i||!b?"a"==P.nodeName(d).toLowerCase()&&c.stop&&P.stopEvent(a):window.location.hash=P(d,"href").replace(RegExp("^[#]+","g"),"");return b}},DoGroupToggle:function(a,b,c,d){var e=P.addClassName,f=P.removeClassName,g=P.Show,h=P.Hide, 
     58i=!1;P.forEach(b,function(a){P.visible(a)?(f(a,"toggleropen"),h(a,d),i=!1):(e(a,"toggleropen"),g(a,c),i=!0)});return i},Switch:function(a,b){P.Debug("Performer.Switch","function");var c=!1,d=P.eventElement(a);d||(d=P.findEventElement(a,"A"));if(d&&P.nodeName(d)&&("click"==a.type||13==(a.keyCode==P.keyCode(a)))){var e=P.classNames(d),f=P.classParam(e,"targetEl1",P.getAttribute(d,"rel")),g=P.$(f),e=P.classParam(e,"targetEl2",P.getAttribute(d,"rev")),h=P.$(e);g&&h&&(P.visible(g)?(P.Debug("-> Show '#"+ 
     59e+"', hide '#"+f+"'","subfunction"),P.Show(h),P.Hide(g),c=!1):(P.Debug("-> Show '#"+f+"', hide '#"+e+"'","subfunction"),P.Show(g),P.Hide(h),c=!0));!b&&"a"==P.nodeName(d).toLowerCase()&&P.stopEvent(a)}return c},Focus:function(a){P.Debug("Performer.Focus","function");if((a=P.$(a))&&P.nodeName(a))P.Debug("-> Focus on '#"+P.identify(a)+"'","subfunction"),P.$(a).focus()},Style:function(a){P.Debug("Performer.Style","function");var b=P.eventOrElement(a),c=b.el;c||(c=P.findEventElement(a,"A"));if(c&&P.nodeName(c)&& 
     60("click"==a.type||13==P.keyCode(a)||!b.stop)){var d=P.classNames(c),e=1E3*P.classParam(d,"delay",0),f=P.$(P.classParam(d,"targetEl",P.getAttribute(c,"rel")));f||(f=c);f&&(0===e?P.DoStyle(f,c,d):setTimeout(function(){P.DoStyle(f,c,d)},e),b.stop&&P.stopEvent(a))}},DoStyle:function(a,b,c){b=P.classParam(c,"style","");a.className=b},Size:function(a){P.Debug("Performer.Size","function");var b=P.findEventElement(a,"a");if(b&&P.nodeName(b)&&("click"==a.type||13==P.keyCode(a))){var c=P.classNames(b),d=P.$(P.classParam(c, 
     61"targetEl",P.getAttribute(b,"rel")));if(d){b=P.classParam(c,"sizes",P.getAttribute(b,"rev"));0<=b.indexOf(",")?(c=b.split(","),b=c[0],c=c[1]):c=0;""==b&&(b=0);""==c&&(c=0);var e=P.getDimensions(d),f=e.height,e=e.width;0!==b&&(b=parseFloat(b)+parseFloat(f)+"px",P.Debug("-> Change height of '#"+P.identify(d)+"' to "+b,"subfunction"),P.setStyle(d,{height:b}));0!==c&&(b=parseFloat(c)+parseFloat(e)+"px",P.Debug("-> Change width of '#"+P.identify(d)+"' to "+b,"subfunction"),P.setStyle(d,{width:b}));P.stopEvent(a)}}}, 
     62Resize:function(a){P.Debug("Performer.Resize","function");if((a=P.eventElement(a))&&P.nodeName(a)){var b=P.classNames(a),b=P.classParam(b,"maxHeight",500),c=a.scrollHeight,d=P.getDimensions(a).height;if(c+5>d&&d<b)a.style.height=c+10+"px"}},ToggleLoad:function(a){P.Debug("Performer.ToggleLoad","function");var b=P.eventElement(a),c=P.classNames(b),d=P.classParam(c,"targetEl",P.getAttribute(b,"rel")),c=P.classParam(c,"targetPage",P.getAttribute(b,"rev"));if(b&&P.nodeName(b)&&d&&c&&("click"==a.type|| 
     6313==P.keyCode(a)))P.Toggle(a)&&(P.Debug("-> Loading content into '#"+d+"'","subfunction"),P.Load(a,!0,!1)),P.stopEvent(a)},InitTabs:function(a){var b=P.identify(a),a=P.$(P.identify(a));P.Hash==b&&(P.addClassName(P.getElementsByAttribute("a","rev",b)[0],"tabbercurrent"),P.removeClassName(a,"hider"),P.Show(a));!P.hasClassName(a,"hider")&&""!=P.Hash&&P.Hash!=b&&(P.removeClassName(P.getElementsByAttribute("a","rev",b)[0],"tabbercurrent"),P.addClassName(a,"hider"),P.Hide(a))},Tab:function(a){P.Debug("Performer.Tab", 
     64"function");P.Hash="";var b=P.findEventElement(a,"A");if(b&&P.nodeName(b)&&("click"==a.type||13==P.keyCode(a))){var c=P.classNames(b),d=P.classParam(c,"tabGroup",P.getAttribute(b,"rel"));if(d&&P.$(d)){for(var e=P.classParam(c,"tab",P.getAttribute(b,"rev")),c=P.classParam(c,"effect","fadein"),f=P.$(e),g=P.$$(".tabber"),h=g.length,i=P.hasClassName,j=P.getAttribute,k=P.removeClassName;h--;)(i(g[h],"tabGroup-"+d)||j(b,"rel")==d)&&k(g[h],"tabbercurrent");d=P.$$("#"+d+" .tab");h=d.length;for(g=P.Hide;h--;)g(d[h]); 
     65P.addClassName(b,"tabbercurrent");P.Debug("-> Showing tab '#"+e+"'","subfunction");c=P.getShowEffect(c);P.Show(f,c);P.stopEvent(a)}}},Accordian:function(a){P.Debug("Performer.Accordian","function");P.Hash="";var b=P.findEventElement(a,"A");if(b&&P.nodeName(b)&&("click"==a.type||13==P.keyCode(a))){var c=P.classNames(b),d=P.classParam(c,"group",!1);if(P.$(d)){P.classNames(b);for(var c=P.classParam(c,"item",!1),e=P.$(c),f=P.$$(".accordianer"),g=f.length,h=P.getAttribute,i=P.removeClassName;g--;)h(f[g], 
     66"rel")==d&&i(f[g],"accordiancurrent");d=P.$$("#"+d+" .accordianitem");g=d.length;for(f=P.Hide;g--;)f(d[g]);P.addClassName(b,"accordiancurrent");P.Debug("-> Showing accordianitem '#"+c+"'","subfunction");P.Show(e,"slidedown");P.stopEvent(a)}}},Load:function(a,b,c){P.Debug("Performer.Load","function");var d=P.findEventElement(a,"A");if(d&&P.nodeName(d)&&("click"==a.type||13==P.keyCode(a))){var e=P.classNames(d),f=P.classParam(e,"targetEl",P.getAttribute(d,"rel")),g=P.$(f),d=P.classParam(e,"targetPage", 
     67P.getAttribute(d,"rev"));f&&g&&P.nodeName(g)&&(P.Debug("-> Loading content into '#"+f+"'","subfunction"),c?P.DoLoad(d,f,"get","fill"):P.DoLoad(d,f,"get","fillandinit"));b||P.stopEvent(a)}},Delete:function(a){P.Debug("Performer.Delete","function");var b=P.findEventElement(a,"A");if(b&&P.nodeName(b)&&("click"==a.type||13==P.keyCode(a))){var c=P.classNames(b),d=P.classParam(c,"targetEl",P.getAttribute(b,"rel")),e=P.$(d),f=P.classParam(c,"targetPage",P.getAttribute(b,"rev")),c=P.classParam(c,"confirmDelete", 
     68!1);d&&e&&P.nodeName(e)&&(P.Debug("-> Deleting '#"+d+"'","subfunction"),(c&&P.getAttribute(b,"title")&&confirm(P.getAttribute(b,"title")+" - are you sure?")||!c)&&P.DoLoad(f,d,"get","deleteandreplace"));P.stopEvent(a)}},DoLoad:function(a,b,c,d){P.Debug("Performer.DoLoad("+a+" -> #"+b+")","function");var e=P.$(b),f=P.$,g=P.removeClassName,h=P.Debug,i=P.ReInit;a&&b&&e&&P.nodeName(e)&&(P.addClassName(f(b),"performerloading"),P.Request(a,c,"",function(a){a=P.getRequestText(a);if("fill"==d)f(b).innerHTML= 
     69a,g(f(b),"performerloading"),h("-> Filled '#"+b+"'","success");if("fillandinit"==d)f(b).innerHTML=a,g(f(b),"performerloading"),h("-> Filled '#"+b+"'","success"),i("#"+b);"deleteandreplace"==d&&(P.insertAfter(f(b),a),P.remove(f(b)));if("setvalue"==d)f(b).value=a,g(f(b),"performerloading"),h("-> Value set '#"+b+"'","success");if("setvalueandinit"==d)f(b).value=a,g(f(b),"performerloading"),h("-> Set value '#"+b+"'","success"),i("#"+b)}))},Reload:function(a){var a=P.$(a),b=P.identify(a);if(-1==P.Reloaders.PerformerIndexOf(b)){var c= 
     70P.classNames(a),d=1E3*P.classParam(c,"delay",0),e=P.classParam(c,"targetPage",!1);0===d&&(d=6E4);a&&P.nodeName(a)&&d&&e&&(P.Reloaders[P.Reloaders.length]=b,P.Debug("Performer.Reload -> Added '#"+b+"' to Performer.Reloaders (now "+P.Reloaders.length+" items): "+d+" seconds","subfunction"),P.DoLoad(e,b,"get","fillandinit"),window.setInterval(function(){var a=(new Date).getTime(),a=-1!=e.indexOf("?")?"&"+a:"?"+a;P.DoLoad(e+a,b,"get","fillandinit")},d))}},Preload:function(a){P.Debug("Performer.Preload", 
     71"function");var a=P.$(a),b=P.classNames(a),b=P.classParam(b,"targetPage",!1);a&&P.nodeName(a)&&b&&(a=P.identify(a),P.Debug("-> Loading content into '#"+a+"'","subfunction"),P.DoLoad(b,a,"get","fillandinit"))},Hide:function(a,b){var c=P.identify(a);a&&P.nodeName(a)?P.Hash!=c?(P.Debug("Performer.Hide -> Hiding '#"+c+"' (effect: "+b+")","subfunction"),P.doHide(a,b),P.hasClassName(a,"hider")||P.addClassName(a,"hider"),P.hasClassName(a,"shower")&&P.removeClassName(a,"shower")):P.removeClassName(a,"hider"): 
     72P.Debug("Performer.Hide -> Could not hide '#"+c+"'","subfunction")},Show:function(a,b){var c=P.identify(a);a&&P.nodeName(a)?(P.doShow(a,b),P.hasClassName(a,"hider")&&P.removeClassName(a,"hider"),P.hasClassName(a,"shower")&&P.removeClassName(a,"shower"),P.Debug("Performer.Show -> Showing '#"+c+"' (effect: "+b+")","subfunction")):P.Debug("Performer.Show -> Could not show '#"+c+"'","subfunction")},Limit:function(a){P.Debug("Performer.Limit","function");var b=P.eventElement(a),c=P.classNames(b),d=P.classParam(c, 
     73"lengthLimit",!1),c=P.$(P.classParam(c,"targetEl",!1));if(b&&d&&c){var e=P.getValue(b).length;parseFloat(e)>=parseFloat(d)?(P.$(b).value=P.getValue(b).substr(0,d),P.update(c,"Limit reached"),b=P.keyCode(a)||a.code,8!=b&&46!=b&&37!=b&&39!=b&&P.stopEvent(a)):P.update(P.$(c),d-e+" characters left")}},LimitNotifier:function(a){P.Debug("Performer.LimitNotifier","function");var b=P.$(a);if(b&&("input"==P.nodeName(b)||"textarea"==P.nodeName(b))){var c=P.classNames(b),a=P.classParam(c,"lengthLimit",!1),c= 
     74P.$(P.classParam(c,"targetEl",!1));if(!P.hasClassName(b,"prompter")&&a&&c)b=P.getValue(b).length,P.update(c,a-b+" characters left")}},Edit:function(a){P.Debug("Performer.Edit","function");var b=P.eventElement(a);if(b&&P.nodeName(b)&&P.getAttribute(b,"id")&&P.classNames(b)&&("click"==a.type||13==P.keyCode(a))){P.removeClassName(b,"editor");var c=P.classNames(b),d=P.classParam(c,"targetPage",!1),a=P.classParam(c,"targetElement",!1),e=P.classParam(c,"inputType","input"),c=P.classParam(c,"autosave",!1); 
     75if(d&&e){var f=P.identify(b);b.innerHTML=P.BuildEditForm(b,d,e,a,c);P.unBind(b,"click",P.Edit);P.unBind(b,"keypress",P.Edit);var g=P.$(f+"-editor");!1!==c?P.bind(P.$(f+"-value"),"blur",function(){var a=P.serialize(g);P.addClassName(P.$(f+"-value"),"performerloading");P.Request(d,"post",a,function(){P.HideEditForm(b,!0)})}):P.bind(g,"submit",function(a){var c=P.serialize(g);P.addClassName(g,"performerloading");P.$(f+"-originaltext").innerHTML=P.$(f+"-value").value;P.Request(d,"post",c,function(){P.HideEditForm(b, 
     76!0)});P.stopEvent(a)});P.$(f+"-value").focus();P.ReInit("#"+f)}}},BuildEditForm:function(a,b,c,d,e){P.Debug("Performer.BuildEditForm("+b+")","function");if(a&&P.nodeName(a)&&P.$(a)&&b){var f=P.identify(a),a=P.$(a).innerHTML,g;g='<form id="'+f+'-editor" class="performer-editor" action="'+b+'" method="post">\n';if(""==c||"input"==c)g+='<input type="text" id="'+f+'-value" name="'+f+'" value="'+a+'" />\n';"textarea"==c&&(g+='<textarea id="'+f+'-value" name="'+f+'" rows="6" cols="30">'+a+"</textarea>\n"); 
     77!1===e&&(g+='<input type="submit" id="'+f+'-save" name="'+f+'-save" value="Save" />\n<a href="#" class="uneditor targetEl-'+f+'">Cancel</a>\n',""!=d&&(g+='<span id="'+d+'"></span>\n'));g+='</form>\n<span style="display:none" id="'+f+'-originaltext">'+a+"</span>";P.Debug("-> Built form with action: "+b,"function");return g}},HideEditForm:function(a,b){P.Debug("Performer.HideEditForm","function");var c=P.identify(a);a.innerHTML=b?P.$(c+"-value").value:P.$(c+"-originaltext").innerHTML;P.bind(P.$(c), 
     78"click",P.Edit);P.bind(P.$(c),"keypress",P.Edit)},UnEdit:function(a){P.Debug("Performer.UnEdit","function");var b=P.eventElement(a);if(b&&P.nodeName(b)&&("click"==a.type||13==P.keyCode(a))){var b=P.classNames(b),b=P.classParam(b,"targetEl",!1),c=P.$(b);if(c)P.bind(c,"click",P.Edit),P.bind(c,"keypress",P.Edit),c.innerHTML=P.$(b+"-originaltext").innerHTML,P.stopEvent(a)}},SetPrompt:function(a){P.Debug("Performer.SetPrompt","function");var b="placeholder"in document.createElement("input"),c=P.identify(a), 
     79d=P.getAttribute(a,"title");if(b)P.setAttribute(a,"placeholder",d);else if(a&&P.nodeName(a)&&d&&""==a.value&&("textarea"==a.type||"text"==a.type))P.Debug("-> Setting prompt: "+d,"function"),P.addClassName(a,"performer-prompter"),a.value=P.getAttribute(a,"title"),(b=P.up("#"+c,"form"))&&P.bind(b,"submit",function(){P.ClearPrompt(a)},!1)},RemovePrompt:function(a){P.Debug("Performer.RemovePrompt","function");(a=P.eventElement(a))&&P.nodeName(a)&&P.ClearPrompt(a)},ClearPrompt:function(a){P.Debug("Performer.ClearPrompt", 
     80"function");var b=P.getAttribute(a,"title");if(a&&P.nodeName(a)&&b&&a.value==b&&("textarea"==a.type||"text"==a.type))a.value="",P.removeClassName(a,"performer-prompter")},CheckPrompt:function(a){P.Debug("Performer.CheckPrompt","function");var a=P.eventElement(a),b=P.getAttribute(a,"title");P.identify(a);if(a&&P.nodeName(a)&&b&&""==a.value&&("textarea"==a.type||"text"==a.type))P.SetPrompt(a),a.value=P.getAttribute(a,"title")},Pop:function(a){P.Debug("Performer.Popper","function");var b=P.findEventElement(a, 
     81"A"),c=P.classNames(b),d=P.classParam(c,"targetName",P.getAttribute(b,"rel"))?"":"popupwindow_"+P.increment(),c=P.classParam(c,"options",P.getAttribute(b,"rev"))?"":"scrollbars=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=yes";if(b&&P.nodeName(b)&&P.getAttribute(b,"href")&&("click"==a.type||13==P.keyCode(a)))b=P.getAttribute(b,"href"),P.Debug("-> Opening: "+b+" with "+c,"function"),d=window.open(b,d,c),window.focus&&d.focus(),P.stopEvent(a)},Morph:function(a){P.Debug("Performer.Morpher", 
     82"function");var b=P.eventOrElement(a),c=b.el,d=P.classNames(c),e=P.classParam(d,"targetEl",P.identify(c));c&&e&&P.$(e)&&(c=1E3*P.classParam(d,"delay",0),setTimeout(function(){var a=P.classParam(d,"duration",1);params=P.setupMorphProperties("lineHeight,margin,padding,width,height,opacity,fontSize,borderWidth,color,backgroundColor".split(","),d);P.animate(e,params,a)},c),b.stop&&P.stopEvent(a))},ToggleDebug:function(a){P.Debugging?(P.Debugging=!1,P.remove(P.$("performerjsdebugwrapper"))):(P.Debugging= 
     83!0,P.PrepareDebug(),P.Debug());P.stopEvent(a)},PrepareDebug:function(){var a=document.getElementsByTagName("body")[0].innerHTML,a=a+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>', 
     84b=document.getElementsByTagName("body")[0],b=P.children(b);b.length&&(P.insertAfter(b[0],a),P.DoListeners("#performerjsdebugwrapper"))},Debug:function(a,b){if(P.Debugging){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.debug&&("function"==b?console.debug(a):"subfunction"==b?console.debug("- "+a):"error"==b?console.error(a):"success"==b?console.info(a):"warning"==b?console.warn(a):"ajax"==b&&console.debug(a));var c="#000";"function"==b?c="#333":"subfunction"==b?c="#AAA":"error"== 
     85b?c="#900":"success"==b?c="#090":"warning"==b?c="#FFA800":"ajax"==b&&(c="#4937DF");P.$("performerjsdebugbox")&&(P.$("performerjsoutput").innerHTML+='<p style="margin:0.1em 0;padding:0;color:'+c+'">'+a+"</p>\n")}},eventOrElement:function(a){var b={stop:!1};b.el=a;if(!a.innerHTML)b.el=P.eventElement(a),b.stop=!0;return b},hasClassName:function(a,b){if(!a||"undefined"==typeof a)return!1;if(P.Prototype||P.Scriptaculous)return a.hasClassName(b);if(P.jQuery)return jQuery(a).hasClass(b);if(P.MooTools)return $(a).hasClass(b)}, 
     86$:function(a){if("object"==typeof a)return a;if("undefined"==typeof a)return!1;if(P.Prototype||P.Scriptaculous)return $(a);if(P.MooTools)return $(a);if(P.jQuery)return jQuery("#"+a)[0]},$$:function(a){var b;if(P.Prototype||P.Scriptaculous)b=$$(a);P.MooTools&&(b=$$(a));P.jQuery&&(b=jQuery(a));return b&&0<b.length?b:!1},$F:function(a){var b=P.identify(a),c;if(P.Prototype||P.Scriptaculous)c=a.getElements();P.jQuery&&(c=jQuery("#"+b+" :input"));P.MooTools&&(c=$$("#"+b+" input","#"+b+" textarea","#"+b+ 
     87" select","#"+b+" button"));return c},nodeName:function(a){var b=!1;if(P.Prototype||P.Scriptaculous)b=a.nodeName.toLowerCase();P.MooTools&&(b=a.nodeName.toLowerCase());P.jQuery&&(b=a.tagName.toLowerCase());return!b||"undefined"==typeof b||"#document"==b?!1:b},getElementsByAttribute:function(a,b,c){a=c?a+"["+b+"='"+c+"']":a+"["+b+"]";if(P.Prototype||P.Scriptaculous)return document.getElementsBySelector(a);if(P.jQuery)return jQuery(a);if(P.MooTools)return document.getElements(a)},getValue:function(a){if(P.Prototype|| 
     88P.Scriptaculous)return a.getValue();if(P.jQuery)return jQuery(a).val();if(P.MooTools)return a.get("value")},setValue:function(a,b){if(P.Prototype||P.Scriptaculous)return a.value=b,a;if(P.jQuery)return jQuery(a).val(b);if(P.MooTools)return a.set("value",b)},up:function(a,b){if(P.Prototype||P.Scriptaculous)return a.up(b);if(P.jQuery)return jQuery(a).parent(b)[0];if(P.MooTools)return a.getParent(b)},serialize:function(a){if(P.Prototype||P.Scriptaculous)return a.serialize(!0);if(P.jQuery)return jQuery(a).serialize(); 
     89if(P.MooTools)return a.toQueryString()},update:function(a,b){if(P.Prototype||P.Scriptaculous)return a.update(b);if(P.jQuery)return jQuery(a).html(b);if(P.MooTools)return a.set("text",b)},insertAfter:function(a,b){if(P.Prototype||P.Scriptaculous)return new Insertion.After(a,b);if(P.jQuery)return jQuery(a).after(b);if(P.MooTools)return"<"!==b.trim().substr(0,1)&&(b="<span>"+b+"</span>"),(new Element("div",{html:b})).inject(a,"after")},increment:function(){P.Counter++;return P.Counter},identify:function(a){"string"== 
     90typeof a&&(a=P.$(a));var b=P.getAttribute(a,"id");if(!b||""==b)b="anonymous_element_"+P.increment(),P.setAttribute(a,"id",b);return b},getAttribute:function(a,b){if(P.Prototype||P.Scriptaculous)return a.readAttribute(b);if(P.jQuery)return jQuery(a).attr(b);if(P.MooTools)return a.get(b)},setAttribute:function(a,b,c){if(P.Prototype||P.Scriptaculous)return a.writeAttribute(b,c);if(P.jQuery)return jQuery(a).attr(b,c);if(P.MooTools)return a.set(b,c)},removeAttribute:function(a,b){return a.removeAttribute(b)}, 
     91remove:function(a){P.Scriptaculous&&Effect.Fade(a,{duration:0.5});if(P.Prototype||P.Scriptaculous)return a.remove();if(P.jQuery)return jQuery(a).fadeOut("normal"),jQuery(a).remove();if(P.MooTools)return a.fade("out"),a.destroy()},children:function(a,b){"undefined"!=typeof b&&(b=b.replace("-"," "),a=P.$$(b));if(P.Prototype||P.Scriptaculous)return a.childElements();if(P.jQuery)return jQuery(a).children();if(P.MooTools)return a.getChildren()},ancestors:function(a){if(P.Prototype||P.Scriptaculous)return a.ancestors(); 
     92if(P.jQuery)return jQuery(a).parents();if(P.MooTools)return a.getParents()},classNames:function(a){var b=P.getAttribute(a,"class");if(b&&0<b.length){for(var a=[],b=b.split(/\s+/),c=b.length;c--;)0<b[c].length&&(a[a.length]=b[c]);return a}return[]},visible:function(a){"object"!=typeof a&&(a=P.$(a));if(P.Prototype||P.Scriptaculous)return a.visible();if(P.jQuery)return jQuery(a).is(":visible");if(P.MooTools)return"none"==a.getStyle("display")?!1:!0},addClassName:function(a,b){"object"!=typeof a&&(a= 
     93P.$(a));if(P.Prototype||P.Scriptaculous)return a.addClassName(b);if(P.jQuery)return jQuery(a).addClass(b);if(P.MooTools)return $(a).addClass(b)},removeClassName:function(a,b){"object"!=typeof a&&(a=P.$(a));if(P.Prototype||P.Scriptaculous)return a.removeClassName(b);if(P.jQuery)return jQuery(a).removeClass(b);if(P.MooTools)return $(a).removeClass(b)},className:function(a,b){"object"!=typeof a&&(a=P.$(a));a.className=b},getShowEffect:function(a){"random"!=a&&0>P.ShowEffects.PerformerIndexOf(a)&&(a= 
     94"fadein");"random"==a&&(a=P.ShowEffects[Math.floor(Math.random()*P.ShowEffects.length)]);return a},disableContext:function(a){(P.Prototype||P.Scriptaculous)&&P.bind(a,"contextmenu",function(a){a.stop()});P.jQuery&&P.bind(a,"contextmenu",function(){return!1});if(P.MooTools)return P.bind(a,"contextmenu",function(a){a.stop()})},doHide:function(a,b){"object"!=typeof a&&(a=P.$(P.identify(a)));if(P.Prototype)return a.hide();if(P.Scriptaculous){if(!b||-1==P.Effects.PerformerIndexOf(b))return a.hide();if("slideup"== 
     95b)return Effect.Fade(a,{duration:0.5});if("slidedown"==b)return Effect.Appear(a,{duration:0.5});if("blinddown"==b)return Effect.BlindDown(a,{duration:0.5});if("blindup"==b)return Effect.BlindUp(a,{duration:0.5});if("fadein"==b)return Effect.Appear(a,{duration:0.5});if("fadeout"==b)return Effect.Fade(a,{duration:0.5})}if(P.jQuery){if(!b||-1==P.Effects.PerformerIndexOf(b))return jQuery(a).hide();if("slideup"==b||"blindup"==b)return jQuery(a).slideUp("normal");if("slidedown"==b||"blinddown"==b)return jQuery(a).slideDown("normal"); 
     96if("fadein"==b)return jQuery(a).fadeIn("normal");if("fadeout"==b)return jQuery(a).fadeOut("normal")}return P.MooTools?(a.fade("out"),a.setStyle("display","none"),a):!1},doShow:function(a,b){"object"!=typeof a&&(a=P.$(P.identify(a)));if(P.Prototype)return a.show();if(P.Scriptaculous){if(!b||-1==P.Effects.PerformerIndexOf(b))return a.show();if("slideup"==b)return Effect.Fade(a,{duration:0.5});if("slidedown"==b)return Effect.Appear(a,{duration:0.5});if("blinddown"==b)return Effect.BlindDown(a,{duration:0.5}); 
     97if("blindup"==b)return Effect.BlindUp(a,{duration:0.5});if("fadein"==b)return Effect.Appear(a,{duration:0.5});if("fadeout"==b)return Effect.Fade(a,{duration:0.5})}if(P.jQuery){if(!b||-1==P.Effects.PerformerIndexOf(b))return jQuery(a).show();if("slideup"==b||"blindup"==b)return jQuery(a).slideUp("normal");if("slidedown"==b||"blinddown"==b)return jQuery(a).slideDown("normal");if("fadein"==b)return jQuery(a).fadeIn("normal");if("fadeout"==b)return jQuery(a).fadeOut("normal")}return P.MooTools?(a.setStyle("display", 
     98"block"),a.fade("in"),a):!1},Request:function(a,b,c,d){(P.Prototype||P.Scriptaculous)&&new Ajax.Request(a,{method:b,parameters:c,onSuccess:d});if(P.jQuery)return jQuery.ajax({type:b,url:a,data:c,success:d});if(P.MooTools)return a=new Request({method:b,url:a,data:c,onSuccess:d}),a.send(),a},getRequestText:function(a){var b=a;if(a.responseText)b=a.responseText;return b},eventElement:function(a){var b;if(!a)a=window.event;if(a.target)b=a.target;else if(a.srcElement)b=a.srcElement;return 3==b.nodeType? 
     99b.parentNode:b},findEventElement:function(a,b){var c;if(P.Prototype||P.Scriptaculous)return Event.findElement(a,b);if(P.jQuery)return(c=P.eventElement(a))&&c.nodeName&&c.nodeName.toLowerCase()==b.toLowerCase()?c:jQuery(c).parents(b)[0];if(P.MooTools)return(c=P.eventElement(a))&&c.nodeName&&c.nodeName.toLowerCase()==b.toLowerCase()?c:$(c).getParent(b)},domLoaded:function(a){(P.Prototype||P.Scriptaculous)&&P.bind(document,"dom:loaded",a);if(P.jQuery)return jQuery(document).ready(a);if(P.MooTools)return P.bind(window, 
     100"domready",a)},bind:function(a,b,c){(P.Prototype||P.Scriptaculous)&&Event.observe(a,b,c);if(P.jQuery)return jQuery(a).bind(b,c);if(P.MooTools)return $(a).addEvent(b,c)},unBind:function(a,b,c){(P.Prototype||P.Scriptaculous)&&Event.stopObserving(a,b,c);if(P.jQuery)return jQuery(a).unbind(b,c);if(P.MooTools)return $(a).removeEvent(b,c)},stopEvent:function(a){if(P.Prototype||P.Scriptaculous)return a.preventDefault(),a.stopPropagation(),Event.stop(a),!1;if(P.jQuery)return a.preventDefault(),a.stopPropagation(), 
     101!1;P.MooTools&&a.stop();return!1},stopPropagation:function(a){a.stopPropagation();return!1},getDimensions:function(a){var b;if(P.Prototype||P.Scriptaculous)return a.getDimensions();b={};if(P.jQuery)b.height=jQuery(a).outerHeight(),b.width=jQuery(a).outerWidth();if(P.MooTools)a=a.getSize(),b.height=a.y,b.width=a.x;return b},setStyle:function(a,b){if(P.Prototype||P.Scriptaculous)return a.setStyle(b);P.jQuery&&jQuery(a).css(b);P.MooTools&&$(a).setStyles(b)},animate:function(a,b,c){var d=P.identify(a); 
     102"object"!=typeof a&&(a=P.$(d));P.Scriptaculous&&$(d).morph(b,{duration:c});P.Prototype&&$(d).setStyle(b);P.jQuery&&(c*=1E3,jQuery(a).animate(b,c));P.MooTools&&(new Fx.Morph(d,{duration:1E3*c,transition:Fx.Transitions.Sine.easeOut})).start(b)},setupMorphProperties:function(a,b){var c,d,e,f,g=P.classParam;if(P.Scriptaculous||P.Prototype){d="";for(e=0,f=a.length;e<f;e++){c=g(b,a[e],!1);var h=a[e],h=h.replace("backgroundColor","background"),h=h.replace("fontSize","font-size"),h=h.replace("borderWidth", 
     103"border-width"),h=h.replace("lineHeight","line-height");c=P.fixCSSParam(h,c);d+=h+": "+c+"; "}}else{d={};for(e=0,f=a.length;e<f;e++)c=g(b,a[e],!1),!1!==c&&(d[a[e]]=c.replace("px",""))}return d},fixCSSParam:function(a,b){if(("line-height"==a||"border-width"==a||"font-size"==a||"padding"==a||"margin"==a)&&"string"==typeof b){var c=b.substring(b.length-2).toLowerCase();if("px"!=c&&"em"!=c&&"pt"!=c)return b+"px"}return b},keyCode:function(a){return window.event?window.event.keyCode:a?a.which:!1},cursorPosition:function(a){if(P.MooTools)return a= 
     104new Event(a),[a.page.x,a.page.y];var b=0,c=0;if(!a)a=window.event;if(a.pageX||a.pageY)b=a.pageX,c=a.pageY;else if(a.clientX||a.clientY)var c=document.documentElement,d=document.body,b=a.clientX+d.scrollLeft+c.scrollLeft,c=a.clientY+d.scrollTop+c.scrollTop;return[b,c]},elementPosition:function(a){var b=0,c=0;if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return[b,c]}},forEach:function(a,b){for(var c=0,d=a.length;c<d;c++)b.call(a[c],a[c],a)},trim:function(a){return a.replace(/^\s\s*/, 
     105"").replace(/\s\s*$/,"")},alertProperties:function(a){var b="",c;for(c in a)b+=c+": "+a[c]+"\n";P.createModal(!0,!0,6,"performermodalouter","performermodalinner",100,100,!0);P.$("performer_modal").innerHTML='<pre style="width: 100%; height: 100%">'+b+"</pre>"}};Array.prototype.PerformerIndexOf="function"==typeof Array.prototype.indexOf?Array.prototype.indexOf:function(a,b){b||(b=0);var c=this.length;for(0>b&&(b=c+b);b<c;b++)if(this[b]===a)return b;return-1};var P=Performer;P.Performer(); 
     106P.jQuery&&function(a){function b(a){var b;return a&&a.constructor==Array&&3==a.length?a:(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]:(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))?[2.55*parseFloat(b[1]),2.55*parseFloat(b[2]),2.55*parseFloat(b[3])]:(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3], 
     10716)]:(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))?[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]:c[P.trim(a).toLowerCase()]}a.each(["backgroundColor","color"],function(c,e){a.fx.step[e]=function(c){if(0==c.state){var d;d=c.elem;var h=e,i;do{i=a.curCSS(d,h);if(""!=i&&"transparent"!=i||a.nodeName(d,"body"))break;h="backgroundColor"}while(d=d.parentNode);d=b(i);c.start=d;c.end=b(c.end)}c.elem.style[e]="rgb("+[Math.max(Math.min(parseInt(c.pos*(c.end[0]-c.start[0])+c.start[0]), 
     108255),0),Math.max(Math.min(parseInt(c.pos*(c.end[1]-c.start[1])+c.start[1]),255),0),Math.max(Math.min(parseInt(c.pos*(c.end[2]-c.start[2])+c.start[2]),255),0)].join()+")"}});var c={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50, 
     109204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192], 
     110white:[255,255,255],yellow:[255,255,0]}}(jQuery);document.write('<style type="text/css">.hider { display: none; } .performertooltip { display: absolute; }.performerlightboxouter { position: fixed; z-index: 10000; top: 0px; right: 0px; bottom: 0px; left: 0px; background: #000; opacity: 0.6; } .performertooltip { background: #FFF;\tpadding: 6px; } .performertooltip div.performertooltipinner { border: 1px solid #000; background: #FFFCDF; padding: 1em; } .performermodalouter { background: #000; } .performermodalinner { background: #FFF; border: 1px solid #000; padding: 1em; } * html .performermodalinner { position: relative; } .performermenu:hover { display: absolute; } a.modalwindowcloser { background: #000; color: #FFF; padding: 0 2em; text-decoration: none; } .performerloading { background: #EFE4B3; } .performercontextmenu { background: #D4DBED; padding: 0.6em; list-style: none; border: 1px solid #CCC; } .password-weak { color: #C00; } .password-ok { color: #EFAD3B; }\t.password-strong { color: #0C0; } .performer-pagination { text-align: right; } .performer-pagination li { display: inline; } .performer-pagination li a { padding: 0.3em; } .performer-pagination .currentpage { font-weight: bold; } .performer-error { color: #C00; }</style>'); 
  • performerjs/trunk/performer.jquery.min.js

    r418393 r493314  
    33Created by Chris Taylor (http://www.stillbreathing.co.uk) 
    44Additional work by kourge and Danny Linkov 
    5 Version 1.0.3 
     5Version 1.0.4 
    66 
    77This work is released under any of the following licenses, please choose the one you wish to use: 
     
    1212- BSD License (http://www.opensource.org/licenses/bsd-license.php) 
    1313*/ 
    14 var Performer={version:'1.0.3',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.Effects=['slideup','slidedown','blinddown','blindup','fadein','fadeout'];P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
     14var Performer={version:'1.0.4',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,LooperFuncs:new Array(),LooperCurrentItem:new Array(),Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.ShowEffects=['slidedown','blinddown','fadein'];P.HideEffects=['slideup','blindup','fadeout'];P.Effects=P.ShowEffects.concat(P.HideEffects);P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
    1515if(el===undefined){el='';} 
    16 P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){if(reinit===undefined){reinit=false;} 
     16P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.looperitem','Loop','click,keypress',reinit);P.Listeners(el,'.looperstart','Loop','click,keypress',reinit);P.Listeners(el,'.looperpause','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){P.Debug('Performer.DoTransformers','function');if(reinit===undefined){reinit=false;} 
    1717if(el===undefined||el==='performerjsdebugwrapper'){el='';} 
    1818P.Transformers(el,'.hider','Hide',reinit);P.Transformers(el,'.shower','Show',reinit);P.Transformers(el,'.focusser','Focus',reinit);P.Transformers(el,'.limiter','LimitNotifier',reinit);P.Transformers(el,'.reloader','Reload',reinit);P.Transformers(el,'.preloader','Preload',reinit);P.Transformers(el,'.prompter','SetPrompt',reinit);P.Transformers(el,'.truncator','Truncate',reinit);P.Transformers(el,'ul.looper,ol.looper','InitLoop',reinit);P.Transformers(el,'.tab','InitTabs',reinit);P.Transformers(el,'.contextmenuer','DisableContextMenu',reinit);P.Transformers(el,'.pager','Page',reinit);P.Transformers(el,'.loadmorpher','Morph',reinit);P.Transformers(el,'.loadtoggler','Toggle',reinit);P.Transformers(el,'.loadgrouptoggler','GroupToggle',reinit);P.Transformers(el,'.loadstyler','Style',reinit);P.Transformers(el,'.loadmodalwindower','ModalWindow',reinit);},Listeners:function(el,classNames,f,event,reinit){var b=P.bind;var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    1919var els=d('body '+el+className);if(els){dbg('Performer.Listeners('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){fe(event.split(','),function(event){b(element,event,P[f]);});}});}});},Transformers:function(el,classNames,f,reinit){var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    2020var els=d('body '+el+className);if(els){dbg('Performer.Transformers('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){P[f](element);}});}});},CheckDebug:function(){P.Debug('Performer.CheckDebug','function');var d=P.$$('.performer-debug');if(d){P.Debugging=true;P.PrepareDebug();}},classParam:function(classNames,paramName,defaultValue){var cls=null;var val=defaultValue;var i=classNames.length;while(i--){cls=classNames[i];if(cls&&cls.substring(0,paramName.length+1)==paramName+'-'){val=cls.replace(paramName+'-','');}} 
    21 return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
     21return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){P.Debug('Performer.Hooker('+P.getAttribute(el,'id')+')','function');var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
    2222var pagesize=P.classParam(cls,"pagesize",10);var startpage=P.classParam(cls,"startpage",1);if(children.length>pagesize){var page=1;var i=0;var acn=P.addClassName;var h=P.Hide;P.forEach(children,function(el){if(i<page*pagesize&&i>=(page-1)*pagesize){}else{page++;} 
    23 acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
     23acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){P.Debug('Performer.BuildPageMenu('+elid+')','function');var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
    2424menu+='<li><a href="#'+elid+'-page'+x+'" class="'+elid+'pagerlink'+currentpage+'" id="'+elid+'-page'+x+'">'+x+'</a></li>';currentpage="";} 
    25 menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
    26 return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(elid){P.Debug('Performer.InitLoop','function');var el=P.$(elid);var shown=0;var i=0;var n=P.nodeName;var h=P.Hide;var hcn=P.hasClassName;var id=P.identify;var hsh=P.Hash;P.forEach(P.children(el),function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
    27 i++;}});P.Show(P.children(el)[shown]);},Loop:function(e){r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el);var loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel'));if(P.$(loop)){var i=0;var toshow=0;var nowshowing=0;var n=P.nodeName;var v=P.visible;var dbg=P.Debug;var h=P.Hide;P.forEach(P.children(P.$(loop)),function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
    28 h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=(P.children(P.$(loop)).length-1);}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=P.children(P.$(loop)).length){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=P.children(P.$(loop)).length-1;} 
    29 P.Debug('- Showing item '+toshow,'subfunction');P.Show(P.children(P.$(loop))[toshow],"fadein");P.stopEvent(e);}}},Tooltip:function(e,cssClass){var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
     25menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;P.Debug('Performer.ShowPage('+elid+')','function');var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){P.Debug('Performer.ContextMenu()','function');var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
     26return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){P.Debug('Performer.Set','function');var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(el){P.Debug('Performer.InitLoop','function');var elid=P.identify(el),shown=0,i=0,cls=P.classNames(el),delay=P.classParam(cls,"delay",0),effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect),n=P.nodeName,h=P.Hide,hcn=P.hasClassName,id=P.identify,hsh=P.Hash,children=P.children(el);P.forEach(children,function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
     27i++;}});P.Show(children[shown]);P.LooperCurrentItem[elid]=shown;if(delay>0)P.StartLoop(elid,children,delay,effect);},StartLoop:function(elid,children,delay,effect){var func=function(){var toshow=P.LooperCurrentItem[elid]+1;if(toshow>=children.length){toshow=0;} 
     28P.LooperCurrentItem[elid]=toshow;P.forEach(children,function(child){P.Hide(child);});P.Show(children[toshow],effect);};P.LooperFuncs[elid]=window.setInterval(func,delay*1000);},Loop:function(e){P.Debug('Performer.Loop','function');r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el),loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel')),loopEl=P.$(loop);if(loopEl){var children=P.children(loopEl);window.clearInterval(P.LooperFuncs[loop]);if(P.hasClassName(el,'looperpause')){P.Debug('Performer.Loop (pause auto-loop)','function');P.stopEvent(e);return false;} 
     29if(P.hasClassName(el,'looperstart')){P.Debug('Performer.Loop (start auto-loop)','function');var elcls=P.classNames(P.$(loop)),delay=P.classParam(elcls,"delay",0),effect=P.classParam(elcls,"effect","fadein"),effect=P.getShowEffect(effect),toshow=P.LooperCurrentItem[loop];if(delay>0){P.Hide(children[toshow]);toshow++;if(toshow>=children.length){toshow=0;} 
     30P.LooperCurrentItem[loop]=toshow;P.Show(children[toshow],effect);P.StartLoop(loop,children,delay,effect);P.stopEvent(e);return false;}} 
     31var i=0,toshow=-1,nowshowing=0,n=P.nodeName,v=P.visible,dbg=P.Debug,h=P.Hide,len=children.length,effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect);P.forEach(children,function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
     32h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=len-1;}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=len){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=len-1;}else if(P.hasClassName(el,'looperitem')){toshow=P.classParam(cls,"item",1);if(toshow>=len)toshow=len-1;P.Debug('Performer.Loop ('+toshow+')','function');} 
     33P.LooperCurrentItem[loop]=toshow;P.Debug('- Showing item '+toshow,'subfunction');P.Show(children[toshow],effect);P.stopEvent(e);}}},Tooltip:function(e,cssClass){P.Debug('Performer.Tooltip','function');var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
    3034var id=P.identify(el);if(el&&P.nodeName(el)&&!P.$(id+'_performertooltip')){var cls=P.classNames(el);var text=false;var originaltext="";if(P.getAttribute(el,"title")&&P.getAttribute(el,"title")!=""){originaltext=P.getAttribute(el,"title");text='<p>'+originaltext.replace(/\r/g,"<br />\n")+'</p>';}else{var targetEl=P.$(P.classParam(cls,"targetEl",false));if(targetEl){text=targetEl.innerHTML;}} 
    3135var position=false;if(e.type=='mouseover'){position=P.cursorPosition(e);}else{position=P.elementPosition(el);position[1]=position[1]+el.offsetHeight;} 
     
    4650var items=P.Duplicators[targetEl]+1;P.Duplicators[targetEl]=items;newel.innerHTML=newel.innerHTML.replace(/_1/g,'_'+items);newel.innerHTML=newel.innerHTML.replace(/[1]/g,items);newel.id=newel.id.replace(/_1/g,'_'+items);if(P.getAttribute(newel,'class')!=''){P.setAttribute(newel,'class',P.getAttribute(newel,'class').replace(/_1/g,'_'+items));} 
    4751var countEl=P.classParam(cls,"countElement",false);var countElement=P.$(countEl);if(countElement){P.setValue(countElement,items);} 
    48 P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.findEventElement(e,'FORM');var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
     52P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.eventElement(e),cls=P.classNames(el),targetForm=P.classParam(cls,"targetEl",P.findEventElement(e,'FORM')),go=P.DoCheckForm(targetForm);if(!go)P.stopEvent(e);return go;},DoCheckForm:function(el){var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
    4953if(field.type=='radio'&&radiogroups.PerformerIndexOf(field.name)==-1){radiogroups[radiogroups.length]=field.name;var radiofail=true;var radiobuttons=el[field.name];for(var i=0;i<radiobuttons.length;i++){if(radiobuttons[i].checked){radiofail=false;break;}} 
    5054var lastbutton=radiobuttons[radiobuttons.length-1];if(radiofail){fn(lastbutton,'error','This field is required');fail=true;}else{fnr(lastbutton);}}} 
     
    5357fnr(identity);}} 
    5458if(hcn(field,'field-required-date')||hcn(field,'field-optional-date')){var validdate=/^([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})$/;if((hcn(field,'field-required-date')&&val=="")||(val!=""&&!validdate.test(val))){fn(identity,'error','This field must be a date (dd/mm/yyyy)');fail=true;}else{fnr(identity);}} 
    55 P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');P.stopEvent(e);}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
     59P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');return false;}else{return true;}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
    5660if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13||P.keyCode(e)==32)||!eve.stop)){var cls=P.classNames(el);var showeffect=P.classParam(cls,'showeffect','slidedown');var hideeffect=P.classParam(cls,'hideeffect','slideup');var toggleid=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));if(!toggleid){toggleid=P.identify(el);} 
    5761var move=P.classParam(cls,'move',false);var delay=P.classParam(cls,'delay',0)*1000;var targetEl=P.$(toggleid);if(targetEl&&P.nodeName(targetEl)){if(delay===0){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);}else{setTimeout(function(){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);},delay);} 
     
    7882P.stopEvent(e);}}},Resize:function(e){P.Debug('Performer.Resize','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var m=P.classParam(cls,'maxHeight',500);var s=el.scrollHeight;var d=P.getDimensions(el);var h=d.height;if((s+5)>h&&h<m){el.style.height=(s+10)+'px';}}},ToggleLoad:function(e){P.Debug('Performer.ToggleLoad','function');var el=P.eventElement(e);var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(el&&P.nodeName(el)&&targetEl&&targetPage&&(e.type=='click'||P.keyCode(e)==13)){if(P.Toggle(e)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');P.Load(e,true,false);} 
    7983P.stopEvent(e);}},InitTabs:function(el){var elid=P.identify(el);el=P.$(P.identify(el));if(P.Hash==elid){P.addClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.removeClassName(el,'hider');P.Show(el);} 
    80 if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev'));var openTab=P.$(otab);var tablinks=P.$$('.tabber');var i=tablinks.length;var hcn=P.hasClassName;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
     84if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev')),effect=P.classParam(cls,'effect','fadein'),openTab=P.$(otab),tablinks=P.$$('.tabber'),i=tablinks.length,hcn=P.hasClassName,ga=P.getAttribute,rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
    8185var tabs=P.$$('#'+tabGroup+' .tab');i=tabs.length;var h=P.Hide;while(i--){h(tabs[i]);} 
    82 P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');P.Show(openTab,'fadein');P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
     86P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');effect=P.getShowEffect(effect);P.Show(openTab,effect);P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
    8387var accordianitems=P.$$('#'+accordianGroup+' .accordianitem');i=accordianitems.length;var h=P.Hide;while(i--){h(accordianitems[i]);} 
    8488P.addClassName(el,'accordiancurrent');P.Debug('-> Showing accordianitem \'#'+oitem+'\'','subfunction');P.Show(openItem,'slidedown');P.stopEvent(e);}}},Load:function(e,c,s){P.Debug('Performer.Load','function');var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var rel=P.$(targetEl);var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(targetEl&&rel&&P.nodeName(rel)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');if(!s){P.DoLoad(targetPage,targetEl,'get','fillandinit');}else{P.DoLoad(targetPage,targetEl,'get','fill');}} 
     
    99103editForm+='</form>\n<span style="display:none" id="'+id+'-originaltext">'+value+'</span>';P.Debug('-> Built form with action: '+targetPage,'function');return editForm;}},HideEditForm:function(el,val){P.Debug('Performer.HideEditForm','function');var id=P.identify(el);if(val){el.innerHTML=P.$(id+'-value').value;}else{el.innerHTML=P.$(id+'-originaltext').innerHTML;} 
    100104P.bind(P.$(id),'click',P.Edit);P.bind(P.$(id),'keypress',P.Edit);},UnEdit:function(e){P.Debug('Performer.UnEdit','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var rel=P.classParam(cls,'targetEl',false);var targetEl=P.$(rel);if(targetEl){P.bind(targetEl,'click',P.Edit);P.bind(targetEl,'keypress',P.Edit);targetEl.innerHTML=P.$(rel+'-originaltext').innerHTML;P.stopEvent(e);}}},SetPrompt:function(el){P.Debug('Performer.SetPrompt','function');var placeHolderSupport=('placeholder'in document.createElement('input'));var id=P.identify(el);var title=P.getAttribute(el,'title');if(!placeHolderSupport){if(el&&P.nodeName(el)&&title&&el.value==""&&(el.type=='textarea'||el.type=='text')){P.Debug('-> Setting prompt: '+title,'function');P.addClassName(el,"performer-prompter");el.value=P.getAttribute(el,'title');var form=P.up('#'+id,'form');if(form){P.bind(form,'submit',function(){P.ClearPrompt(el);},false);}}}else{P.setAttribute(el,'placeholder',title);}},RemovePrompt:function(e){P.Debug('Performer.RemovePrompt','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){P.ClearPrompt(el);}},ClearPrompt:function(el){P.Debug('Performer.ClearPrompt','function');var title=P.getAttribute(el,"title");if(el&&P.nodeName(el)&&title&&(el.value==title)&&(el.type=='textarea'||el.type=='text')){el.value="";P.removeClassName(el,"performer-prompter");}},CheckPrompt:function(e){P.Debug('Performer.CheckPrompt','function');var el=P.eventElement(e);var title=P.getAttribute(el,"title");var id=P.identify(el);if(el&&P.nodeName(el)&&title&&(el.value=="")&&(el.type=='textarea'||el.type=='text')){P.SetPrompt(el);el.value=P.getAttribute(el,'title');}},Pop:function(e){P.Debug('Performer.Popper','function');var el=P.findEventElement(e,'A');var cls=P.classNames(el);var targetName=P.classParam(cls,'targetName',P.getAttribute(el,'rel'))?'':'popupwindow_'+P.increment();var pageOptions=P.classParam(cls,'options',P.getAttribute(el,'rev'))?'':'scrollbars=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=yes';if(el&&P.nodeName(el)&&P.getAttribute(el,'href')&&(e.type=='click'||P.keyCode(e)==13)){var targetURL=P.getAttribute(el,'href');P.Debug('-> Opening: '+targetURL+' with '+pageOptions,'function');var win=window.open(targetURL,targetName,pageOptions);if(window.focus){win.focus();} 
    101 P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
     105P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){if(typeof window.console!="undefined"&&typeof window.console.debug!="undefined"){if(status=='function'){console.debug(str);}else if(status=='subfunction'){console.debug("- "+str);}else if(status=='error'){console.error(str);}else if(status=='success'){console.info(str);}else if(status=='warning'){console.warn(str);}else if(status=='ajax'){console.debug(str);}} 
     106var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
    102107if(P.$('performerjsdebugbox')){P.$('performerjsoutput').innerHTML+='<p style="margin:0.1em 0;padding:0;color:'+col+'">'+str+'</p>\n';}}},eventOrElement:function(e){var o={};o.stop=false;o.el=e;if(!e.innerHTML){o.el=P.eventElement(e);o.stop=true;} 
    103108return o;},hasClassName:function(el,cls){if(!el||typeof el=='undefined'){return false;} 
     
    115120if(P.jQuery){return jQuery(el).addClass(cls);}},removeClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    116121if(P.jQuery){return jQuery(el).removeClass(cls);}},className:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    117 el.className=cls;},disableContext:function(el){if(P.jQuery){P.bind(el,'contextmenu',function(e){return false;});} 
     122el.className=cls;},getShowEffect:function(effect){if(effect!="random"){if(P.ShowEffects.PerformerIndexOf(effect)<0)effect="fadein";} 
     123if(effect=="random")effect=P.ShowEffects[Math.floor(Math.random()*P.ShowEffects.length)];return effect;},disableContext:function(el){if(P.jQuery){P.bind(el,'contextmenu',function(e){return false;});} 
    118124if(P.MooTools){return P.bind(el,'contextmenu',function(e){e.stop();});}},doHide:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el));} 
    119125if(P.jQuery){if(!effect||P.Effects.PerformerIndexOf(effect)==-1){return jQuery(el).hide();}else{if(effect=='slideup'||effect=='blindup'){return jQuery(el).slideUp("normal");} 
  • performerjs/trunk/performer.mootools.min.js

    r418393 r493314  
    33Created by Chris Taylor (http://www.stillbreathing.co.uk) 
    44Additional work by kourge and Danny Linkov 
    5 Version 1.0.3 
     5Version 1.0.4 
    66 
    77This work is released under any of the following licenses, please choose the one you wish to use: 
     
    1212- BSD License (http://www.opensource.org/licenses/bsd-license.php) 
    1313*/ 
    14 var Performer={version:'1.0.3',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.Effects=['slideup','slidedown','blinddown','blindup','fadein','fadeout'];P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
     14var Performer={version:'1.0.4',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,LooperFuncs:new Array(),LooperCurrentItem:new Array(),Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.ShowEffects=['slidedown','blinddown','fadein'];P.HideEffects=['slideup','blindup','fadeout'];P.Effects=P.ShowEffects.concat(P.HideEffects);P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
    1515if(el===undefined){el='';} 
    16 P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){if(reinit===undefined){reinit=false;} 
     16P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.looperitem','Loop','click,keypress',reinit);P.Listeners(el,'.looperstart','Loop','click,keypress',reinit);P.Listeners(el,'.looperpause','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){P.Debug('Performer.DoTransformers','function');if(reinit===undefined){reinit=false;} 
    1717if(el===undefined||el==='performerjsdebugwrapper'){el='';} 
    1818P.Transformers(el,'.hider','Hide',reinit);P.Transformers(el,'.shower','Show',reinit);P.Transformers(el,'.focusser','Focus',reinit);P.Transformers(el,'.limiter','LimitNotifier',reinit);P.Transformers(el,'.reloader','Reload',reinit);P.Transformers(el,'.preloader','Preload',reinit);P.Transformers(el,'.prompter','SetPrompt',reinit);P.Transformers(el,'.truncator','Truncate',reinit);P.Transformers(el,'ul.looper,ol.looper','InitLoop',reinit);P.Transformers(el,'.tab','InitTabs',reinit);P.Transformers(el,'.contextmenuer','DisableContextMenu',reinit);P.Transformers(el,'.pager','Page',reinit);P.Transformers(el,'.loadmorpher','Morph',reinit);P.Transformers(el,'.loadtoggler','Toggle',reinit);P.Transformers(el,'.loadgrouptoggler','GroupToggle',reinit);P.Transformers(el,'.loadstyler','Style',reinit);P.Transformers(el,'.loadmodalwindower','ModalWindow',reinit);},Listeners:function(el,classNames,f,event,reinit){var b=P.bind;var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    1919var els=d('body '+el+className);if(els){dbg('Performer.Listeners('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){fe(event.split(','),function(event){b(element,event,P[f]);});}});}});},Transformers:function(el,classNames,f,reinit){var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    2020var els=d('body '+el+className);if(els){dbg('Performer.Transformers('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){P[f](element);}});}});},CheckDebug:function(){P.Debug('Performer.CheckDebug','function');var d=P.$$('.performer-debug');if(d){P.Debugging=true;P.PrepareDebug();}},classParam:function(classNames,paramName,defaultValue){var cls=null;var val=defaultValue;var i=classNames.length;while(i--){cls=classNames[i];if(cls&&cls.substring(0,paramName.length+1)==paramName+'-'){val=cls.replace(paramName+'-','');}} 
    21 return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
     21return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){P.Debug('Performer.Hooker('+P.getAttribute(el,'id')+')','function');var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
    2222var pagesize=P.classParam(cls,"pagesize",10);var startpage=P.classParam(cls,"startpage",1);if(children.length>pagesize){var page=1;var i=0;var acn=P.addClassName;var h=P.Hide;P.forEach(children,function(el){if(i<page*pagesize&&i>=(page-1)*pagesize){}else{page++;} 
    23 acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
     23acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){P.Debug('Performer.BuildPageMenu('+elid+')','function');var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
    2424menu+='<li><a href="#'+elid+'-page'+x+'" class="'+elid+'pagerlink'+currentpage+'" id="'+elid+'-page'+x+'">'+x+'</a></li>';currentpage="";} 
    25 menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
    26 return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(elid){P.Debug('Performer.InitLoop','function');var el=P.$(elid);var shown=0;var i=0;var n=P.nodeName;var h=P.Hide;var hcn=P.hasClassName;var id=P.identify;var hsh=P.Hash;P.forEach(P.children(el),function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
    27 i++;}});P.Show(P.children(el)[shown]);},Loop:function(e){r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el);var loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel'));if(P.$(loop)){var i=0;var toshow=0;var nowshowing=0;var n=P.nodeName;var v=P.visible;var dbg=P.Debug;var h=P.Hide;P.forEach(P.children(P.$(loop)),function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
    28 h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=(P.children(P.$(loop)).length-1);}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=P.children(P.$(loop)).length){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=P.children(P.$(loop)).length-1;} 
    29 P.Debug('- Showing item '+toshow,'subfunction');P.Show(P.children(P.$(loop))[toshow],"fadein");P.stopEvent(e);}}},Tooltip:function(e,cssClass){var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
     25menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;P.Debug('Performer.ShowPage('+elid+')','function');var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){P.Debug('Performer.ContextMenu()','function');var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
     26return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){P.Debug('Performer.Set','function');var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(el){P.Debug('Performer.InitLoop','function');var elid=P.identify(el),shown=0,i=0,cls=P.classNames(el),delay=P.classParam(cls,"delay",0),effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect),n=P.nodeName,h=P.Hide,hcn=P.hasClassName,id=P.identify,hsh=P.Hash,children=P.children(el);P.forEach(children,function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
     27i++;}});P.Show(children[shown]);P.LooperCurrentItem[elid]=shown;if(delay>0)P.StartLoop(elid,children,delay,effect);},StartLoop:function(elid,children,delay,effect){var func=function(){var toshow=P.LooperCurrentItem[elid]+1;if(toshow>=children.length){toshow=0;} 
     28P.LooperCurrentItem[elid]=toshow;P.forEach(children,function(child){P.Hide(child);});P.Show(children[toshow],effect);};P.LooperFuncs[elid]=window.setInterval(func,delay*1000);},Loop:function(e){P.Debug('Performer.Loop','function');r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el),loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel')),loopEl=P.$(loop);if(loopEl){var children=P.children(loopEl);window.clearInterval(P.LooperFuncs[loop]);if(P.hasClassName(el,'looperpause')){P.Debug('Performer.Loop (pause auto-loop)','function');P.stopEvent(e);return false;} 
     29if(P.hasClassName(el,'looperstart')){P.Debug('Performer.Loop (start auto-loop)','function');var elcls=P.classNames(P.$(loop)),delay=P.classParam(elcls,"delay",0),effect=P.classParam(elcls,"effect","fadein"),effect=P.getShowEffect(effect),toshow=P.LooperCurrentItem[loop];if(delay>0){P.Hide(children[toshow]);toshow++;if(toshow>=children.length){toshow=0;} 
     30P.LooperCurrentItem[loop]=toshow;P.Show(children[toshow],effect);P.StartLoop(loop,children,delay,effect);P.stopEvent(e);return false;}} 
     31var i=0,toshow=-1,nowshowing=0,n=P.nodeName,v=P.visible,dbg=P.Debug,h=P.Hide,len=children.length,effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect);P.forEach(children,function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
     32h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=len-1;}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=len){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=len-1;}else if(P.hasClassName(el,'looperitem')){toshow=P.classParam(cls,"item",1);if(toshow>=len)toshow=len-1;P.Debug('Performer.Loop ('+toshow+')','function');} 
     33P.LooperCurrentItem[loop]=toshow;P.Debug('- Showing item '+toshow,'subfunction');P.Show(children[toshow],effect);P.stopEvent(e);}}},Tooltip:function(e,cssClass){P.Debug('Performer.Tooltip','function');var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
    3034var id=P.identify(el);if(el&&P.nodeName(el)&&!P.$(id+'_performertooltip')){var cls=P.classNames(el);var text=false;var originaltext="";if(P.getAttribute(el,"title")&&P.getAttribute(el,"title")!=""){originaltext=P.getAttribute(el,"title");text='<p>'+originaltext.replace(/\r/g,"<br />\n")+'</p>';}else{var targetEl=P.$(P.classParam(cls,"targetEl",false));if(targetEl){text=targetEl.innerHTML;}} 
    3135var position=false;if(e.type=='mouseover'){position=P.cursorPosition(e);}else{position=P.elementPosition(el);position[1]=position[1]+el.offsetHeight;} 
     
    4650var items=P.Duplicators[targetEl]+1;P.Duplicators[targetEl]=items;newel.innerHTML=newel.innerHTML.replace(/_1/g,'_'+items);newel.innerHTML=newel.innerHTML.replace(/[1]/g,items);newel.id=newel.id.replace(/_1/g,'_'+items);if(P.getAttribute(newel,'class')!=''){P.setAttribute(newel,'class',P.getAttribute(newel,'class').replace(/_1/g,'_'+items));} 
    4751var countEl=P.classParam(cls,"countElement",false);var countElement=P.$(countEl);if(countElement){P.setValue(countElement,items);} 
    48 P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.findEventElement(e,'FORM');var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
     52P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.eventElement(e),cls=P.classNames(el),targetForm=P.classParam(cls,"targetEl",P.findEventElement(e,'FORM')),go=P.DoCheckForm(targetForm);if(!go)P.stopEvent(e);return go;},DoCheckForm:function(el){var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
    4953if(field.type=='radio'&&radiogroups.PerformerIndexOf(field.name)==-1){radiogroups[radiogroups.length]=field.name;var radiofail=true;var radiobuttons=el[field.name];for(var i=0;i<radiobuttons.length;i++){if(radiobuttons[i].checked){radiofail=false;break;}} 
    5054var lastbutton=radiobuttons[radiobuttons.length-1];if(radiofail){fn(lastbutton,'error','This field is required');fail=true;}else{fnr(lastbutton);}}} 
     
    5357fnr(identity);}} 
    5458if(hcn(field,'field-required-date')||hcn(field,'field-optional-date')){var validdate=/^([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})$/;if((hcn(field,'field-required-date')&&val=="")||(val!=""&&!validdate.test(val))){fn(identity,'error','This field must be a date (dd/mm/yyyy)');fail=true;}else{fnr(identity);}} 
    55 P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');P.stopEvent(e);}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
     59P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');return false;}else{return true;}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
    5660if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13||P.keyCode(e)==32)||!eve.stop)){var cls=P.classNames(el);var showeffect=P.classParam(cls,'showeffect','slidedown');var hideeffect=P.classParam(cls,'hideeffect','slideup');var toggleid=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));if(!toggleid){toggleid=P.identify(el);} 
    5761var move=P.classParam(cls,'move',false);var delay=P.classParam(cls,'delay',0)*1000;var targetEl=P.$(toggleid);if(targetEl&&P.nodeName(targetEl)){if(delay===0){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);}else{setTimeout(function(){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);},delay);} 
     
    7882P.stopEvent(e);}}},Resize:function(e){P.Debug('Performer.Resize','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var m=P.classParam(cls,'maxHeight',500);var s=el.scrollHeight;var d=P.getDimensions(el);var h=d.height;if((s+5)>h&&h<m){el.style.height=(s+10)+'px';}}},ToggleLoad:function(e){P.Debug('Performer.ToggleLoad','function');var el=P.eventElement(e);var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(el&&P.nodeName(el)&&targetEl&&targetPage&&(e.type=='click'||P.keyCode(e)==13)){if(P.Toggle(e)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');P.Load(e,true,false);} 
    7983P.stopEvent(e);}},InitTabs:function(el){var elid=P.identify(el);el=P.$(P.identify(el));if(P.Hash==elid){P.addClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.removeClassName(el,'hider');P.Show(el);} 
    80 if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev'));var openTab=P.$(otab);var tablinks=P.$$('.tabber');var i=tablinks.length;var hcn=P.hasClassName;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
     84if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev')),effect=P.classParam(cls,'effect','fadein'),openTab=P.$(otab),tablinks=P.$$('.tabber'),i=tablinks.length,hcn=P.hasClassName,ga=P.getAttribute,rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
    8185var tabs=P.$$('#'+tabGroup+' .tab');i=tabs.length;var h=P.Hide;while(i--){h(tabs[i]);} 
    82 P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');P.Show(openTab,'fadein');P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
     86P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');effect=P.getShowEffect(effect);P.Show(openTab,effect);P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
    8387var accordianitems=P.$$('#'+accordianGroup+' .accordianitem');i=accordianitems.length;var h=P.Hide;while(i--){h(accordianitems[i]);} 
    8488P.addClassName(el,'accordiancurrent');P.Debug('-> Showing accordianitem \'#'+oitem+'\'','subfunction');P.Show(openItem,'slidedown');P.stopEvent(e);}}},Load:function(e,c,s){P.Debug('Performer.Load','function');var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var rel=P.$(targetEl);var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(targetEl&&rel&&P.nodeName(rel)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');if(!s){P.DoLoad(targetPage,targetEl,'get','fillandinit');}else{P.DoLoad(targetPage,targetEl,'get','fill');}} 
     
    99103editForm+='</form>\n<span style="display:none" id="'+id+'-originaltext">'+value+'</span>';P.Debug('-> Built form with action: '+targetPage,'function');return editForm;}},HideEditForm:function(el,val){P.Debug('Performer.HideEditForm','function');var id=P.identify(el);if(val){el.innerHTML=P.$(id+'-value').value;}else{el.innerHTML=P.$(id+'-originaltext').innerHTML;} 
    100104P.bind(P.$(id),'click',P.Edit);P.bind(P.$(id),'keypress',P.Edit);},UnEdit:function(e){P.Debug('Performer.UnEdit','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var rel=P.classParam(cls,'targetEl',false);var targetEl=P.$(rel);if(targetEl){P.bind(targetEl,'click',P.Edit);P.bind(targetEl,'keypress',P.Edit);targetEl.innerHTML=P.$(rel+'-originaltext').innerHTML;P.stopEvent(e);}}},SetPrompt:function(el){P.Debug('Performer.SetPrompt','function');var placeHolderSupport=('placeholder'in document.createElement('input'));var id=P.identify(el);var title=P.getAttribute(el,'title');if(!placeHolderSupport){if(el&&P.nodeName(el)&&title&&el.value==""&&(el.type=='textarea'||el.type=='text')){P.Debug('-> Setting prompt: '+title,'function');P.addClassName(el,"performer-prompter");el.value=P.getAttribute(el,'title');var form=P.up('#'+id,'form');if(form){P.bind(form,'submit',function(){P.ClearPrompt(el);},false);}}}else{P.setAttribute(el,'placeholder',title);}},RemovePrompt:function(e){P.Debug('Performer.RemovePrompt','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){P.ClearPrompt(el);}},ClearPrompt:function(el){P.Debug('Performer.ClearPrompt','function');var title=P.getAttribute(el,"title");if(el&&P.nodeName(el)&&title&&(el.value==title)&&(el.type=='textarea'||el.type=='text')){el.value="";P.removeClassName(el,"performer-prompter");}},CheckPrompt:function(e){P.Debug('Performer.CheckPrompt','function');var el=P.eventElement(e);var title=P.getAttribute(el,"title");var id=P.identify(el);if(el&&P.nodeName(el)&&title&&(el.value=="")&&(el.type=='textarea'||el.type=='text')){P.SetPrompt(el);el.value=P.getAttribute(el,'title');}},Pop:function(e){P.Debug('Performer.Popper','function');var el=P.findEventElement(e,'A');var cls=P.classNames(el);var targetName=P.classParam(cls,'targetName',P.getAttribute(el,'rel'))?'':'popupwindow_'+P.increment();var pageOptions=P.classParam(cls,'options',P.getAttribute(el,'rev'))?'':'scrollbars=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=yes';if(el&&P.nodeName(el)&&P.getAttribute(el,'href')&&(e.type=='click'||P.keyCode(e)==13)){var targetURL=P.getAttribute(el,'href');P.Debug('-> Opening: '+targetURL+' with '+pageOptions,'function');var win=window.open(targetURL,targetName,pageOptions);if(window.focus){win.focus();} 
    101 P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
     105P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){if(typeof window.console!="undefined"&&typeof window.console.debug!="undefined"){if(status=='function'){console.debug(str);}else if(status=='subfunction'){console.debug("- "+str);}else if(status=='error'){console.error(str);}else if(status=='success'){console.info(str);}else if(status=='warning'){console.warn(str);}else if(status=='ajax'){console.debug(str);}} 
     106var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
    102107if(P.$('performerjsdebugbox')){P.$('performerjsoutput').innerHTML+='<p style="margin:0.1em 0;padding:0;color:'+col+'">'+str+'</p>\n';}}},eventOrElement:function(e){var o={};o.stop=false;o.el=e;if(!e.innerHTML){o.el=P.eventElement(e);o.stop=true;} 
    103108return o;},hasClassName:function(el,cls){if(!el||typeof el=='undefined'){return false;} 
     
    116121if(P.MooTools){return $(el).addClass(cls);}},removeClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    117122if(P.MooTools){return $(el).removeClass(cls);}},className:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    118 el.className=cls;},disableContext:function(el){if(P.MooTools){return P.bind(el,'contextmenu',function(e){e.stop();});}},doHide:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el));} 
     123el.className=cls;},getShowEffect:function(effect){if(effect!="random"){if(P.ShowEffects.PerformerIndexOf(effect)<0)effect="fadein";} 
     124if(effect=="random")effect=P.ShowEffects[Math.floor(Math.random()*P.ShowEffects.length)];return effect;},disableContext:function(el){if(P.MooTools){return P.bind(el,'contextmenu',function(e){e.stop();});}},doHide:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el));} 
    119125if(P.MooTools){el.fade('out');el.setStyle('display','none');return el;} 
    120126return false;},doShow:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el));} 
  • performerjs/trunk/performer.prototype.min.js

    r418393 r493314  
    33Created by Chris Taylor (http://www.stillbreathing.co.uk) 
    44Additional work by kourge and Danny Linkov 
    5 Version 1.0.3 
     5Version 1.0.4 
    66 
    77This work is released under any of the following licenses, please choose the one you wish to use: 
     
    1212- BSD License (http://www.opensource.org/licenses/bsd-license.php) 
    1313*/ 
    14 var Performer={version:'1.0.3',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.Effects=['slideup','slidedown','blinddown','blindup','fadein','fadeout'];P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
     14var Performer={version:'1.0.4',Scriptaculous:false,Prototype:false,jQuery:false,MooTools:false,Counter:0,LooperFuncs:new Array(),LooperCurrentItem:new Array(),Performer:function(){P.DetectLibrary();if(P.Scriptaculous||P.Prototype||P.jQuery||P.MooTools){P.Start();}},DetectLibrary:function(){if(window.Scriptaculous&&typeof window.Scriptaculous!='undefined'){P.Scriptaculous=true;}else if(window.Prototype&&typeof window.Prototype!='undefined'&&window.Prototype.Version){P.Prototype=true;}else if(window.MooTools&&typeof window.MooTools!='undefined'&&window.MooTools.version){P.MooTools=true;}else if(window.jQuery&&typeof window.jQuery!='undefined'){P.jQuery=true;}},Start:function(){P.domLoaded(function(){P.Debugging=false;P.Debug('Performer.Performer','function');P.Reloaders=[];P.Repeaters=[];P.Groups=null;P.Duplicators=[];P.TextValue=[];P.NewTextValue=[];P.Hash=parent.location.hash.replace(new RegExp('^[#]+','g'),'');P.ShowEffects=['slidedown','blinddown','fadein'];P.HideEffects=['slideup','blindup','fadeout'];P.Effects=P.ShowEffects.concat(P.HideEffects);P.Init();});},Init:function(){P.CheckDebug();P.Debug('Performer.Init','function');P.DoTransformers();P.DoListeners();P.addClassName(P.$$('body')[0],'performer-enabled');},ReInit:function(el){P.Debug('Performer.ReInit','function');P.DoTransformers(el,true);P.DoListeners(el,true);},DoListeners:function(el,reinit){if(reinit===undefined){reinit=false;} 
    1515if(el===undefined){el='';} 
    16 P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){if(reinit===undefined){reinit=false;} 
     16P.Listeners(el,'form.formchecker','CheckForm','submit',reinit);P.Listeners(el,'.toggler','Toggle','click,keypress',reinit);P.Listeners(el,'.switcher','Switch','click,keypress',reinit);P.Listeners(el,'.loader','Load','click,keypress',reinit);P.Listeners(el,'.deleter','Delete','click,keypress',reinit);P.Listeners(el,'.toggleloader','ToggleLoad','click,keypress',reinit);P.Listeners(el,'.sizer','Size','click,keypress',reinit);P.Listeners(el,'.resizer','Resize','keypress',reinit);P.Listeners(el,'.tabber','Tab','click,keypress',reinit);P.Listeners(el,'.accordianer','Accordian','click,keypress',reinit);P.Listeners(el,'.selector','Select','change,keypress',reinit);P.Listeners(el,'.limiter','Limit','keyup,keydown',reinit);P.Listeners(el,'.editor','Edit','click,keypress',reinit);P.Listeners(el,'.uneditor','UnEdit','click,keypress',reinit);P.Listeners(el,'.setter','Set','click,keypress',reinit);P.Listeners(el,'.prompter','RemovePrompt','focus',reinit);P.Listeners(el,'.prompter','CheckPrompt','blur',reinit);P.Listeners(el,'.popper','Pop','click,keypress',reinit);P.Listeners(el,'.passwordchecker','CheckPassword','keyup',reinit);P.Listeners(el,'.matcher','Match','keyup',reinit);P.Listeners(el,'.grouptoggler','GroupToggle','click,keypress',reinit);P.Listeners(el,'.submitter','Submit','submit',reinit);P.Listeners(el,'.looperforward','Loop','click,keypress',reinit);P.Listeners(el,'.looperback','Loop','click,keypress',reinit);P.Listeners(el,'.looperfirst','Loop','click,keypress',reinit);P.Listeners(el,'.looperlast','Loop','click,keypress',reinit);P.Listeners(el,'.looperitem','Loop','click,keypress',reinit);P.Listeners(el,'.looperstart','Loop','click,keypress',reinit);P.Listeners(el,'.looperpause','Loop','click,keypress',reinit);P.Listeners(el,'.tooltipper','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.popup','Tooltip','mouseover,focus',reinit);P.Listeners(el,'.modalwindower','ModalWindow','click,keypress',reinit);P.Listeners(el,'.modalwindowcloser','CloseModal','click,keypress',reinit);P.Listeners(el,'.contextmenuer','ContextMenu','mouseup',reinit);P.Listeners(el,'.styler','Style','click,keypress',reinit);P.Listeners(el,'.duplicator','Duplicate','click,keypress',reinit);P.Listeners(el,'.morpher','Morph','click,keypress',reinit);P.Listeners(el,'form.submitlocker','SubmitLock','submit',reinit);P.Listeners(el,'a.toggle-performer-debug','ToggleDebug','click,keypress',reinit);P.Listeners(el,'.hooker-click','Hooker','click,keypress',reinit);P.Listeners(el,'.hooker-keypress','Hooker','keypress',reinit);P.Listeners(el,'.hooker-change','Hooker','change',reinit);P.Listeners(el,'.hooker-mouseover','Hooker','mouseover',reinit);P.Listeners(el,'.hooker-mouseout','Hooker','mouseout',reinit);P.Listeners(el,'.hooker-submit','Hooker','submit',reinit);P.Listeners(el,'.hooker-focus','Hooker','focus',reinit);P.Listeners(el,'.hooker-blur','Hooker','blur',reinit);},DoTransformers:function(el,reinit){P.Debug('Performer.DoTransformers','function');if(reinit===undefined){reinit=false;} 
    1717if(el===undefined||el==='performerjsdebugwrapper'){el='';} 
    1818P.Transformers(el,'.hider','Hide',reinit);P.Transformers(el,'.shower','Show',reinit);P.Transformers(el,'.focusser','Focus',reinit);P.Transformers(el,'.limiter','LimitNotifier',reinit);P.Transformers(el,'.reloader','Reload',reinit);P.Transformers(el,'.preloader','Preload',reinit);P.Transformers(el,'.prompter','SetPrompt',reinit);P.Transformers(el,'.truncator','Truncate',reinit);P.Transformers(el,'ul.looper,ol.looper','InitLoop',reinit);P.Transformers(el,'.tab','InitTabs',reinit);P.Transformers(el,'.contextmenuer','DisableContextMenu',reinit);P.Transformers(el,'.pager','Page',reinit);P.Transformers(el,'.loadmorpher','Morph',reinit);P.Transformers(el,'.loadtoggler','Toggle',reinit);P.Transformers(el,'.loadgrouptoggler','GroupToggle',reinit);P.Transformers(el,'.loadstyler','Style',reinit);P.Transformers(el,'.loadmodalwindower','ModalWindow',reinit);},Listeners:function(el,classNames,f,event,reinit){var b=P.bind;var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    1919var els=d('body '+el+className);if(els){dbg('Performer.Listeners('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){fe(event.split(','),function(event){b(element,event,P[f]);});}});}});},Transformers:function(el,classNames,f,reinit){var n=P.nodeName;var fe=P.forEach;var d=P.$$;var dbg=P.Debug;var cls=classNames.split(',');fe(cls,function(className){if(el!==undefined){el=el+' ';} 
    2020var els=d('body '+el+className);if(els){dbg('Performer.Transformers('+el+className+') - '+els.length+' elements found','function');fe(els,function(element){if(n(element)){P[f](element);}});}});},CheckDebug:function(){P.Debug('Performer.CheckDebug','function');var d=P.$$('.performer-debug');if(d){P.Debugging=true;P.PrepareDebug();}},classParam:function(classNames,paramName,defaultValue){var cls=null;var val=defaultValue;var i=classNames.length;while(i--){cls=classNames[i];if(cls&&cls.substring(0,paramName.length+1)==paramName+'-'){val=cls.replace(paramName+'-','');}} 
    21 return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
     21return val;},Hooker:function(e){var el=P.eventElement(e);if(el&&P.getAttribute(el,'id')&&P.getAttribute(el,'class')){P.Debug('Performer.Hooker('+P.getAttribute(el,'id')+')','function');var t=e.type;var func=P.classParam(P.classNames(el),"func",null);if(eval('typeof('+func+')')=='function'){eval(func+'(el,e)');}}},Page:function(el){var elid=P.identify(el);el=P.$(elid);var cls=P.classNames(el);var selector=P.classParam(cls,"selector","");var children;if(selector.length>0){children=P.children(el,"#"+elid+"-"+selector);}else{children=P.children(el);} 
    2222var pagesize=P.classParam(cls,"pagesize",10);var startpage=P.classParam(cls,"startpage",1);if(children.length>pagesize){var page=1;var i=0;var acn=P.addClassName;var h=P.Hide;P.forEach(children,function(el){if(i<page*pagesize&&i>=(page-1)*pagesize){}else{page++;} 
    23 acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
     23acn(el,'pageelement');acn(el,'page'+page);h(el);i++;});var s=P.Show;P.forEach(P.$$("#"+elid+" .page"+startpage),function(el){s(el);});var menu=P.BuildPageMenu(elid,page,startpage);P.insertAfter(el,menu);var links=P.$$("."+elid+"pagerlink");var b=P.bind;P.forEach(links,function(el){b(el,"click",P.ShowPage);b(el,"keypress",P.ShowPage);});}},BuildPageMenu:function(elid,page,startpage){P.Debug('Performer.BuildPageMenu('+elid+')','function');var menu='<ul class="performer-pagination">';var currentpage="";for(var x=1;x<=page;x++){if(x==startpage){currentpage=" currentpage";} 
    2424menu+='<li><a href="#'+elid+'-page'+x+'" class="'+elid+'pagerlink'+currentpage+'" id="'+elid+'-page'+x+'">'+x+'</a></li>';currentpage="";} 
    25 menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
    26 return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(elid){P.Debug('Performer.InitLoop','function');var el=P.$(elid);var shown=0;var i=0;var n=P.nodeName;var h=P.Hide;var hcn=P.hasClassName;var id=P.identify;var hsh=P.Hash;P.forEach(P.children(el),function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
    27 i++;}});P.Show(P.children(el)[shown]);},Loop:function(e){r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el);var loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel'));if(P.$(loop)){var i=0;var toshow=0;var nowshowing=0;var n=P.nodeName;var v=P.visible;var dbg=P.Debug;var h=P.Hide;P.forEach(P.children(P.$(loop)),function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
    28 h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=(P.children(P.$(loop)).length-1);}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=P.children(P.$(loop)).length){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=P.children(P.$(loop)).length-1;} 
    29 P.Debug('- Showing item '+toshow,'subfunction');P.Show(P.children(P.$(loop))[toshow],"fadein");P.stopEvent(e);}}},Tooltip:function(e,cssClass){var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
     25menu+='</ul>';return menu;},ShowPage:function(e){var el=P.eventElement(e);var elid=P.identify(el);var parts=elid.split("-page");var fe=P.forEach;P.Debug('Performer.ShowPage('+elid+')','function');var h=P.Hide;fe(P.$$("#"+parts[0]+" .pageelement"),function(el){h(el);});var s=P.Show;fe(P.$$("#"+parts[0]+" .page"+parts[1]),function(el){s(el);});var rcn=P.removeClassName;fe(P.$$("."+parts[0]+"pagerlink"),function(el){rcn(el,"currentpage");});P.addClassName(P.$(elid),"currentpage");P.stopEvent(e);},ContextMenu:function(e){P.Debug('Performer.ContextMenu()','function');var el=P.eventElement(e);var h=P.Hide;var b=P.bind;P.forEach(P.$$(".performercontextmenu"),function(el){h(el);});if(el&&((e.which&&e.which==3)||(e.button&&e.button==3)||(e.rightClick))){var targetEl=P.classParam(P.classNames(el),"targetEl",false);var position=P.cursorPosition(e);if(position&&targetEl&&P.$(targetEl)){var id=P.identify(el);targetEl=P.$(targetEl);P.addClassName(targetEl,'performercontextmenu');targetEl.style.position='absolute';targetEl.style.zIndex='10000';targetEl.style.top=position[1]+'px';targetEl.style.left=position[0]+'px';P.Show(targetEl);e.preventDefault();b(P.$$('body')[0],'click',P.HideContextMenu);b(P.$$('body')[0],'keypress',P.HideContextMenu);P.stopEvent(e);return false;}} 
     26return false;},DisableContextMenu:function(el){P.disableContext(el);},HideContextMenu:function(e){var els=P.$$('.performercontextmenu');var rcn=P.removeClassName;var h=P.Hide;P.forEach(els,function(el){rcn(el,'performercontextmenu');h(el);});},Set:function(e){var el=P.eventElement(e);if(el&&P.nodeName(el)){P.Debug('Performer.Set','function');var cls=P.classNames(el);var value=unescape(P.classParam(cls,"value",""));var targetEl=P.classParam(cls,"targetEl",P.getAttribute(el,"rel"));P.setValue(P.$(targetEl),value);P.stopEvent(e);}},InitLoop:function(el){P.Debug('Performer.InitLoop','function');var elid=P.identify(el),shown=0,i=0,cls=P.classNames(el),delay=P.classParam(cls,"delay",0),effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect),n=P.nodeName,h=P.Hide,hcn=P.hasClassName,id=P.identify,hsh=P.Hash,children=P.children(el);P.forEach(children,function(child){if(n(child)){h(child);if(hcn(child,'looperdefault')||hsh==id(child)){shown=i;} 
     27i++;}});P.Show(children[shown]);P.LooperCurrentItem[elid]=shown;if(delay>0)P.StartLoop(elid,children,delay,effect);},StartLoop:function(elid,children,delay,effect){var func=function(){var toshow=P.LooperCurrentItem[elid]+1;if(toshow>=children.length){toshow=0;} 
     28P.LooperCurrentItem[elid]=toshow;P.forEach(children,function(child){P.Hide(child);});P.Show(children[toshow],effect);};P.LooperFuncs[elid]=window.setInterval(func,delay*1000);},Loop:function(e){P.Debug('Performer.Loop','function');r=false;var el=P.findEventElement(e,'A');if(e.type=='click'||P.keyCode(e)==13){var cls=P.classNames(el),loop=P.classParam(cls,"targetEl",P.getAttribute(el,'rel')),loopEl=P.$(loop);if(loopEl){var children=P.children(loopEl);window.clearInterval(P.LooperFuncs[loop]);if(P.hasClassName(el,'looperpause')){P.Debug('Performer.Loop (pause auto-loop)','function');P.stopEvent(e);return false;} 
     29if(P.hasClassName(el,'looperstart')){P.Debug('Performer.Loop (start auto-loop)','function');var elcls=P.classNames(P.$(loop)),delay=P.classParam(elcls,"delay",0),effect=P.classParam(elcls,"effect","fadein"),effect=P.getShowEffect(effect),toshow=P.LooperCurrentItem[loop];if(delay>0){P.Hide(children[toshow]);toshow++;if(toshow>=children.length){toshow=0;} 
     30P.LooperCurrentItem[loop]=toshow;P.Show(children[toshow],effect);P.StartLoop(loop,children,delay,effect);P.stopEvent(e);return false;}} 
     31var i=0,toshow=-1,nowshowing=0,n=P.nodeName,v=P.visible,dbg=P.Debug,h=P.Hide,len=children.length,effect=P.classParam(cls,"effect","fadein"),effect=P.getShowEffect(effect);P.forEach(children,function(child){if(n(child)&&v(child)){dbg('- Currently showing item '+i,'subfunction');nowshowing=i;} 
     32h(child);i++;});if(P.hasClassName(el,'looperback')){P.Debug('Performer.Loop (back)','function');toshow=nowshowing-1;if(toshow<0){toshow=len-1;}}else if(P.hasClassName(el,'looperforward')){P.Debug('Performer.Loop (forward)','function');toshow=nowshowing+1;if(toshow>=len){toshow=0;}}else if(P.hasClassName(el,'looperfirst')){P.Debug('Performer.Loop (first)','function');toshow=0;}else if(P.hasClassName(el,'looperlast')){P.Debug('Performer.Loop (last)','function');toshow=len-1;}else if(P.hasClassName(el,'looperitem')){toshow=P.classParam(cls,"item",1);if(toshow>=len)toshow=len-1;P.Debug('Performer.Loop ('+toshow+')','function');} 
     33P.LooperCurrentItem[loop]=toshow;P.Debug('- Showing item '+toshow,'subfunction');P.Show(children[toshow],effect);P.stopEvent(e);}}},Tooltip:function(e,cssClass){P.Debug('Performer.Tooltip','function');var el=P.eventElement(e);if(!cssClass){cssClass="performertooltip";} 
    3034var id=P.identify(el);if(el&&P.nodeName(el)&&!P.$(id+'_performertooltip')){var cls=P.classNames(el);var text=false;var originaltext="";if(P.getAttribute(el,"title")&&P.getAttribute(el,"title")!=""){originaltext=P.getAttribute(el,"title");text='<p>'+originaltext.replace(/\r/g,"<br />\n")+'</p>';}else{var targetEl=P.$(P.classParam(cls,"targetEl",false));if(targetEl){text=targetEl.innerHTML;}} 
    3135var position=false;if(e.type=='mouseover'){position=P.cursorPosition(e);}else{position=P.elementPosition(el);position[1]=position[1]+el.offsetHeight;} 
     
    4650var items=P.Duplicators[targetEl]+1;P.Duplicators[targetEl]=items;newel.innerHTML=newel.innerHTML.replace(/_1/g,'_'+items);newel.innerHTML=newel.innerHTML.replace(/[1]/g,items);newel.id=newel.id.replace(/_1/g,'_'+items);if(P.getAttribute(newel,'class')!=''){P.setAttribute(newel,'class',P.getAttribute(newel,'class').replace(/_1/g,'_'+items));} 
    4751var countEl=P.classParam(cls,"countElement",false);var countElement=P.$(countEl);if(countElement){P.setValue(countElement,items);} 
    48 P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.findEventElement(e,'FORM');var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
     52P.stopEvent(e);}},SubmitLock:function(e){var el=P.findEventElement(e,'FORM');if(el){var fields=P.$F(el);var acn=P.addClassName;P.forEach(fields,function(input){var field=P.$(P.identify(input));if(field.type.toLowerCase()=='submit'){field.disabled=true;acn(field,'performer-disabled');}});}},Submit:function(e){var el=P.findEventElement(e,'FORM');var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",P.classParam(cls,"targetElement",false));var targetElement=P.$(targetEl);if(targetPage&&el&&P.nodeName(el)&&targetElement&&P.nodeName(targetElement)){var params=P.serialize(el);P.addClassName(targetElement,'performerloading');P.Request(targetPage,'POST',params,function(request){var text=P.getRequestText(request);P.update(targetElement,text);P.removeClassName(targetElement,'performerloading');P.Debug('-> Filled \'#'+targetEl+'\'','success');});P.stopEvent(e);}},CheckForm:function(e){P.Debug('Performer.CheckForm','function');var el=P.eventElement(e),cls=P.classNames(el),targetForm=P.classParam(cls,"targetEl",P.findEventElement(e,'FORM')),go=P.DoCheckForm(targetForm);if(!go)P.stopEvent(e);return go;},DoCheckForm:function(el){var fail=false;var radiogroups=[];var fields=P.$F(el);var id=P.identify;var d=P.$;var hcn=P.hasClassName;var fn=P.FieldNotify;var fnr=P.FieldNotifyRemove;var gv=P.getValue;P.forEach(fields,function(input){var identity=id(input);var field=d(identity);var val=gv(field);if(hcn(field,'field-required')){if(field.type!='radio'&&((field.type=='checkbox'&&field.checked===false)||field.value=="")){fn(identity,'error','This field is required');fail=true;}else{fnr(identity);} 
    4953if(field.type=='radio'&&radiogroups.PerformerIndexOf(field.name)==-1){radiogroups[radiogroups.length]=field.name;var radiofail=true;var radiobuttons=el[field.name];for(var i=0;i<radiobuttons.length;i++){if(radiobuttons[i].checked){radiofail=false;break;}} 
    5054var lastbutton=radiobuttons[radiobuttons.length-1];if(radiofail){fn(lastbutton,'error','This field is required');fail=true;}else{fnr(lastbutton);}}} 
     
    5357fnr(identity);}} 
    5458if(hcn(field,'field-required-date')||hcn(field,'field-optional-date')){var validdate=/^([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})$/;if((hcn(field,'field-required-date')&&val=="")||(val!=""&&!validdate.test(val))){fn(identity,'error','This field must be a date (dd/mm/yyyy)');fail=true;}else{fnr(identity);}} 
    55 P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');P.stopEvent(e);}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
     59P.Debug('-> Field '+input.name,'subfunction');});if(fail){fn(P.identify(el),'error','There are errors with some fields. Please check the form and try again.');return false;}else{return true;}},FieldNotify:function(field,messageclass,message){if(!P.$(field+'-notification')){P.insertAfter(P.$(field),'<span id="'+field+'-notification" class="performer-'+messageclass+'">'+message+'</span>');}else{P.$(field+'-notification').innerHTML=message;P.$(field+'-notification').className='performer-'+messageclass;}},FieldNotifyRemove:function(field){if(P.$(field+'-notification')){P.$(field+'-notification').innerHTML="";P.$(field+'-notification').className="";}},Select:function(e){P.Debug('Performer.Select','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var targetPage=P.classParam(cls,"targetPage",false);var targetEl=P.classParam(cls,"targetEl",false);var targetValue=P.classParam(cls,"targetValue",false);if(targetPage&&P.$(targetEl)){if(targetValue=='true'){P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','setvalueandinit');}else{P.DoLoad(targetPage+'?selection='+P.getValue(el),targetEl,'post','fillandinit');}}}},CheckPassword:function(e){P.Debug('Performer.CheckPassword','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));if(notifyEl){P.Show(notifyEl);var val=el.value;if(val.length<6){P.update(notifyEl,'Your password must be at least 6 characters long');P.className(notifyEl,'password-weak');}else{P.update(notifyEl,'');if(val.match(/^([a-zA-Z]{6,10})$/)||val.match(/^([0-9]{6,10})$/)){P.update(notifyEl,'Weak password');P.className(notifyEl,'password-weak');}else if(val.match(/^([a-zA-Z]{10,})$/)||val.match(/^([0-9]{10,})$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[^0-9a-zA-Z]).*$/)){P.update(notifyEl,'Strong password');P.className(notifyEl,'password-strong');}else if(val.match(/^.*(?=.{6,})(?=.*\d)(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*[a-z]).*$/)||val.match(/^.*(?=.{6,})(?=.*[^0-9a-zA-Z])(?=.*\d).*$/)){P.update(notifyEl,'Acceptable password');P.className(notifyEl,'password-ok');}}}}},Match:function(e){P.Debug('Performer.Match','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&P.getAttribute(el,'id')&&P.getAttribute(el,'name')&&P.getAttribute(el,'class')){var cls=P.classNames(el);var notifyEl=P.$(P.classParam(cls,"notifyEl",false));var matchEl=P.$(P.classParam(cls,"matchEl",false));if(notifyEl&&matchEl){P.Show(notifyEl);var val1=el.value;var val2=matchEl.value;if(val1==val2){P.Hide(notifyEl);}}}},Toggle:function(e,c){var r=false;var eve=P.eventOrElement(e);var el=eve.el;if(!el){el=P.findEventElement(e,'A');} 
    5660if(el&&P.nodeName(el)&&((e.type=='click'||P.keyCode(e)==13||P.keyCode(e)==32)||!eve.stop)){var cls=P.classNames(el);var showeffect=P.classParam(cls,'showeffect','slidedown');var hideeffect=P.classParam(cls,'hideeffect','slideup');var toggleid=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));if(!toggleid){toggleid=P.identify(el);} 
    5761var move=P.classParam(cls,'move',false);var delay=P.classParam(cls,'delay',0)*1000;var targetEl=P.$(toggleid);if(targetEl&&P.nodeName(targetEl)){if(delay===0){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);}else{setTimeout(function(){r=P.DoToggle(toggleid,targetEl,el,showeffect,hideeffect);},delay);} 
     
    7882P.stopEvent(e);}}},Resize:function(e){P.Debug('Performer.Resize','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){var cls=P.classNames(el);var m=P.classParam(cls,'maxHeight',500);var s=el.scrollHeight;var d=P.getDimensions(el);var h=d.height;if((s+5)>h&&h<m){el.style.height=(s+10)+'px';}}},ToggleLoad:function(e){P.Debug('Performer.ToggleLoad','function');var el=P.eventElement(e);var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(el&&P.nodeName(el)&&targetEl&&targetPage&&(e.type=='click'||P.keyCode(e)==13)){if(P.Toggle(e)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');P.Load(e,true,false);} 
    7983P.stopEvent(e);}},InitTabs:function(el){var elid=P.identify(el);el=P.$(P.identify(el));if(P.Hash==elid){P.addClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.removeClassName(el,'hider');P.Show(el);} 
    80 if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev'));var openTab=P.$(otab);var tablinks=P.$$('.tabber');var i=tablinks.length;var hcn=P.hasClassName;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
     84if(!P.hasClassName(el,'hider')&&P.Hash!=''&&P.Hash!=elid){P.removeClassName(P.getElementsByAttribute('a','rev',elid)[0],'tabbercurrent');P.addClassName(el,'hider');P.Hide(el);}},Tab:function(e){P.Debug('Performer.Tab','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var tabGroup=P.classParam(cls,'tabGroup',P.getAttribute(el,'rel'));if(tabGroup&&P.$(tabGroup)){var otab=P.classParam(cls,'tab',P.getAttribute(el,'rev')),effect=P.classParam(cls,'effect','fadein'),openTab=P.$(otab),tablinks=P.$$('.tabber'),i=tablinks.length,hcn=P.hasClassName,ga=P.getAttribute,rcn=P.removeClassName;while(i--){if(hcn(tablinks[i],'tabGroup-'+tabGroup)||ga(el,'rel')==tabGroup){rcn(tablinks[i],'tabbercurrent');}} 
    8185var tabs=P.$$('#'+tabGroup+' .tab');i=tabs.length;var h=P.Hide;while(i--){h(tabs[i]);} 
    82 P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');P.Show(openTab,'fadein');P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
     86P.addClassName(el,'tabbercurrent');P.Debug('-> Showing tab \'#'+otab+'\'','subfunction');effect=P.getShowEffect(effect);P.Show(openTab,effect);P.stopEvent(e);}}},Accordian:function(e){P.Debug('Performer.Accordian','function');P.Hash='';var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var accordianGroup=P.classParam(cls,"group",false);if(P.$(accordianGroup)){var groupcls=P.classNames(el);var oitem=P.classParam(cls,"item",false);var openItem=P.$(oitem);var accordianlinks=P.$$('.accordianer');var i=accordianlinks.length;var ga=P.getAttribute;var rcn=P.removeClassName;while(i--){if(ga(accordianlinks[i],'rel')==accordianGroup){rcn(accordianlinks[i],'accordiancurrent');}} 
    8387var accordianitems=P.$$('#'+accordianGroup+' .accordianitem');i=accordianitems.length;var h=P.Hide;while(i--){h(accordianitems[i]);} 
    8488P.addClassName(el,'accordiancurrent');P.Debug('-> Showing accordianitem \'#'+oitem+'\'','subfunction');P.Show(openItem,'slidedown');P.stopEvent(e);}}},Load:function(e,c,s){P.Debug('Performer.Load','function');var el=P.findEventElement(e,'A');if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.getAttribute(el,'rel'));var rel=P.$(targetEl);var targetPage=P.classParam(cls,'targetPage',P.getAttribute(el,'rev'));if(targetEl&&rel&&P.nodeName(rel)){P.Debug('-> Loading content into \'#'+targetEl+'\'','subfunction');if(!s){P.DoLoad(targetPage,targetEl,'get','fillandinit');}else{P.DoLoad(targetPage,targetEl,'get','fill');}} 
     
    99103editForm+='</form>\n<span style="display:none" id="'+id+'-originaltext">'+value+'</span>';P.Debug('-> Built form with action: '+targetPage,'function');return editForm;}},HideEditForm:function(el,val){P.Debug('Performer.HideEditForm','function');var id=P.identify(el);if(val){el.innerHTML=P.$(id+'-value').value;}else{el.innerHTML=P.$(id+'-originaltext').innerHTML;} 
    100104P.bind(P.$(id),'click',P.Edit);P.bind(P.$(id),'keypress',P.Edit);},UnEdit:function(e){P.Debug('Performer.UnEdit','function');var el=P.eventElement(e);if(el&&P.nodeName(el)&&(e.type=='click'||P.keyCode(e)==13)){var cls=P.classNames(el);var rel=P.classParam(cls,'targetEl',false);var targetEl=P.$(rel);if(targetEl){P.bind(targetEl,'click',P.Edit);P.bind(targetEl,'keypress',P.Edit);targetEl.innerHTML=P.$(rel+'-originaltext').innerHTML;P.stopEvent(e);}}},SetPrompt:function(el){P.Debug('Performer.SetPrompt','function');var placeHolderSupport=('placeholder'in document.createElement('input'));var id=P.identify(el);var title=P.getAttribute(el,'title');if(!placeHolderSupport){if(el&&P.nodeName(el)&&title&&el.value==""&&(el.type=='textarea'||el.type=='text')){P.Debug('-> Setting prompt: '+title,'function');P.addClassName(el,"performer-prompter");el.value=P.getAttribute(el,'title');var form=P.up('#'+id,'form');if(form){P.bind(form,'submit',function(){P.ClearPrompt(el);},false);}}}else{P.setAttribute(el,'placeholder',title);}},RemovePrompt:function(e){P.Debug('Performer.RemovePrompt','function');var el=P.eventElement(e);if(el&&P.nodeName(el)){P.ClearPrompt(el);}},ClearPrompt:function(el){P.Debug('Performer.ClearPrompt','function');var title=P.getAttribute(el,"title");if(el&&P.nodeName(el)&&title&&(el.value==title)&&(el.type=='textarea'||el.type=='text')){el.value="";P.removeClassName(el,"performer-prompter");}},CheckPrompt:function(e){P.Debug('Performer.CheckPrompt','function');var el=P.eventElement(e);var title=P.getAttribute(el,"title");var id=P.identify(el);if(el&&P.nodeName(el)&&title&&(el.value=="")&&(el.type=='textarea'||el.type=='text')){P.SetPrompt(el);el.value=P.getAttribute(el,'title');}},Pop:function(e){P.Debug('Performer.Popper','function');var el=P.findEventElement(e,'A');var cls=P.classNames(el);var targetName=P.classParam(cls,'targetName',P.getAttribute(el,'rel'))?'':'popupwindow_'+P.increment();var pageOptions=P.classParam(cls,'options',P.getAttribute(el,'rev'))?'':'scrollbars=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=yes';if(el&&P.nodeName(el)&&P.getAttribute(el,'href')&&(e.type=='click'||P.keyCode(e)==13)){var targetURL=P.getAttribute(el,'href');P.Debug('-> Opening: '+targetURL+' with '+pageOptions,'function');var win=window.open(targetURL,targetName,pageOptions);if(window.focus){win.focus();} 
    101 P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
     105P.stopEvent(e);}},Morph:function(e){P.Debug('Performer.Morpher','function');var eve=P.eventOrElement(e);var el=eve.el;var cls=P.classNames(el);var targetEl=P.classParam(cls,'targetEl',P.identify(el));if(el&&targetEl&&P.$(targetEl)){var delay=P.classParam(cls,'delay',0)*1000;setTimeout(function(){var duration=P.classParam(cls,'duration',1);var props=["lineHeight","margin","padding","width","height","opacity","fontSize","borderWidth","color","backgroundColor"];params=P.setupMorphProperties(props,cls);P.animate(targetEl,params,duration);},delay);if(eve.stop){P.stopEvent(e);}}},ToggleDebug:function(e){if(!P.Debugging){P.Debugging=true;P.PrepareDebug();P.Debug();P.stopEvent(e);}else{P.Debugging=false;P.remove(P.$('performerjsdebugwrapper'));P.stopEvent(e);}},PrepareDebug:function(){var bodyhtml=document.getElementsByTagName('body')[0].innerHTML;bodyhtml=bodyhtml+'<div style="position:fixed;bottom:0;right:0;left:0;margin-top:height:400px;" id="performerjsdebugwrapper">\n<p style="margin:0; padding: 0 0 4px 0;"><a href="#" class="toggler targetEl-performerjsdebugbox" style="background:#333;color:#FFF;padding:0.3em 0.6em;margin:0 0 0 1em;-moz-border-radius-topright:5px;-moz-border-radius-topleft:5px;-webkit-border-top-right-radius:5px;-webkit-border-top-left-radius:5px;border:0">Performer Debug</a></p>\n<div class="hider" style="background:#333;padding:0.5em" id="performerjsdebugbox"><div id="performerjsoutput" style="padding:0.3em;height:400px;overflow:auto;background:#FFF;">\n</div></div>';var body=document.getElementsByTagName('body')[0];var children=P.children(body);if(children.length){P.insertAfter(children[0],bodyhtml);P.DoListeners("#performerjsdebugwrapper");}},Debug:function(str,status){if(P.Debugging){if(typeof window.console!="undefined"&&typeof window.console.debug!="undefined"){if(status=='function'){console.debug(str);}else if(status=='subfunction'){console.debug("- "+str);}else if(status=='error'){console.error(str);}else if(status=='success'){console.info(str);}else if(status=='warning'){console.warn(str);}else if(status=='ajax'){console.debug(str);}} 
     106var col='#000';if(status=='function'){col='#333';}else if(status=='subfunction'){col='#AAA';}else if(status=='error'){col='#900';}else if(status=='success'){col='#090';}else if(status=='warning'){col='#FFA800';}else if(status=='ajax'){col='#4937DF';} 
    102107if(P.$('performerjsdebugbox')){P.$('performerjsoutput').innerHTML+='<p style="margin:0.1em 0;padding:0;color:'+col+'">'+str+'</p>\n';}}},eventOrElement:function(e){var o={};o.stop=false;o.el=e;if(!e.innerHTML){o.el=P.eventElement(e);o.stop=true;} 
    103108return o;},hasClassName:function(el,cls){if(!el||typeof el=='undefined'){return false;} 
     
    116121if(P.Prototype||P.Scriptaculous){return el.addClassName(cls);}},removeClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    117122if(P.Prototype||P.Scriptaculous){return el.removeClassName(cls);}},className:function(el,cls){if(typeof(el)!='object'){el=P.$(el);} 
    118 el.className=cls;},disableContext:function(el){if(P.Prototype||P.Scriptaculous){P.bind(el,'contextmenu',function(e){e.stop();});} 
     123el.className=cls;},getShowEffect:function(effect){if(effect!="random"){if(P.ShowEffects.PerformerIndexOf(effect)<0)effect="fadein";} 
     124if(effect=="random")effect=P.ShowEffects[Math.floor(Math.random()*P.ShowEffects.length)];return effect;},disableContext:function(el){if(P.Prototype||P.Scriptaculous){P.bind(el,'contextmenu',function(e){e.stop();});} 
    119125if(P.MooTools){return P.bind(el,'contextmenu',function(e){e.stop();});}},doHide:function(el,effect){if(typeof(el)!='object'){el=P.$(P.identify(el));} 
    120126if(P.Prototype){return el.hide();} 
  • performerjs/trunk/readme.txt

    r418393 r493314  
    44Tags: performer, javascript, html, css, interaction, ajax 
    55Requires at least: 2.7 
    6 Tested up to: 2.8.4 
    7 Stable tag: 1.0.3 
     6Tested up to: 3.3.1 
     7Stable tag: 1.0.4 
    88 
    99PerformerJS allows you to add really cool effects and features to your website by doing some simple editing of the HTML code in your pages. 
     
    5555= And the Wordpress plugin? = 
    5656 
    57 This plugin simply includes the Performer JavaScript file using the 'admin_head' (yes, Performer in the admin area) and 'wp_foot' hooks. However it first checks to see if one of the support JavaScript libraries is present, and if not includes the jQuery library using the Google AJAX API. 
     57This plugin simply includes the Performer JavaScript file using the 'admin_head' (yes, Performer in the admin area) and 'wp_footer' hooks. However it first checks to see if one of the support JavaScript libraries is present, and if not includes the jQuery library using the Google AJAX API. 
    5858 
    5959== Screenshots == 
     
    6666 
    6767== Changelog == 
     68 
     69= 1.0.4 = 
     70 
     71Added delay parameter to Looper, allowing for slideshows. Fixed some bugs. 
    6872 
    6973= 1.0.3 = 
Note: See TracChangeset for help on using the changeset viewer.