/* widget.js.php
includes the javascript needed for widgets and
appends the class name triggering the function load onto $jsLoaded <=====
*/
if(!defined('SESSION_JS_LOADED')){
define('SESSION_JS_LOADED','');
}
mb_internal_encoding('UTF-8');
if(!isset($jsLoaded)){
$jsLoaded='';
}
/* ACCORDIAN Management */
if(array_key_exists('acc_',$classesLoading) || array_key_exists('acc_1',$classesLoading)){ /* acc is funeral homes acc_1 is westwardbound */
$jsLoaded.=' acc_';?>
?>
acc_=function(e){
/* this accommodates different html layouts for different styline of accordians */?>
let o=tgt(e),n= if(array_key_exists('acc_',$classesLoading)) echo 'o.nextElementSibling.firstElementChild.nextElementSibling';if(array_key_exists('acc_1',$classesLoading)) echo 'o.nextElementSibling.nextElementSibling'; ?>;
n.style.maxHeight=o.checked?n.scrollHeight+'px':'0';
return;
};
}
if(array_key_exists('ca_',$classesLoading)){
$jsLoaded.=' ca_';?>
ca_=function(a,d){/* build the framework for a calendar page, add to the DOM and add all the items to the calendar. ibi is the interface block id, a is an array of all the items to be added to the calendar */?>
a=a.split(' echo ZDEF_ROW_DELIMITER; ?>');
var D=nD(d),n,o=ce('div','ca_'),tb,tr,z;
o.innerHTML='
- <<
- <
- '+nD.mns[D.m-1]+' '+D.y+'
- <>
- >
- >>
';
/* dont use ih on a table element as long as we support ie9 */?>
n=ce('div');n.innerHTML='| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
';o.appendChild(n.firstElementChild);
n=bc(o,'div');x=ce('div','z_c');x.innerHTML='';n.appendChild(x);
n.appendChild(ca_.bc(D.y,D.m));
ob('ca_').appendChild(o);
wk=false;for(i=0;i');
if(b[0]!==wk){wk=b[0];rw=false;tb=ob('wk'+b[0]).querySelector('tbody');}
try{
if(b[1]!==rw){rw=b[1];tr=tb.appendChild(d.createElement('tr'));}
/* dont use ih on a tr as long as we support ie9 , strip any
tags out of the heading */?>
x=ce('div');x.innerHTML='';
tr.appendChild(x.firstElementChild.firstElementChild.firstElementChild.firstElementChild);
}catch(e){cl('calendar build error 1');cl(e);cl(b);continue;}
}
};
ca_.bc=function(sY,sM){/* sM is a ONE BASED month!!! build calendar returns a table body full of tables that represent each row in the month. If today is in the month it is marked with a class of 'now',
all years, months and days are integers until they are displayed
dow1 is the day of the week of the first day (0=Sunday),td is the total # of days in the current month,tdl is the total number of days in the last month, now is the current day */?>
var cD,cls,cM,cY,dow1=nD(sY,sM,1).dw,D,o,now=nD().setHours(0,0,0,0),td=nD.dim(sY,sM),tdl=nD.dim(sY,sM-1)||nD.dim(sY,12),tr,x,z;
o=ce('div','z_d');x=(sY%4==0&&sY%100!=0)||sY%400==0;if(sM==2&&x)td=29;/* deal with leap year */?>if(sM==3&&x)tdl=29;/* deal with leap year in the previous month*/?>
if(dow1>0){c=tdl-dow1+1;cls='lmon';if(sM>1){cM=sM-1;cY=sY;}else{cM='12';cY=sY-1;}}else{c=1;cls='tm';cM=sM;cY=sY}/* c = day counter */?>
for(i=0;i<6;i++){/* this is one week per row */?>
for(j=0;j<7;j++){
if(cls=='lmon'&&c>tdl){c=1;cls='tm';cM=sM;cY=sY;}if(cls=='tm'&&c>td){c=1;cls='nmon';if(sM==12){cM=1;cY=sY+1;}else cM=sM+1;}
/*x=cls=='lmon'?sM-1:cls=='nmon'?sM+1:sM;*/?>
cD=nD(cY,cM,c);
if(j==0){
tr=o.appendChild(ce('div'));if(i%2==1)tr.className='erow';tr.id='wk'+nD(cD.setDate(cD.getDate()+1)).getWeek();/* place the weeknumber class name on table row. Add 1 to day because getWeek is ISO (starts mon) and we start sun */?>
tr=bc(bc(tr.appendChild('table'),'tbody'),'tr');
}
/* two objects are never equal. coherce the dates to number before comparison. if the day is now, set td class to now */?>
x=d.createTextNode((c==1?nD.mns[cM-1]+' ':'')+c);z=ce('td',cls+(+cD==+now?' now':'')+(cD< now?' past':''));z.id='c'+zl(cY,4)+zl(cM,2)+zl(c,2);tr.appendChild(ap(z,x));c++;
}
}
return o;
};
ca_ini=function(r){/* this function runs to add html results to the calendar */?>
var ca_=ob('ca_');ca_.parentNode.replaceChild(ce('div',false,'ca_'),ca_);
r=b[0]+b[2];z.innerHTML=r;z.replaceChild(ob('b_'),z.firstElementChild);b=b[1].split(' echo ZDEF_ROW_DELIMITER; ?>');ca_(b);/* ca_ is in the widget.js.php file */?>
ob('tk_').querySelector('.dr_').classList.add('mini');
};
}
if(array_key_exists('cu_anim_1',$classesLoading)){
$jsLoaded.=' cu_anim_1'; ?>
anim_1=function(){/* called onscroll of wpg */?>
let n=document.body.querySelector('.cu_anim_1'),h=getComputedStyle(n).height.pi(),t=n.getBoundingClientRect().top+n.ownerDocument.defaultView.pageYOffset,xr=[30,80];/* t=top of anim div relative to viewport. xr=[start transformX, end transformX] */?>
let tn=n.querySelector('anim_1');
temp=h/t*(xr[1]-xr[0]);tempy=tn.style.transform;
tn.style.transform="translate:(temp,)";
}
/* ob(wpg).addEventListener("scroll",anim_1,{passive: true}); */?>
}
if( (array_key_exists('frm_',$classesLoading)) || (array_key_exists('ssv_',$classesLoading)) ){
if(array_key_exists('frm_',$classesLoading) && strpos(SESSION_JS_LOADED,'frm_*') === false){
$jsLoaded.=' frm_*';
require_once ZDEF_PATH_TO_LIBRARY.'forms.handler.js.php';// THIS FILE IS ALSO USED BY THE PUBLISHER
}
if(array_key_exists('ssv_',$classesLoading) && strpos(SESSION_JS_LOADED,'ssv_*') === false) {
$jsLoaded.=' ssv_*'; // jsLoaded.=' frm_*' is set above
}
?>
frm_f=function(e){/* form focus: triggered on all input fields.
WE MUST use onfocus so we can capture keyboard events, but we only want to this processing if the focus event was caused by a tab
WE CANNOT use onfocus to do processing when there is a click because if there is an error message created then event is corrupted and onmouseup and onclick cannot get the right object from e
*/?>
if(frm_f.tab){
frm_f.tab=false;frm_c(e);/* trigger 'click' processing for focus caused by non-mouse (keyboard) events */?>
}
};frm_f.tab=false;
frm_c=function(e){/* on click for radio,checkbox; onchange for select: or programmatically called from frm_f */?>
var i,fn,o=tgt(e),n;/* fn = function name */?>
if(n=fcc(o,'zedit'))o=n;
while((isi(o)||fcc(o,'zimagegroup'))&&((!e.which)||e.which==1)){/* input field, if mouse, only left click is processed */?>
/* If the input field isn't in form then it's modal (like the stripe pay block) and we don't do FFF processing on it. */?>
if(fce(o,'form')&&fcc(o,'frm_')&&w['frm_init'])FFF(o);/* PREVIOUS element edits (performed after having left the field )*/?>
/* the following functions are performed onfocus triggered by tab or onclick triggered by mouse */?>
i=frm_c.cn.f(o.name||o.id);
if(i!==false){N.X(o);fn=w[frm_c.fn[i]];if(!fn(e)){r=false;fce(o,'li_').classList.add('err_');N.M(o,fn.m);break;}}
break;
}
/* if o is zimagegroup then we're in contenteditable div and didn't select image. Block this. */?>
if(o&&o.classList.contains('zimagegroup'))ks(o);else if(d.activeElement!=o){if(o.focus)o.focus();if(fcc(o,'zedit')){rse();/* rtzico(e); */?>}}/* changing dom to show error messages can cause the current object to lose focus. Re-focus and reselect text if in zedit */?>
};frm_c.cn=[];frm_c.fn=[];
/* get all active inputs in the form */?>
frm_inp=function(o){return o.querySelectorAll('input:not(:disabled):not([readonly]):not([type=hidden]),select:not(:disabled):not([readonly]),textarea:not(:disabled):not([readonly]),div.zedit');};
frm_init=function(o){/* initialize form events. If o is a form, act on o. If o is an object, act on all forms in object. Otherwise act on all forms in document. This is called when in publisher and from independent webpage form */?>
var a=(o=ob(o))?(o.nodeName.toLowerCase()=='form'?[o]:o.querySelectorAll('form')):document.body.querySelectorAll('form'),b,i,j,s,n;
for(i=a.length;i--;){
a[i].onkeydown=function(e){if(e.keyCode==9)frm_f.tab=true;};
b=frm_inp(a[i]);
/* onfocus event for radio and checkbox is inconsistent across browsers so we use onclick to trigger FFF for radio and checkbox */?>
/* zrsel is resource insert */?>
for(j=b.length;j--;){
/* element data-oc functions get performed onfocus for most elements
exception is radio and checkbox which data-oc functions get performed onclick (the onclick is triggered by the browser when they change)
the SELECT element doesn't trigger a click when changed by keyboard so we trigger their functions onchange
element data-fn functions don't get performed until move PAST them in the form (onclick is used to process FFF but FFF only processes elements already passed)
*/ ?>
n=b[j];
if(n.nodeName.toLowerCase()=='select')n.onchange=frm_c;else{if(!document.body.classList.contains('ssv_'))n.onclick=frm_c;};/* if in the publisher then onclick processing is done by wss_ */?>
n.onfocus=frm_f;/* we use frm_f onfocus to detect when a tab has caused us to enter an input element. */?>
if(s=n.getAttribute('data-oc')){frm_c.cn.push(n.id);frm_c.fn.push(s);}/* set up all the routines required onclick */?>
}
b=a[i].querySelectorAll('.zedit');
for(j=b.length;j--;){/* prepare the zedit richtext blocks for editing. MUST BE done for whole page because cannot set contenteditable as entering field or range will not be updated on first selection */?>
n=b[j];n.contentEditable='true';n.setAttribute('unselectable','on');n.spellcheck='true';
}
};
};
}if(array_key_exists('frm_',$classesLoading)){?>
frm_init();
}if(array_key_exists('social_',$classesLoading)){
if(!array_key_exists('social_',$classesLoading)){
$jsLoaded.=' social_*';
?>
if(!array_key_exists('social_',$classesLoading)){
social_ini=function(){
var a=document.body.querySelectorAll('a'),i=a.length;
while(i--)if(decodeURIComponent(a[i].href).indexOf('////')>-1){a[i].href=decodeURIComponent(a[i].href).rpg('////',w.location.href);}
};
}
}?>
social_ini();
}
//================ DATE PICKER (has to be before toolkit)
// dp_ is date picker, tk_ is toolkit, mca_ is mini calendar, ca_ is a calendar page
/* build date picker controls on all document objects with a class of 'dp_' */
if(1==2 && array_key_exists('dp_',$classesLoading)){/* build date picker DP.bp EXPECTS nD.m to be ONE based!! DP.bp.m is a ONE based month*/
$jsLoaded.=' dp_';
?>
DP=ob('dp_');/* DP is a constant reference to the datepicker in the DOM, DP.dp_ is the date picker function. DP.bp builds the date picker in DP*/?>
DP.dp_=function(wk,mo){/* if mo is true then the month header on the calendar is a nav button. mo is not true when date picker is used to pick dates rather than to select date ranges */?>
var a=d.querySelectorAll('.dp_'),D=nD(),i=a.length,o,x;
while(i--){
if(!fcc(o=a[i],'db_')){/* the date picker is in the display block. In publisher it gets moved into the scrolling list area and back out again on close */?>
o.innerHTML='';
/* dont use ih on a table element as long as we support ie9 */?>
x=ce('div');x.innerHTML='';
o.appendChild(x.firstElementChild);
}
o.y=D.y;o.m=D.m;
}
};
DP.bp=function(o,D){
if(o=ob(o)){
let tm=o.querySelector('.dp_tm');if(tm)tm.textContent=nD.mns[D.m-1]+' '+D.y;
k(o.querySelector('tbody'));
o.querySelector('table').appendChild(DP.bc(D.y,D.m,o.getAttribute('data-opt')=='wk'));
let m=fci(o,'mca_');if(m){let n=o.querySelector('table');if(n)n.setAttribute('data-href',m.getAttribute('data-href'));}/* if in an mini-calendar place the data-href on the table, where oc (in std.js) will look for it */?>
o.y=D.y;o.m=D.m;
for(let n of Array.from(o.querySelectorAll('.sel'))){rcn(n,'sel');}
ob('d'+D.y+D.m+D.d).classList.add('sel');/* this highlights the currently selected date */?>
/*unsel(o);*/?>
}
};
/* this is an ISO getWeek function. Use it by adding one day to the start date so it works with the week starting on Sunday instead of Monday */?>
Date.prototype.getWeek = function() {
var date = new Date(this.getTime());
date.setHours(0, 0, 0, 0);
/* Thursday in current week decides the year. */?>
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
/* January 4 is always in week 1. */?>
var week1 = new Date(date.getFullYear(), 0, 4);
/* Adjust to Thursday in week 1 and count number of weeks from date to week1. */?>
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);
};
DP.bc=function(sY,sM,wk,ib){/* sM is a ONE BASED month!!! build calendar returns a table body full of the days of a month. If today is in the month it is marked with a class of 'now', wk is optional. If true then week numbers will be appended to start of calendar weeks. if ib is passed it is the id of the interface block in which the calendar is being built. ib is not passed if just building a date picker
all years, months and days are integers until they are displayed
dow1 is the day of the week of the first day (0=Sunday),td is the total # of days in the current month,tdl is the total number of days in the last month, now is the current day */?>
var cD,cls,cM,cY,dow1=nD(sY,sM,1),D,now=nD().setHours(0,0,0,0),td=nD.dim(sY,sM),tdl=nD.dim(sY,sM-1)||nD.dim(sY,12),tr,x,z;dow1=dow1.dw;
ib=ib||'d';tB=ce('tbody','btns');x=(sY%4==0&&sY%100!=0)||sY%400==0;if(sM==2&&x)td=29;/* deal with leap year */?>if(sM==3&&x)tdl=29;/* deal with leap year in the previous month*/?>
if(dow1>0){c=tdl-dow1+1;cls='lmon';if(sM>1){cM=sM-1;cY=sY;}else{cM='12';cY=sY-1;}}else{c=1;cls='tm';cM=sM;cY=sY}/* c = day counter */?>
for(i=0;i<6;i++){
tr=ce('tr');tB.appendChild(tr);if(i%2==1)tr.className='erow';
for(j=0;j<7;j++){
if(cls=='lmon'&&c>tdl){c=1;cls='tm';cM=sM;cY=sY;}if(cls=='tm'&&c>td){c=1;cls='nmon';if(sM==12){cM=1;cY=sY+1;}else cM=sM+1;}
cD=nD(cY,cM,c);if(wk&&j==0)ap(tr,ap(ce('td','wk'),d.createTextNode(zl(cD.getWeek(),2)))).appendChild('td');
/* two objects are never equal. coherce the dates to number before comparison. if the day is now, set td class to now */?>
x=d.createTextNode(''+c);z=ce('td',cls+(+cD==+now?' now':'')+(cD < now?' past':''));z.id=ib+zl(cY,4)+zl(cM,2)+zl(c,2);tr.appendChild(ap(z,x));c++;
}
}return tB;
};
DP.close=function(){acn(DP,'dn');ob('jenisys').appendChild(k(DP));};/* do not use let on DP */?>
DP.dp_(false,true);DP.bp('dp_',nD());
}
if(array_key_exists('mca_',$classesLoading)) {
if (strpos(SESSION_JS_LOADED,'mca_*') === false){
$jsLoaded.=' mca_*'; ?>
mca_ini=function(){var o=ob('mca_');o.y= echo date('Y'); ?>;o.m= echo date('m'); ?>;DP.dp_(false,true);DP.bp('mca_',nD());};
mcacl_=function(e){/* click in a date picker object, in the toolbar or in a date picker embedded in a page */?>
var D,o=tgt(e),n;
if(n=fci(o,'mca_')){
if(fcc(o,'dpik'))dpcl_(e);
if(fce(o,'table')||fcc(o,'dp_tm'))n.querySelector('table').setAttribute('data-parms','dr='+nD(n.y,n.m,'01').ds+','+nD(n.y,n.m,nD.dim(n.y,n.m)).ds);
if(n)if(o=n.querySelector('table'))o.setAttribute('data-href',n.getAttribute('data-href'))
}
};oc.fn.push('mcacl_');oc.cn.push('mca_');
}?>
mca_ini();
}
//// TOOKIT
if(array_key_exists('tk_',$classesLoading)){
$jsLoaded.=' tk_'; ?>
tk_kd=function(e){var o=tgt(e),x=ky(e);if(x==13&&o.id=='tk_term')tkcl_(ns(o));};/* process keydown: if we hit enter in search term then search initiates. */?>
tk_blr=function(){/* on blur of the search term we MUST initiate a server request but we do save the term so it is used in the next request */?>
/*tk_.sr=get('tk_term'.t());*/?>
/* INITIATE A SERVER REQUEST FOR EACH SEARCH !! */?>
};
tkcl_=function(e){
var a,b,c,D,D2,dy,m,n,o=tgt(e),op,s,tl,x,y;/* There is always a 'vw' entry in tk_.op */?>
while(o){
if(tl=fcc(o,'sr_')){/* Search */?>
if(o.id=='tk_term'){
/* o.select(); fix this so only first click (with no swipe causing selection) selects all the text in the input) click in field
make sure subsequent click does not select all text */?>
}
if(o.type=='button'){op=true;tk_.sr=get('tk_term'.t());}
break;
}
if(fcc(o,'btns')){
if(fcc(o,'vw_')){
fcc(o,'dd_').classList.remove('open');
/* tl=fcc(o,'vw_'; tl.parentNode.appendChild(tl=k(tl)); this is the only way we figured out to force the list to lose focus and close on mobile safari */?>
tk_.vw=did(o);op=true;
if(tk_.vw=='ca'){/* force the start and end date to the first and last day of month */?>
D=nD(tk_.sd);/* if tk_.sd isn't defined yet then nD will return today */?>
tk_.sd=nD(D.y,D.m,1).ds;tk_.ed=nD(D.y,D.m+1,0).ds;/* tk_.ed is the last day of this month */?>
}
}
if(fcc(o,'rg_')){tk_.rg=did(o);op=true;}
if(fcc(o,'cg_')){tk_.cg=did(o);op=true;}
}
if(fcc(o,'dr_')){D=dpcl_(e);D2=D[1];D=D[0];if(D){fcc(o,'dd_').classList.remove('open');D2=D2||D;tk_.sd=D.ds;tk_.ed=D2.ds;op=true;}}
break;
}
if(op){tk_xr();}/* if there is a selection of a toolkit parm, bundle requests for all affected INTERFACE BLOCKS into one call and add any other toolkit parms already set */?>
};
tk_nf=function(){/* toolkit remove search filters */?>
var a=ob('tk_').getAttribute('data-opt').split('&'),b,i;
for(i=0;i
var a,c,s,vr;
tk_.odl=tk_.od.slice(0);/* tk_odl = last request. Need to know, in case get server access failures. This needs work. */?>
tk_.dr=(tk_.sd||'')+','+(tk_.ed||'');if(tk_.dr==',')tk_.dr='';
s='';for(i=0;i
/* There should always be an ib_ list in c. Just a precaution. */?>
Xd('b_',oc.prm+(pnm(w.location.href)||'index')+s+'&jensiii='+document.body.getAttribute('data-jensiii'));
};
/* tk_ just adds the class names of visible tools to the tk_ div so the tools will show. It doesn't control anything else */?>
tk_=function(a){var b,i;
i=tk_.op.length;while(i--)tk_[tk_.op[i]]='';
a=a.split('&');i=a.length;tk_.sd=tk_.ed='';
while(i--){b=a[i].split('=');
if(b[0]=='vw')ob('wpg').className='wpg '+b[1];
if(b[0]=='dr'){b=b[1].split(',');tk_.sd=b[0];tk_.ed=b[1];}else{tk_[b[0]]=b[1]||'';}
}
set('tk_term',tk_.sr);/* we only want the data, not the parameter string */?>
};
tk_ini=function(){
var a,b,D=nD(),i,o,x;
ob('tk_').querySelector('tk_').classList.remove('dn');
o=ob('tk_term');o.onkeydown=tk_kd;o.onblur=tk_blr;/* initialize search keydown on the input element in the search area */?>
/* Build the date picker. Passing t to DP.dp_ will cause the dp_tm 'month header' to be displayed as a button, which is needed when using date picker to select a range of dates rather than a single date */?>
x=ob('tk_').querySelector('li.dr_');x.y=D.y;x.m=D.m;/* initialize the date picker */?>
oc.fn.push('tkcl_');oc.cn.push('tk_');/* enable the onclick event for the toolkit */?>
oc.fn.push('tk_nf');oc.cn.push('nofilt_');/* enable the onclick event to remove search filters */?>
tk_.prm='cmd=tk_&cf=config';/* this is the call for widget data */?>
tk_.op='vw dr sr cg rg gr rp'.split(' ');tk_.od=[];/* option parameters and option data DO NOT save ri (record id for details) */?>
a=ob('tk_').getAttribute('data-opt');tk_(a);a=a.split('&');
for(i=0;i
};
dpcl_=function(e){/* click in a date picker object, in the toolbar! This is not for date picker embedded in page */?>
var o=tgt(e),c=o.className,D=false,D2=false,n=fcc(o,'dr_'),m=n.m,y=n.y,vca;/* n is the date picker object, c is the id of the source object. */?>
if(w['tk_'])vca=tk_.vw='ca';
while(!(fcc(o,'mn_')&&fce(o,'tbody'))){/* a click on tbody in a mini calendar triggers a link, which is handled by oc in std.js */?>
if(c=='py')y--;if(c=='sy')y++;if(c=='pm'){if(m==1){y--;m=12;}else m--;}if(c=='sm'){if(m==12){y++;m=1;}else m++;}if(c=='to'){x=nD();y=x.y;m=x.m;}/* dont use D when setting 'to' values because it will cause a trip to the server */?>
if(fcc(o,'dpik')){DP.bp(n,nD(y,m,1));cE(e);break;}/* If in the date picker header just rebuild the calendar, don't query the server. */?>
if(c=='pm'||c=='sm'||c=='to'){D=nD(y,m,1);n.y=y;n.m=m;break;}/* this is from the TODAY, previous month, subsequent month buttons in the display block, not the date picker */?>
if(w['tk_']&&(o.classList.contains('dp_tm')||(vca&&fce(o,'tbody')))){/* date picker month or clicked in picker table when view is calendar */?>
D=nD(y,m,1);D2=nD(D.y,D.m+1,0);/* zero day gives us the last day of the same month */?>
break;
}
if(nn(o)=='li'&&fcc(o,'dc_')){a=did(o).split(',');D=nD(a[0]);D2=nD(a[1]||a[0]);break;}/* there was a click on the list of 'canned' date selections */?>
if(fce(o,'table')){/* If we are contained in a table we are in the date picker */?>
if(w['tk_']){
o=fce(o,'td');
if(!o)break;
x=(c=='wk')?ns(ns(o)).id:o.id;
y=x.substr(1,4);m=x.substr(5,2);dy=x.substr(7,2);
if(c=='wk'){D=nD(y,m,(vca)?1:dy);D2=vca?nD(D.y,D.m+1,0):nD(D.y,D.m,D.d+6);break;}/* date picker week */?>
/* date picker day */?>
if(vca){D=nD(y,m,1);D2=nD(D.y,D.m+1,0);}else D=nD(y,m,dy);
}
}
break;
}
return [D,D2];
};
}
// =========================== CALENDAR ITEMS ============================================
if(array_key_exists('ca_',$classesLoading)){/* ca_ is calendar routines */
$jsLoaded.=' ca_'; ?>
cacl_=function(e){
var c,D,o=tgt(e),m,y;
if(fcc(o,'dpik')){
c=o.className;D=nD(tk_.sd);
y=D.y;m=D.m;
if(c=='py')y--;if(c=='sy')y++;if(c=='pm'){if(m==1){y--;m=12;}else m--;}if(c=='sm'){if(m==12){y++;m=1;}else m++;}if(c=='to'){D=nD();y=D.y;m=D.m;}
D=nD(y,m,1);D2=nD(D.y,D.m+1,0);/* zero day gives us the last day of the same month */?>
if( if(ZDEF_IS_MODERN_PHONE)echo 'true';else echo 'false'; ?>){/* If we are contained in a table we are in the date picker. This only matters if we are on smartPhone */?>
if(x=fce(o,'td')){
x=o.id;
/* smart phone. just use x to display the right info already downloaded */?>
}
}
if(D){tk_.sd=D.ds;tk_.ed=D2.ds;}
tk_xr();
}
return;
};
oc.fn.push('cacl_');oc.cn.push('ca_'); /* enable the onclick event for the toolkit */ ?>
/* we only need something like this for the smartphone. Calendar will be on top and when click on day get list of events and links below
var o=tgt(e),n=fce(o,'p'),n1,n2;
if(n){
acn(db,'fz_');
n1=ce('div','exp_');
n2=bc(bc(n1,'div'),'div');
n2.innerHTML=n.getAttribute('data-exp')+'X
';
n2.insertAdjacentElement('afterbegin',n.cloneNode(true));
document.body.appendChild(n1);
}
*/?>
}if(array_key_exists('ca_xxxxxxxxxxxx',$classesLoading) ){/* ca_ is calendar routines */
$jsLoaded.=' ca_xxxxxxxxxxxx'; ?>
?>
ca_xr=function(a,IB){
/* ca_ stores the reponse data in X[IB.id][xx???????] where xx is the name of the data item (eg. hd=header, sd=start date) and ri is the record id of the event */?>
C=IB.plv.rset;
var b,c,cD,dr=IB.querySelector('.dr_'),D,D2,DB=IB.querySelector('db_'),cm,dy,i,j,mn,o,psd,r,s=' ',term,tr,tt,x,y,yr,x,z;
c=a[0].split(' echo ZDEF_ROW_DELIMITER; ?>');
a=c[0].split(' echo ZDEF_SECTION_DELIMITER; ?>');
cm=a[0];
while(cm=='get'){/* add events to calendar */?>
var vw=a[1],pvw=IB.plv[IB.pnm.f('vw')]||'',vca=vw=='ca',vag=vw=='ag',vbb=vw=='bb',vpb=vw=='pb',sd=a[2],ed=a[3],sr=a[4],cg=a[5],rg=a[6],ri=a[7],r,sY=sd.ss(0,4).pi(),sM=sd.ss(4,2).pi(),sD=sd.ss(6).pi(),tbl,tB=document.body.querySelector('tbody'),x,z;/* tB is table body, */?>
D=nD(sd);D2=nD(ed||sd);if(x=document.body.querySelector('.hdg'))ca_.hdg=k(x);kc(document.body);
if(ri){document.body.innerHTML=a[8];document.body.classList.remove(pvw);document.body.classList.add('dt');break;}
if(vw!=pvw||document.body.classList.contains('dt')){/* ================ CHANGE IN VIEW (or change back after detail view) =============== */?>
if(vca){rac(dr,'sel');rac(z=IB.querySelector('.dp_'),'sel');z.querySelector('.dp_tm').classList.add('sel');}/* the month is always selected in calendar view. Unselect anything in date range picker. */?>
IB.classList.remove(pvw);document.body.classList.remove(pvw);document.body.classList.remove('dt');IB.classList.add(vw);document.body.classList.add(vw);/* remove the current (old) view from IB and document.body class and add the new view. If view was 'calendar' set date picker togl to same setting as before went to calendar view */?>
}
document.body.appendChild(ca_.hdg);tbl=bc(document.body,'table');tt=document.body.querySelector('.title');
term=(sr.l>0?' Search Term '+sr:'');
/* add category, region etc. to search term here */?>
if(vca){
tB=tbl.appendChild(calendar(sY,sM,false,IB.id));
set(kc(tt),nD.mns[sd.ss(4,2).pi()-1]+' '+sd.ss(0,4));
}else{
tB=tbl.appendChild(ce('tbody'));
if(c.length< 2){
tB.appendChild(ap(ce('tr','noresult'),bp('td',d.createTextNode('No Events Scheduled'+(term?': ':'')+term))));
}
set(kc(tt),nD.ld(D,D2,true));
}
/* EVENTS hd=heading,in=synopsis,sd=start date, ed= end date, st= start time, et = end time, lo=location, lk=link, im=image, ib=image border */?>
b='hd in sd ed st et lo lk lx im ib'.split(' ');
for(i=1;i0?a.sd:false;/* psd is the start date on the previous line */?>
a=[];r=c[i].split(' echo ZDEF_SECTION_DELIMITER; ?>');
r.id=r[0];
for(j=0;j< b.length;j++){
x=r[j+1];
C[b[j]+r.id]=x;
r[b[j]]=x;
}/* store the data from the X request in IB.plv.rset and as an attribute of array r */?>
if(vca){
/* ca calendar view build: always builds a table with all the days in the cells. If only passed start date then builds full month otherwise builds date range
current day class = "now"
current month's days are class="ca_tm"
if today is showing, its class="now"
last month's days are class="ca_lm"
next month's days are class="ca_nm" */?>
IB.id+r.sd.appendChild(ap(sa(sa(ce('span'),'data-id',r.id),'data-sd',r.sd),d.createTextNode(r.st.rpg(' pm','p').rpg(' am','a').rpg(':00','')+' '+r.hd)));
}
if(vag){
if(psd&&r.sd!=psd){x=ce('td');x.colSpan=4;x=tB.appendChild(ap(ce('tr','spr'),x));}/* spacing row if new day */?>
tr=bc(tB,'tr');tr.onclick='ocl_';tr.setAttribute('data-id',r.id);tr.setAttribute('data-sd',r.sd);D=nD(r.sd);D2=nD(r.ed||r.sd);
x=D.dn;if(D.dn!=D2.dn)x+=' - '+D2.dn;tr.appendChild(ap(ce('td'),bp('strong',d.createTextNode(x)))); /* show the day of the week. If more than one day show start and end day */?>
n=bp('td',d.createTextNode(nD.ld(D,D2)));tr.appendChild(n);
/* dont use ih on td as long as we support ie9 */?>
x=ce('div');x.innerHTML=''+r.st+' | ';tr.appendChild(x.firstElementChild);
/* tr.appendChild(x=ce('td'));x.innerHTML=r.st;*/?>
if(r.et&&r.et!=r.st){x.appendChild(d.createTextNode(' - '));x.appendChild(ap(ce('span','wnw'),d.createTextNode(r.et)));}
atr.appendChild(ap(ce('td','hd'),ap(ce('span'),d.createTextNode(r.hd))));
if(r.lk){y=ce('a');y.href=r.lk;y.target='_blank';ap(y,d.createTextNode(r.lx));}else{y=d.createTextNode('');}
bc(tr,'td').appendChild(y);
}
}
break;
};
};
}if(array_key_exists('pb_',$classesLoading)){/* pb_ is pinboard image blocks Right now we don't have any .pb_ styling. Should we use columns instead?? */
if (strpos(SESSION_JS_LOADED,'pb_*') === false){
$jsLoaded.=' pb_*'; ?>
g_=function(){
/*
g_ sets the absolute heights of PINBOARD GALLERY items
g_ sets a timeout for itself until no changes have happened (images downloaded) for 100 ms, also has a timeout for resize and onload
*/?>
var a=d.querySelectorAll('.pb_'),b,c,ch,cx,ht,i=a.length,j,l,ml,mb,n,o,osl,ost,tw,x,y,z;
while(i--){/* for each pinboard gallery on the page */?>
b=a[i].querySelectorAll('.i');/* this are the tiles as 's */?>
/* This is necessary to get the top row to 'flow' naturally just in case the number 'up' changes with the resize. Change j to the maximum number 'UP'. We only need the top row to flow properly */?>
j=b.length;
if(j==0)continue;/* this would be an empty gallery */?>
if(j>8)j=8;while(j--){b[j].style.left=null;b[j].style.top=null;b[j].style.position='relative';b[j].style.width=b[0].style.width;}
o=b[0];
mb=getComputedStyle(o).marginBottom.pi();
ml=getComputedStyle(o).marginLeft.pi()
tw=getComputedStyle(o).width.pi();/* tile width for each item in the gallery */?>
ost=o.offsetTop;osl=o.offsetLeft-w.getComputedStyle(o,'').marginLeft.pi();ch=[];cx=[];/* ch = column heights, cx = column left offsets */?>
j=0;while(b[j]&&b[j].offsetTop==ost){cx[j]=j*(tw+ml)+osl;ch[j]=ost+mb+w.getComputedStyle(b[j],'').height.pi();j++;}
tir=j;l=b.length-tir;/* tir is the number of tiles in each row */?>
if(tir==1){/* dont try to reconfigure when 1-up. Let the stylesheet take care of it */?>
for(j=0;j
n=b[j];n.style.position='relative';n.style.top=0;n.style.left=0;a[i].style.height='auto';
}
}else{
for(j=0;j
/* find the shortest column, starting on the left. We favor the left so we want a column 100 px shorter */?>
z=0;y=ch[0];
for(x=0;x
/*o=o.querySelector('img');if(o.complete){o.style.width=''+(tw+ml)+'px';}*/?>
y=ch[0];x=tir;while(x--)if(ch[x]>y)y=ch[x];/* find the height of the tallest column */?>
a[i].style.height=y+'px';
}
}
}
};
g_ini=function(){
var a=document.body.querySelectorAll('.pb_'),b,i,j;
for(i=0;i
/* if(1==2)g_(); we need to run g_ here IF we have PINBOARD ITEMS!!! just in case all the images loaded before g_ini executes */?>
};
w.addEventListener('resize',function(){if(ob('g_')){clearTimeout(TO['g_']);TO['g_']=setTimeout(g_,100);}},true);/* g_ might not be present if we've had a page swap. g_ won't be executed until the resize event hasn't fired for a while */?>
}?>
g_ini();
}if(array_key_exists('pin-share-button',$classesLoading)&& JENISYS !=1){/* load the map js just once and don't load it if we are in the publisher */
$jsLoaded.=' pin-share-button';
echo 'xhs(\'//assets.pinterest.com/js/pinit.js\');';
}
if(array_key_exists('twitter-share-button',$classesLoading)&& JENISYS !=1){/* load the map js just once and don't load it if we are in the publisher */ ?>
var twitterOpts=function(){/* this code opens a window floating over the website instead of moving to a new twitter page */?>
var height=Math.min(w.innerHeight,300),width=Math.min(w.innerWidth,600),left=(w.innerWidth/2)-(width/2),top=(w.innerHeight/2)-(height/2);
return['resizable,scrollbars,status','height='+height,'width='+width,'left='+left,'top='+top].join();
};
var twitterBtn=document.querySelector('.twitter-share-button>a');
var twitterUrl='https://twitter.com/intent/tweet?url='+location.href+'&text='+encodeURIComponent(' echo ORG_ORGANIZATION_NAME; ?>');
twitterBtn.href=twitterUrl;
twitterBtn.addEventListener('click',function(e){cE(e);var win=w.open(twitterUrl,'ShareOnTwitter',twitterOpts());win.opener=null;});
}if(array_key_exists('mc_',$classesLoading) && JENISYS !=1){/* mailchimp form */
if (strpos(SESSION_JS_LOADED,'mc_*') === false){
$jsLoaded.=' mc_*';
/* https://css-tricks.com/form-validation-part-4-validating-mailchimp-subscribe-form/ */
?>
mc_=function(e){
var o=fcc(tgt(e),'mc_'),a=o.elements,url=o.getAttribute('action').replace('/post?u=', '/post-json?u=');
cE(e);
for (i=0;i
}
url+='&c=mc_x';
o=ce('script');o.src=url;o.id='mc_script';d.head.appendChild(o);o.onload=function(){this.remove();}
};
mc_x=function(x){
var n,o;
o=ob('mc_error');o.innerHTML='';o.classList.add('dn');o=ob('mc_success');o.innerHTML='';o.classList.add('dn');
o=ob('mc_'+x.result);n=ce('div');n.innerHTML=x.msg;o.appendChild(n); /* the message returned may or may not be html, might just be a string */?>
o.classList.remove('dn');/* using innerHTML here gets rid of any old message */?>
};
mc_ini=function(){
var n=ob('mc_submit');
if(n)n.onclick=mc_;
};
}?>
mc_ini();
}if(array_key_exists('submit_',$classesLoading)){/* LOGIN FORM: be careful changing this */ ?>
jii.ui=function(e){if(e.isTrusted)jii.c='';};
jii.submit=function(e){
e.preventDefault();e.stopPropagation();
if(e.isTrusted){
jii.ui(e);
const f=e.target,fd=new FormData(f);/* f is the form */?>
f.querySelector('button[type="submit"]').disabled=true;
fd.append('auth',''+jii.c);/* if javascript detects user interaction jii.c will be a zero width whitespace */?>
if(e.target.parentNode.querySelectorAll('input[name="login"]').length>0){
fd.append('pth',window.location.href.split('#')[0].split(' echo ORG_HANDLE; ?>')[1]||'index/');
}
/* for (let pair of fd.entries()) { console.log(pair[0] + ': ' + pair[1] + ' ' + pair[1].length);} */?>
X('b_',fd); /* note: passing a FormData object here*/?>
}
};
jii.submit_ini=function(){
const a=WPG.querySelectorAll('form');
a.forEach( f=>{
if(f.querySelector('button[type="submit"]')){
f.addEventListener('submit',jii.submit);
}
});
WPG.addEventListener('submit',jii.ui,{capture:true});
WPG.addEventListener('click',jii.ui,{capture:true});/* The event listener is registered in the capturing phase.*/
WPG.addEventListener('touchstart',jii.ui,{passive:true,capture:true });
document.addEventListener('keydown',jii.ui,{capture:true});
};
jii.submit_ini();
}
if(1==2 && array_key_exists('review_',$classesLoading)){/* review page */ ?>
review_ini=function(){
let n =document.body.querySelector('.review_');
n.addEventListener('mousedown',review_reg);
addEventListener('touchstart',review_reg,{passive: true});
};
review_reg=function(e){
let fd=new FormData();
fd.append('cmd','GRVW');
X('b_',fd); /* note: passing a FormData object here*/?>
};
review_ini();
}if(array_key_exists('form_',$classesLoading)){ // new contact form js for CDN
if (strpos(SESSION_JS_LOADED,'form_*') === false){
$jsLoaded.=' form_*';
} ?>
window.jiif=(function(){
require ZDEF_PATH_TO_LIBRARY.'fetch.message.js'; ?>
const C='';
function localStorageAccessible() {
try {
const testKey = 'test';
localStorage.setItem(testKey, 'test');
localStorage.removeItem(testKey);
return true;
} catch (e) {
console.error('SELF GENERATED ERROR: Access to localStorage is denied:', e);
return false;
}
}
const formSubmit = function(f){
formData = new FormData(f);
if(localStorageAccessible()){
formData.append('tkn2', localStorage.getItem('csrf_token'));
}
formData.append('callback','jiif.callback');
formData.append('auth','form_'+C);
formData.append('id',f.getAttribute('id'));
/*for (const [key, value] of formData.entries()) {
console.log(`${key}: ${value}`);
}*/?>
const reqd = f.querySelectorAll('[required]');
formData.append('reqd',Array.from(reqd).map(e => e.name).join(','));
afetch(formData);
};
const ini = function(tkn){
for(let f of document.body.querySelectorAll('.form_')){
for(let i of f.querySelectorAll('input,textarea,select')){
f.addEventListener('change', function(e) {
f.classList.remove('form_err');
});
}
f.querySelector('button').disabled=false;
f.addEventListener('submit', function(e) {
e.preventDefault();
e.stopPropagation();
if(e.isTrusted){
f.querySelector('button').disabled=true;
formSubmit(f);
}
});
}
document.getElementById('jenisys_message_pop').addEventListener('click', function() {
let p=document.getElementById('jenisys_message_pop');
p.classList.add('dn');
document.getElementById('jenisys_loading_overlay').classList.add('dn');
var s = p.querySelector('.ic_close');
while (s=s.nextSibling) {
if (s.nodeType === Node.TEXT_NODE) {
s.textContent = '';
}
}
});
if(localStorageAccessible()){
localStorage.setItem('csrf_token', ' echo TOKEN; ?>');
}
};
const ui = function(e){
if(e.isTrusted){
if(e.type=='mousemove'){
if(typeof e.clientX !=='undefined')C=' ';
} else if (e.type === 'touchstart') {
if (e.touches.length > 0) {
if('screenX' in e.touches[0] !== true)C=' ';
}
} else if(e.type === 'keydown')C=' ';
}else{
e.preventDefault();
}
};
const callback = function(response){
if(response){
if(response.error=='Timeout'){
setTimeout(formSubmit, 200, response.id);
}else{
if(response.message){
messagePop(response);
}
if(response.complete){
for(let f of document.body.querySelectorAll('.form_')){
f.reset();
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}
}
}
}
for(let f of document.body.querySelectorAll('.form_')){
f.querySelector('button').disabled=false;
}
};
ini();
return{
ui: ui,
callback: callback
};
})();
}if((preg_grep('/plx_$/', array_keys($classesLoading)))){
// plx_ runs before imgs in Webpage Script, so imgs gets the right width, crop, etc.
?>
document.body.querySelectorAll('[class$="plx_"]').forEach(i => {
i.classList.add('plxl_');
});
document.body.offsetHeight; /* force a reflow */?>
}if(array_key_exists('ix_',$classesLoading) || array_key_exists('ss_',$classesLoading)){
$jsLoaded.=' ix_'; ?>
window.jiix_=(function(){ const ix_=function(e){
var a,i,o=e.target,ix=document.querySelector('#ix_'),s,x;
console.log('IX_');
if(o.closest('#ix_')){
e.preventDefault();
};
console.log(o);
if(o.closest('.close')||o.closest('.cancel')||e.keyCode==27){
close();
}else if(o.closest('.i')&&(o.closest('.ix_'))&&!o.closest('.modal_')&&!o.closest('.hero_')&&!o.closest('#ss_')){
open(e);
}else if(ix){
/* if there is a click on the right half of the screen, set the object to 'fwd', else 'bwd' */?>
o=ix.querySelector(e.pageX>parseInt(getComputedStyle(ix).width,10)/2?'.fwd':'.bwd');
let cmd=o.closest('.fwd')||e.keyCode==39?'fwd':o.closest('.bwd')||e.keyCode==37?'bwd':false;
if(cmd){
let c=ix.querySelector('.i.ix_current'),is=ix.querySelectorAll('.i');
let n=cmd=='fwd'?c.nextElementSibling||is[0]:c.previousElementSibling||is[is.length-1];
c.classList.remove('ix_current');
n.classList.add('ix_current');
style(n);
console.log('styled');
console.log(n.outerHTML);
/*txt();*/?>
}
}
};
const style=function(n){
let ix=document.getElementById('ix_');
let s = 'translateX(-' + 100 * (Array.from(ix.querySelectorAll('.i')).indexOf(n) || 0) + '%)';/* this gives us the current slide # */?>
let m=ix.querySelector('.slides_');m.style.webkitTransform=s;m.style.transform=s;
};
const close=function(){
console.log('ix_close');
var n=document.getElementById('ix_');
document.body.appendChild(document.getElementById('ldg_')).classList.add('dn');
n.parentNode.removeChild(n);
document.body.style.overflow='auto';
document.body.scrollTop=document.body.sc[1];/* n.scrollTo(document.body.sc[0],document.body.sc[1]); replaced with n.scrollTop= because of IE Edge bug */?>
};
const txt=function(i){
let ix=document.getElementById('ix_');
let s=ix.classList&&ix.classList.contains('textfromtitle');
if(x=i.querySelector('img')){
if(s)text=x.getAttribute('title')||'';else text=x.getAttribute('alt')||''
}
if(text){let txt=document.createElement('p');txt.classList.add('itxt');txt.textContent=text;i.appendChild(txt);}
};
const open=function(e){
console.log('IX_OPEN');
let o=e.target,m=document.createElement('div');
/* window.stop(); stop loading any images so we can be sure we can load the gallery slides */?>
document.body.sc=[document.body.scrollLeft,document.body.scrollTop];
document.body.scrollTop=0;
document.body.style.overflow='hidden';/* scrollTo BEFORE you hide */?>
m.classList.add('modal_');
m.id='ix_';
m.appendChild(document.getElementById('ldg_'));
let slides_=document.createElement('div');
slides_.classList.add('slides_');
m.appendChild(slides_);
document.getElementById('wpg').appendChild(m);
let ix=o.closest('.ix_');/* this is the .ix_ div containing all the images */?>
if(ix.getAttribute('data_textfrom')=='title')m.classList.add('textfromtitle');/* text from title?? */?>
let g_img_s=ix.querySelectorAll('.img_');
console.log(g_img_s);
for(let g_img_ of g_img_s){
const g_img=g_img_.querySelector('img');
console.log(g_img);
let a=g_img.getAttribute('alt'),dm=g_img.getAttribute('data-max')||'1000x750',img_=document.createElement('span'),i=document.createElement('div'),img=document.createElement('img'),t=g_img.getAttribute('title'),s=' echo ORG_CDN_URL; ?>'+(g_img.getAttribute('data-src')||g_img.getAttribute('src').slice(1)); /* // once the page is published the image src will be in src, not data-src */?>
a=a&&a!='null'?a:'';
t=t&&t!=null?t:'';
img_.classList.add('img_');
i.classList.add('i');
i.appendChild(img_);
/* We are creating a slide image from a gallery image. */?>
img.setAttribute('src',s);
img.setAttribute('title',t);
img.setAttribute('alt',a);
img_.appendChild(img);
let x=document.createElement('span');
x.classList.add('close');
x.appendChild(document.createElement('span'));
i.appendChild(x);
if(g_img_s.length>1){
x=document.createElement('span');
x.classList.add('bwd');
x.appendChild(document.createElement('span'));
i.appendChild(x);
x=document.createElement('span');
x.classList.add('fwd');
x.appendChild(document.createElement('span'));
i.appendChild(x);
}
slides_.appendChild(i);
txt(i);
if(g_img_==o.closest('.img_')){
i.classList.add('ix_current');
style(i);
}
if(dm){
let o=document.querySelector('.ix_').querySelector('.itxt');
let th=o?getComputedStyle(o).display=='block'?parseInt(getComputedStyle(o).height,10)||0:0:0; /* if display is 'none' getComputedStyle.height will return 'auto', parseInt of auto returns NaN */?>
let ar=dm.split('x');
if(ar.length>1){
ar=ar[1]/ar[0];
let s=getComputedStyle(img_);
let hr=parseInt(s.height,10)-th;
wr=Math.min(parseInt(s.width,10),+ echo SITEDEF_EXPANDED_IMAGE_MAX_WIDTH; ?>);
if(ar>hr/wr){/* height is the constraining dimension */?>
wr=Math.ceil(hr/ar);
}else{/* width is the constraining dimension */?>
hr=Math.ceil(ar*wr);
}
img_.style.width=wr+'px';
img_.style.height=hr+'px';
img_.style.flexGrow='0';
}
}
}
return;
};
WPG.addEventListener('keydown', ix_);
WPG.addEventListener('click',ix_);
})();
}if(1==2 && (array_key_exists('fd_',$classesLoading)||array_key_exists('dt_',$classesLoading))){/* feed view or detail view. We need image expansion and scroll induced ajx */ ?>
dt_ax=function(){
var a=document.body.querySelector('div.dt_').querySelectorAll('span','i'),i,n,o,y=w.pageYOffset;
for(i=0;i< a.length;i++){
o=a[i];
/* y=document.body.scrollTop||document.documentElement.scrollTop; */?>
if(o.classList.contains('dn')&&os(o.parentNode)[1]-y< 2400){n=o.querySelector('img');n.src=n.getAttribute('data-src');o.classList.remove('dn');}
}
};w.addEventListener('scroll',dt_ax,false);
} if(1==2 && array_key_exists('ani_vis',$classesLoading)){/* animate when object becomes visible */
$classesLoading['ani_vis']=true;
// YOU NEED TO ADD aniVis TO the oc function so it runs on pageswap, also need it on page load
?>
aniVis=function(){
if(!aniVis.to){
for(let n from ob('wpg').querySelector('[class^="ani_"],[class*=" ani_"]')){if(n.top < window.innerHeight && n.bottom >= 0)acn(n,'ani_isvis');}
aniVis.to=setTimeout(function(){aniVis.to=false;},250);
}
};
ob('wpg').addEventListener('scroll',aniVis);
} if(1==2 && array_key_exists('ss_',$classesLoading)){/* SLIDESHOW */ ?>
slide_ini=function(){
let i=document.body.querySelector('.ss_');
if(w['oc']&&w['oc'].fn&&i){
oc.fn.pu('slide_cl');oc.cn.pu('ss_');
}else{
TO['slide_ini']=setTimeout(slide_ini,50);
}
};
slide_cl=function(e){
TO['iChk']=setTimeout(iChk,20);/* give the label time to realize it is 'checked'*/?>
return;
};
slide_ini();
} if(1==2 && array_key_exists('ssr_',$classesLoading)){/* simple search */ ?>
ssr_cl=function(e){
var o=tgt(e);
did(o,pnm(w.location.href)+'.htm?sr='+get('sr_tx'));
};
ssr_ini=function(){oc.fn.push('ssr_cl');oc.cn.push('sr_b');};
ssr_ini();/* we don't need to rerun this every time the page loads because the click is registered with oc */?>
}?>