-
Notifications
You must be signed in to change notification settings - Fork 0
/
performer.mootools.min.js
154 lines (152 loc) · 57.3 KB
/
performer.mootools.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
Performer JavaScript library (http://performerjs.org)
Created by Chris Taylor (http://www.stillbreathing.co.uk)
Additional work by kourge and Danny Linkov
Version 1.0.4
This work is released under any of the following licenses, please choose the one you wish to use:
- Creative Commons Attribution-ShareAlike 3.0 licence (http://creativecommons.org/licenses/by-sa/3.0/)
- Microsoft Public License (http://www.opensource.org/licenses/ms-pl.html)
- MIT License (http://www.opensource.org/licenses/mit-license.php)
- BSD License (http://www.opensource.org/licenses/bsd-license.php)
*/
var 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;}
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,'.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;}
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')){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);}
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){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";}
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;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;}}
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)){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;}
i++;}});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;}
P.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;}
if(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;}
P.LooperCurrentItem[loop]=toshow;P.Show(children[toshow],effect);P.StartLoop(loop,children,delay,effect);P.stopEvent(e);return false;}}
var 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;}
h(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');}
P.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";}
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.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);}
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("£","").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.');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');}
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')),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');}}
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');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');}}
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){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);}}
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.MooTools){return $(el).hasClass(cls);}},$:function(el){if(typeof el=='object'){return el;}
if(typeof el=='undefined'){return false;}
if(P.MooTools){return $(el);}},$$:function(cls){var els;if(P.MooTools){els=$$(cls);}
if(els&&els.length>0){return els;}else{return false;}},$F:function(el){var elid=P.identify(el);var fields;if(P.MooTools){fields=$$("#"+elid+" input","#"+elid+" textarea","#"+elid+" select","#"+elid+" button");}
return fields;},nodeName:function(el){var nn=false;if(P.MooTools){nn=el.nodeName.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.MooTools){return document.getElements(s);}}else{s=type+"["+attr+"]";if(P.MooTools){return document.getElements(s);}}},getValue:function(el){if(P.MooTools){return el.get('value');}},setValue:function(el,value){if(P.MooTools){return el.set('value',value);}},up:function(el,filter){if(P.MooTools){return el.getParent(filter);}},serialize:function(el){if(P.MooTools){return el.toQueryString();}},update:function(el,html){if(P.MooTools){return el.set('text',html);}},insertAfter:function(el,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.MooTools){return el.get(attr);}},setAttribute:function(el,attr,val){if(P.MooTools){return el.set(attr,val);}},removeAttribute:function(el,attr){return el.removeAttribute(attr);},remove:function(el){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.MooTools){return el.getChildren();}},ancestors:function(el){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.MooTools){if(el.getStyle('display')=='none'){return false;}else{return true;}}},addClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el);}
if(P.MooTools){return $(el).addClass(cls);}},removeClassName:function(el,cls){if(typeof(el)!='object'){el=P.$(el);}
if(P.MooTools){return $(el).removeClass(cls);}},className:function(el,cls){if(typeof(el)!='object'){el=P.$(el);}
el.className=cls;},getShowEffect:function(effect){if(effect!="random"){if(P.ShowEffects.PerformerIndexOf(effect)<0)effect="fadein";}
if(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));}
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.MooTools){el.setStyle('display','block');el.fade('in');return el;}
return false;},Request:function(targetPage,requestMethod,params,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.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.MooTools){return P.bind(window,'domready',func);}},bind:function(el,event,func){if(P.MooTools){return $(el).addEvent(event,func);}},unBind:function(el,event,func){if(P.MooTools){return $(el).removeEvent(event,func);}},stopEvent:function(e){if(P.MooTools){e.stop();return false;}
return false;},stopPropagation:function(e){e.stopPropagation();return false;},getDimensions:function(el){var size,getsize;size={};if(P.MooTools){getsize=el.getSize();size.height=getsize.y;size.width=getsize.x;}
return size;},setStyle:function(el,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.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;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>');