WP Photo Album Plus - Version 8.0.00.004

Version Description

= 7.7.07 =

  • This version addresses various minor bug fixes and feature requests.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 8.0.00.004
Comparing to
See all releases

Code changes from version 7.7.07.006 to 8.0.00.004

changelog.txt CHANGED
@@ -1,11 +1,22 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
 
3
  = 7.7.07 =
4
 
5
  * Shortcode virtual album attribute album="#related,... did not work. Fixed.
6
  * Client side performance improvements.
7
- * New feature: If panorama is enabled (Table IV-A24.2), one can now bulk set all the photos of an album to a valid panorama mode for thos photos that have their x/y ratio >= 2.
8
- * New setting: Table IV-H5: Panorama max width spheric. The max size when a spheric panorama is converted to 230° can now be set from 4.000 up to 10.000. Was 6.000 previously.
 
 
9
 
10
  = 7.7.06 =
11
 
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8 =
4
+
5
+ * Ajax method changed. No longer possible to choose between admin or non admin ajax.
6
+ Ajax is always activated, because there can no longer be conflicts due to inaccessibility of both ajax files from the frontend by http request.
7
+ * Photo count treshold has been removed because one can select a childrens image as cover image of any album.
8
+ * Nice scroller is no longer loaded on mobile devives.
9
+ * Removed WPPA+ Text widget. You can now use the WP Custom HTML widget instead.
10
+ * Restructured and greatly simplified settings page.
11
+
12
  = 7.7.07 =
13
 
14
  * Shortcode virtual album attribute album="#related,... did not work. Fixed.
15
  * Client side performance improvements.
16
+ * New feature: If panorama is enabled (Table IV-A24.2), one can now bulk set all the photos of an album to a valid panorama mode for those .jpg photos that have their x/y ratio >= 2.
17
+ * New setting: Table IV-H5: Panorama max width spheric. The max size when a spheric panorama is converted to 360° can now be set from 4.000 up to 10.000. Was 6.000 previously.
18
+ If set to spheric, the files will be converted to get the right aspect ratio if required, i.e. the source image will be padded so the height will be half the width.
19
+ * Converting spheric panoramas to cover 360° now uses the jpg image quality as set in Table IX-A2.
20
 
21
  = 7.7.06 =
22
 
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 7.7.07.005
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -181,7 +181,6 @@ function wppaReUpload( event, photo, expectedName, reload ) {
181
  /* This functions does the init after loading settings page. do not put this code in the document.ready function!!! */
182
  function wppaInitSettings() {
183
  wppaCheckBreadcrumb();
184
- wppaCheckFullHalign();
185
  wppaCheckUseThumbOpacity();
186
  wppaCheckUseCoverOpacity();
187
  wppaCheckThumbType();
@@ -205,7 +204,6 @@ function wppaInitSettings() {
205
  wppaCheckRating();
206
  wppaCheckComments();
207
  wppaCheckCustom();
208
- wppaCheckResize();
209
  wppaCheckNumbar();
210
  wppaCheckWatermark();
211
  wppaCheckPopup();
@@ -469,26 +467,6 @@ function wppaCheckWidgetMethod() {
469
  }
470
  }
471
 
472
- /* Enables or disables the setting of full size horizontal alignment. Only when fullsize is unequal to column width */
473
- /* also no hor align if vertical align is ---default-- */
474
- /* Also show/hide initial colwidth for resp themem ( Table I-A1.1 ) */
475
- function wppaCheckFullHalign() {
476
- var fs = document.getElementById('fullsize').value;
477
- var cs = document.getElementById('colwidth').value;
478
- var va = document.getElementById('fullvalign').value;
479
- if ((fs != cs) && (va != 'default')) {
480
- jQuery('.wppa_ha').css('display', '');
481
- }
482
- else {
483
- jQuery('.wppa_ha').css('display', 'none');
484
- }
485
- if ( cs == 'auto' ) {
486
- jQuery('.wppa_init_resp_width').css('display', '');
487
- }
488
- else {
489
- jQuery('.wppa_init_resp_width').css('display', 'none');
490
- }
491
- }
492
 
493
  /* Check for CDN type */
494
  function wppaCheckCDN() {
@@ -958,16 +936,6 @@ function wppaCheckSlidePhotoLink() {
958
  }
959
  }
960
 
961
- function wppaCheckResize() {
962
- var Rs = document.getElementById('resize_on_upload').checked;
963
- if (Rs) {
964
- jQuery('.re_up').css('display', '');
965
- }
966
- else {
967
- jQuery('.re_up').css('display', 'none');
968
- }
969
- }
970
-
971
  function wppaCheckNumbar() {
972
  var Nb = document.getElementById('show_slideshownumbar').checked;
973
  if (Nb) {
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.0.00.004
5
  /* Various js routines used in admin pages
6
  */
7
 
181
  /* This functions does the init after loading settings page. do not put this code in the document.ready function!!! */
182
  function wppaInitSettings() {
183
  wppaCheckBreadcrumb();
 
184
  wppaCheckUseThumbOpacity();
185
  wppaCheckUseCoverOpacity();
186
  wppaCheckThumbType();
204
  wppaCheckRating();
205
  wppaCheckComments();
206
  wppaCheckCustom();
 
207
  wppaCheckNumbar();
208
  wppaCheckWatermark();
209
  wppaCheckPopup();
467
  }
468
  }
469
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
 
471
  /* Check for CDN type */
472
  function wppaCheckCDN() {
936
  }
937
  }
938
 
 
 
 
 
 
 
 
 
 
 
939
  function wppaCheckNumbar() {
940
  var Nb = document.getElementById('show_slideshownumbar').checked;
941
  if (Nb) {
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album",wppaCropper=[];function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,i,t,o){document.getElementById("wppa-re-up-form-"+i);var p=document.getElementById("wppa-re-up-file-"+i),l=document.getElementById("wppa-re-up-butn-"+i);e.preventDefault();p=p.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+i).css("display","none");l.value="Uploading...",l.style.color="black";t=new FormData;t.append("photo",p,p.name);var s=new XMLHttpRequest,p="?action=wppa&wppa-action=update-photo&photo-id="+i+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+i).value;s.open("POST",wppaAjaxUrl+p,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,p,a,n=JSON.parse(e[2]);for(t in n)switch(a=n[t],t){case"remark":a=(a=(a=a.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),p="0"!=e[1]?'<span style="color:red;" >'+a+"</span>":'<span style="color:green;" >'+a+"</span>",o&&(p+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(p);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(a):jQuery("#photourl-"+i).attr("src",a),jQuery("#thumba-"+i).attr("href",a);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",a);break;case"magickstack":jQuery("#magickstack-"+i).html(a),0<a.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+t+"-"+i).html(a)}l.value="Upload",jQuery("#re-up-"+i).css("display","none");break;case"99":document.getElementById("photoitem-"+i).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+i).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",l.value="Error occured",l.style.color="red"}}else alert("An error occurred!")},s.send(t)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckAlbumNavigatorWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for(("on"==p?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<15;subtab++)"on"==wppa_getCookie("table_"+e[table-1]+"-"+t[subtab])&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<15;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){e=e.substring(5);document.getElementById(e).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",e=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",e)}function wppaCheckWidgetMethod(){var e,t,p;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(p=jQuery("#wppa-wp").val())||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;e||t?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(t=document.getElementById("bc_separator").value)?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==t?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))):(jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",n="",a=e||'<div style="padding-left:5px;" >';p?n=p:aftrer="</div>",wppaFeAjaxLog("in");var i=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,i.open("GET",p,!0),i.send(),i.onreadystatechange=function(){switch(i.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==i.status?("ER"==(e=wppaTrim(i.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+i.status+": "+i.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==p.status?("ER"==(e=wppaTrim(p.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),p&&(n+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(n),a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")}}function wppaAjaxUpdateIptc(s,e,t,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+s+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(t)+"&tagname="+p,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(bef+'<span style="color:red">'+a[2]+"</span>"+aft);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(s,r,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+r+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",u&&(i+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none");break;default:jQuery("#"+n+"-"+s).html(o)}}"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){var a=(a=document.location.href).replace(/&pano-val=./,"");u?setTimeout(function(){document.location.href=a},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var i=wppaAlbumUpdateMatrix.length,o=0,l=!1,s=-1;o<i;)wppaAlbumUpdateMatrix[o][0]==e&&wppaAlbumUpdateMatrix[o][1]==t&&(l=!0,s=o),o++;l||(wppaAlbumUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],s=i),wppaAlbumUpdateMatrix[s][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[s][5]=a,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(o,l,s,r,u){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+o+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+o).value+"&value="+wppaEncode(s),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+o).html(e[2]):jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+o).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),u&&"0"==e[1])return jQuery("#albumstatus-"+o).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var a=0,n=-1,i=wppaAlbumUpdateMatrix.length;a<i;)wppaAlbumUpdateMatrix[a][0]==o&&wppaAlbumUpdateMatrix[a][1]==l&&(n=a),a++;wppaAlbumUpdateMatrix[n][2]=s||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(r)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+o).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,p,e){var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"))},a.open("GET",e,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status)),wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(a,e,o){if(!o&&!e&&"yes"==document.getElementById(a+"_continue").value)return document.getElementById(a+"_continue").value="no",document.getElementById(a+"_button").value="Start!",void(0<jQuery("#"+a+"_togo").html()&&(jQuery("#"+a+"_status").html("Pausing..."),jQuery("#"+a+"_button").css("display","none")));o||(document.getElementById(a+"_continue").value="yes",document.getElementById(a+"_button").value="Stop!",""==jQuery("#"+a+"_status").html()&&jQuery("#"+a+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(o?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),n=a[1],i=!1;return n?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),i=!0),jQuery("#"+n+"_status").html(a[2]),jQuery("#"+n+"_togo").html(a[3]),jQuery("#"+n+"_button").css("display",""),i||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?o||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+a+", Error = "+p+", status = "+t,"force"),jQuery("#"+a+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==a&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==a&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==a&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+a+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(e),4==p.readyState&&200==p.status&&(p=(e=wppaEntityDecode(p.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+p+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(s,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(s)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+s,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+s.replace("#","H")).attr("title",e[2]),e[4])for(var a,n,i,o=e[4].split(";"),l=0;l<o.length;)a=o[l].split(":"),n=jQuery("#"+a[0]).html(),i=a[1],""!=n&&""==i&&(i='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+a[0]).html(i),l++},error:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+s).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=s&&"icon_corner_style"!=s||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=s&&"svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=s&&"ovl_svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(a=(a=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),p=0,a="";p<t.length;)a+=t[p],++p<t.length&&(a+="||PLUS||");return a}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",n=-1,i=-2,o=0,l=!1,s=0;s<e.length;)0!=(p=e[s].valueOf())&&(o=n,p==++o?l=!0:l?(a+=n==i?t+n+t+p:t+t+n+t+p,l=!1):a+=t+p,l||(i=p,i++),n=p),s++;for(l&&(a+=".."+n);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var p,a=[],n=0,i=0;for(t=t||".",p=jQuery(e),i=n=0;n<p.length;)p[n].selected&&(a[i]=p[n].value,i++),n++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+n+"_togo").html(a[0]);e=jQuery("#"+n+"_status").html(),a=a[1];""!=e&&""==a&&(a='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(a),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){e=e.split("|");jQuery("#"+a).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var p=0,a=0;function n(e){(e=e||window.event).preventDefault(),p=a-e.clientY,a=e.clientY,t.style.top=t.offsetTop-p+"px"}function i(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,a=e.clientY,document.onmouseup=i,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,p){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
1
+ var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album",wppaCropper=[];function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,o,t,i){document.getElementById("wppa-re-up-form-"+o);var p=document.getElementById("wppa-re-up-file-"+o),r=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();p=p.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");r.value="Uploading...",r.style.color="black";t=new FormData;t.append("photo",p,p.name);var l=new XMLHttpRequest,p="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;l.open("POST",wppaAjaxUrl+p,!0),l.onload=function(){if(200===l.status){var e=wppaTrim(l.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,p,a,n=JSON.parse(e[2]);for(t in n)switch(a=n[t],t){case"remark":a=(a=(a=a.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),p="0"!=e[1]?'<span style="color:red;" >'+a+"</span>":'<span style="color:green;" >'+a+"</span>",i&&(p+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(p);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(a):jQuery("#photourl-"+o).attr("src",a),jQuery("#thumba-"+o).attr("href",a);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",a);break;case"magickstack":jQuery("#magickstack-"+o).html(a),0<a.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(a)}r.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",r.value="Error occured",r.style.color="red"}}else alert("An error occurred!")},l.send(t)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckAlbumNavigatorWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for(("on"==p?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<15;subtab++)"on"==wppa_getCookie("table_"+e[table-1]+"-"+t[subtab])&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<15;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){e=e.substring(5);document.getElementById(e).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",e=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",e)}function wppaCheckWidgetMethod(){var e,t,p;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(p=jQuery("#wppa-wp").val())||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;e||t?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(t=document.getElementById("bc_separator").value)?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==t?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))):(jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",n="",a=e||'<div style="padding-left:5px;" >';p?n=p:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",p,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==p.status?("ER"==(e=wppaTrim(p.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),p&&(n+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(n),a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")}}function wppaAjaxUpdateIptc(l,e,t,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+l+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(t)+"&tagname="+p,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+l).html(bef+'<span style="color:red">'+a[2]+"</span>"+aft);else{var n,o,i,r=JSON.parse(a[2]);for(n in r)switch(i=r[n],n){case"remark":i=(i=(i=i.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=a[1]?'<span style="color:red;" >'+i+"</span>":'<span style="color:green;" >'+i+"</span>",jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(i):jQuery("#photourl-"+l).attr("src",i),jQuery("#thumba-"+l).attr("href",i);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",i);break;case"magickstack":jQuery("#magickstack-"+l).html(i),0<i.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(l,s,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+l+"&item="+s+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==s&&jQuery("#wppa-photo-spin-"+l).css({visibility:"visible"}),jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+l).html(c+'<span style="color:red">'+a[2]+"</span>"+d);else{var n,o,i,r=JSON.parse(a[2]);for(n in r)switch(i=r[n],n){case"remark":i=(i=(i=i.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=a[1]?'<span style="color:red;" >'+i+"</span>":'<span style="color:green;" >'+i+"</span>",u&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(i):jQuery("#photourl-"+l).attr("src",i),jQuery("#thumba-"+l).attr("href",i);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",i);break;case"magickstack":jQuery("#magickstack-"+l).html(i),0<i.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none");break;default:jQuery("#"+n+"-"+l).html(i)}}"description"==s&&jQuery("#wppa-photo-spin-"+l).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){var a=(a=document.location.href).replace(/&pano-val=./,"");u?setTimeout(function(){document.location.href=a},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,i=0,r=!1,l=-1;i<o;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(r=!0,l=i),i++;r||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,a],l=o),wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(i,r,l,s,u){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+i+"&item="+r+"&wppa-nonce="+document.getElementById("album-nonce-"+i).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==r&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+i).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+i).html(e[2]):jQuery("#albumstatus-"+i).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+i).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),u&&"0"==e[1])return jQuery("#albumstatus-"+i).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==r&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var a=0,n=-1,o=wppaAlbumUpdateMatrix.length;a<o;)wppaAlbumUpdateMatrix[a][0]==i&&wppaAlbumUpdateMatrix[a][1]==r&&(n=a),a++;wppaAlbumUpdateMatrix[n][2]=l||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(s)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,p,e){var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"))},a.open("GET",e,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status)),wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(a,e,i){if(!i&&!e&&"yes"==document.getElementById(a+"_continue").value)return document.getElementById(a+"_continue").value="no",document.getElementById(a+"_button").value="Start!",void(0<jQuery("#"+a+"_togo").html()&&(jQuery("#"+a+"_status").html("Pausing..."),jQuery("#"+a+"_button").css("display","none")));i||(document.getElementById(a+"_continue").value="yes",document.getElementById(a+"_button").value="Stop!",""==jQuery("#"+a+"_status").html()&&jQuery("#"+a+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),n=a[1],o=!1;return n?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),o=!0),jQuery("#"+n+"_status").html(a[2]),jQuery("#"+n+"_togo").html(a[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?i||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+a+", Error = "+p+", status = "+t,"force"),jQuery("#"+a+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==a&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==a&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==a&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+a+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(e),4==p.readyState&&200==p.status&&(p=(e=wppaEntityDecode(p.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+p+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(l,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+l.replace("#","H")).attr("title",e[2]),e[4])for(var a,n,o,i=e[4].split(";"),r=0;r<i.length;)a=i[r].split(":"),n=jQuery("#"+a[0]).html(),o=a[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+a[0]).html(o),r++},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+l).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(a=(a=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),p=0,a="";p<t.length;)a+=t[p],++p<t.length&&(a+="||PLUS||");return a}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",n=-1,o=-2,i=0,r=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=n,p==++i?r=!0:r?(a+=n==o?t+n+t+p:t+t+n+t+p,r=!1):a+=t+p,r||(o=p,o++),n=p),l++;for(r&&(a+=".."+n);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var p,a=[],n=0,o=0;for(t=t||".",p=jQuery(e),o=n=0;n<p.length;)p[n].selected&&(a[o]=p[n].value,o++),n++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+n+"_togo").html(a[0]);e=jQuery("#"+n+"_status").html(),a=a[1];""!=e&&""==a&&(a='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(a),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){e=e.split("|");jQuery("#"+a).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var p=0,a=0;function n(e){(e=e||window.event).preventDefault(),p=a-e.clientY,a=e.clientY,t.style.top=t.offsetTop-p+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,a=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,p){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
js/wppa-ajax-front.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsAjaxVersion = '7.7.03.002';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -141,11 +141,12 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
141
  wppaConsoleLog( 'wppaDoAjaxRender failed. Error = ' + error + ', status = ' + status, 'force' );
142
 
143
  // Do it by reload
144
- document.location.href = newurl;
145
-
146
- // Run Autocol?
147
- wppaColWidth[mocc] = 0; // force a recalc and triggers autocol if needed
148
- _wppaDoAutocol( mocc, 'ajax' );
 
149
  },
150
  complete: function( xhr, status, newurl ) {
151
  wppaWaitForCounter++;
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '8.0.00.001';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
141
  wppaConsoleLog( 'wppaDoAjaxRender failed. Error = ' + error + ', status = ' + status, 'force' );
142
 
143
  // Do it by reload
144
+ if ( newurl ) {
145
+ document.location.href = newurl;
146
+ }
147
+ else {
148
+ document.location.reload(true);
149
+ }
150
  },
151
  complete: function( xhr, status, newurl ) {
152
  wppaWaitForCounter++;
js/wppa-ajax-front.min.js CHANGED
@@ -1 +1 @@
1
- var wppaJsAjaxVersion="7.7.03.002",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(o,a,r,e,p,t){0<parseInt(p)&&p!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+o+", '"+a+"', '"+r+"', '"+e+"', "+p+" )",100):(wppaRenderAdd=e,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),t&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,e,p){var t;if(wppaRenderAdd?jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+o+"-end"):wppaRenderModal&&r?(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)})):(jQuery("#wppa-container-"+o).html(a),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r){wppaHis++,r=r.split("&amp;").join("&");try{history.pushState({page:wppaHis,occur:o,type:"html",html:a},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=o)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,e,p){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+p+", status = "+e,"force"),document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},complete:function(a,e,p){wppaWaitForCounter++,!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+o).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax")))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,e,p){document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRequestInfo(a,e,p){dialogHtml="<h3>"+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+e+", "+p+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div>";p={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(dialogHtml).dialog(p).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0),jQuery("#wppa-modal-container-"+o).dialog("close")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+p+", status = "+e,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),p="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){var e;"classic"==wppaUploadEdit&&((r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>"),e='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><link rel="stylesheet" id="wppa_cropper" href="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.css?ver="+wppaVersion+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.js?ver="+wppaVersion+'"><\/script><title>'+p+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>',r.document.write(e),r.document.write("</head>"),r.document.write("<body>"))},success:function(a,e,p){var t;"classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit&&(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"))},error:function(a,e,p){"classic"==wppaUploadEdit&&r.document.write(e+" "+p),wppaConsoleLog("wppaEditPhoto failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("<script>\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function(){window.dispatchEvent(new Event(\"DOMContentLoaded\", { 'bubbles': true }))},1000);\t\t\t\t\t\t\t\t\t\t\t\t<\/script>"),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,e,p,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+p).val(),c=0,u=0,a="";c<r.length;)r[c].selected&&(n[u]=r[c].value,u++),c++;""!=(o=jQuery("#"+e).val())&&(n[u]=o),a=n.join(),""==o&&""==p||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,e,p){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,e,p){jQuery("#"+t).html('<span style="color:red" >'+p+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDestroyAlbum(a,e){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+e,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+p+", status = "+e,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,e,p){},error:function(a,e,p){wppaConsoleLog("_bumpClickCount failed. Error = "+p+", status = "+e,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){wppaPhotoView[t]=!0},error:function(a,e,p){wppaConsoleLog("_bumpViewCount failed. Error = "+p+", status = "+e,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,e,p){wppaConsoleLog("wppaVoteThumb failed. Error = "+p+", status = "+e,"force")}})}function _wppaRateIt(o,e){var a,p,t;0!=e&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],p=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=p&&wppaRatingOnce||p<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+e+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+e).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,e,p){wppaConsoleLog("_wppaRateIt failed. Error = "+p+", status = "+e,"force")}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,e,p){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxMakeOrigName(a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+e+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,e,p){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,e,p){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,e,p){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,e,p){alert("An error occurred:\n"+p+"\nPlease try again")},complete:function(a,e,p){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,e,p){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,e,p){wppaConsoleLog("wppaAjaxComment failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a){for(var e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],p="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<e.length;)void 0!==jQuery("#"+e[t]).val()&&(p+="&"+e[t]+"="+jQuery("#"+e[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:p,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,e,p){0<a.length&&alert(a)},error:function(a,e,p){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){a=a.split("|");document.getElementById(t).src=a[0],jQuery(t).attr("title",a[1])},error:function(a,e,p){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+p+", status = "+e,"force")}}))}function wppaAjaxNotify(a,e){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+e+"&onoff="+a;jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxNotify failed. Error = "+p+", status = "+e,"force")}})}
1
+ var wppaJsAjaxVersion="8.0.00.001",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(o,a,r,e,p,t){0<parseInt(p)&&p!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+o+", '"+a+"', '"+r+"', '"+e+"', "+p+" )",100):(wppaRenderAdd=e,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),t&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,e,p){var t;if(wppaRenderAdd?jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+o+"-end"):wppaRenderModal&&r?(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)})):(jQuery("#wppa-container-"+o).html(a),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r){wppaHis++,r=r.split("&amp;").join("&");try{history.pushState({page:wppaHis,occur:o,type:"html",html:a},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=o)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,e,p){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+p+", status = "+e,"force"),r?document.location.href=r:document.location.reload(!0)},complete:function(a,e,p){wppaWaitForCounter++,!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+o).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax")))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,e,p){document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRequestInfo(a,e,p){dialogHtml="<h3>"+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+e+", "+p+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div>";p={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(dialogHtml).dialog(p).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0),jQuery("#wppa-modal-container-"+o).dialog("close")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+p+", status = "+e,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),p="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){var e;"classic"==wppaUploadEdit&&((r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>"),e='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><link rel="stylesheet" id="wppa_cropper" href="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.css?ver="+wppaVersion+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.js?ver="+wppaVersion+'"><\/script><title>'+p+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>',r.document.write(e),r.document.write("</head>"),r.document.write("<body>"))},success:function(a,e,p){var t;"classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit&&(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"))},error:function(a,e,p){"classic"==wppaUploadEdit&&r.document.write(e+" "+p),wppaConsoleLog("wppaEditPhoto failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("<script>\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function(){window.dispatchEvent(new Event(\"DOMContentLoaded\", { 'bubbles': true }))},1000);\t\t\t\t\t\t\t\t\t\t\t\t<\/script>"),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,e,p,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+p).val(),c=0,u=0,a="";c<r.length;)r[c].selected&&(n[u]=r[c].value,u++),c++;""!=(o=jQuery("#"+e).val())&&(n[u]=o),a=n.join(),""==o&&""==p||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,e,p){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,e,p){jQuery("#"+t).html('<span style="color:red" >'+p+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDestroyAlbum(a,e){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+e,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+p+", status = "+e,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,e,p){},error:function(a,e,p){wppaConsoleLog("_bumpClickCount failed. Error = "+p+", status = "+e,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){wppaPhotoView[t]=!0},error:function(a,e,p){wppaConsoleLog("_bumpViewCount failed. Error = "+p+", status = "+e,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,e,p){wppaConsoleLog("wppaVoteThumb failed. Error = "+p+", status = "+e,"force")}})}function _wppaRateIt(o,e){var a,p,t;0!=e&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],p=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=p&&wppaRatingOnce||p<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+e+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+e).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,e,p){wppaConsoleLog("_wppaRateIt failed. Error = "+p+", status = "+e,"force")}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,e,p){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxMakeOrigName(a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+e+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,e,p){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,e,p){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,e,p){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,e,p){alert("An error occurred:\n"+p+"\nPlease try again")},complete:function(a,e,p){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,e,p){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,e,p){wppaConsoleLog("wppaAjaxComment failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a){for(var e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],p="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<e.length;)void 0!==jQuery("#"+e[t]).val()&&(p+="&"+e[t]+"="+jQuery("#"+e[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:p,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,e,p){0<a.length&&alert(a)},error:function(a,e,p){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){a=a.split("|");document.getElementById(t).src=a[0],jQuery(t).attr("title",a[1])},error:function(a,e,p){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+p+", status = "+e,"force")}}))}function wppaAjaxNotify(a,e){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+e+"&onoff="+a;jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxNotify failed. Error = "+p+", status = "+e,"force")}})}
js/wppa-all.js CHANGED
@@ -1,11 +1,11 @@
1
  // wppa-utils
2
- var wppaDebug;wppaJsUtilsVersion="7.7.07.003";var wppaMakeLazyVisibleScrollEndTimer,wppaDebugCounter=0;function wppaAnimate(e,a,t,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(a),i&&setTimeout(i,10)):jQuery(e).stop().animate(a,t,p,i)}function wppaFadeIn(e,a,t){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),t&&setTimeout(t,10)):jQuery(e).stop().fadeIn(a,t)}function wppaFadeOut(e,a,t){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),t&&setTimeout(t,10)):jQuery(e).stop().fadeOut(a,t)}function wppaFadeTo(e,a,t,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:t}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(a,t,p)}function wppaTrim(e,a){e=wppaTrimLeft(e,a);return e=wppaTrimRight(e,a)}function wppaTrimLeft(e,a){var t,p,i,n,r,o,s;switch(typeof a){case"string":for(p=(t=e).length,i=a.length;i<=p&&t.substr(0,i)==a;)p=(t=t.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<a.length;)s=wppaTrimLeft(s,a[n]),n++;r=o==s}t=s;break;default:return e.replace(/^\s\s*/,"")}return t}function wppaTrimRight(e,a){var t,p,i,n,r,o,s;switch(typeof a){case"string":for(p=(t=e).length,i=a.length;i<=p&&t.substr(p-i)==a;)p=(t=t.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<a.length;)s=wppaTrimRight(s,a[n]),n++;r=o==s}t=s;break;default:return e.replace(/\s\s*$/,"")}return t}function wppa_setCookie(e,a,t){var p=new Date;p.setDate(p.getDate()+t);p=escape(a)+(null==t?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var a,t,p=document.cookie.split(";"),i=0;i<p.length;i++)if(a=p[i].substr(0,p[i].indexOf("=")),t=p[i].substr(p[i].indexOf("=")+1),(a=a.replace(/^\s+|\s+$/g,""))==e)return unescape(t);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,a){var t,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=a||(t=(new Date).getTime()%864e5,t-=60*(p=Math.floor(t/36e5))*60*1e3,t-=60*(i=Math.floor(t/6e4))*1e3,a=Math.floor(t/1e3),console.log("At: "+p+":"+i+":"+a+"."+(t-=1e3*a)+" message: "+e))}function wppaSvgHtml(e,a,t,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}a=a||"32px",t="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):t?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==t&&(t="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(a?"height:"+a+";":"")+"fill:"+s+";background-color:"+t+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(wppaMakeLazyVisible,wppaScrollEndDelay)}var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(){if(!wppaLazyBusy&&(wppaLazyBusy=!0,wppaInitMasonryPlus(),wppaLazyLoad)){var e,a=new Date,t=a.getTime();if(t<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible()},100),void(wppaLazyBusy=!1);wppaLastLazy=t,clearTimeout(wppaLazyTimer);var p=0;jQuery("*[data-src]").each(function(){e=jQuery(this).attr("data-src"),(wppaIsElementInViewport(this)||wppaIsMobile)&&(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),p++)}),0<p&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize()},500)),t=(a=new Date).getTime(),wppaLastLazy=t,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var a=jQuery(e);a[0]&&"BODY"!=a[0].nodeName;){if("none"==jQuery(a[0]).css("display"))return!1;a=jQuery(a[0]).parent()}"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight()}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,a,t){t=t?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==t?a:(wppaIsMini[e]?t/2:t)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var a=e.parentNode.clientWidth;jQuery(e).css({maxWidth:a})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,a,t=jQuery;wppaOvlOpen&&(a=wppaIsFs()?(t(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(t(".wppa-pctl-div-lb").css({position:"initial"}),t("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(a-=20),a<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(a/12-4))&&(t(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),t(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,t(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),t(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?t(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):t(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),t(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,a,t){},error:function(e,a,t){wppaConsoleLog("wppaServerLog failed. Error = "+t+", status = "+a,"force")}})}function wppaTimNow(){return(new Date).getTime()}
3
  // wppa
4
- wppaWppaVer="7.7.07.003";var wppaIsChrome=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime),wppaIsSafari=!1,wppaOvlActivePanorama=0,wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaStart,wppaStop,wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaProcessing,wppaDone,wppaUploadFailed,wppaServerError,wppaVersion="0",wppaIsIe=!1,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth,wppaAutoColumnWidth=wppaAutoColumnWidth||[],wppaAutoColumnFrac,wppaAutoColumnFrac=wppaAutoColumnFrac||[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaMiniTreshold=300,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth,wppaColWidth=wppaColWidth||[],wppaMCRWidth,wppaMCRWidth=wppaMCRWidth||[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,wppaThumbAspect=.75,wppaFilmonlyContinuous=!1,wppaNoAnimateOnMobile=!1,wppaAjaxScroll=!0,wppaFilmInit=[],wppaResizeEndDelay=200,wppaScrollEndDelay=200,wppaArtmonkeyFileNotSource=!1,wppaRequestInfoDialogText="Please specify your question",wppaGlobalFsIconSize=32,wppaFsFillcolor="#999999",wppaFsBgcolor="transparent",_wppaId=[],_wppaRealId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],_wppaLastIdx=[],_wppaStopping=[],_wppaFilename=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlIds,wppaOvlTitles,wppaOvlAlts,wppaOvlTypes,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlClosing=!1,wppaThumbSize=100,wppaTfMargin=4,wppaZoomData=[],wppaSphericData=[],wppaFsPolicy="lightbox",wppaOvlGlobal,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaIsIpad=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light",wppaCoverSpacing=8,wppaResizeEndTimer,wppaScrollEndTimer;function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips()}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var p=jQuery(this).attr("id").substr(6);wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",wppaMakeLazyVisible),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",wppaAdjustAllFilmstrips),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){jQuery(".wppa-thumb-area").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".albumlist").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".wppa-div").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize()},2e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisible()},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var p=jQuery(this).attr("href");p&&("jpg"!=(p=(p=p.split("."))[p.length-1])&&"jpeg"!=p&&"png"!=p||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisible)}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var e=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:e*a})})}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(p){wppaTimNow()<wppaLastAllAutocols+wppaExtendedResizeDelay?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,wppaExtendedResizeDelay):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(e){return jQuery(".wppa-container").each(function(){var p=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[p]&&_wppaDoAutocol(p,e)}),(e<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(e+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}),jQuery("canvas").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var e,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,a=0;a<3;)1==++a&&0!=p||(e=document.getElementById(t[a]))&&"function"==typeof e.pause&&e.pause()}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var e=jQuery("audio");if(0<e.length)for(var a=0;a<e.length;)"wppa"==jQuery(e[a]).attr("data-from")&&e[a].pause(),a++}}function wppaMakeFullsizeUrl(p){var e,a;p=(e=(p=p.replace("/thumbs/","/")).split("//"))[1]?(a=e[1].split("/"),e[0]+"//"):(a=e[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var e=document.getElementById("wppa-container-"+p);if(e){var a=0;if(!wppaAutoColumnWidth[p])return e.clientWidth;for(;0==a;)e=e.parentNode,a=jQuery(e).width();return parseInt(a*wppaAutoColumnFrac[p])}}function _wppaDoAutocol(p,e){if(!wppaAutoColumnWidth[p])return!0;var a,t,o=wppaGetContainerWidth(p);if(document.getElementById("wppa-container-"+p)){if(wppaCoverImageResponsive[p]||1<(a=jQuery(".wppa-asym-text-frame-"+p)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:o})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:o},wppaResponseSpeed))),1<(a=jQuery(".wppa-cover-box-mcr-"+p)).length){var r=document.getElementById("wppa-albumlist-"+p).clientWidth,i=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,n=i-1,s=parseInt((r+wppaCoverSpacing)/i-wppaCoverSpacing);if(wppaColWidth[p]!=r||wppaMCRWidth[p]!=s){wppaColWidth[p]=r,wppaMCRWidth[p]=s;for(var l=0;l<a.length;){switch(l%i){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case n:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:s-wppaTextFrameDelta},wppaResponseSpeed),jQuery(a[0]).width(),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:s},wppaResponseSpeed)}}else 1==a.length&&(wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+p).length&&(jQuery("#wppa-container-"+p).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+p).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+p).css("width")))&&(s=o-wppaThumbnailAreaDelta-7,t=Math.max(1,parseInt(s/(r+wppaMinThumbSpace))),t=parseInt((s-t*r)/(t+1)),jQuery(".thumbnail-frame-"+p).css({marginLeft:t})),jQuery(".thumbnail-frame-comalt-"+p).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var w,u=1,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");c;)w=c*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+u+"-"+p).css("height",w),u++,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),document.getElementById("slide_frame-"+p)&&wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*o),wppaFilmStripLength[p]=o-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",o),jQuery(".wppa-simg-"+p).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",o+10),jQuery(".wppa-mimg-"+p).css("width",o),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(o/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*o),wppaSetRealCalendarHeights(p),!0}}function wppaSetRealCalendarHeights(e){var a,t,o,p=jQuery("#wppa-real-calendar-"+e).width();0<p&&(a=!0,t=p*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+e).css({height:t}),p=p/50+2,jQuery("#wppa-real-calendar-"+e).css({fontSize:p}),p=p/4,jQuery(".wppa-real-calendar-head-td-"+e).css({marginTop:p,marginBottom:p}),o=t/2,jQuery(".wppa-realcalimg-"+e).each(function(){var p;0==this.height?a=!1:(p=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+p+"-"+e).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(e)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var e=jQuery(".wppa-mas-h-"+p),a=wppaMinThumbSpace,t=0;t<e.length;t++){var o=wppaGetChildI(e[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(e[t]).css({width:o})}}}function wppaGetChildI(p){for(var e=p.childNodes,a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var e=1;e<=wppaMaxOccur;)wppaStartHtml[e]=jQuery("#wppa-container-"+e).html(),e++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,e){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(e),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,e)):setTimeout("wppaFotomotoToolbar( "+p+',"'+e+'" )',200))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var e=["?","&","#","/",'"',"'"],a=0;a<e.length;){if(-1!=p.indexOf(e[a]))return!0;a++}return!1}function wppaPushStateSlide(p,e,a){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:e},"---",a)}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var e=0;if(wppaCanPushState){if(p.state)switch(e=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+e).html(p.state.html);break;case"slide":_wppaGoto(e,p.state.slide)}else if(wppaUpdateAddressLine){e=wppaFirstOccur,jQuery("#wppa-container-"+e).html(wppaStartHtml[e]),(wppaFirstOccur=0)==e&&(a=document.location.href.split("&wppa-occur="),e=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[e].length&&_wppaId[e][o]!=t;)o++;o<_wppaId[e].length&&_wppaGoto(e,o)}}document.getElementById("theslide0-"+e)&&_wppaStop(e)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,e){var a,t;document.selection?(p.focus(),sel=document.selection.createRange(),sel.text=e):p.selectionStart||"0"==p.selectionStart?(a=p.selectionStart,t=p.selectionEnd,p.value=p.value.substring(0,a)+e+p.value.substring(t,p.value.length),p.selectionStart=a+e.length,p.selectionEnd=a+e.length):p.value+=e}function wppaGeoInit(p,e,a){var e=new google.maps.LatLng(e,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:e},t=new google.maps.Map(document.getElementById("map-canvas-"+p),a),o=new google.maps.Marker({position:e,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(p){if(void 0!==p){for(var e=(t=(t=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<e.length;)t+=e[a],++a<e.length&&(t+="||PLUS||");return t}}function wppaUrlToId(p){var e=p.split("/wppa/");return 1==e.length&&(e=p.split("/upload/")),1==e.length?0:e=(e=(e=(e=(e=(e=(e=e[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,e){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var a=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var i=jQuery(".wppa-ss-albumcat-"+p),r="";for(n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");i=jQuery(".wppa-ss-albumtext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");i=jQuery(".wppa-ss-phototag-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var n,i=jQuery(".wppa-ss-phototext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}e&&(-1==(e=jQuery("#wppa-ss-pageurl-"+p).val()).indexOf("?")?e+="?":e+="&",e+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=e)}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,e){p=jQuery(p).length;6<p&&(p=6),p<2&&(p=2),jQuery(e).attr("size",p)}function wppaUpdateSearchRoot(p,e){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(p),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)e?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(e),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),e=0;e<p.length;)jQuery(p[e]).html(""),e++;for(p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).prop("disabled",!0),e++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).removeAttr("disabled"),e++}function wppaDisplaySelectedFiles(p){for(var e=jQuery("#"+p),a=0,t="";a<e[0].files.length;)t+=e[0].files[a].name+" ",a++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,e,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var p=jQuery(this).attr("id").substr(5),e=wppaGetContainerWidth(p)-wppaThumbnailAreaDelta,e=e/parseInt((e+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin))-wppaTfMargin;jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+p).css("width",e+"px"),jQuery("#grid-"+p).masonry({itemSelector:".grid-item-"+p,columnWidth:e,gutter:wppaTfMargin,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var p=parseInt(wppaGlobalFsIconSize/4),e=p;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(p+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var p=document.documentElement;p.requestFullscreen?p.requestFullscreen():p.mozRequestFullScreen?p.mozRequestFullScreen():p.webkitRequestFullScreen&&p.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="7.7.07.003";function wppaStoreSlideInfo(p,a,e,t,i,w,r,o,n,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){n=wppaRepairScriptTags(n),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]=wppaRepairBrTags(r),_wppaNames[p][a]=o,_wppaDsc[p][a]=n,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(o=_wppaRealId[p],_wppaLat[p][o[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][o[_wppaNxtIdx[p]]],_wppaLon[p][o[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,o=_wppaNxtIdx[p],n=(wppaNumbarMax-1)/2;o<n?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-n<o?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=o+n+.5-1,(i=o-n+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(n=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",n,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",n,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,o="#theimg"+e+"-"+p,n="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(o,wppaAnimationSpeed),setTimeout(wppaFadeIn(n,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l+"px"},wppaAnimationSpeed,"swing"),jQuery(r).css({marginLeft:l+"px"}),wppaFadeIn(n,10),wppaAnimate(r,{marginLeft:"0px"},wppaAnimationSpeed,"swing",_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l+"px"},wppaAnimationSpeed,"swing"),jQuery(r).css({marginLeft:-l+"px"}),wppaFadeIn(n,10),wppaAnimate(r,{marginLeft:"0px"},wppaAnimationSpeed,"swing",_wppaNextSlide_4(p));break;case"none":wppaFadeIn(n,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(o,wppaAnimationSpeed),wppaFadeIn(n,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),o=e.naturalWidth;void 0===o&&(o=parseInt(e.style.maxWidth));var n=e.naturalHeight;void 0===n&&(n=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*n/o))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=o||f-d<=n?l<(n+d)/(o+d)?(c=f-d,j=parseInt(c*o/n)):(j=x-d,c=parseInt(j*n/o)):(j=o,c=n),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var o,n,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaNames[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),n=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'"></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),n=".pdf"==(o=_wppaHiresUrl[p][e]).substr(o.length-4,o.length),s+='<a href="'+i+'" onclick="wppaStopAudio();wppaStopShow('+p+');" style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'">'+(n?"<iframe "+l+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),n=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'"></a>',d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if(document.getElementById("wppa-filmstrip-"+p)){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var o=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(o))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e)):(o=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(o<i?2:i<o-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w+"px"}):(i<o-1.5*w||o+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0)),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible(p,!0),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var n=0;n<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][n]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+n+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+n+"-"+p).attr("title",jQuery("#wppa-film-"+n+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+n+"-"+p).attr("title",jQuery("#wppa-film-"+n+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==n?(jQuery("#wppa-film-"+n+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+n+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+n+"-"+p).attr("title",wppaClickToView+" "+_wppaNames[p][n]),jQuery("#wppa-pre-"+n+"-"+p).attr("title",wppaClickToView+" "+_wppaNames[p][n]))),n++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?jQuery("#wppa-next-pagelink-"+p).trigger("click"):0<e.length&&jQuery(e).trigger("click")):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).trigger("click"):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t,i="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(i).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(i).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":if(wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a){if(!wppaSlideWrap[p])return void wppaPrev(p);(t=_wppaCurIdx[p]-1)<0&&(t=_wppaSlides[p].length-1)}if("r"==a){if(!wppaSlideWrap[p])return void wppaNext(p);(t=_wppaCurIdx[p]+1)==_wppaSlides[p].length&&(t=0)}wppaGotoKeepState(p,t);break;default:alert("Unimplemented instruction: "+e+" on: "+i)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden"))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
8
- var wppaJsAjaxVersion="7.7.03.002",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(o,a,r,e,p,t){0<parseInt(p)&&p!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+o+", '"+a+"', '"+r+"', '"+e+"', "+p+" )",100):(wppaRenderAdd=e,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),t&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,e,p){var t;if(wppaRenderAdd?jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+o+"-end"):wppaRenderModal&&r?(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)})):(jQuery("#wppa-container-"+o).html(a),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r){wppaHis++,r=r.split("&amp;").join("&");try{history.pushState({page:wppaHis,occur:o,type:"html",html:a},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=o)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,e,p){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+p+", status = "+e,"force"),document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},complete:function(a,e,p){wppaWaitForCounter++,!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+o).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax")))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,e,p){document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRequestInfo(a,e,p){dialogHtml="<h3>"+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+e+", "+p+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div>";p={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(dialogHtml).dialog(p).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0),jQuery("#wppa-modal-container-"+o).dialog("close")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+p+", status = "+e,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),p="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){var e;"classic"==wppaUploadEdit&&((r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>"),e='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><link rel="stylesheet" id="wppa_cropper" href="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.css?ver="+wppaVersion+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.js?ver="+wppaVersion+'"><\/script><title>'+p+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>',r.document.write(e),r.document.write("</head>"),r.document.write("<body>"))},success:function(a,e,p){var t;"classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit&&(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"))},error:function(a,e,p){"classic"==wppaUploadEdit&&r.document.write(e+" "+p),wppaConsoleLog("wppaEditPhoto failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("<script>\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function(){window.dispatchEvent(new Event(\"DOMContentLoaded\", { 'bubbles': true }))},1000);\t\t\t\t\t\t\t\t\t\t\t\t<\/script>"),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,e,p,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+p).val(),c=0,u=0,a="";c<r.length;)r[c].selected&&(n[u]=r[c].value,u++),c++;""!=(o=jQuery("#"+e).val())&&(n[u]=o),a=n.join(),""==o&&""==p||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,e,p){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,e,p){jQuery("#"+t).html('<span style="color:red" >'+p+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDestroyAlbum(a,e){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+e,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+p+", status = "+e,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,e,p){},error:function(a,e,p){wppaConsoleLog("_bumpClickCount failed. Error = "+p+", status = "+e,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){wppaPhotoView[t]=!0},error:function(a,e,p){wppaConsoleLog("_bumpViewCount failed. Error = "+p+", status = "+e,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,e,p){wppaConsoleLog("wppaVoteThumb failed. Error = "+p+", status = "+e,"force")}})}function _wppaRateIt(o,e){var a,p,t;0!=e&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],p=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=p&&wppaRatingOnce||p<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+e+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+e).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,e,p){wppaConsoleLog("_wppaRateIt failed. Error = "+p+", status = "+e,"force")}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,e,p){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxMakeOrigName(a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+e+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,e,p){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,e,p){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,e,p){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,e,p){alert("An error occurred:\n"+p+"\nPlease try again")},complete:function(a,e,p){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,e,p){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,e,p){wppaConsoleLog("wppaAjaxComment failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a){for(var e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],p="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<e.length;)void 0!==jQuery("#"+e[t]).val()&&(p+="&"+e[t]+"="+jQuery("#"+e[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:p,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,e,p){0<a.length&&alert(a)},error:function(a,e,p){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){a=a.split("|");document.getElementById(t).src=a[0],jQuery(t).attr("title",a[1])},error:function(a,e,p){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+p+", status = "+e,"force")}}))}function wppaAjaxNotify(a,e){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+e+"&onoff="+a;jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxNotify failed. Error = "+p+", status = "+e,"force")}})}
9
  // wppa-lightbox
10
  var wppaSavedContainerHeight,wppaSavedMarginLeft,wppaSavedMarginTop,wppaSavedImageWidth,wppaSavedImageHeight,wppaJsLightboxVersion="7.7.03.001",wppaIsVideo=!1,wppaHasAudio=!1,wppaOvlIsPdf=!1,wppaOvlImgs=[],wppaKbHandlerInstalled=!1,wppaOvlCurIdx=0,wppaOvlSvgInverse=!1,wppaOvlHasPanoramas=!1,wppaGlobalOvlPanoramaId=0,wppaOvlBrowseOnClick=!1,wppaOvlGlobal=!1,wppaWppaOverlayActivated=!1,wppaOvlTimer=0,wppaSavedContainerWidth=0;function wppaOvlKeyboardHandler(a){var p,t=(p=(null==a?event:a).keyCode,27),a=String.fromCharCode(p).toLowerCase();switch(p){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(a){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(a){var p,t,e=jQuery;if(0<wppaOvlActivePanorama||e("#wppa-overlay-ic").css({top:"50%",left:"50%"}),e("#wppa-overlay-bg").stop().fadeTo(3,wppaOvlOpacity),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof a){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!(wppaOvlImgs=[]);var l=(a.rel||!!e(a).attr("data-rel")&&e(a).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],n=e("a"),w=0,d=0;d<n.length;d++)1<(l=!!e(o=n[d]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[w]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[w]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[w]=wppaRepairScriptTags(o.title),wppaOvlIds[w]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[w]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[w]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[w]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[w]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[w]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[w]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",0<(p=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"").length?(wppaOvlHasPanoramas=!0,t=p.indexOf("."),wppaOvlPanoramaHtml[w]=p.substr(t+1),wppaOvlPanoramaIds[w]=p.substr(0,t),wppaOvlTypes[w]="panorama"):(wppaOvlPanoramaHtml[w]="",wppaOvlPanoramaIds[w]=0,wppaOvlTypes[w]=""),0<wppaOvlPdfHtmls[w].length&&(wppaOvlTypes[w]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(a).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(a).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(a).attr("data-audiohtml"))&&o.href==a.href&&(wppaOvlIdx=w),w++);else wppaOvlUrls[0]=a.href,e(a).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(a).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(a.title),wppaOvlIds[0]=e(a).attr("data-id")?e(a).attr("data-id"):"0",wppaOvlAlts[0]=e(a).attr("data-alt")?e(a).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(a).attr("data-videohtml")?decodeURI(e(a).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(a).attr("data-audiohtml")?decodeURI(e(a).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(a).attr("data-pdfhtml")?decodeURI(e(a).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(a).attr("data-videonatwidth")?e(a).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(a).attr("data-videonatheight")?e(a).attr("data-videonatheight"):"",0<(p=e(a).attr("data-panorama")?e(a).attr("data-panorama"):"").length?(wppaOvlHasPanoramas=!0,t=p.indexOf("."),wppaOvlPanoramaHtml[0]=p.substr(t+1),wppaOvlPanoramaIds[0]=p.substr(0,t),wppaOvlTypes[0]="panorama"):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=a;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(a){var p=jQuery;wppaOvlCurIdx=a,wppaOvlFirst&&p("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[a],wppaHasAudio=""!=wppaOvlAudioHtmls[a],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[a];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if("panorama"!=wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t],wppaConsoleLog("Preloading next "+wppaOvlUrls[t]+" index = "+t)),"panorama"!=wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e],wppaConsoleLog("Preloading previous "+wppaOvlUrls[e]+" index = "+e)),_bumpViewCount(wppaOvlIds[a]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[a],wppaOvlActivePanorama?p("#wppa-overlay-ic").css({top:0,left:0}):p("#wppa-overlay-ic").css({top:"50%",left:"50%",display:"block"}),wppaIsFs()||wppaOvlActivePanorama)return wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[a]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" >'+wppaOvlVideoHtmls[a]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[a]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[a]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[a]+"</audio>"),l+="</div>"),(wppaIsVideo||wppaHasAudio)&&wppaOvlFsPhotoId==wppaPhotoId&&0!=wppaPhotoId||(wppaStopVideo(0),wppaStopAudio(),p("#wppa-overlay-ic").html(l)),0<wppaOvlPanoramaIds[a]&&wppaOvlIsSingle&&p(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,wppaFsShow(),wppaProtect(),!1;wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;p("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" >'+wppaOvlVideoHtmls[a]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[a]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[a]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[a]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[a],l+="</div>",l+="</div>",p("#wppa-overlay-ic").html(l),wppaFsShow(),p("#wppa-overlay-img").bind("contextmenu",function(a){return!1}),0==wppaOvlPanoramaIds[a]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(a){var p=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=p("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),n=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,n=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/n)?e:t)<1&&(l=parseInt(l*t),n=parseInt(n*t));var t=p("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/n),i=(wppaOvlPadTop,parseInt((o-i)/2),i);n<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(n=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*n/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+p("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),p("#wppa-overlay-img").stop().animate({width:wppaSavedImageWidth,height:wppaSavedImageHeight},a),p("#wppa-overlay-ic").stop().animate({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},a),o?(p("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},a+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var a,p=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)a=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)a=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(a=document.getElementById("wppa-overlay-img"),!(wppaIsIe||a&&a.complete))return void setTimeout(wppaOvlFormatFull,200);o=a.naturalWidth,i=a.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),p(a).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),p(a).css({visibility:"visible"}),p("#wppa-ovl-full-bg").css({overflow:"hidden"}),p("#wppa-ovl-full-bg").scrollTop(0),p("#wppa-ovl-full-bg").scrollLeft(0),p("#wppa-ovl-spin").hide(),p("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=p("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",p("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var a=document.getElementById("wppa-overlay-audio");a&&"function"==typeof a.play&&a.play()}function wppaOvlStartStop(){var a=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&a("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&a("#wppa-ovl-next-btn").css("visibility","visible")),a("#wppa-ovl-stop-btn").hide(),a("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),a("#wppa-ovl-stop-btn").show(),a("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo){var a=document.getElementById("wppa-overlay-img");if(a&&!wppaIsIe&&!a.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var a=wppaOvlCurIdx-1;a<0&&(a=wppaOvlUrls.length-1);var p=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[a]||wppaIsIe||p.complete||!wppaOvlOpen?wppaOvlShow(a):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var a=wppaOvlCurIdx+1;a>wppaOvlUrls.length-1&&(a=0);var p=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[a]||wppaIsIe||p.complete||!wppaOvlOpen?wppaOvlShow(a):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var a,p;wppaOvlOpen&&(a=wppaOvlCurIdx,p=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(a),p&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(a){var p=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),a||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),p("#wppa-overlay-ic").html(""),p("#wppa-overlay-ic").hide(),p(document).off("keydown",wppaOvlKeyboardHandler),wppaOvlFirst=!(wppaKbHandlerInstalled=!1),wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),p("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,p("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),p(window).trigger("wppalightboxend"),p(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(a)},250):(wppaOvlClosing=!1,a||setTimeout(function(){p("#wppa-overlay-bg").hide(),p("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(a){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var p=a.screenX-window.screenX;48<a.clientY&&(p<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var a=e(this),p=a.find("IMG[alt]").attr("alt")||"",t=a.find(".wp-caption-text").html()||"",a=a.find("a"),t=p+"<br>"+t;a.attr("data-lbtitle")||a.attr("data-lbtitle",t)});var a,p,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),p=0;p<t.length;p++)if(a=t[p],e(a).attr("data-rel")?l=e(a).attr("data-rel").split("["):a.rel?l=a.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(a).on("click",function(a){wppaOvlShow(this),a.preventDefault()}),wppaMagnifierCursor){case"pointer":e(a).css("cursor","pointer");break;case"":e(a).css("cursor","default");break;default:e(a).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}wppaIsMobile&&window.addEventListener("orientationchange",wppaOvlShowSame),e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(a){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(a.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var a=wppaIsMobile?"ontouchstart":"onclick",p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" '+a+'="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" '+a+'="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" '+a+'="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" '+a+'="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" '+a+'="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" '+a+'="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" '+a+'="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(a){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
11
  // wppa-popup
1
  // wppa-utils
2
+ var wppaDebug;wppaJsUtilsVersion="8.0.00.004";var wppaMakeLazyVisibleScrollEndTimer,wppaDebugCounter=0;function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(wppaMakeLazyVisible,wppaScrollEndDelay)}var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(){if(!wppaLazyBusy&&(wppaLazyBusy=!0,wppaInitMasonryPlus(),wppaLazyLoad)){var e,t=new Date,a=t.getTime();if(a<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible()},100),void(wppaLazyBusy=!1);wppaLastLazy=a,clearTimeout(wppaLazyTimer);var p=0;jQuery("*[data-src]").each(function(){e=jQuery(this).attr("data-src"),(wppaIsElementInViewport(this)||wppaIsMobile)&&(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),p++)}),0<p&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery(".wppa-box").trigger("scroll")},250)),a=(t=new Date).getTime(),wppaLastLazy=a,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;t=jQuery(t[0]).parent()}"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight()}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}
3
  // wppa
4
+ wppaWppaVer="8.0.00.001";var wppaIsChrome=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime),wppaIsSafari=!1,wppaOvlActivePanorama=0,wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaStart,wppaStop,wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaProcessing,wppaDone,wppaUploadFailed,wppaServerError,wppaVersion="0",wppaIsIe=!1,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth,wppaAutoColumnWidth=wppaAutoColumnWidth||[],wppaAutoColumnFrac,wppaAutoColumnFrac=wppaAutoColumnFrac||[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaMiniTreshold=300,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth,wppaColWidth=wppaColWidth||[],wppaMCRWidth,wppaMCRWidth=wppaMCRWidth||[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,wppaThumbAspect=.75,wppaFilmonlyContinuous=!1,wppaNoAnimateOnMobile=!1,wppaAjaxScroll=!0,wppaFilmInit=[],wppaResizeEndDelay=200,wppaScrollEndDelay=200,wppaArtmonkeyFileNotSource=!1,wppaRequestInfoDialogText="Please specify your question",wppaGlobalFsIconSize=32,wppaFsFillcolor="#999999",wppaFsBgcolor="transparent",_wppaId=[],_wppaRealId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],_wppaLastIdx=[],_wppaStopping=[],_wppaFilename=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlIds,wppaOvlTitles,wppaOvlAlts,wppaOvlTypes,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlClosing=!1,wppaThumbSize=100,wppaTfMargin=4,wppaZoomData=[],wppaSphericData=[],wppaFsPolicy="lightbox",wppaOvlGlobal,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaIsIpad=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light",wppaCoverSpacing=8,wppaResizeEndTimer,wppaScrollEndTimer;function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips()}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var p=jQuery(this).attr("id").substr(6);wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",wppaMakeLazyVisible),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",wppaAdjustAllFilmstrips),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){jQuery(".wppa-thumb-area").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".albumlist").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".wppa-div").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize()},2e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisible()},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var p=jQuery(this).attr("href");p&&("jpg"!=(p=(p=p.split("."))[p.length-1])&&"jpeg"!=p&&"png"!=p||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisible)}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var e=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:e*a})})}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(p){wppaTimNow()<wppaLastAllAutocols+wppaExtendedResizeDelay?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,wppaExtendedResizeDelay):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(e){return jQuery(".wppa-container").each(function(){var p=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[p]&&_wppaDoAutocol(p,e)}),(e<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(e+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}),jQuery("canvas").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var e,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,a=0;a<3;)1==++a&&0!=p||(e=document.getElementById(t[a]))&&"function"==typeof e.pause&&e.pause()}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var e=jQuery("audio");if(0<e.length)for(var a=0;a<e.length;)"wppa"==jQuery(e[a]).attr("data-from")&&e[a].pause(),a++}}function wppaMakeFullsizeUrl(p){var e,a;p=(e=(p=p.replace("/thumbs/","/")).split("//"))[1]?(a=e[1].split("/"),e[0]+"//"):(a=e[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var e=document.getElementById("wppa-container-"+p);if(e){var a=0;if(!wppaAutoColumnWidth[p])return e.clientWidth;for(;0==a;)e=e.parentNode,a=jQuery(e).width();return parseInt(a*wppaAutoColumnFrac[p])}}function _wppaDoAutocol(p,e){if(!wppaAutoColumnWidth[p])return!0;var a,t,o=wppaGetContainerWidth(p);if(document.getElementById("wppa-container-"+p)){if(wppaCoverImageResponsive[p]||1<(a=jQuery(".wppa-asym-text-frame-"+p)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:o})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:o},wppaResponseSpeed))),1<(a=jQuery(".wppa-cover-box-mcr-"+p)).length){var r=document.getElementById("wppa-albumlist-"+p).clientWidth,i=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,n=i-1,s=parseInt((r+wppaCoverSpacing)/i-wppaCoverSpacing);if(wppaColWidth[p]!=r||wppaMCRWidth[p]!=s){wppaColWidth[p]=r,wppaMCRWidth[p]=s;for(var l=0;l<a.length;){switch(l%i){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case n:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:s-wppaTextFrameDelta},wppaResponseSpeed),jQuery(a[0]).width(),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:s},wppaResponseSpeed)}}else 1==a.length&&(wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+p).length&&(jQuery("#wppa-container-"+p).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+p).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+p).css("width")))&&(s=o-wppaThumbnailAreaDelta-7,t=Math.max(1,parseInt(s/(r+wppaMinThumbSpace))),t=parseInt((s-t*r)/(t+1)),jQuery(".thumbnail-frame-"+p).css({marginLeft:t})),jQuery(".thumbnail-frame-comalt-"+p).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var w,u=1,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");c;)w=c*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+u+"-"+p).css("height",w),u++,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),document.getElementById("slide_frame-"+p)&&wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*o),wppaFilmStripLength[p]=o-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",o),jQuery(".wppa-simg-"+p).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",o+10),jQuery(".wppa-mimg-"+p).css("width",o),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(o/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*o),wppaSetRealCalendarHeights(p),!0}}function wppaSetRealCalendarHeights(e){var a,t,o,p=jQuery("#wppa-real-calendar-"+e).width();0<p&&(a=!0,t=p*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+e).css({height:t}),p=p/50+2,jQuery("#wppa-real-calendar-"+e).css({fontSize:p}),p=p/4,jQuery(".wppa-real-calendar-head-td-"+e).css({marginTop:p,marginBottom:p}),o=t/2,jQuery(".wppa-realcalimg-"+e).each(function(){var p;0==this.height?a=!1:(p=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+p+"-"+e).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(e)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var e=jQuery(".wppa-mas-h-"+p),a=wppaMinThumbSpace,t=0;t<e.length;t++){var o=wppaGetChildI(e[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(e[t]).css({width:o})}}}function wppaGetChildI(p){for(var e=p.childNodes,a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var e=1;e<=wppaMaxOccur;)wppaStartHtml[e]=jQuery("#wppa-container-"+e).html(),e++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,e){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(e),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,e)):setTimeout("wppaFotomotoToolbar( "+p+',"'+e+'" )',200))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var e=["?","&","#","/",'"',"'"],a=0;a<e.length;){if(-1!=p.indexOf(e[a]))return!0;a++}return!1}function wppaPushStateSlide(p,e,a){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:e},"---",a)}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var e=0;if(wppaCanPushState){if(p.state)switch(e=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+e).html(p.state.html);break;case"slide":_wppaGoto(e,p.state.slide)}else if(wppaUpdateAddressLine){e=wppaFirstOccur,jQuery("#wppa-container-"+e).html(wppaStartHtml[e]),(wppaFirstOccur=0)==e&&(a=document.location.href.split("&wppa-occur="),e=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[e].length&&_wppaId[e][o]!=t;)o++;o<_wppaId[e].length&&_wppaGoto(e,o)}}document.getElementById("theslide0-"+e)&&_wppaStop(e)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,e){var a,t;document.selection?(p.focus(),sel=document.selection.createRange(),sel.text=e):p.selectionStart||"0"==p.selectionStart?(a=p.selectionStart,t=p.selectionEnd,p.value=p.value.substring(0,a)+e+p.value.substring(t,p.value.length),p.selectionStart=a+e.length,p.selectionEnd=a+e.length):p.value+=e}function wppaGeoInit(p,e,a){var e=new google.maps.LatLng(e,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:e},t=new google.maps.Map(document.getElementById("map-canvas-"+p),a),o=new google.maps.Marker({position:e,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(p){if(void 0!==p){for(var e=(t=(t=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<e.length;)t+=e[a],++a<e.length&&(t+="||PLUS||");return t}}function wppaUrlToId(p){var e=p.split("/wppa/");return 1==e.length&&(e=p.split("/upload/")),1==e.length?0:e=(e=(e=(e=(e=(e=(e=e[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,e){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var a=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var i=jQuery(".wppa-ss-albumcat-"+p),r="";for(n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");i=jQuery(".wppa-ss-albumtext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");i=jQuery(".wppa-ss-phototag-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var n,i=jQuery(".wppa-ss-phototext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}e&&(-1==(e=jQuery("#wppa-ss-pageurl-"+p).val()).indexOf("?")?e+="?":e+="&",e+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=e)}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,e){p=jQuery(p).length;6<p&&(p=6),p<2&&(p=2),jQuery(e).attr("size",p)}function wppaUpdateSearchRoot(p,e){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(p),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)e?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(e),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),e=0;e<p.length;)jQuery(p[e]).html(""),e++;for(p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).prop("disabled",!0),e++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).removeAttr("disabled"),e++}function wppaDisplaySelectedFiles(p){for(var e=jQuery("#"+p),a=0,t="";a<e[0].files.length;)t+=e[0].files[a].name+" ",a++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,e,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var p=jQuery(this).attr("id").substr(5),e=wppaGetContainerWidth(p)-wppaThumbnailAreaDelta,e=e/parseInt((e+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin))-wppaTfMargin;jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+p).css("width",e+"px"),jQuery("#grid-"+p).masonry({itemSelector:".grid-item-"+p,columnWidth:e,gutter:wppaTfMargin,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var p=parseInt(wppaGlobalFsIconSize/4),e=p;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(p+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var p=document.documentElement;p.requestFullscreen?p.requestFullscreen():p.mozRequestFullScreen?p.mozRequestFullScreen():p.webkitRequestFullScreen&&p.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="7.7.07.003";function wppaStoreSlideInfo(p,a,e,t,i,w,r,o,n,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){n=wppaRepairScriptTags(n),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]=wppaRepairBrTags(r),_wppaNames[p][a]=o,_wppaDsc[p][a]=n,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(o=_wppaRealId[p],_wppaLat[p][o[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][o[_wppaNxtIdx[p]]],_wppaLon[p][o[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,o=_wppaNxtIdx[p],n=(wppaNumbarMax-1)/2;o<n?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-n<o?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=o+n+.5-1,(i=o-n+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(n=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",n,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",n,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,o="#theimg"+e+"-"+p,n="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(o,wppaAnimationSpeed),setTimeout(wppaFadeIn(n,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l+"px"},wppaAnimationSpeed,"swing"),jQuery(r).css({marginLeft:l+"px"}),wppaFadeIn(n,10),wppaAnimate(r,{marginLeft:"0px"},wppaAnimationSpeed,"swing",_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l+"px"},wppaAnimationSpeed,"swing"),jQuery(r).css({marginLeft:-l+"px"}),wppaFadeIn(n,10),wppaAnimate(r,{marginLeft:"0px"},wppaAnimationSpeed,"swing",_wppaNextSlide_4(p));break;case"none":wppaFadeIn(n,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(o,wppaAnimationSpeed),wppaFadeIn(n,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),o=e.naturalWidth;void 0===o&&(o=parseInt(e.style.maxWidth));var n=e.naturalHeight;void 0===n&&(n=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*n/o))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=o||f-d<=n?l<(n+d)/(o+d)?(c=f-d,j=parseInt(c*o/n)):(j=x-d,c=parseInt(j*n/o)):(j=o,c=n),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var o,n,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaNames[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),n=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'"></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),n=".pdf"==(o=_wppaHiresUrl[p][e]).substr(o.length-4,o.length),s+='<a href="'+i+'" onclick="wppaStopAudio();wppaStopShow('+p+');" style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'">'+(n?"<iframe "+l+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),n=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(n?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+wppaRel+'="'+wppaLightBox[p]+u+'"></a>',d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if(document.getElementById("wppa-filmstrip-"+p)){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var o=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(o))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e)):(o=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(o<i?2:i<o-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w+"px"}):(i<o-1.5*w||o+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e+"px"},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0)),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible(p,!0),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var n=0;n<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][n]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+n+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+n+"-"+p).attr("title",jQuery("#wppa-film-"+n+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+n+"-"+p).attr("title",jQuery("#wppa-film-"+n+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==n?(jQuery("#wppa-film-"+n+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+n+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+n+"-"+p).attr("title",wppaClickToView+" "+_wppaNames[p][n]),jQuery("#wppa-pre-"+n+"-"+p).attr("title",wppaClickToView+" "+_wppaNames[p][n]))),n++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?jQuery("#wppa-next-pagelink-"+p).trigger("click"):0<e.length&&jQuery(e).trigger("click")):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).trigger("click"):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t,i="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(i).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(i).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":if(wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a){if(!wppaSlideWrap[p])return void wppaPrev(p);(t=_wppaCurIdx[p]-1)<0&&(t=_wppaSlides[p].length-1)}if("r"==a){if(!wppaSlideWrap[p])return void wppaNext(p);(t=_wppaCurIdx[p]+1)==_wppaSlides[p].length&&(t=0)}wppaGotoKeepState(p,t);break;default:alert("Unimplemented instruction: "+e+" on: "+i)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden"))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
8
+ var wppaJsAjaxVersion="8.0.00.001",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(o,a,r,e,p,t){0<parseInt(p)&&p!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+o+", '"+a+"', '"+r+"', '"+e+"', "+p+" )",100):(wppaRenderAdd=e,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),t&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,e,p){var t;if(wppaRenderAdd?jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+o+"-end"):wppaRenderModal&&r?(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)})):(jQuery("#wppa-container-"+o).html(a),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r){wppaHis++,r=r.split("&amp;").join("&");try{history.pushState({page:wppaHis,occur:o,type:"html",html:a},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=o)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,e,p){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+p+", status = "+e,"force"),r?document.location.href=r:document.location.reload(!0)},complete:function(a,e,p){wppaWaitForCounter++,!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+o).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax")))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,e,p){document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxRequestInfo(a,e,p){dialogHtml="<h3>"+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+e+", "+p+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div>";p={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(dialogHtml).dialog(p).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0),jQuery("#wppa-modal-container-"+o).dialog("close")):alert(a),n&&document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+p+", status = "+e,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),p="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){var e;"classic"==wppaUploadEdit&&((r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>"),e='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><link rel="stylesheet" id="wppa_cropper" href="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.css?ver="+wppaVersion+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/vendor/cropperjs/dist/cropper.min.js?ver="+wppaVersion+'"><\/script><title>'+p+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>',r.document.write(e),r.document.write("</head>"),r.document.write("<body>"))},success:function(a,e,p){var t;"classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit&&(t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""},jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"))},error:function(a,e,p){"classic"==wppaUploadEdit&&r.document.write(e+" "+p),wppaConsoleLog("wppaEditPhoto failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("<script>\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function(){window.dispatchEvent(new Event(\"DOMContentLoaded\", { 'bubbles': true }))},1000);\t\t\t\t\t\t\t\t\t\t\t\t<\/script>"),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,e,p,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+p).val(),c=0,u=0,a="";c<r.length;)r[c].selected&&(n[u]=r[c].value,u++),c++;""!=(o=jQuery("#"+e).val())&&(n[u]=o),a=n.join(),""==o&&""==p||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,e,p){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,e,p){jQuery("#"+t).html('<span style="color:red" >'+p+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxDestroyAlbum(a,e){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+e,async:!0,type:"GET",timeout:6e4,success:function(a,e,p){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,e,p){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+p+", status = "+e,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,e,p){},error:function(a,e,p){wppaConsoleLog("_bumpClickCount failed. Error = "+p+", status = "+e,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){wppaPhotoView[t]=!0},error:function(a,e,p){wppaConsoleLog("_bumpViewCount failed. Error = "+p+", status = "+e,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,e,p){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,e,p){wppaConsoleLog("wppaVoteThumb failed. Error = "+p+", status = "+e,"force")}})}function _wppaRateIt(o,e){var a,p,t;0!=e&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],p=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=p&&wppaRatingOnce||p<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+e+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+e).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,e,p){wppaConsoleLog("_wppaRateIt failed. Error = "+p+", status = "+e,"force")}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,e,p){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,e,p){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+p+", status = "+e,"force")}})}function wppaAjaxMakeOrigName(a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+e+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,e,p){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,e,p){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,e,p){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,e,p){alert("An error occurred:\n"+p+"\nPlease try again")},complete:function(a,e,p){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,e,p){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,e,p){wppaConsoleLog("wppaAjaxComment failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a){for(var e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],p="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<e.length;)void 0!==jQuery("#"+e[t]).val()&&(p+="&"+e[t]+"="+jQuery("#"+e[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:p,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,e,p){0<a.length&&alert(a)},error:function(a,e,p){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+p+", status = "+e,"force")},complete:function(a,e,p){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){a=a.split("|");document.getElementById(t).src=a[0],jQuery(t).attr("title",a[1])},error:function(a,e,p){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+p+", status = "+e,"force")}}))}function wppaAjaxNotify(a,e){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+e+"&onoff="+a;jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,e,p){alert(a)},error:function(a,e,p){wppaConsoleLog("wppaAjaxNotify failed. Error = "+p+", status = "+e,"force")}})}
9
  // wppa-lightbox
10
  var wppaSavedContainerHeight,wppaSavedMarginLeft,wppaSavedMarginTop,wppaSavedImageWidth,wppaSavedImageHeight,wppaJsLightboxVersion="7.7.03.001",wppaIsVideo=!1,wppaHasAudio=!1,wppaOvlIsPdf=!1,wppaOvlImgs=[],wppaKbHandlerInstalled=!1,wppaOvlCurIdx=0,wppaOvlSvgInverse=!1,wppaOvlHasPanoramas=!1,wppaGlobalOvlPanoramaId=0,wppaOvlBrowseOnClick=!1,wppaOvlGlobal=!1,wppaWppaOverlayActivated=!1,wppaOvlTimer=0,wppaSavedContainerWidth=0;function wppaOvlKeyboardHandler(a){var p,t=(p=(null==a?event:a).keyCode,27),a=String.fromCharCode(p).toLowerCase();switch(p){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(a){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(a){var p,t,e=jQuery;if(0<wppaOvlActivePanorama||e("#wppa-overlay-ic").css({top:"50%",left:"50%"}),e("#wppa-overlay-bg").stop().fadeTo(3,wppaOvlOpacity),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof a){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!(wppaOvlImgs=[]);var l=(a.rel||!!e(a).attr("data-rel")&&e(a).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],n=e("a"),w=0,d=0;d<n.length;d++)1<(l=!!e(o=n[d]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[w]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[w]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[w]=wppaRepairScriptTags(o.title),wppaOvlIds[w]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[w]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[w]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[w]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[w]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[w]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[w]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",0<(p=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"").length?(wppaOvlHasPanoramas=!0,t=p.indexOf("."),wppaOvlPanoramaHtml[w]=p.substr(t+1),wppaOvlPanoramaIds[w]=p.substr(0,t),wppaOvlTypes[w]="panorama"):(wppaOvlPanoramaHtml[w]="",wppaOvlPanoramaIds[w]=0,wppaOvlTypes[w]=""),0<wppaOvlPdfHtmls[w].length&&(wppaOvlTypes[w]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(a).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(a).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(a).attr("data-audiohtml"))&&o.href==a.href&&(wppaOvlIdx=w),w++);else wppaOvlUrls[0]=a.href,e(a).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(a).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(a.title),wppaOvlIds[0]=e(a).attr("data-id")?e(a).attr("data-id"):"0",wppaOvlAlts[0]=e(a).attr("data-alt")?e(a).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(a).attr("data-videohtml")?decodeURI(e(a).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(a).attr("data-audiohtml")?decodeURI(e(a).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(a).attr("data-pdfhtml")?decodeURI(e(a).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(a).attr("data-videonatwidth")?e(a).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(a).attr("data-videonatheight")?e(a).attr("data-videonatheight"):"",0<(p=e(a).attr("data-panorama")?e(a).attr("data-panorama"):"").length?(wppaOvlHasPanoramas=!0,t=p.indexOf("."),wppaOvlPanoramaHtml[0]=p.substr(t+1),wppaOvlPanoramaIds[0]=p.substr(0,t),wppaOvlTypes[0]="panorama"):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=a;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(a){var p=jQuery;wppaOvlCurIdx=a,wppaOvlFirst&&p("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[a],wppaHasAudio=""!=wppaOvlAudioHtmls[a],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[a];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if("panorama"!=wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t],wppaConsoleLog("Preloading next "+wppaOvlUrls[t]+" index = "+t)),"panorama"!=wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e],wppaConsoleLog("Preloading previous "+wppaOvlUrls[e]+" index = "+e)),_bumpViewCount(wppaOvlIds[a]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[a],wppaOvlActivePanorama?p("#wppa-overlay-ic").css({top:0,left:0}):p("#wppa-overlay-ic").css({top:"50%",left:"50%",display:"block"}),wppaIsFs()||wppaOvlActivePanorama)return wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[a]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" >'+wppaOvlVideoHtmls[a]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[a]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[a]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[a]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[a]+"</audio>"),l+="</div>"),(wppaIsVideo||wppaHasAudio)&&wppaOvlFsPhotoId==wppaPhotoId&&0!=wppaPhotoId||(wppaStopVideo(0),wppaStopAudio(),p("#wppa-overlay-ic").html(l)),0<wppaOvlPanoramaIds[a]&&wppaOvlIsSingle&&p(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,wppaFsShow(),wppaProtect(),!1;wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;p("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" >'+wppaOvlVideoHtmls[a]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[a]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[a]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[a]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[a]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[a],l+="</div>",l+="</div>",p("#wppa-overlay-ic").html(l),wppaFsShow(),p("#wppa-overlay-img").bind("contextmenu",function(a){return!1}),0==wppaOvlPanoramaIds[a]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(a){var p=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=p("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),n=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,n=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/n)?e:t)<1&&(l=parseInt(l*t),n=parseInt(n*t));var t=p("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/n),i=(wppaOvlPadTop,parseInt((o-i)/2),i);n<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(n=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*n/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+p("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),p("#wppa-overlay-img").stop().animate({width:wppaSavedImageWidth,height:wppaSavedImageHeight},a),p("#wppa-overlay-ic").stop().animate({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},a),o?(p("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},a+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var a,p=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)a=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)a=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(a=document.getElementById("wppa-overlay-img"),!(wppaIsIe||a&&a.complete))return void setTimeout(wppaOvlFormatFull,200);o=a.naturalWidth,i=a.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),p(a).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),p(a).css({visibility:"visible"}),p("#wppa-ovl-full-bg").css({overflow:"hidden"}),p("#wppa-ovl-full-bg").scrollTop(0),p("#wppa-ovl-full-bg").scrollLeft(0),p("#wppa-ovl-spin").hide(),p("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=p("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",p("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var a=document.getElementById("wppa-overlay-audio");a&&"function"==typeof a.play&&a.play()}function wppaOvlStartStop(){var a=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&a("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&a("#wppa-ovl-next-btn").css("visibility","visible")),a("#wppa-ovl-stop-btn").hide(),a("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),a("#wppa-ovl-stop-btn").show(),a("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo){var a=document.getElementById("wppa-overlay-img");if(a&&!wppaIsIe&&!a.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var a=wppaOvlCurIdx-1;a<0&&(a=wppaOvlUrls.length-1);var p=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[a]||wppaIsIe||p.complete||!wppaOvlOpen?wppaOvlShow(a):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var a=wppaOvlCurIdx+1;a>wppaOvlUrls.length-1&&(a=0);var p=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[a]||wppaIsIe||p.complete||!wppaOvlOpen?wppaOvlShow(a):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var a,p;wppaOvlOpen&&(a=wppaOvlCurIdx,p=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(a),p&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(a){var p=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),a||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),p("#wppa-overlay-ic").html(""),p("#wppa-overlay-ic").hide(),p(document).off("keydown",wppaOvlKeyboardHandler),wppaOvlFirst=!(wppaKbHandlerInstalled=!1),wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),p("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,p("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),p(window).trigger("wppalightboxend"),p(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(a)},250):(wppaOvlClosing=!1,a||setTimeout(function(){p("#wppa-overlay-bg").hide(),p("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(a){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var p=a.screenX-window.screenX;48<a.clientY&&(p<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var a=e(this),p=a.find("IMG[alt]").attr("alt")||"",t=a.find(".wp-caption-text").html()||"",a=a.find("a"),t=p+"<br>"+t;a.attr("data-lbtitle")||a.attr("data-lbtitle",t)});var a,p,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),p=0;p<t.length;p++)if(a=t[p],e(a).attr("data-rel")?l=e(a).attr("data-rel").split("["):a.rel?l=a.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(a).on("click",function(a){wppaOvlShow(this),a.preventDefault()}),wppaMagnifierCursor){case"pointer":e(a).css("cursor","pointer");break;case"":e(a).css("cursor","default");break;default:e(a).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}wppaIsMobile&&window.addEventListener("orientationchange",wppaOvlShowSame),e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(a){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(a.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var a=wppaIsMobile?"ontouchstart":"onclick",p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" '+a+'="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" '+a+'="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" '+a+'="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" '+a+'="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" '+a+'="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" '+a+'="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" '+a+'="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(a){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
11
  // wppa-popup
js/wppa-utils.js CHANGED
@@ -2,7 +2,7 @@
2
  //
3
  // conatins common vars and functions
4
  //
5
- wppaJsUtilsVersion = '7.7.07.003';
6
  var wppaDebug;
7
  var wppaDebugCounter = 0;
8
 
@@ -421,6 +421,11 @@ function wppaMakeLazyVisible() {
421
  jQuery( "div" ).getNiceScroll().resize();
422
  },500);
423
  }
 
 
 
 
 
424
  }
425
 
426
  d = new Date();
2
  //
3
  // conatins common vars and functions
4
  //
5
+ wppaJsUtilsVersion = '8.0.00.004';
6
  var wppaDebug;
7
  var wppaDebugCounter = 0;
8
 
421
  jQuery( "div" ).getNiceScroll().resize();
422
  },500);
423
  }
424
+
425
+ // Fake a scroll
426
+ setTimeout( function(){
427
+ jQuery(".wppa-box").trigger("scroll");
428
+ }, 250);
429
  }
430
 
431
  d = new Date();
js/wppa-utils.min.js CHANGED
@@ -1 +1 @@
1
- var wppaDebug;wppaJsUtilsVersion="7.7.07.003";var wppaMakeLazyVisibleScrollEndTimer,wppaDebugCounter=0;function wppaAnimate(e,a,t,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(a),i&&setTimeout(i,10)):jQuery(e).stop().animate(a,t,p,i)}function wppaFadeIn(e,a,t){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),t&&setTimeout(t,10)):jQuery(e).stop().fadeIn(a,t)}function wppaFadeOut(e,a,t){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),t&&setTimeout(t,10)):jQuery(e).stop().fadeOut(a,t)}function wppaFadeTo(e,a,t,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:t}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(a,t,p)}function wppaTrim(e,a){e=wppaTrimLeft(e,a);return e=wppaTrimRight(e,a)}function wppaTrimLeft(e,a){var t,p,i,n,r,o,s;switch(typeof a){case"string":for(p=(t=e).length,i=a.length;i<=p&&t.substr(0,i)==a;)p=(t=t.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<a.length;)s=wppaTrimLeft(s,a[n]),n++;r=o==s}t=s;break;default:return e.replace(/^\s\s*/,"")}return t}function wppaTrimRight(e,a){var t,p,i,n,r,o,s;switch(typeof a){case"string":for(p=(t=e).length,i=a.length;i<=p&&t.substr(p-i)==a;)p=(t=t.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<a.length;)s=wppaTrimRight(s,a[n]),n++;r=o==s}t=s;break;default:return e.replace(/\s\s*$/,"")}return t}function wppa_setCookie(e,a,t){var p=new Date;p.setDate(p.getDate()+t);p=escape(a)+(null==t?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var a,t,p=document.cookie.split(";"),i=0;i<p.length;i++)if(a=p[i].substr(0,p[i].indexOf("=")),t=p[i].substr(p[i].indexOf("=")+1),(a=a.replace(/^\s+|\s+$/g,""))==e)return unescape(t);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,a){var t,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=a||(t=(new Date).getTime()%864e5,t-=60*(p=Math.floor(t/36e5))*60*1e3,t-=60*(i=Math.floor(t/6e4))*1e3,a=Math.floor(t/1e3),console.log("At: "+p+":"+i+":"+a+"."+(t-=1e3*a)+" message: "+e))}function wppaSvgHtml(e,a,t,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}a=a||"32px",t="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):t?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==t&&(t="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(a?"height:"+a+";":"")+"fill:"+s+";background-color:"+t+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(wppaMakeLazyVisible,wppaScrollEndDelay)}var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(){if(!wppaLazyBusy&&(wppaLazyBusy=!0,wppaInitMasonryPlus(),wppaLazyLoad)){var e,a=new Date,t=a.getTime();if(t<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible()},100),void(wppaLazyBusy=!1);wppaLastLazy=t,clearTimeout(wppaLazyTimer);var p=0;jQuery("*[data-src]").each(function(){e=jQuery(this).attr("data-src"),(wppaIsElementInViewport(this)||wppaIsMobile)&&(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),p++)}),0<p&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize()},500)),t=(a=new Date).getTime(),wppaLastLazy=t,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var a=jQuery(e);a[0]&&"BODY"!=a[0].nodeName;){if("none"==jQuery(a[0]).css("display"))return!1;a=jQuery(a[0]).parent()}"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight()}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,a,t){t=t?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==t?a:(wppaIsMini[e]?t/2:t)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var a=e.parentNode.clientWidth;jQuery(e).css({maxWidth:a})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,a,t=jQuery;wppaOvlOpen&&(a=wppaIsFs()?(t(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(t(".wppa-pctl-div-lb").css({position:"initial"}),t("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(a-=20),a<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(a/12-4))&&(t(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),t(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,t(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),t(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?t(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):t(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),t(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,a,t){},error:function(e,a,t){wppaConsoleLog("wppaServerLog failed. Error = "+t+", status = "+a,"force")}})}function wppaTimNow(){return(new Date).getTime()}
1
+ var wppaDebug;wppaJsUtilsVersion="8.0.00.004";var wppaMakeLazyVisibleScrollEndTimer,wppaDebugCounter=0;function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(wppaMakeLazyVisible,wppaScrollEndDelay)}var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(){if(!wppaLazyBusy&&(wppaLazyBusy=!0,wppaInitMasonryPlus(),wppaLazyLoad)){var e,t=new Date,a=t.getTime();if(a<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible()},100),void(wppaLazyBusy=!1);wppaLastLazy=a,clearTimeout(wppaLazyTimer);var p=0;jQuery("*[data-src]").each(function(){e=jQuery(this).attr("data-src"),(wppaIsElementInViewport(this)||wppaIsMobile)&&(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),p++)}),0<p&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery(".wppa-box").trigger("scroll")},250)),a=(t=new Date).getTime(),wppaLastLazy=a,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;t=jQuery(t[0]).parent()}"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight()}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}
js/wppa.js CHANGED
@@ -3,7 +3,7 @@
3
  // contains common vars and functions
4
  //
5
 
6
- wppaWppaVer = '7.7.07.003';
7
 
8
  var wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
9
  var wppaIsSafari = false;
3
  // contains common vars and functions
4
  //
5
 
6
+ wppaWppaVer = '8.0.00.001';
7
 
8
  var wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
9
  var wppaIsSafari = false;
js/wppa.min.js CHANGED
@@ -1 +1 @@
1
- wppaWppaVer="7.7.07.003";var wppaIsChrome=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime),wppaIsSafari=!1,wppaOvlActivePanorama=0,wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaStart,wppaStop,wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaProcessing,wppaDone,wppaUploadFailed,wppaServerError,wppaVersion="0",wppaIsIe=!1,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth,wppaAutoColumnWidth=wppaAutoColumnWidth||[],wppaAutoColumnFrac,wppaAutoColumnFrac=wppaAutoColumnFrac||[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaMiniTreshold=300,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth,wppaColWidth=wppaColWidth||[],wppaMCRWidth,wppaMCRWidth=wppaMCRWidth||[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,wppaThumbAspect=.75,wppaFilmonlyContinuous=!1,wppaNoAnimateOnMobile=!1,wppaAjaxScroll=!0,wppaFilmInit=[],wppaResizeEndDelay=200,wppaScrollEndDelay=200,wppaArtmonkeyFileNotSource=!1,wppaRequestInfoDialogText="Please specify your question",wppaGlobalFsIconSize=32,wppaFsFillcolor="#999999",wppaFsBgcolor="transparent",_wppaId=[],_wppaRealId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],_wppaLastIdx=[],_wppaStopping=[],_wppaFilename=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlIds,wppaOvlTitles,wppaOvlAlts,wppaOvlTypes,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlClosing=!1,wppaThumbSize=100,wppaTfMargin=4,wppaZoomData=[],wppaSphericData=[],wppaFsPolicy="lightbox",wppaOvlGlobal,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaIsIpad=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light",wppaCoverSpacing=8,wppaResizeEndTimer,wppaScrollEndTimer;function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips()}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var p=jQuery(this).attr("id").substr(6);wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",wppaMakeLazyVisible),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",wppaAdjustAllFilmstrips),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){jQuery(".wppa-thumb-area").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".albumlist").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".wppa-div").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize()},2e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisible()},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var p=jQuery(this).attr("href");p&&("jpg"!=(p=(p=p.split("."))[p.length-1])&&"jpeg"!=p&&"png"!=p||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisible)}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var e=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:e*a})})}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(p){wppaTimNow()<wppaLastAllAutocols+wppaExtendedResizeDelay?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,wppaExtendedResizeDelay):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(e){return jQuery(".wppa-container").each(function(){var p=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[p]&&_wppaDoAutocol(p,e)}),(e<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(e+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}),jQuery("canvas").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var e,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,a=0;a<3;)1==++a&&0!=p||(e=document.getElementById(t[a]))&&"function"==typeof e.pause&&e.pause()}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var e=jQuery("audio");if(0<e.length)for(var a=0;a<e.length;)"wppa"==jQuery(e[a]).attr("data-from")&&e[a].pause(),a++}}function wppaMakeFullsizeUrl(p){var e,a;p=(e=(p=p.replace("/thumbs/","/")).split("//"))[1]?(a=e[1].split("/"),e[0]+"//"):(a=e[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var e=document.getElementById("wppa-container-"+p);if(e){var a=0;if(!wppaAutoColumnWidth[p])return e.clientWidth;for(;0==a;)e=e.parentNode,a=jQuery(e).width();return parseInt(a*wppaAutoColumnFrac[p])}}function _wppaDoAutocol(p,e){if(!wppaAutoColumnWidth[p])return!0;var a,t,o=wppaGetContainerWidth(p);if(document.getElementById("wppa-container-"+p)){if(wppaCoverImageResponsive[p]||1<(a=jQuery(".wppa-asym-text-frame-"+p)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:o})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:o},wppaResponseSpeed))),1<(a=jQuery(".wppa-cover-box-mcr-"+p)).length){var r=document.getElementById("wppa-albumlist-"+p).clientWidth,i=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,n=i-1,s=parseInt((r+wppaCoverSpacing)/i-wppaCoverSpacing);if(wppaColWidth[p]!=r||wppaMCRWidth[p]!=s){wppaColWidth[p]=r,wppaMCRWidth[p]=s;for(var l=0;l<a.length;){switch(l%i){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case n:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:s-wppaTextFrameDelta},wppaResponseSpeed),jQuery(a[0]).width(),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:s},wppaResponseSpeed)}}else 1==a.length&&(wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+p).length&&(jQuery("#wppa-container-"+p).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+p).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+p).css("width")))&&(s=o-wppaThumbnailAreaDelta-7,t=Math.max(1,parseInt(s/(r+wppaMinThumbSpace))),t=parseInt((s-t*r)/(t+1)),jQuery(".thumbnail-frame-"+p).css({marginLeft:t})),jQuery(".thumbnail-frame-comalt-"+p).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var w,u=1,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");c;)w=c*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+u+"-"+p).css("height",w),u++,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),document.getElementById("slide_frame-"+p)&&wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*o),wppaFilmStripLength[p]=o-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",o),jQuery(".wppa-simg-"+p).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",o+10),jQuery(".wppa-mimg-"+p).css("width",o),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(o/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*o),wppaSetRealCalendarHeights(p),!0}}function wppaSetRealCalendarHeights(e){var a,t,o,p=jQuery("#wppa-real-calendar-"+e).width();0<p&&(a=!0,t=p*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+e).css({height:t}),p=p/50+2,jQuery("#wppa-real-calendar-"+e).css({fontSize:p}),p=p/4,jQuery(".wppa-real-calendar-head-td-"+e).css({marginTop:p,marginBottom:p}),o=t/2,jQuery(".wppa-realcalimg-"+e).each(function(){var p;0==this.height?a=!1:(p=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+p+"-"+e).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(e)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var e=jQuery(".wppa-mas-h-"+p),a=wppaMinThumbSpace,t=0;t<e.length;t++){var o=wppaGetChildI(e[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(e[t]).css({width:o})}}}function wppaGetChildI(p){for(var e=p.childNodes,a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var e=1;e<=wppaMaxOccur;)wppaStartHtml[e]=jQuery("#wppa-container-"+e).html(),e++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,e){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(e),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,e)):setTimeout("wppaFotomotoToolbar( "+p+',"'+e+'" )',200))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var e=["?","&","#","/",'"',"'"],a=0;a<e.length;){if(-1!=p.indexOf(e[a]))return!0;a++}return!1}function wppaPushStateSlide(p,e,a){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:e},"---",a)}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var e=0;if(wppaCanPushState){if(p.state)switch(e=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+e).html(p.state.html);break;case"slide":_wppaGoto(e,p.state.slide)}else if(wppaUpdateAddressLine){e=wppaFirstOccur,jQuery("#wppa-container-"+e).html(wppaStartHtml[e]),(wppaFirstOccur=0)==e&&(a=document.location.href.split("&wppa-occur="),e=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[e].length&&_wppaId[e][o]!=t;)o++;o<_wppaId[e].length&&_wppaGoto(e,o)}}document.getElementById("theslide0-"+e)&&_wppaStop(e)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,e){var a,t;document.selection?(p.focus(),sel=document.selection.createRange(),sel.text=e):p.selectionStart||"0"==p.selectionStart?(a=p.selectionStart,t=p.selectionEnd,p.value=p.value.substring(0,a)+e+p.value.substring(t,p.value.length),p.selectionStart=a+e.length,p.selectionEnd=a+e.length):p.value+=e}function wppaGeoInit(p,e,a){var e=new google.maps.LatLng(e,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:e},t=new google.maps.Map(document.getElementById("map-canvas-"+p),a),o=new google.maps.Marker({position:e,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(p){if(void 0!==p){for(var e=(t=(t=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<e.length;)t+=e[a],++a<e.length&&(t+="||PLUS||");return t}}function wppaUrlToId(p){var e=p.split("/wppa/");return 1==e.length&&(e=p.split("/upload/")),1==e.length?0:e=(e=(e=(e=(e=(e=(e=e[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,e){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var a=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var i=jQuery(".wppa-ss-albumcat-"+p),r="";for(n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");i=jQuery(".wppa-ss-albumtext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");i=jQuery(".wppa-ss-phototag-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var n,i=jQuery(".wppa-ss-phototext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}e&&(-1==(e=jQuery("#wppa-ss-pageurl-"+p).val()).indexOf("?")?e+="?":e+="&",e+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=e)}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,e){p=jQuery(p).length;6<p&&(p=6),p<2&&(p=2),jQuery(e).attr("size",p)}function wppaUpdateSearchRoot(p,e){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(p),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)e?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(e),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),e=0;e<p.length;)jQuery(p[e]).html(""),e++;for(p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).prop("disabled",!0),e++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).removeAttr("disabled"),e++}function wppaDisplaySelectedFiles(p){for(var e=jQuery("#"+p),a=0,t="";a<e[0].files.length;)t+=e[0].files[a].name+" ",a++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,e,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var p=jQuery(this).attr("id").substr(5),e=wppaGetContainerWidth(p)-wppaThumbnailAreaDelta,e=e/parseInt((e+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin))-wppaTfMargin;jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+p).css("width",e+"px"),jQuery("#grid-"+p).masonry({itemSelector:".grid-item-"+p,columnWidth:e,gutter:wppaTfMargin,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var p=parseInt(wppaGlobalFsIconSize/4),e=p;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(p+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var p=document.documentElement;p.requestFullscreen?p.requestFullscreen():p.mozRequestFullScreen?p.mozRequestFullScreen():p.webkitRequestFullScreen&&p.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
1
+ wppaWppaVer="8.0.00.001";var wppaIsChrome=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime),wppaIsSafari=!1,wppaOvlActivePanorama=0,wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaStart,wppaStop,wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaProcessing,wppaDone,wppaUploadFailed,wppaServerError,wppaVersion="0",wppaIsIe=!1,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth,wppaAutoColumnWidth=wppaAutoColumnWidth||[],wppaAutoColumnFrac,wppaAutoColumnFrac=wppaAutoColumnFrac||[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaMiniTreshold=300,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth,wppaColWidth=wppaColWidth||[],wppaMCRWidth,wppaMCRWidth=wppaMCRWidth||[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,wppaThumbAspect=.75,wppaFilmonlyContinuous=!1,wppaNoAnimateOnMobile=!1,wppaAjaxScroll=!0,wppaFilmInit=[],wppaResizeEndDelay=200,wppaScrollEndDelay=200,wppaArtmonkeyFileNotSource=!1,wppaRequestInfoDialogText="Please specify your question",wppaGlobalFsIconSize=32,wppaFsFillcolor="#999999",wppaFsBgcolor="transparent",_wppaId=[],_wppaRealId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],_wppaLastIdx=[],_wppaStopping=[],_wppaFilename=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlIds,wppaOvlTitles,wppaOvlAlts,wppaOvlTypes,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlClosing=!1,wppaThumbSize=100,wppaTfMargin=4,wppaZoomData=[],wppaSphericData=[],wppaFsPolicy="lightbox",wppaOvlGlobal,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaIsIpad=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light",wppaCoverSpacing=8,wppaResizeEndTimer,wppaScrollEndTimer;function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips()}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var p=jQuery(this).attr("id").substr(6);wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",wppaMakeLazyVisible),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",wppaAdjustAllFilmstrips),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){jQuery(".wppa-thumb-area").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".albumlist").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery(".wppa-div").each(function(){jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()}),jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize()},2e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisible()},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var p=jQuery(this).attr("href");p&&("jpg"!=(p=(p=p.split("."))[p.length-1])&&"jpeg"!=p&&"png"!=p||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisible)}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var e=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:e*a})})}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(p){wppaTimNow()<wppaLastAllAutocols+wppaExtendedResizeDelay?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,wppaExtendedResizeDelay):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(e){return jQuery(".wppa-container").each(function(){var p=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[p]&&_wppaDoAutocol(p,e)}),(e<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(e+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}),jQuery("canvas").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var e,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,a=0;a<3;)1==++a&&0!=p||(e=document.getElementById(t[a]))&&"function"==typeof e.pause&&e.pause()}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var e=jQuery("audio");if(0<e.length)for(var a=0;a<e.length;)"wppa"==jQuery(e[a]).attr("data-from")&&e[a].pause(),a++}}function wppaMakeFullsizeUrl(p){var e,a;p=(e=(p=p.replace("/thumbs/","/")).split("//"))[1]?(a=e[1].split("/"),e[0]+"//"):(a=e[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var e=document.getElementById("wppa-container-"+p);if(e){var a=0;if(!wppaAutoColumnWidth[p])return e.clientWidth;for(;0==a;)e=e.parentNode,a=jQuery(e).width();return parseInt(a*wppaAutoColumnFrac[p])}}function _wppaDoAutocol(p,e){if(!wppaAutoColumnWidth[p])return!0;var a,t,o=wppaGetContainerWidth(p);if(document.getElementById("wppa-container-"+p)){if(wppaCoverImageResponsive[p]||1<(a=jQuery(".wppa-asym-text-frame-"+p)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:o})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:o},wppaResponseSpeed))),1<(a=jQuery(".wppa-cover-box-mcr-"+p)).length){var r=document.getElementById("wppa-albumlist-"+p).clientWidth,i=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,n=i-1,s=parseInt((r+wppaCoverSpacing)/i-wppaCoverSpacing);if(wppaColWidth[p]!=r||wppaMCRWidth[p]!=s){wppaColWidth[p]=r,wppaMCRWidth[p]=s;for(var l=0;l<a.length;){switch(l%i){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case n:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:s-wppaTextFrameDelta},wppaResponseSpeed),jQuery(a[0]).width(),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:s},wppaResponseSpeed)}}else 1==a.length&&(wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:o-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+p).length&&(jQuery("#wppa-container-"+p).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+p).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+p).css("width")))&&(s=o-wppaThumbnailAreaDelta-7,t=Math.max(1,parseInt(s/(r+wppaMinThumbSpace))),t=parseInt((s-t*r)/(t+1)),jQuery(".thumbnail-frame-"+p).css({marginLeft:t})),jQuery(".thumbnail-frame-comalt-"+p).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var w,u=1,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");c;)w=c*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+u+"-"+p).css("height",w),u++,c=jQuery("#wppa-mas-h-"+u+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),document.getElementById("slide_frame-"+p)&&wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*o),wppaFilmStripLength[p]=o-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",o),jQuery(".wppa-simg-"+p).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",o+10),jQuery(".wppa-mimg-"+p).css("width",o),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(o/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*o),wppaSetRealCalendarHeights(p),!0}}function wppaSetRealCalendarHeights(e){var a,t,o,p=jQuery("#wppa-real-calendar-"+e).width();0<p&&(a=!0,t=p*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+e).css({height:t}),p=p/50+2,jQuery("#wppa-real-calendar-"+e).css({fontSize:p}),p=p/4,jQuery(".wppa-real-calendar-head-td-"+e).css({marginTop:p,marginBottom:p}),o=t/2,jQuery(".wppa-realcalimg-"+e).each(function(){var p;0==this.height?a=!1:(p=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+p+"-"+e).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(e)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var e=jQuery(".wppa-mas-h-"+p),a=wppaMinThumbSpace,t=0;t<e.length;t++){var o=wppaGetChildI(e[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(e[t]).css({width:o})}}}function wppaGetChildI(p){for(var e=p.childNodes,a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var e=1;e<=wppaMaxOccur;)wppaStartHtml[e]=jQuery("#wppa-container-"+e).html(),e++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,e){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(e),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,e)):setTimeout("wppaFotomotoToolbar( "+p+',"'+e+'" )',200))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var e=["?","&","#","/",'"',"'"],a=0;a<e.length;){if(-1!=p.indexOf(e[a]))return!0;a++}return!1}function wppaPushStateSlide(p,e,a){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:e},"---",a)}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var e=0;if(wppaCanPushState){if(p.state)switch(e=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+e).html(p.state.html);break;case"slide":_wppaGoto(e,p.state.slide)}else if(wppaUpdateAddressLine){e=wppaFirstOccur,jQuery("#wppa-container-"+e).html(wppaStartHtml[e]),(wppaFirstOccur=0)==e&&(a=document.location.href.split("&wppa-occur="),e=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[e].length&&_wppaId[e][o]!=t;)o++;o<_wppaId[e].length&&_wppaGoto(e,o)}}document.getElementById("theslide0-"+e)&&_wppaStop(e)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,e){var a,t;document.selection?(p.focus(),sel=document.selection.createRange(),sel.text=e):p.selectionStart||"0"==p.selectionStart?(a=p.selectionStart,t=p.selectionEnd,p.value=p.value.substring(0,a)+e+p.value.substring(t,p.value.length),p.selectionStart=a+e.length,p.selectionEnd=a+e.length):p.value+=e}function wppaGeoInit(p,e,a){var e=new google.maps.LatLng(e,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:e},t=new google.maps.Map(document.getElementById("map-canvas-"+p),a),o=new google.maps.Marker({position:e,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(p){if(void 0!==p){for(var e=(t=(t=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<e.length;)t+=e[a],++a<e.length&&(t+="||PLUS||");return t}}function wppaUrlToId(p){var e=p.split("/wppa/");return 1==e.length&&(e=p.split("/upload/")),1==e.length?0:e=(e=(e=(e=(e=(e=(e=e[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,e){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var a=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var i=jQuery(".wppa-ss-albumcat-"+p),r="";for(n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");i=jQuery(".wppa-ss-albumtext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");i=jQuery(".wppa-ss-phototag-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var n,i=jQuery(".wppa-ss-phototext-"+p);for(r="",n=0;n<i.length;n++)jQuery(i[n]).prop("selected")&&(r+="."+jQuery(i[n]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}e&&(-1==(e=jQuery("#wppa-ss-pageurl-"+p).val()).indexOf("?")?e+="?":e+="&",e+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=e)}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,e,a){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,e,a){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+a+", status = "+e,"force")},complete:function(p,e,a){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,e){p=jQuery(p).length;6<p&&(p=6),p<2&&(p=2),jQuery(e).attr("size",p)}function wppaUpdateSearchRoot(p,e){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(p),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)e?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(e),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),e=0;e<p.length;)jQuery(p[e]).html(""),e++;for(p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).prop("disabled",!0),e++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),e=0;e<p.length;)jQuery(p[e]).removeAttr("disabled"),e++}function wppaDisplaySelectedFiles(p){for(var e=jQuery("#"+p),a=0,t="";a<e[0].files.length;)t+=e[0].files[a].name+" ",a++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,e,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var p=jQuery(this).attr("id").substr(5),e=wppaGetContainerWidth(p)-wppaThumbnailAreaDelta,e=e/parseInt((e+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin))-wppaTfMargin;jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+p).css("width",e+"px"),jQuery("#grid-"+p).masonry({itemSelector:".grid-item-"+p,columnWidth:e,gutter:wppaTfMargin,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var p=parseInt(wppaGlobalFsIconSize/4),e=p;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(p+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+p+"px;right:"+e+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var p=document.documentElement;p.requestFullscreen?p.requestFullscreen():p.mozRequestFullScreen?p.mozRequestFullScreen():p.webkitRequestFullScreen&&p.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
theme/wppa-theme.php CHANGED
@@ -3,11 +3,11 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
- * Version 7.3.11.002
7
  */
8
  function wppa_theme() {
9
 
10
- global $wppa_version; $wppa_version = '7.3.11.002'; // The version number of this file
11
  global $wppa;
12
  global $wppa_show_statistics; // Can be set to true by a custom page template
13
 
@@ -120,7 +120,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
120
  }
121
 
122
  if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
123
- if ( is_array( $thumbs ) && count( $thumbs ) <= wppa_get_mincount() && ! $wanted_empty ) $thumbs = false; // Less than treshold value
124
  if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
125
 
126
  // Process the thumbs
@@ -472,7 +472,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
472
  function wppa_is_wanted_empty( $thumbs ) {
473
 
474
  if ( ! wppa_switch( 'show_empty_thumblist' ) ) return false; // Feature not enabled
475
- if ( is_array( $thumbs ) && count( $thumbs ) > wppa_get_mincount() ) return false; // Album is not empty
476
  if ( wppa_is_virtual() ) return false; // wanted empty only on real albums
477
  if ( ! wppa_is_int( wppa( 'start_album' ) ) ) return false; // Only seingle albums, no enumerations
478
  if ( wppa( 'albums_only' ) ) return false; // Explicitly no thumbs
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
+ * Version 8.0.00.003
7
  */
8
  function wppa_theme() {
9
 
10
+ global $wppa_version; $wppa_version = '8.0.00.003'; // The version number of this file
11
  global $wppa;
12
  global $wppa_show_statistics; // Can be set to true by a custom page template
13
 
120
  }
121
 
122
  if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
123
+ if ( is_array( $thumbs ) && ! count( $thumbs ) && ! $wanted_empty ) $thumbs = false; // Less than treshold value
124
  if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
125
 
126
  // Process the thumbs
472
  function wppa_is_wanted_empty( $thumbs ) {
473
 
474
  if ( ! wppa_switch( 'show_empty_thumblist' ) ) return false; // Feature not enabled
475
+ if ( is_array( $thumbs ) && count( $thumbs ) ) return false; // Album is not empty
476
  if ( wppa_is_virtual() ) return false; // wanted empty only on real albums
477
  if ( ! wppa_is_int( wppa( 'start_album' ) ) ) return false; // Only seingle albums, no enumerations
478
  if ( wppa( 'albums_only' ) ) return false; // Explicitly no thumbs
vendor/nicescroll/jquery.nicescroll.iframehelper.js CHANGED
@@ -1,112 +1,105 @@
1
- /* iframe script helper for jquery.nicescroll
2
- -- version 0.9.0
3
- -- copyright 2017-06-18 InuYaksa*2017
4
- -- licensed under the MIT
5
- --
6
- -- https://nicescroll.areaaperta.com/
7
- -- https://github.com/inuyaksa/jquery.nicescroll
8
- --
9
- */
10
-
11
- (function (document, window) {
12
-
13
- var body = document.body;
14
- var parent = window.parent;
15
-
16
- if (parent && ("createEvent" in document)) {
17
-
18
- var isoldie = ("documentMode" in document); // 11-
19
- var ismsedge = ("msCredentials" in window); // MS Edge 14+
20
-
21
- function onwheel (e) {
22
-
23
- var evt = document.createEvent("MouseEvents");
24
- evt.initEvent('wheel', true, true);
25
- evt.deltaMode = e.deltaMode;
26
- evt.deltaX = e.deltaX;
27
- evt.deltaY = e.deltaY;
28
- evt.deltaZ = e.deltaZ;
29
- evt.wheelDelta = e.wheelDelta;
30
- evt.wheelDeltaX = e.wheelDeltaX;
31
- evt.wheelDeltaY = e.wheelDeltaY;
32
-
33
- parent.dispatchEvent(evt);
34
- }
35
-
36
- body.addEventListener("wheel", onwheel);
37
-
38
- }
39
-
40
- if (window.addEventListener) {
41
-
42
- // https://davidwalsh.name/add-rules-stylesheets
43
- var sheet = (function () {
44
- var style = document.createElement("style");
45
- style.appendChild(document.createTextNode(""));
46
- document.head.appendChild(style);
47
- return style.sheet;
48
- })();
49
-
50
- var tmrscroll = false;
51
- var lastiframe = null;
52
- var lastiframeviewport = null;
53
- var lastscroll = [];
54
-
55
- window.addEventListener("scroll", function (e) {
56
- if (lastiframeviewport) {
57
- // var df = [ window.scrollX - lastscroll[0], window.scrollY - lastscroll[1] ];
58
- window.scrollTo(lastscroll[0], lastscroll[1]);
59
- // lastiframeviewport.scrollBy(df[0],df[1]);
60
- // console.log(df);
61
- }
62
- });
63
-
64
- function findNiceParent (t) {
65
- do {
66
- if ($.data(t, '__nicescroll') !== undefined) {
67
- return t;
68
- }
69
- t = t.parentNode || false;
70
- }
71
- while (t);
72
- return false;
73
- }
74
-
75
- window.addEventListener("load", function () {
76
-
77
- var hasstyle = false;
78
-
79
- $.nicescroll.each(function () {
80
- var nice = this;
81
- nice.scrollstart(function () {
82
- if (! hasstyle) {
83
- sheet.insertRule("iframe { pointer-events: none !important; }", 0);
84
- }
85
- hasstyle = true;
86
- });
87
- nice.scrollend(function () {
88
- if (hasstyle) {
89
- sheet.deleteRule(0);
90
- }
91
- hasstyle = false;
92
- });
93
- });
94
-
95
- $("iframe").each(function () {
96
- this.addEventListener("mouseenter", function (e) {
97
- lastiframe = e.target;
98
- var chk = findNiceParent(lastiframe);
99
- lastiframeviewport = chk;
100
- //if (chk) lastiframeviewport = $(chk).getNiceScroll();
101
- lastscroll = [window.scrollX, window.scrollY];
102
- });
103
- this.addEventListener("mouseleave", function (e) {
104
- lastiframe = lastiframeviewport = null;
105
- });
106
- });
107
-
108
- });
109
-
110
- }
111
-
112
- })(document, window);
1
+ /* iframe script helper for jquery.nicescroll
2
+ -- version 0.9.0
3
+ -- copyright 2017-06-18 InuYaksa*2017
4
+ -- licensed under the MIT
5
+ --
6
+ -- https://nicescroll.areaaperta.com/
7
+ -- https://github.com/inuyaksa/jquery.nicescroll
8
+ --
9
+ */
10
+
11
+ (function (document,window) {
12
+
13
+ var body = document.body;
14
+ var parent = window.parent;
15
+
16
+ if (parent && ("createEvent" in document)) {
17
+
18
+ var isoldie = ("documentMode" in document); // 11-
19
+ var ismsedge = ("msCredentials" in window); // MS Edge 14+
20
+
21
+ function onwheel(e) {
22
+
23
+ var evt = document.createEvent("MouseEvents");
24
+ evt.initEvent('wheel', true, true);
25
+ evt.deltaMode = e.deltaMode;
26
+ evt.deltaX = e.deltaX;
27
+ evt.deltaY = e.deltaY;
28
+ evt.deltaZ = e.deltaZ;
29
+ evt.wheelDelta = e.wheelDelta;
30
+ evt.wheelDeltaX = e.wheelDeltaX;
31
+ evt.wheelDeltaY = e.wheelDeltaY;
32
+
33
+ parent.dispatchEvent(evt);
34
+ }
35
+
36
+ body.addEventListener("wheel", onwheel);
37
+
38
+ }
39
+
40
+ if (window.addEventListener) {
41
+
42
+ // https://davidwalsh.name/add-rules-stylesheets
43
+ var sheet = (function () {
44
+ var style = document.createElement("style");
45
+ style.appendChild(document.createTextNode(""));
46
+ document.head.appendChild(style);
47
+ return style.sheet;
48
+ })();
49
+
50
+ var tmrscroll = false;
51
+ var lastiframe = null;
52
+ var lastiframeviewport = null;
53
+ var lastscroll = [];
54
+
55
+ window.addEventListener("scroll", function (e) {
56
+ if (lastiframeviewport) {
57
+ // var df = [ window.scrollX - lastscroll[0], window.scrollY - lastscroll[1] ];
58
+ window.scrollTo(lastscroll[0], lastscroll[1]);
59
+ // lastiframeviewport.scrollBy(df[0],df[1]);
60
+ // console.log(df);
61
+ }
62
+ });
63
+
64
+ function findNiceParent(t) {
65
+ do {
66
+ if ($.data(t, '__nicescroll') !== undefined) return t;
67
+ t = t.parentNode || false;
68
+ } while (t);
69
+ return false;
70
+ }
71
+
72
+ window.addEventListener("load", function () {
73
+
74
+ var hasstyle = false;
75
+
76
+ $.nicescroll.each(function () {
77
+ var nice = this;
78
+ nice.scrollstart(function () {
79
+ if (!hasstyle) sheet.insertRule("iframe { pointer-events: none !important; }", 0);
80
+ hasstyle = true;
81
+ });
82
+ nice.scrollend(function () {
83
+ if (hasstyle) sheet.deleteRule(0);
84
+ hasstyle = false;
85
+ });
86
+ });
87
+
88
+ $("iframe").each(function () {
89
+ this.addEventListener("mouseenter", function (e) {
90
+ lastiframe = e.target;
91
+ var chk = findNiceParent(lastiframe);
92
+ lastiframeviewport = chk;
93
+ //if (chk) lastiframeviewport = $(chk).getNiceScroll();
94
+ lastscroll = [window.scrollX, window.scrollY];
95
+ });
96
+ this.addEventListener("mouseleave", function (e) {
97
+ lastiframe = lastiframeviewport = null;
98
+ });
99
+ });
100
+
101
+ });
102
+
103
+ }
104
+
105
+ })(document,window);
 
 
 
 
 
 
 
vendor/nicescroll/jquery.nicescroll.iframehelper.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /* iframe helper for jquery.nicescroll v3.7.6 InuYaksa - MIT - https://nicescroll.areaaperta.com */
2
  !function(e,t){function n(t){var n=e.createEvent("MouseEvents");n.initEvent("wheel",!0,!0),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ,n.wheelDelta=t.wheelDelta,n.wheelDeltaX=t.wheelDeltaX,n.wheelDeltaY=t.wheelDeltaY,r.dispatchEvent(n)}function l(e){do{if(void 0!==$.data(e,"__nicescroll"))return e;e=e.parentNode||!1}while(e);return!1}var a=e.body,r=t.parent;if(r&&"createEvent"in e){a.addEventListener("wheel",n)}if(t.addEventListener){var i=function(){var t=e.createElement("style");return t.appendChild(e.createTextNode("")),e.head.appendChild(t),t.sheet}(),d=null,o=null,c=[];t.addEventListener("scroll",function(e){o&&t.scrollTo(c[0],c[1])}),t.addEventListener("load",function(){var e=!1;$.nicescroll.each(function(){var t=this;t.scrollstart(function(){e||i.insertRule("iframe { pointer-events: none !important; }",0),e=!0}),t.scrollend(function(){e&&i.deleteRule(0),e=!1})}),$("iframe").each(function(){this.addEventListener("mouseenter",function(e){var n=l(d=e.target);o=n,c=[t.scrollX,t.scrollY]}),this.addEventListener("mouseleave",function(e){d=o=null})})})}}(document,window);
1
+ /* iframe helper for jquery.nicescroll v3.7.6 InuYaksa - MIT - https://nicescroll.areaaperta.com */
2
  !function(e,t){function n(t){var n=e.createEvent("MouseEvents");n.initEvent("wheel",!0,!0),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ,n.wheelDelta=t.wheelDelta,n.wheelDeltaX=t.wheelDeltaX,n.wheelDeltaY=t.wheelDeltaY,r.dispatchEvent(n)}function l(e){do{if(void 0!==$.data(e,"__nicescroll"))return e;e=e.parentNode||!1}while(e);return!1}var a=e.body,r=t.parent;if(r&&"createEvent"in e){a.addEventListener("wheel",n)}if(t.addEventListener){var i=function(){var t=e.createElement("style");return t.appendChild(e.createTextNode("")),e.head.appendChild(t),t.sheet}(),d=null,o=null,c=[];t.addEventListener("scroll",function(e){o&&t.scrollTo(c[0],c[1])}),t.addEventListener("load",function(){var e=!1;$.nicescroll.each(function(){var t=this;t.scrollstart(function(){e||i.insertRule("iframe { pointer-events: none !important; }",0),e=!0}),t.scrollend(function(){e&&i.deleteRule(0),e=!1})}),$("iframe").each(function(){this.addEventListener("mouseenter",function(e){var n=l(d=e.target);o=n,c=[t.scrollX,t.scrollY]}),this.addEventListener("mouseleave",function(e){d=o=null})})})}}(document,window);
vendor/nicescroll/jquery.nicescroll.js CHANGED
@@ -1,4371 +1,3729 @@
1
- /* jquery.nicescroll
2
- -- version 3.7.6
3
- -- copyright 2017-07-19 InuYaksa*2017
4
- -- licensed under the MIT
5
- --
6
- -- https://nicescroll.areaaperta.com/
7
- -- https://github.com/inuyaksa/jquery.nicescroll
8
- --
9
- */
10
-
11
- /* jshint expr: true */
12
-
13
- (function (factory) {
14
- if (typeof define === 'function' && define.amd) {
15
- // AMD. Register as anonymous module.
16
- define(['jquery'], factory);
17
- }
18
- else if (typeof exports === 'object') {
19
- // Node/CommonJS.
20
- module.exports = factory(require('jquery'));
21
- }
22
- else {
23
- // Browser globals.
24
- factory(jQuery);
25
- }
26
- }(function (jQuery) {
27
-
28
- "use strict";
29
-
30
- // globals
31
- var domfocus = false,
32
- mousefocus = false,
33
- tabindexcounter = 0,
34
- ascrailcounter = 2000,
35
- globalmaxzindex = 0;
36
-
37
- var $ = jQuery, // sandbox
38
- _doc = document,
39
- _win = window,
40
- $window = $(_win);
41
-
42
- var delegatevents = [];
43
-
44
- // http://stackoverflow.com/questions/2161159/get-script-path
45
- function getScriptPath () {
46
- var scripts = _doc.currentScript || (function () {
47
- var s = _doc.getElementsByTagName('script');
48
- return (s.length) ? s[s.length - 1] : false;
49
- })();
50
- var path = scripts ? scripts.src.split('?')[0] : '';
51
- return (path.split('/').length > 0) ? path.split('/').slice(0, - 1).join('/') + '/' : '';
52
- }
53
-
54
- // based on code by Paul Irish https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
55
- var setAnimationFrame = _win.requestAnimationFrame || _win.webkitRequestAnimationFrame || _win.mozRequestAnimationFrame || false;
56
- var clearAnimationFrame = _win.cancelAnimationFrame || _win.webkitCancelAnimationFrame || _win.mozCancelAnimationFrame || false;
57
-
58
- if (! setAnimationFrame) {
59
- var anilasttime = 0;
60
- setAnimationFrame = function (callback, element) {
61
- var currTime = new Date().getTime();
62
- var timeToCall = Math.max(0, 16 - (currTime - anilasttime));
63
- var id = _win.setTimeout(function () {
64
- callback(currTime + timeToCall);
65
- },
66
- timeToCall);
67
- anilasttime = currTime + timeToCall;
68
- return id;
69
- };
70
- clearAnimationFrame = function (id) {
71
- _win.clearTimeout(id);
72
- };
73
- }
74
- else {
75
- if (! _win.cancelAnimationFrame) {
76
- clearAnimationFrame = function (id) {
77
- };
78
- }
79
- }
80
-
81
- var ClsMutationObserver = _win.MutationObserver || _win.WebKitMutationObserver || false;
82
-
83
- var now = Date.now || function () {
84
- return new Date().getTime();
85
- };
86
-
87
- var _globaloptions = {
88
- zindex: "auto",
89
- cursoropacitymin: 0,
90
- cursoropacitymax: 1,
91
- cursorcolor: "#424242",
92
- cursorwidth: "6px",
93
- cursorborder: "1px solid #fff",
94
- cursorborderradius: "5px",
95
- scrollspeed: 40,
96
- mousescrollstep: 9 * 3,
97
- touchbehavior: false, // deprecated
98
- emulatetouch: false, // replacing touchbehavior
99
- hwacceleration: true,
100
- usetransition: true,
101
- boxzoom: false,
102
- dblclickzoom: true,
103
- gesturezoom: true,
104
- grabcursorenabled: true,
105
- autohidemode: true,
106
- background: "",
107
- iframeautoresize: true,
108
- cursorminheight: 32,
109
- preservenativescrolling: true,
110
- railoffset: false,
111
- railhoffset: false,
112
- bouncescroll: true,
113
- spacebarenabled: true,
114
- railpadding: {
115
- top: 0,
116
- right: 0,
117
- left: 0,
118
- bottom: 0
119
- },
120
- disableoutline: true,
121
- horizrailenabled: true,
122
- railalign: "right",
123
- railvalign: "bottom",
124
- enabletranslate3d: true,
125
- enablemousewheel: true,
126
- enablekeyboard: true,
127
- smoothscroll: true,
128
- sensitiverail: true,
129
- enablemouselockapi: true,
130
- // cursormaxheight:false,
131
- cursorfixedheight: false,
132
- directionlockdeadzone: 6,
133
- hidecursordelay: 400,
134
- nativeparentscrolling: true,
135
- enablescrollonselection: true,
136
- overflowx: true,
137
- overflowy: true,
138
- cursordragspeed: 0.3,
139
- rtlmode: "auto",
140
- cursordragontouch: false,
141
- oneaxismousemode: "auto",
142
- scriptpath: getScriptPath(),
143
- preventmultitouchscrolling: true,
144
- disablemutationobserver: false,
145
- enableobserver: true,
146
- scrollbarid: false
147
- };
148
-
149
- var browserdetected = false;
150
-
151
- var getBrowserDetection = function () {
152
-
153
- if (browserdetected) {
154
- return browserdetected;
155
- }
156
-
157
- var _el = _doc.createElement('DIV'),
158
- _style = _el.style,
159
- _agent = navigator.userAgent,
160
- _platform = navigator.platform,
161
- d = {};
162
-
163
- d.haspointerlock = "pointerLockElement" in _doc || "webkitPointerLockElement" in _doc || "mozPointerLockElement" in _doc;
164
-
165
- d.isopera = ("opera" in _win); // 12-
166
- d.isopera12 = (d.isopera && ("getUserMedia" in navigator));
167
- d.isoperamini = (Object.prototype.toString.call(_win.operamini) === "[object OperaMini]");
168
-
169
- d.isie = (("all" in _doc) && ("attachEvent" in _el) && ! d.isopera); //IE10-
170
- d.isieold = (d.isie && ! ("msInterpolationMode" in _style)); // IE6 and older
171
- d.isie7 = d.isie && ! d.isieold && (! ("documentMode" in _doc) || (_doc.documentMode === 7));
172
- d.isie8 = d.isie && ("documentMode" in _doc) && (_doc.documentMode === 8);
173
- d.isie9 = d.isie && ("performance" in _win) && (_doc.documentMode === 9);
174
- d.isie10 = d.isie && ("performance" in _win) && (_doc.documentMode === 10);
175
- d.isie11 = ("msRequestFullscreen" in _el) && (_doc.documentMode >= 11); // IE11+
176
-
177
- d.ismsedge = ("msCredentials" in _win); // MS Edge 14+
178
-
179
- d.ismozilla = ("MozAppearance" in _style);
180
-
181
- d.iswebkit = ! d.ismsedge && ("WebkitAppearance" in _style);
182
-
183
- d.ischrome = d.iswebkit && ("chrome" in _win);
184
- d.ischrome38 = (d.ischrome && ("touchAction" in _style)); // behavior changed in touch emulation
185
- d.ischrome22 = (! d.ischrome38) && (d.ischrome && d.haspointerlock);
186
- d.ischrome26 = (! d.ischrome38) && (d.ischrome && ("transition" in _style)); // issue with transform detection (maintain prefix)
187
-
188
- d.cantouch = ("ontouchstart" in _doc.documentElement) || ("ontouchstart" in _win); // with detection for Chrome Touch Emulation
189
- d.hasw3ctouch = (_win.PointerEvent || false) && ((navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); //IE11 pointer events, following W3C Pointer Events spec
190
- d.hasmstouch = (! d.hasw3ctouch) && (_win.MSPointerEvent || false); // IE10 pointer events
191
-
192
- d.ismac = /^mac$/i.test(_platform);
193
-
194
- d.isios = d.cantouch && /iphone|ipad|ipod/i.test(_platform);
195
- d.isios4 = d.isios && ! ("seal" in Object);
196
- d.isios7 = d.isios && ("webkitHidden" in _doc); //iOS 7+
197
- d.isios8 = d.isios && ("hidden" in _doc); //iOS 8+
198
- d.isios10 = d.isios && _win.Proxy; //iOS 10+
199
-
200
- d.isandroid = (/android/i.test(_agent));
201
-
202
- d.haseventlistener = ("addEventListener" in _el);
203
-
204
- d.trstyle = false;
205
- d.hastransform = false;
206
- d.hastranslate3d = false;
207
- d.transitionstyle = false;
208
- d.hastransition = false;
209
- d.transitionend = false;
210
-
211
- d.trstyle = "transform";
212
- d.hastransform = ("transform" in _style) || (function () {
213
- var check = ['msTransform', 'webkitTransform', 'MozTransform', 'OTransform'];
214
- for (var a = 0, c = check.length ; a < c ; a ++) {
215
- if (_style[check[a]] !== undefined) {
216
- d.trstyle = check[a];
217
- break;
218
- }
219
- }
220
- d.hastransform = (! ! d.trstyle);
221
- })();
222
-
223
- if (d.hastransform) {
224
- _style[d.trstyle] = "translate3d(1px,2px,3px)";
225
- d.hastranslate3d = /translate3d/.test(_style[d.trstyle]);
226
- }
227
-
228
- d.transitionstyle = "transition";
229
- d.prefixstyle = '';
230
- d.transitionend = "transitionend";
231
-
232
- d.hastransition = ("transition" in _style) || (function () {
233
-
234
- d.transitionend = false;
235
- var check = ['webkitTransition', 'msTransition', 'MozTransition', 'OTransition', 'OTransition', 'KhtmlTransition'];
236
- var prefix = ['-webkit-', '-ms-', '-moz-', '-o-', '-o', '-khtml-'];
237
- var evs = ['webkitTransitionEnd', 'msTransitionEnd', 'transitionend', 'otransitionend', 'oTransitionEnd', 'KhtmlTransitionEnd'];
238
- for (var a = 0, c = check.length ; a < c ; a ++) {
239
- if (check[a] in _style) {
240
- d.transitionstyle = check[a];
241
- d.prefixstyle = prefix[a];
242
- d.transitionend = evs[a];
243
- break;
244
- }
245
- }
246
- if (d.ischrome26) {
247
- d.prefixstyle = prefix[1];
248
- } // always use prefix
249
-
250
- d.hastransition = (d.transitionstyle);
251
-
252
- })();
253
-
254
- function detectCursorGrab () {
255
- var lst = ['grab', '-webkit-grab', '-moz-grab'];
256
- if ((d.ischrome && ! d.ischrome38) || d.isie) {
257
- lst = [];
258
- } // force setting for IE returns false positive and chrome cursor bug
259
- for (var a = 0, l = lst.length ; a < l ; a ++) {
260
- var p = lst[a];
261
- _style.cursor = p;
262
- if (_style.cursor == p) {
263
- return p;
264
- }
265
- }
266
- return 'url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize'; // thanks to https://cdnjs.com/ for the openhand cursor!
267
- }
268
-
269
- d.cursorgrabvalue = detectCursorGrab();
270
-
271
- d.hasmousecapture = ("setCapture" in _el);
272
-
273
- d.hasMutationObserver = (ClsMutationObserver !== false);
274
-
275
- _el = null; //memory released
276
-
277
- browserdetected = d;
278
-
279
- return d;
280
- };
281
-
282
- var NiceScrollClass = function (myopt, me) {
283
-
284
- var self = this;
285
-
286
- this.version = '3.7.6';
287
- this.name = 'nicescroll';
288
-
289
- this.me = me;
290
-
291
- var $body = $("body");
292
-
293
- var opt = this.opt = {
294
- doc: $body,
295
- win: false
296
- };
297
-
298
- $.extend(opt, _globaloptions); // clone opts
299
-
300
- // Options for internal use
301
- opt.snapbackspeed = 80;
302
-
303
- if (myopt || false) {
304
- for (var a in opt) {
305
- if (myopt[a] !== undefined) {
306
- opt[a] = myopt[a];
307
- }
308
- }
309
- }
310
-
311
- if (opt.disablemutationobserver) {
312
- ClsMutationObserver = false;
313
- }
314
-
315
- this.doc = opt.doc;
316
- this.iddoc = (this.doc && this.doc[0]) ? this.doc[0].id || '' : '';
317
- this.ispage = /^BODY|HTML/.test((opt.win) ? opt.win[0].nodeName : this.doc[0].nodeName);
318
- this.haswrapper = (opt.win !== false);
319
- this.win = opt.win || (this.ispage ? $window : this.doc);
320
- this.docscroll = (this.ispage && ! this.haswrapper) ? $window : this.win;
321
- this.body = $body;
322
- this.viewport = false;
323
-
324
- this.isfixed = false;
325
-
326
- this.iframe = false;
327
- this.isiframe = ((this.doc[0].nodeName == 'IFRAME') && (this.win[0].nodeName == 'IFRAME'));
328
-
329
- this.istextarea = (this.win[0].nodeName == 'TEXTAREA');
330
-
331
- this.forcescreen = false; //force to use screen position on events
332
-
333
- this.canshowonmouseevent = (opt.autohidemode != "scroll");
334
-
335
- // Events jump table
336
- this.onmousedown = false;
337
- this.onmouseup = false;
338
- this.onmousemove = false;
339
- this.onmousewheel = false;
340
- this.onkeypress = false;
341
- this.ongesturezoom = false;
342
- this.onclick = false;
343
-
344
- // Nicescroll custom events
345
- this.onscrollstart = false;
346
- this.onscrollend = false;
347
- this.onscrollcancel = false;
348
-
349
- this.onzoomin = false;
350
- this.onzoomout = false;
351
-
352
- // Let's start!
353
- this.view = false;
354
- this.page = false;
355
-
356
- this.scroll = {
357
- x: 0,
358
- y: 0
359
- };
360
- this.scrollratio = {
361
- x: 0,
362
- y: 0
363
- };
364
- this.cursorheight = 20;
365
- this.scrollvaluemax = 0;
366
-
367
- // http://dev.w3.org/csswg/css-writing-modes-3/#logical-to-physical
368
- // http://dev.w3.org/csswg/css-writing-modes-3/#svg-writing-mode
369
- if (opt.rtlmode == "auto") {
370
- var target = this.win[0] == _win ? this.body : this.win;
371
- var writingMode = target.css("writing-mode") || target.css("-webkit-writing-mode") || target.css("-ms-writing-mode") || target.css("-moz-writing-mode");
372
-
373
- if (writingMode == "horizontal-tb" || writingMode == "lr-tb" || writingMode === "") {
374
- this.isrtlmode = (target.css("direction") == "rtl");
375
- this.isvertical = false;
376
- }
377
- else {
378
- this.isrtlmode = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl" || writingMode == "rl-tb");
379
- this.isvertical = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl");
380
- }
381
- }
382
- else {
383
- this.isrtlmode = (opt.rtlmode === true);
384
- this.isvertical = false;
385
- }
386
- // this.checkrtlmode = false;
387
-
388
- this.scrollrunning = false;
389
-
390
- this.scrollmom = false;
391
-
392
- this.observer = false; // observer div changes
393
- this.observerremover = false; // observer on parent for remove detection
394
- this.observerbody = false; // observer on body for position change
395
-
396
- if (opt.scrollbarid !== false) {
397
- this.id = opt.scrollbarid;
398
- }
399
- else {
400
- do {
401
- this.id = "ascrail" + (ascrailcounter ++);
402
- }
403
- while (_doc.getElementById(this.id));
404
- }
405
-
406
- this.rail = false;
407
- this.cursor = false;
408
- this.cursorfreezed = false;
409
- this.selectiondrag = false;
410
-
411
- this.zoom = false;
412
- this.zoomactive = false;
413
-
414
- this.hasfocus = false;
415
- this.hasmousefocus = false;
416
-
417
- //this.visibility = true;
418
- this.railslocked = false; // locked by resize
419
- this.locked = false; // prevent lost of locked status sets by user
420
- this.hidden = false; // rails always hidden
421
- this.cursoractive = true; // user can interact with cursors
422
-
423
- this.wheelprevented = false; //prevent mousewheel event
424
-
425
- this.overflowx = opt.overflowx;
426
- this.overflowy = opt.overflowy;
427
-
428
- this.nativescrollingarea = false;
429
- this.checkarea = 0;
430
-
431
- this.events = []; // event list for unbind
432
-
433
- this.saved = {}; // style saved
434
-
435
- this.delaylist = {};
436
- this.synclist = {};
437
-
438
- this.lastdeltax = 0;
439
- this.lastdeltay = 0;
440
-
441
- this.detected = getBrowserDetection();
442
-
443
- var cap = $.extend({}, this.detected);
444
-
445
- this.canhwscroll = (cap.hastransform && opt.hwacceleration);
446
- this.ishwscroll = (this.canhwscroll && self.haswrapper);
447
-
448
- if (! this.isrtlmode) {
449
- this.hasreversehr = false;
450
- }
451
- else if (this.isvertical) { // RTL mode with reverse horizontal axis
452
- this.hasreversehr = ! (cap.iswebkit || cap.isie || cap.isie11);
453
- }
454
- else {
455
- this.hasreversehr = ! (cap.iswebkit || (cap.isie && ! cap.isie10 && ! cap.isie11));
456
- }
457
-
458
- this.istouchcapable = false; // desktop devices with touch screen support
459
-
460
- //## Check WebKit-based desktop with touch support
461
- //## + Firefox 18 nightly build (desktop) false positive (or desktop with touch support)
462
-
463
- if (! cap.cantouch && (cap.hasw3ctouch || cap.hasmstouch)) { // desktop device with multiple input
464
- this.istouchcapable = true;
465
- }
466
- else if (cap.cantouch && ! cap.isios && ! cap.isandroid && (cap.iswebkit || cap.ismozilla)) {
467
- this.istouchcapable = true;
468
- }
469
-
470
- //## disable MouseLock API on user request
471
- if (! opt.enablemouselockapi) {
472
- cap.hasmousecapture = false;
473
- cap.haspointerlock = false;
474
- }
475
-
476
- this.debounced = function (name, fn, tm) {
477
- if (! self) {
478
- return;
479
- }
480
- var dd = self.delaylist[name] || false;
481
- if (! dd) {
482
- self.delaylist[name] = {
483
- h: setAnimationFrame(function () {
484
- self.delaylist[name].fn.call(self);
485
- self.delaylist[name] = false;
486
- }, tm)
487
- };
488
- fn.call(self);
489
- }
490
- self.delaylist[name].fn = fn;
491
- };
492
-
493
-
494
- this.synched = function (name, fn) {
495
- if (self.synclist[name]) {
496
- self.synclist[name] = fn;
497
- }
498
- else {
499
- self.synclist[name] = fn;
500
- setAnimationFrame(function () {
501
- if (! self) {
502
- return;
503
- }
504
- self.synclist[name] && self.synclist[name].call(self);
505
- self.synclist[name] = null;
506
- });
507
- }
508
- };
509
-
510
- this.unsynched = function (name) {
511
- if (self.synclist[name]) {
512
- self.synclist[name] = false;
513
- }
514
- };
515
-
516
- this.css = function (el, pars) { // save & set
517
- for (var n in pars) {
518
- self.saved.css.push([el, n, el.css(n)]);
519
- el.css(n, pars[n]);
520
- }
521
- };
522
-
523
- this.scrollTop = function (val) {
524
- return (val === undefined) ? self.getScrollTop() : self.setScrollTop(val);
525
- };
526
-
527
- this.scrollLeft = function (val) {
528
- return (val === undefined) ? self.getScrollLeft() : self.setScrollLeft(val);
529
- };
530
-
531
- // derived by by Dan Pupius www.pupius.net
532
- var BezierClass = function (st, ed, spd, p1, p2, p3, p4) {
533
-
534
- this.st = st;
535
- this.ed = ed;
536
- this.spd = spd;
537
-
538
- this.p1 = p1 || 0;
539
- this.p2 = p2 || 1;
540
- this.p3 = p3 || 0;
541
- this.p4 = p4 || 1;
542
-
543
- this.ts = now();
544
- this.df = ed - st;
545
- };
546
- BezierClass.prototype = {
547
- B2: function (t) {
548
- return 3 * (1 - t) * (1 - t) * t;
549
- },
550
- B3: function (t) {
551
- return 3 * (1 - t) * t * t;
552
- },
553
- B4: function (t) {
554
- return t * t * t;
555
- },
556
- getPos: function () {
557
- return (now() - this.ts) / this.spd;
558
- },
559
- getNow: function () {
560
- var pc = (now() - this.ts) / this.spd;
561
- var bz = this.B2(pc) + this.B3(pc) + this.B4(pc);
562
- return (pc >= 1) ? this.ed : this.st + (this.df * bz) | 0;
563
- },
564
- update: function (ed, spd) {
565
- this.st = this.getNow();
566
- this.ed = ed;
567
- this.spd = spd;
568
- this.ts = now();
569
- this.df = this.ed - this.st;
570
- return this;
571
- }
572
- };
573
-
574
- //derived from http://stackoverflow.com/questions/11236090/
575
- function getMatrixValues () {
576
- var tr = self.doc.css(cap.trstyle);
577
- if (tr && (tr.substr(0, 6) == "matrix")) {
578
- return tr.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, '').split(/, +/);
579
- }
580
- return false;
581
- }
582
-
583
- if (this.ishwscroll) { // hw accelerated scroll
584
-
585
- this.doc.translate = {
586
- x: 0,
587
- y: 0,
588
- tx: "0px",
589
- ty: "0px"
590
- };
591
-
592
- //this one can help to enable hw accel on ios6 http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/
593
- if (cap.hastranslate3d && cap.isios) {
594
- this.doc.css("-webkit-backface-visibility", "hidden");
595
- } // prevent flickering http://stackoverflow.com/questions/3461441/
596
-
597
- this.getScrollTop = function (last) {
598
- if (! last) {
599
- var mtx = getMatrixValues();
600
- if (mtx) {
601
- return (mtx.length == 16) ? - mtx[13] : - mtx[5];
602
- } //matrix3d 16 on IE10
603
- if (self.timerscroll && self.timerscroll.bz) {
604
- return self.timerscroll.bz.getNow();
605
- }
606
- }
607
- return self.doc.translate.y;
608
- };
609
-
610
- this.getScrollLeft = function (last) {
611
- if (! last) {
612
- var mtx = getMatrixValues();
613
- if (mtx) {
614
- return (mtx.length == 16) ? - mtx[12] : - mtx[4];
615
- } //matrix3d 16 on IE10
616
- if (self.timerscroll && self.timerscroll.bh) {
617
- return self.timerscroll.bh.getNow();
618
- }
619
- }
620
- return self.doc.translate.x;
621
- };
622
-
623
- this.notifyScrollEvent = function (el) {
624
- var e = _doc.createEvent("UIEvents");
625
- e.initUIEvent("scroll", false, false, _win, 1);
626
- e.niceevent = true;
627
- el.dispatchEvent(e);
628
- };
629
-
630
- var cxscrollleft = (this.isrtlmode) ? 1 : - 1;
631
-
632
- if (cap.hastranslate3d && opt.enabletranslate3d) {
633
- this.setScrollTop = function (val, silent) {
634
- self.doc.translate.y = val;
635
- self.doc.translate.ty = (val * - 1) + "px";
636
- self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
637
- if (! silent) {
638
- self.notifyScrollEvent(self.win[0]);
639
- }
640
- };
641
- this.setScrollLeft = function (val, silent) {
642
- self.doc.translate.x = val;
643
- self.doc.translate.tx = (val * cxscrollleft) + "px";
644
- self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
645
- if (! silent) {
646
- self.notifyScrollEvent(self.win[0]);
647
- }
648
- };
649
- }
650
- else {
651
- this.setScrollTop = function (val, silent) {
652
- self.doc.translate.y = val;
653
- self.doc.translate.ty = (val * - 1) + "px";
654
- self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
655
- if (! silent) {
656
- self.notifyScrollEvent(self.win[0]);
657
- }
658
- };
659
- this.setScrollLeft = function (val, silent) {
660
- self.doc.translate.x = val;
661
- self.doc.translate.tx = (val * cxscrollleft) + "px";
662
- self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
663
- if (! silent) {
664
- self.notifyScrollEvent(self.win[0]);
665
- }
666
- };
667
- }
668
- }
669
- else { // native scroll
670
-
671
- this.getScrollTop = function () {
672
- return self.docscroll.scrollTop();
673
- };
674
- this.setScrollTop = function (val) {
675
- self.docscroll.scrollTop(val);
676
- };
677
-
678
- this.getScrollLeft = function () {
679
- var val;
680
- if (! self.hasreversehr) {
681
- val = self.docscroll.scrollLeft();
682
- }
683
- else if (self.detected.ismozilla) {
684
- val = self.page.maxw - Math.abs(self.docscroll.scrollLeft());
685
- }
686
- else {
687
- val = self.page.maxw - self.docscroll.scrollLeft();
688
- }
689
- return val;
690
- };
691
- this.setScrollLeft = function (val) {
692
- return setTimeout(function () {
693
- if (! self) {
694
- return;
695
- }
696
- if (self.hasreversehr) {
697
- if (self.detected.ismozilla) {
698
- val = - (self.page.maxw - val);
699
- }
700
- else {
701
- val = self.page.maxw - val;
702
- }
703
- }
704
- return self.docscroll.scrollLeft(val);
705
- }, 1);
706
- };
707
- }
708
-
709
- this.getTarget = function (e) {
710
- if (! e) {
711
- return false;
712
- }
713
- if (e.target) {
714
- return e.target;
715
- }
716
- if (e.srcElement) {
717
- return e.srcElement;
718
- }
719
- return false;
720
- };
721
-
722
- this.hasParent = function (e, id) {
723
- if (! e) {
724
- return false;
725
- }
726
- var el = e.target || e.srcElement || e || false;
727
- while (el && el.id != id) {
728
- el = el.parentNode || false;
729
- }
730
- return (el !== false);
731
- };
732
-
733
- function getZIndex () {
734
- var dom = self.win;
735
- if ("zIndex" in dom) {
736
- return dom.zIndex();
737
- } // use jQuery UI method when available
738
- while (dom.length > 0) {
739
- if (dom[0].nodeType == 9) {
740
- return false;
741
- }
742
- var zi = dom.css('zIndex');
743
- if (! isNaN(zi) && zi !== 0) {
744
- return parseInt(zi);
745
- }
746
- dom = dom.parent();
747
- }
748
- return false;
749
- }
750
-
751
- //inspired by http://forum.jquery.com/topic/width-includes-border-width-when-set-to-thin-medium-thick-in-ie
752
- var _convertBorderWidth = {
753
- "thin": 1,
754
- "medium": 3,
755
- "thick": 5
756
- };
757
-
758
- function getWidthToPixel (dom, prop, chkheight) {
759
- var wd = dom.css(prop);
760
- var px = parseFloat(wd);
761
- if (isNaN(px)) {
762
- px = _convertBorderWidth[wd] || 0;
763
- var brd = (px == 3) ? ((chkheight) ? (self.win.outerHeight() - self.win.innerHeight()) : (self.win.outerWidth() - self.win.innerWidth())) : 1; //DON'T TRUST CSS
764
- if (self.isie8 && px) {
765
- px += 1;
766
- }
767
- return (brd) ? px : 0;
768
- }
769
- return px;
770
- }
771
-
772
- this.getDocumentScrollOffset = function () {
773
- return {
774
- top: _win.pageYOffset || _doc.documentElement.scrollTop,
775
- left: _win.pageXOffset || _doc.documentElement.scrollLeft
776
- };
777
- };
778
-
779
- this.getOffset = function () {
780
- if (self.isfixed) {
781
- var ofs = self.win.offset(); // fix Chrome auto issue (when right/bottom props only)
782
- var scrl = self.getDocumentScrollOffset();
783
- ofs.top -= scrl.top;
784
- ofs.left -= scrl.left;
785
- return ofs;
786
- }
787
- var ww = self.win.offset();
788
- if (! self.viewport) {
789
- return ww;
790
- }
791
- var vp = self.viewport.offset();
792
- return {
793
- top: ww.top - vp.top,
794
- left: ww.left - vp.left
795
- };
796
- };
797
-
798
- this.updateScrollBar = function (len) {
799
- var pos, off;
800
- if (self.ishwscroll) {
801
- self.rail.css({
802
- height: self.win.innerHeight() - (opt.railpadding.top + opt.railpadding.bottom)
803
- });
804
- if (self.railh) {
805
- self.railh.css({
806
- width: self.win.innerWidth() - (opt.railpadding.left + opt.railpadding.right)
807
- });
808
- }
809
- }
810
- else {
811
- var wpos = self.getOffset();
812
- pos = {
813
- top: wpos.top,
814
- left: wpos.left - (opt.railpadding.left + opt.railpadding.right)
815
- };
816
- pos.top += getWidthToPixel(self.win, 'border-top-width', true);
817
- pos.left += (self.rail.align) ? self.win.outerWidth() - getWidthToPixel(self.win, 'border-right-width') - self.rail.width : getWidthToPixel(self.win, 'border-left-width');
818
-
819
- off = opt.railoffset;
820
- if (off) {
821
- if (off.top) {
822
- pos.top += off.top;
823
- }
824
- if (off.left) {
825
- pos.left += off.left;
826
- }
827
- }
828
-
829
- if (! self.railslocked) {
830
- self.rail.css({
831
- top: pos.top,
832
- left: pos.left,
833
- height: ((len) ? len.h : self.win.innerHeight()) - (opt.railpadding.top + opt.railpadding.bottom)
834
- });
835
- }
836
-
837
- if (self.zoom) {
838
- self.zoom.css({
839
- top: pos.top + 1,
840
- left: (self.rail.align == 1) ? pos.left - 20 : pos.left + self.rail.width + 4
841
- });
842
- }
843
-
844
- if (self.railh && ! self.railslocked) {
845
- pos = {
846
- top: wpos.top,
847
- left: wpos.left
848
- };
849
- off = opt.railhoffset;
850
- if (off) {
851
- if (off.top) {
852
- pos.top += off.top;
853
- }
854
- if (off.left) {
855
- pos.left += off.left;
856
- }
857
- }
858
- var y = (self.railh.align) ? pos.top + getWidthToPixel(self.win, 'border-top-width', true) + self.win.innerHeight() - self.railh.height : pos.top + getWidthToPixel(self.win, 'border-top-width', true);
859
- var x = pos.left + getWidthToPixel(self.win, 'border-left-width');
860
- self.railh.css({
861
- top: y - (opt.railpadding.top + opt.railpadding.bottom),
862
- left: x,
863
- width: self.railh.width
864
- });
865
- }
866
-
867
- }
868
- };
869
-
870
- this.doRailClick = function (e, dbl, hr) {
871
- var fn, pg, cur, pos;
872
-
873
- if (self.railslocked) {
874
- return;
875
- }
876
-
877
- self.cancelEvent(e);
878
-
879
- if (! ("pageY" in e)) {
880
- e.pageX = e.clientX + _doc.documentElement.scrollLeft;
881
- e.pageY = e.clientY + _doc.documentElement.scrollTop;
882
- }
883
-
884
- if (dbl) {
885
- fn = (hr) ? self.doScrollLeft : self.doScrollTop;
886
- cur = (hr) ? ((e.pageX - self.railh.offset().left - (self.cursorwidth / 2)) * self.scrollratio.x) : ((e.pageY - self.rail.offset().top - (self.cursorheight / 2)) * self.scrollratio.y);
887
- self.unsynched("relativexy");
888
- fn(cur | 0);
889
- }
890
- else {
891
- fn = (hr) ? self.doScrollLeftBy : self.doScrollBy;
892
- cur = (hr) ? self.scroll.x : self.scroll.y;
893
- pos = (hr) ? e.pageX - self.railh.offset().left : e.pageY - self.rail.offset().top;
894
- pg = (hr) ? self.view.w : self.view.h;
895
- fn((cur >= pos) ? pg : - pg);
896
- }
897
-
898
- };
899
-
900
- self.newscrolly = self.newscrollx = 0;
901
-
902
- self.hasanimationframe = ("requestAnimationFrame" in _win);
903
- self.hascancelanimationframe = ("cancelAnimationFrame" in _win);
904
-
905
- self.hasborderbox = false;
906
-
907
- this.init = function () {
908
-
909
- self.saved.css = [];
910
-
911
- if (cap.isoperamini) {
912
- return true;
913
- } // SORRY, DO NOT WORK!
914
- if (cap.isandroid && ! ("hidden" in _doc)) {
915
- return true;
916
- } // Android 3- SORRY, DO NOT WORK!
917
-
918
- opt.emulatetouch = opt.emulatetouch || opt.touchbehavior; // mantain compatibility with "touchbehavior"
919
-
920
- self.hasborderbox = _win.getComputedStyle && (_win.getComputedStyle(_doc.body)['box-sizing'] === "border-box");
921
-
922
- var _scrollyhidden = { 'overflow-y': 'hidden' };
923
- if (cap.isie11 || cap.isie10) {
924
- _scrollyhidden['-ms-overflow-style'] = 'none';
925
- } // IE 10 & 11 is always a world apart!
926
-
927
- if (self.ishwscroll) {
928
- this.doc.css(cap.transitionstyle, cap.prefixstyle + 'transform 0ms ease-out');
929
- if (cap.transitionend) {
930
- self.bind(self.doc, cap.transitionend, self.onScrollTransitionEnd, false);
931
- } //I have got to do something usefull!!
932
- }
933
-
934
- self.zindex = "auto";
935
- if (! self.ispage && opt.zindex == "auto") {
936
- self.zindex = getZIndex() || "auto";
937
- }
938
- else {
939
- self.zindex = opt.zindex;
940
- }
941
-
942
- if (! self.ispage && self.zindex != "auto" && self.zindex > globalmaxzindex) {
943
- globalmaxzindex = self.zindex;
944
- }
945
-
946
- if (self.isie && self.zindex === 0 && opt.zindex == "auto") { // fix IE auto == 0
947
- self.zindex = "auto";
948
- }
949
-
950
- if (! self.ispage || ! cap.isieold) {
951
-
952
- var cont = self.docscroll;
953
- if (self.ispage) {
954
- cont = (self.haswrapper) ? self.win : self.doc;
955
- }
956
-
957
- self.css(cont, _scrollyhidden);
958
-
959
- if (self.ispage && (cap.isie11 || cap.isie)) { // IE 7-11
960
- self.css($("html"), _scrollyhidden);
961
- }
962
-
963
- if (cap.isios && ! self.ispage && ! self.haswrapper) {
964
- self.css($body, {
965
- "-webkit-overflow-scrolling": "touch"
966
- });
967
- } //force hw acceleration
968
-
969
- var cursor = $(_doc.createElement('div'));
970
- cursor.css({
971
- position: "relative",
972
- top: 0,
973
- "float": "right",
974
- width: opt.cursorwidth,
975
- height: 0,
976
- 'background-color': opt.cursorcolor,
977
- border: opt.cursorborder,
978
- 'background-clip': 'padding-box',
979
- '-webkit-border-radius': opt.cursorborderradius,
980
- '-moz-border-radius': opt.cursorborderradius,
981
- 'border-radius': opt.cursorborderradius
982
- });
983
-
984
- cursor.addClass('nicescroll-cursors');
985
-
986
- self.cursor = cursor;
987
-
988
- var rail = $(_doc.createElement('div'));
989
- rail.attr('id', self.id);
990
- rail.addClass('nicescroll-rails nicescroll-rails-vr');
991
-
992
- var v, a, kp = ["left", "right", "top", "bottom"]; //**
993
- for (var n in kp) {
994
- a = kp[n];
995
- v = opt.railpadding[a] || 0;
996
- v && rail.css("padding-" + a, v + "px");
997
- }
998
-
999
- rail.append(cursor);
1000
-
1001
- rail.width = Math.max(parseFloat(opt.cursorwidth), cursor.outerWidth());
1002
- rail.css({
1003
- width: rail.width + "px",
1004
- zIndex: self.zindex,
1005
- background: opt.background,
1006
- cursor: "default"
1007
- });
1008
-
1009
- rail.visibility = true;
1010
- rail.scrollable = true;
1011
-
1012
- rail.align = (opt.railalign == "left") ? 0 : 1;
1013
-
1014
- self.rail = rail;
1015
-
1016
- self.rail.drag = false;
1017
-
1018
- var zoom = false;
1019
- if (opt.boxzoom && ! self.ispage && ! cap.isieold) {
1020
- zoom = _doc.createElement('div');
1021
-
1022
- self.bind(zoom, "click", self.doZoom);
1023
- self.bind(zoom, "mouseenter", function () {
1024
- self.zoom.css('opacity', opt.cursoropacitymax);
1025
- });
1026
- self.bind(zoom, "mouseleave", function () {
1027
- self.zoom.css('opacity', opt.cursoropacitymin);
1028
- });
1029
-
1030
- self.zoom = $(zoom);
1031
- self.zoom.css({
1032
- cursor: "pointer",
1033
- zIndex: self.zindex,
1034
- backgroundImage: 'url(' + opt.scriptpath + 'zoomico.png)',
1035
- height: 18,
1036
- width: 18,
1037
- backgroundPosition: '0 0'
1038
- });
1039
- if (opt.dblclickzoom) {
1040
- self.bind(self.win, "dblclick", self.doZoom);
1041
- }
1042
- if (cap.cantouch && opt.gesturezoom) {
1043
- self.ongesturezoom = function (e) {
1044
- if (e.scale > 1.5) {
1045
- self.doZoomIn(e);
1046
- }
1047
- if (e.scale < 0.8) {
1048
- self.doZoomOut(e);
1049
- }
1050
- return self.cancelEvent(e);
1051
- };
1052
- self.bind(self.win, "gestureend", self.ongesturezoom);
1053
- }
1054
- }
1055
-
1056
- // init HORIZ
1057
-
1058
- self.railh = false;
1059
- var railh;
1060
-
1061
- if (opt.horizrailenabled) {
1062
-
1063
- self.css(cont, {
1064
- overflowX: 'hidden'
1065
- });
1066
-
1067
- cursor = $(_doc.createElement('div'));
1068
- cursor.css({
1069
- position: "absolute",
1070
- top: 0,
1071
- height: opt.cursorwidth,
1072
- width: 0,
1073
- backgroundColor: opt.cursorcolor,
1074
- border: opt.cursorborder,
1075
- backgroundClip: 'padding-box',
1076
- '-webkit-border-radius': opt.cursorborderradius,
1077
- '-moz-border-radius': opt.cursorborderradius,
1078
- 'border-radius': opt.cursorborderradius
1079
- });
1080
-
1081
- if (cap.isieold) {
1082
- cursor.css('overflow', 'hidden');
1083
- } //IE6 horiz scrollbar issue
1084
-
1085
- cursor.addClass('nicescroll-cursors');
1086
-
1087
- self.cursorh = cursor;
1088
-
1089
- railh = $(_doc.createElement('div'));
1090
- railh.attr('id', self.id + '-hr');
1091
- railh.addClass('nicescroll-rails nicescroll-rails-hr');
1092
- railh.height = Math.max(parseFloat(opt.cursorwidth), cursor.outerHeight());
1093
- railh.css({
1094
- height: railh.height + "px",
1095
- 'zIndex': self.zindex,
1096
- "background": opt.background
1097
- });
1098
-
1099
- railh.append(cursor);
1100
-
1101
- railh.visibility = true;
1102
- railh.scrollable = true;
1103
-
1104
- railh.align = (opt.railvalign == "top") ? 0 : 1;
1105
-
1106
- self.railh = railh;
1107
-
1108
- self.railh.drag = false;
1109
-
1110
- }
1111
-
1112
- if (self.ispage) {
1113
-
1114
- rail.css({
1115
- position: "fixed",
1116
- top: 0,
1117
- height: "100%"
1118
- });
1119
-
1120
- rail.css((rail.align) ? { right: 0 } : { left: 0 });
1121
-
1122
- self.body.append(rail);
1123
- if (self.railh) {
1124
- railh.css({
1125
- position: "fixed",
1126
- left: 0,
1127
- width: "100%"
1128
- });
1129
-
1130
- railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1131
-
1132
- self.body.append(railh);
1133
- }
1134
- }
1135
- else {
1136
- if (self.ishwscroll) {
1137
- if (self.win.css('position') == 'static') {
1138
- self.css(self.win, { 'position': 'relative' });
1139
- }
1140
- var bd = (self.win[0].nodeName == 'HTML') ? self.body : self.win;
1141
- $(bd).scrollTop(0).scrollLeft(0); // fix rail position if content already scrolled
1142
- if (self.zoom) {
1143
- self.zoom.css({
1144
- position: "absolute",
1145
- top: 1,
1146
- right: 0,
1147
- "margin-right": rail.width + 4
1148
- });
1149
- bd.append(self.zoom);
1150
- }
1151
- rail.css({
1152
- position: "absolute",
1153
- top: 0
1154
- });
1155
- rail.css((rail.align) ? { right: 0 } : { left: 0 });
1156
- bd.append(rail);
1157
- if (railh) {
1158
- railh.css({
1159
- position: "absolute",
1160
- left: 0,
1161
- bottom: 0
1162
- });
1163
- railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1164
- bd.append(railh);
1165
- }
1166
- }
1167
- else {
1168
- self.isfixed = (self.win.css("position") == "fixed");
1169
- var rlpos = (self.isfixed) ? "fixed" : "absolute";
1170
-
1171
- if (! self.isfixed) {
1172
- self.viewport = self.getViewport(self.win[0]);
1173
- }
1174
- if (self.viewport) {
1175
- self.body = self.viewport;
1176
- if (! (/fixed|absolute/.test(self.viewport.css("position")))) {
1177
- self.css(self.viewport, {
1178
- "position": "relative"
1179
- });
1180
- }
1181
- }
1182
-
1183
- rail.css({
1184
- position: rlpos
1185
- });
1186
- if (self.zoom) {
1187
- self.zoom.css({
1188
- position: rlpos
1189
- });
1190
- }
1191
- self.updateScrollBar();
1192
- self.body.append(rail);
1193
- if (self.zoom) {
1194
- self.body.append(self.zoom);
1195
- }
1196
- if (self.railh) {
1197
- railh.css({
1198
- position: rlpos
1199
- });
1200
- self.body.append(railh);
1201
- }
1202
- }
1203
-
1204
- if (cap.isios) {
1205
- self.css(self.win, {
1206
- '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',
1207
- '-webkit-touch-callout': 'none'
1208
- });
1209
- } // prevent grey layer on click
1210
-
1211
- if (opt.disableoutline) {
1212
- if (cap.isie) {
1213
- self.win.attr("hideFocus", "true");
1214
- } // IE, prevent dotted rectangle on focused div
1215
- if (cap.iswebkit) {
1216
- self.win.css('outline', 'none');
1217
- } // Webkit outline
1218
- }
1219
-
1220
- }
1221
-
1222
- if (opt.autohidemode === false) {
1223
- self.autohidedom = false;
1224
- self.rail.css({
1225
- opacity: opt.cursoropacitymax
1226
- });
1227
- if (self.railh) {
1228
- self.railh.css({
1229
- opacity: opt.cursoropacitymax
1230
- });
1231
- }
1232
- }
1233
- else if ((opt.autohidemode === true) || (opt.autohidemode === "leave")) {
1234
- self.autohidedom = $().add(self.rail);
1235
- if (cap.isie8) {
1236
- self.autohidedom = self.autohidedom.add(self.cursor);
1237
- }
1238
- if (self.railh) {
1239
- self.autohidedom = self.autohidedom.add(self.railh);
1240
- }
1241
- if (self.railh && cap.isie8) {
1242
- self.autohidedom = self.autohidedom.add(self.cursorh);
1243
- }
1244
- }
1245
- else if (opt.autohidemode == "scroll") {
1246
- self.autohidedom = $().add(self.rail);
1247
- if (self.railh) {
1248
- self.autohidedom = self.autohidedom.add(self.railh);
1249
- }
1250
- }
1251
- else if (opt.autohidemode == "cursor") {
1252
- self.autohidedom = $().add(self.cursor);
1253
- if (self.railh) {
1254
- self.autohidedom = self.autohidedom.add(self.cursorh);
1255
- }
1256
- }
1257
- else if (opt.autohidemode == "hidden") {
1258
- self.autohidedom = false;
1259
- self.hide();
1260
- self.railslocked = false;
1261
- }
1262
-
1263
- if (cap.cantouch || self.istouchcapable || opt.emulatetouch || cap.hasmstouch) {
1264
-
1265
- self.scrollmom = new ScrollMomentumClass2D(self);
1266
-
1267
- var delayedclick = null;
1268
-
1269
- self.ontouchstart = function (e) {
1270
-
1271
- if (self.locked) {
1272
- return false;
1273
- }
1274
-
1275
- //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1276
- if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1277
- return false;
1278
- } // need test on surface!!
1279
-
1280
- self.hasmoving = false;
1281
-
1282
- if (self.scrollmom.timer) {
1283
- self.triggerScrollEnd();
1284
- self.scrollmom.stop();
1285
- }
1286
-
1287
- if (! self.railslocked) {
1288
- var tg = self.getTarget(e);
1289
-
1290
- if (tg) {
1291
- var skp = (/INPUT/i.test(tg.nodeName)) && (/range/i.test(tg.type));
1292
- if (skp) {
1293
- return self.stopPropagation(e);
1294
- }
1295
- }
1296
-
1297
- var ismouse = (e.type === "mousedown");
1298
-
1299
- if (! ("clientX" in e) && ("changedTouches" in e)) {
1300
- e.clientX = e.changedTouches[0].clientX;
1301
- e.clientY = e.changedTouches[0].clientY;
1302
- }
1303
-
1304
- if (self.forcescreen) {
1305
- var le = e;
1306
- e = {
1307
- "original": (e.original) ? e.original : e
1308
- };
1309
- e.clientX = le.screenX;
1310
- e.clientY = le.screenY;
1311
- }
1312
-
1313
- self.rail.drag = {
1314
- x: e.clientX,
1315
- y: e.clientY,
1316
- sx: self.scroll.x,
1317
- sy: self.scroll.y,
1318
- st: self.getScrollTop(),
1319
- sl: self.getScrollLeft(),
1320
- pt: 2,
1321
- dl: false,
1322
- tg: tg
1323
- };
1324
-
1325
- if (self.ispage || ! opt.directionlockdeadzone) {
1326
-
1327
- self.rail.drag.dl = "f";
1328
-
1329
- }
1330
- else {
1331
-
1332
- var view = {
1333
- w: $window.width(),
1334
- h: $window.height()
1335
- };
1336
-
1337
- var page = self.getContentSize();
1338
-
1339
- var maxh = page.h - view.h;
1340
- var maxw = page.w - view.w;
1341
-
1342
- if (self.rail.scrollable && ! self.railh.scrollable) {
1343
- self.rail.drag.ck = (maxh > 0) ? "v" : false;
1344
- }
1345
- else if (! self.rail.scrollable && self.railh.scrollable) {
1346
- self.rail.drag.ck = (maxw > 0) ? "h" : false;
1347
- }
1348
- else {
1349
- self.rail.drag.ck = false;
1350
- }
1351
-
1352
- }
1353
-
1354
- if (opt.emulatetouch && self.isiframe && cap.isie) {
1355
- var wp = self.win.position();
1356
- self.rail.drag.x += wp.left;
1357
- self.rail.drag.y += wp.top;
1358
- }
1359
-
1360
- self.hasmoving = false;
1361
- self.lastmouseup = false;
1362
- self.scrollmom.reset(e.clientX, e.clientY);
1363
-
1364
- if (tg && ismouse) {
1365
-
1366
- var ip = /INPUT|SELECT|BUTTON|TEXTAREA/i.test(tg.nodeName);
1367
- if (! ip) {
1368
- if (cap.hasmousecapture) {
1369
- tg.setCapture();
1370
- }
1371
- if (opt.emulatetouch) {
1372
- if (tg.onclick && ! (tg._onclick || false)) { // intercept DOM0 onclick event
1373
- tg._onclick = tg.onclick;
1374
- tg.onclick = function (e) {
1375
- if (self.hasmoving) {
1376
- return false;
1377
- }
1378
- tg._onclick.call(this, e);
1379
- };
1380
- }
1381
- return self.cancelEvent(e);
1382
- }
1383
- return self.stopPropagation(e);
1384
- }
1385
-
1386
- if (/SUBMIT|CANCEL|BUTTON/i.test($(tg).attr('type'))) {
1387
- self.preventclick = {
1388
- "tg": tg,
1389
- "click": false
1390
- };
1391
- }
1392
-
1393
- }
1394
- }
1395
-
1396
- };
1397
-
1398
- self.ontouchend = function (e) {
1399
-
1400
- if (! self.rail.drag) {
1401
- return true;
1402
- }
1403
-
1404
- if (self.rail.drag.pt == 2) {
1405
- //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1406
- if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1407
- return false;
1408
- }
1409
-
1410
- self.rail.drag = false;
1411
-
1412
- var ismouse = (e.type === "mouseup");
1413
-
1414
- if (self.hasmoving) {
1415
- self.scrollmom.doMomentum();
1416
- self.lastmouseup = true;
1417
- self.hideCursor();
1418
- if (cap.hasmousecapture) {
1419
- _doc.releaseCapture();
1420
- }
1421
- if (ismouse) {
1422
- return self.cancelEvent(e);
1423
- }
1424
- }
1425
-
1426
- }
1427
- else if (self.rail.drag.pt == 1) {
1428
- return self.onmouseup(e);
1429
- }
1430
-
1431
- };
1432
-
1433
- var moveneedoffset = (opt.emulatetouch && self.isiframe && ! cap.hasmousecapture);
1434
-
1435
- var locktollerance = opt.directionlockdeadzone * 0.3 | 0;
1436
-
1437
- self.ontouchmove = function (e, byiframe) {
1438
-
1439
- if (! self.rail.drag) {
1440
- return true;
1441
- }
1442
-
1443
- if (e.targetTouches && opt.preventmultitouchscrolling) {
1444
- if (e.targetTouches.length > 1) {
1445
- return true;
1446
- } // multitouch
1447
- }
1448
-
1449
- //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1450
- if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1451
- return true;
1452
- }
1453
-
1454
- if (self.rail.drag.pt == 2) {
1455
-
1456
- if (("changedTouches" in e)) {
1457
- e.clientX = e.changedTouches[0].clientX;
1458
- e.clientY = e.changedTouches[0].clientY;
1459
- }
1460
-
1461
- var ofy, ofx;
1462
- ofx = ofy = 0;
1463
-
1464
- if (moveneedoffset && ! byiframe) {
1465
- var wp = self.win.position();
1466
- ofx = - wp.left;
1467
- ofy = - wp.top;
1468
- }
1469
-
1470
- var fy = e.clientY + ofy;
1471
- var my = (fy - self.rail.drag.y);
1472
- var fx = e.clientX + ofx;
1473
- var mx = (fx - self.rail.drag.x);
1474
-
1475
- var ny = self.rail.drag.st - my;
1476
-
1477
- if (self.ishwscroll && opt.bouncescroll) {
1478
- if (ny < 0) {
1479
- ny = Math.round(ny / 2);
1480
- }
1481
- else if (ny > self.page.maxh) {
1482
- ny = self.page.maxh + Math.round((ny - self.page.maxh) / 2);
1483
- }
1484
- }
1485
- else {
1486
- if (ny < 0) {
1487
- ny = 0;
1488
- fy = 0;
1489
- }
1490
- else if (ny > self.page.maxh) {
1491
- ny = self.page.maxh;
1492
- fy = 0;
1493
- }
1494
- if (fy === 0 && ! self.hasmoving) {
1495
- if (! self.ispage) {
1496
- self.rail.drag = false;
1497
- }
1498
- return true;
1499
- }
1500
- }
1501
-
1502
- var nx = self.getScrollLeft();
1503
-
1504
- if (self.railh && self.railh.scrollable) {
1505
- nx = (self.isrtlmode) ? mx - self.rail.drag.sl : self.rail.drag.sl - mx;
1506
-
1507
- if (self.ishwscroll && opt.bouncescroll) {
1508
- if (nx < 0) {
1509
- nx = Math.round(nx / 2);
1510
- }
1511
- else if (nx > self.page.maxw) {
1512
- nx = self.page.maxw + Math.round((nx - self.page.maxw) / 2);
1513
- }
1514
- }
1515
- else {
1516
- if (nx < 0) {
1517
- nx = 0;
1518
- fx = 0;
1519
- }
1520
- if (nx > self.page.maxw) {
1521
- nx = self.page.maxw;
1522
- fx = 0;
1523
- }
1524
- }
1525
-
1526
- }
1527
-
1528
-
1529
- if (! self.hasmoving) {
1530
-
1531
- if (self.rail.drag.y === e.clientY && self.rail.drag.x === e.clientX) {
1532
- return self.cancelEvent(e);
1533
- } // prevent first useless move event
1534
-
1535
- var ay = Math.abs(my);
1536
- var ax = Math.abs(mx);
1537
- var dz = opt.directionlockdeadzone;
1538
-
1539
- if (! self.rail.drag.ck) {
1540
- if (ay > dz && ax > dz) {
1541
- self.rail.drag.dl = "f";
1542
- }
1543
- else if (ay > dz) {
1544
- self.rail.drag.dl = (ax > locktollerance) ? "f" : "v";
1545
- }
1546
- else if (ax > dz) {
1547
- self.rail.drag.dl = (ay > locktollerance) ? "f" : "h";
1548
- }
1549
- }
1550
- else if (self.rail.drag.ck == "v") {
1551
- if (ax > dz && ay <= locktollerance) {
1552
- self.rail.drag = false;
1553
- }
1554
- else if (ay > dz) {
1555
- self.rail.drag.dl = "v";
1556
- }
1557
-
1558
- }
1559
- else if (self.rail.drag.ck == "h") {
1560
-
1561
- if (ay > dz && ax <= locktollerance) {
1562
- self.rail.drag = false;
1563
- }
1564
- else if (ax > dz) {
1565
- self.rail.drag.dl = "h";
1566
- }
1567
-
1568
- }
1569
-
1570
- if (! self.rail.drag.dl) {
1571
- return self.cancelEvent(e);
1572
- }
1573
-
1574
- self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1575
- self.hasmoving = true;
1576
- }
1577
-
1578
- if (self.preventclick && ! self.preventclick.click) {
1579
- self.preventclick.click = self.preventclick.tg.onclick || false;
1580
- self.preventclick.tg.onclick = self.onpreventclick;
1581
- }
1582
-
1583
- if (self.rail.drag.dl) {
1584
- if (self.rail.drag.dl == "v") {
1585
- nx = self.rail.drag.sl;
1586
- }
1587
- else if (self.rail.drag.dl == "h") {
1588
- ny = self.rail.drag.st;
1589
- }
1590
- }
1591
-
1592
- self.synched("touchmove", function () {
1593
- if (self.rail.drag && (self.rail.drag.pt == 2)) {
1594
- if (self.prepareTransition) {
1595
- self.resetTransition();
1596
- }
1597
- if (self.rail.scrollable) {
1598
- self.setScrollTop(ny);
1599
- }
1600
- self.scrollmom.update(fx, fy);
1601
- if (self.railh && self.railh.scrollable) {
1602
- self.setScrollLeft(nx);
1603
- self.showCursor(ny, nx);
1604
- }
1605
- else {
1606
- self.showCursor(ny);
1607
- }
1608
- if (cap.isie10) {
1609
- _doc.selection.clear();
1610
- }
1611
- }
1612
- });
1613
-
1614
- return self.cancelEvent(e);
1615
-
1616
- }
1617
- else if (self.rail.drag.pt == 1) { // drag on cursor
1618
- return self.onmousemove(e);
1619
- }
1620
-
1621
- };
1622
-
1623
- self.ontouchstartCursor = function (e, hronly) {
1624
- if (self.rail.drag && self.rail.drag.pt != 3) {
1625
- return;
1626
- }
1627
- if (self.locked) {
1628
- return self.cancelEvent(e);
1629
- }
1630
- self.cancelScroll();
1631
- self.rail.drag = {
1632
- x: e.touches[0].clientX,
1633
- y: e.touches[0].clientY,
1634
- sx: self.scroll.x,
1635
- sy: self.scroll.y,
1636
- pt: 3,
1637
- hr: (! ! hronly)
1638
- };
1639
- var tg = self.getTarget(e);
1640
- if (! self.ispage && cap.hasmousecapture) {
1641
- tg.setCapture();
1642
- }
1643
- if (self.isiframe && ! cap.hasmousecapture) {
1644
- self.saved.csspointerevents = self.doc.css("pointer-events");
1645
- self.css(self.doc, { "pointer-events": "none" });
1646
- }
1647
- return self.cancelEvent(e);
1648
- };
1649
-
1650
- self.ontouchendCursor = function (e) {
1651
- if (self.rail.drag) {
1652
- if (cap.hasmousecapture) {
1653
- _doc.releaseCapture();
1654
- }
1655
- if (self.isiframe && ! cap.hasmousecapture) {
1656
- self.doc.css("pointer-events", self.saved.csspointerevents);
1657
- }
1658
- if (self.rail.drag.pt != 3) {
1659
- return;
1660
- }
1661
- self.rail.drag = false;
1662
- return self.cancelEvent(e);
1663
- }
1664
- };
1665
-
1666
- self.ontouchmoveCursor = function (e) {
1667
- if (self.rail.drag) {
1668
- if (self.rail.drag.pt != 3) {
1669
- return;
1670
- }
1671
-
1672
- self.cursorfreezed = true;
1673
-
1674
- if (self.rail.drag.hr) {
1675
- self.scroll.x = self.rail.drag.sx + (e.touches[0].clientX - self.rail.drag.x);
1676
- if (self.scroll.x < 0) {
1677
- self.scroll.x = 0;
1678
- }
1679
- var mw = self.scrollvaluemaxw;
1680
- if (self.scroll.x > mw) {
1681
- self.scroll.x = mw;
1682
- }
1683
- }
1684
- else {
1685
- self.scroll.y = self.rail.drag.sy + (e.touches[0].clientY - self.rail.drag.y);
1686
- if (self.scroll.y < 0) {
1687
- self.scroll.y = 0;
1688
- }
1689
- var my = self.scrollvaluemax;
1690
- if (self.scroll.y > my) {
1691
- self.scroll.y = my;
1692
- }
1693
- }
1694
-
1695
- self.synched('touchmove', function () {
1696
- if (self.rail.drag && (self.rail.drag.pt == 3)) {
1697
- self.showCursor();
1698
- if (self.rail.drag.hr) {
1699
- self.doScrollLeft(Math.round(self.scroll.x * self.scrollratio.x), opt.cursordragspeed);
1700
- }
1701
- else {
1702
- self.doScrollTop(Math.round(self.scroll.y * self.scrollratio.y), opt.cursordragspeed);
1703
- }
1704
- }
1705
- });
1706
-
1707
- return self.cancelEvent(e);
1708
- }
1709
-
1710
- };
1711
-
1712
- }
1713
-
1714
- self.onmousedown = function (e, hronly) {
1715
- if (self.rail.drag && self.rail.drag.pt != 1) {
1716
- return;
1717
- }
1718
- if (self.railslocked) {
1719
- return self.cancelEvent(e);
1720
- }
1721
- self.cancelScroll();
1722
- self.rail.drag = {
1723
- x: e.clientX,
1724
- y: e.clientY,
1725
- sx: self.scroll.x,
1726
- sy: self.scroll.y,
1727
- pt: 1,
1728
- hr: hronly || false
1729
- };
1730
- var tg = self.getTarget(e);
1731
-
1732
- if (cap.hasmousecapture) {
1733
- tg.setCapture();
1734
- }
1735
- if (self.isiframe && ! cap.hasmousecapture) {
1736
- self.saved.csspointerevents = self.doc.css("pointer-events");
1737
- self.css(self.doc, {
1738
- "pointer-events": "none"
1739
- });
1740
- }
1741
- self.hasmoving = false;
1742
- return self.cancelEvent(e);
1743
- };
1744
-
1745
- self.onmouseup = function (e) {
1746
- if (self.rail.drag) {
1747
- if (self.rail.drag.pt != 1) {
1748
- return true;
1749
- }
1750
-
1751
- if (cap.hasmousecapture) {
1752
- _doc.releaseCapture();
1753
- }
1754
- if (self.isiframe && ! cap.hasmousecapture) {
1755
- self.doc.css("pointer-events", self.saved.csspointerevents);
1756
- }
1757
- self.rail.drag = false;
1758
- self.cursorfreezed = false;
1759
- if (self.hasmoving) {
1760
- self.triggerScrollEnd();
1761
- }
1762
- return self.cancelEvent(e);
1763
- }
1764
- };
1765
-
1766
- self.onmousemove = function (e) {
1767
- if (self.rail.drag) {
1768
- if (self.rail.drag.pt !== 1) {
1769
- return;
1770
- }
1771
-
1772
- if (cap.ischrome && e.which === 0) {
1773
- return self.onmouseup(e);
1774
- }
1775
-
1776
- self.cursorfreezed = true;
1777
-
1778
- if (! self.hasmoving) {
1779
- self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1780
- }
1781
-
1782
- self.hasmoving = true;
1783
-
1784
- if (self.rail.drag.hr) {
1785
- self.scroll.x = self.rail.drag.sx + (e.clientX - self.rail.drag.x);
1786
- if (self.scroll.x < 0) {
1787
- self.scroll.x = 0;
1788
- }
1789
- var mw = self.scrollvaluemaxw;
1790
- if (self.scroll.x > mw) {
1791
- self.scroll.x = mw;
1792
- }
1793
- }
1794
- else {
1795
- self.scroll.y = self.rail.drag.sy + (e.clientY - self.rail.drag.y);
1796
- if (self.scroll.y < 0) {
1797
- self.scroll.y = 0;
1798
- }
1799
- var my = self.scrollvaluemax;
1800
- if (self.scroll.y > my) {
1801
- self.scroll.y = my;
1802
- }
1803
- }
1804
-
1805
- self.synched('mousemove', function () {
1806
-
1807
- if (self.cursorfreezed) {
1808
- self.showCursor();
1809
-
1810
- if (self.rail.drag.hr) {
1811
- self.scrollLeft(Math.round(self.scroll.x * self.scrollratio.x));
1812
- }
1813
- else {
1814
- self.scrollTop(Math.round(self.scroll.y * self.scrollratio.y));
1815
- }
1816
-
1817
- }
1818
- });
1819
-
1820
- return self.cancelEvent(e);
1821
- }
1822
- else {
1823
- self.checkarea = 0;
1824
- }
1825
- };
1826
-
1827
- if (cap.cantouch || opt.emulatetouch) {
1828
-
1829
- self.onpreventclick = function (e) {
1830
- if (self.preventclick) {
1831
- self.preventclick.tg.onclick = self.preventclick.click;
1832
- self.preventclick = false;
1833
- return self.cancelEvent(e);
1834
- }
1835
- };
1836
-
1837
- self.onclick = (cap.isios) ? false : function (e) { // it needs to check IE11 ???
1838
- if (self.lastmouseup) {
1839
- self.lastmouseup = false;
1840
- return self.cancelEvent(e);
1841
- }
1842
- else {
1843
- return true;
1844
- }
1845
- };
1846
-
1847
- if (opt.grabcursorenabled && cap.cursorgrabvalue) {
1848
- self.css((self.ispage) ? self.doc : self.win, {
1849
- 'cursor': cap.cursorgrabvalue
1850
- });
1851
- self.css(self.rail, {
1852
- 'cursor': cap.cursorgrabvalue
1853
- });
1854
- }
1855
-
1856
- }
1857
- else {
1858
-
1859
- var checkSelectionScroll = function (e) {
1860
- if (! self.selectiondrag) {
1861
- return;
1862
- }
1863
-
1864
- if (e) {
1865
- var ww = self.win.outerHeight();
1866
- var df = (e.pageY - self.selectiondrag.top);
1867
- if (df > 0 && df < ww) {
1868
- df = 0;
1869
- }
1870
- if (df >= ww) {
1871
- df -= ww;
1872
- }
1873
- self.selectiondrag.df = df;
1874
- }
1875
- if (self.selectiondrag.df === 0) {
1876
- return;
1877
- }
1878
-
1879
- var rt = - (self.selectiondrag.df * 2 / 6) | 0;
1880
- self.doScrollBy(rt);
1881
-
1882
- self.debounced("doselectionscroll", function () {
1883
- checkSelectionScroll();
1884
- }, 50);
1885
- };
1886
-
1887
- if ("getSelection" in _doc) { // A grade - Major browsers
1888
- self.hasTextSelected = function () {
1889
- return (_doc.getSelection().rangeCount > 0);
1890
- };
1891
- }
1892
- else if ("selection" in _doc) { //IE9-
1893
- self.hasTextSelected = function () {
1894
- return (_doc.selection.type != "None");
1895
- };
1896
- }
1897
- else {
1898
- self.hasTextSelected = function () { // no support
1899
- return false;
1900
- };
1901
- }
1902
-
1903
- self.onselectionstart = function (e) {
1904
- // More testing - severe chrome issues
1905
- /*
1906
- if (!self.haswrapper&&(e.which&&e.which==2)) { // fool browser to manage middle button scrolling
1907
- self.win.css({'overflow':'auto'});
1908
- setTimeout(function(){
1909
- self.win.css({'overflow':'hidden'});
1910
- },10);
1911
- return true;
1912
- }
1913
- */
1914
- if (self.ispage) {
1915
- return;
1916
- }
1917
- self.selectiondrag = self.win.offset();
1918
- };
1919
-
1920
- self.onselectionend = function (e) {
1921
- self.selectiondrag = false;
1922
- };
1923
- self.onselectiondrag = function (e) {
1924
- if (! self.selectiondrag) {
1925
- return;
1926
- }
1927
- if (self.hasTextSelected()) {
1928
- self.debounced("selectionscroll", function () {
1929
- checkSelectionScroll(e);
1930
- }, 250);
1931
- }
1932
- };
1933
- }
1934
-
1935
- if (cap.hasw3ctouch) { //IE11+
1936
- self.css((self.ispage) ? $("html") : self.win, { 'touch-action': 'none' });
1937
- self.css(self.rail, {
1938
- 'touch-action': 'none'
1939
- });
1940
- self.css(self.cursor, {
1941
- 'touch-action': 'none'
1942
- });
1943
- self.bind(self.win, "pointerdown", self.ontouchstart);
1944
- self.bind(_doc, "pointerup", self.ontouchend);
1945
- self.delegate(_doc, "pointermove", self.ontouchmove);
1946
- }
1947
- else if (cap.hasmstouch) { //IE10
1948
- self.css((self.ispage) ? $("html") : self.win, { '-ms-touch-action': 'none' });
1949
- self.css(self.rail, {
1950
- '-ms-touch-action': 'none'
1951
- });
1952
- self.css(self.cursor, {
1953
- '-ms-touch-action': 'none'
1954
- });
1955
- self.bind(self.win, "MSPointerDown", self.ontouchstart);
1956
- self.bind(_doc, "MSPointerUp", self.ontouchend);
1957
- self.delegate(_doc, "MSPointerMove", self.ontouchmove);
1958
- self.bind(self.cursor, "MSGestureHold", function (e) {
1959
- e.preventDefault();
1960
- });
1961
- self.bind(self.cursor, "contextmenu", function (e) {
1962
- e.preventDefault();
1963
- });
1964
- }
1965
- else if (cap.cantouch) { // smartphones/touch devices
1966
- self.bind(self.win, "touchstart", self.ontouchstart, false, true);
1967
- self.bind(_doc, "touchend", self.ontouchend, false, true);
1968
- self.bind(_doc, "touchcancel", self.ontouchend, false, true);
1969
- self.delegate(_doc, "touchmove", self.ontouchmove, false, true);
1970
- }
1971
-
1972
- if (opt.emulatetouch) {
1973
- self.bind(self.win, "mousedown", self.ontouchstart, false, true);
1974
- self.bind(_doc, "mouseup", self.ontouchend, false, true);
1975
- self.bind(_doc, "mousemove", self.ontouchmove, false, true);
1976
- }
1977
-
1978
- if (opt.cursordragontouch || (! cap.cantouch && ! opt.emulatetouch)) {
1979
-
1980
- self.rail.css({
1981
- cursor: "default"
1982
- });
1983
- self.railh && self.railh.css({
1984
- cursor: "default"
1985
- });
1986
-
1987
- self.jqbind(self.rail, "mouseenter", function () {
1988
- if (! self.ispage && ! self.win.is(":visible")) {
1989
- return false;
1990
- }
1991
- if (self.canshowonmouseevent) {
1992
- self.showCursor();
1993
- }
1994
- self.rail.active = true;
1995
- });
1996
- self.jqbind(self.rail, "mouseleave", function () {
1997
- self.rail.active = false;
1998
- if (! self.rail.drag) {
1999
- self.hideCursor();
2000
- }
2001
- });
2002
-
2003
- if (opt.sensitiverail) {
2004
- self.bind(self.rail, "click", function (e) {
2005
- self.doRailClick(e, false, false);
2006
- });
2007
- self.bind(self.rail, "dblclick", function (e) {
2008
- self.doRailClick(e, true, false);
2009
- });
2010
- self.bind(self.cursor, "click", function (e) {
2011
- self.cancelEvent(e);
2012
- });
2013
- self.bind(self.cursor, "dblclick", function (e) {
2014
- self.cancelEvent(e);
2015
- });
2016
- }
2017
-
2018
- if (self.railh) {
2019
- self.jqbind(self.railh, "mouseenter", function () {
2020
- if (! self.ispage && ! self.win.is(":visible")) {
2021
- return false;
2022
- }
2023
- if (self.canshowonmouseevent) {
2024
- self.showCursor();
2025
- }
2026
- self.rail.active = true;
2027
- });
2028
- self.jqbind(self.railh, "mouseleave", function () {
2029
- self.rail.active = false;
2030
- if (! self.rail.drag) {
2031
- self.hideCursor();
2032
- }
2033
- });
2034
-
2035
- if (opt.sensitiverail) {
2036
- self.bind(self.railh, "click", function (e) {
2037
- self.doRailClick(e, false, true);
2038
- });
2039
- self.bind(self.railh, "dblclick", function (e) {
2040
- self.doRailClick(e, true, true);
2041
- });
2042
- self.bind(self.cursorh, "click", function (e) {
2043
- self.cancelEvent(e);
2044
- });
2045
- self.bind(self.cursorh, "dblclick", function (e) {
2046
- self.cancelEvent(e);
2047
- });
2048
- }
2049
-
2050
- }
2051
-
2052
- }
2053
-
2054
- if (opt.cursordragontouch && (this.istouchcapable || cap.cantouch)) {
2055
- self.bind(self.cursor, "touchstart", self.ontouchstartCursor);
2056
- self.bind(self.cursor, "touchmove", self.ontouchmoveCursor);
2057
- self.bind(self.cursor, "touchend", self.ontouchendCursor);
2058
- self.cursorh && self.bind(self.cursorh, "touchstart", function (e) {
2059
- self.ontouchstartCursor(e, true);
2060
- });
2061
- self.cursorh && self.bind(self.cursorh, "touchmove", self.ontouchmoveCursor);
2062
- self.cursorh && self.bind(self.cursorh, "touchend", self.ontouchendCursor);
2063
- }
2064
-
2065
- // if (!cap.cantouch && !opt.emulatetouch) {
2066
- if (! opt.emulatetouch && ! cap.isandroid && ! cap.isios) {
2067
-
2068
- self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.onmouseup);
2069
- self.bind(_doc, "mousemove", self.onmousemove);
2070
- if (self.onclick) {
2071
- self.bind(_doc, "click", self.onclick);
2072
- }
2073
-
2074
- self.bind(self.cursor, "mousedown", self.onmousedown);
2075
- self.bind(self.cursor, "mouseup", self.onmouseup);
2076
-
2077
- if (self.railh) {
2078
- self.bind(self.cursorh, "mousedown", function (e) {
2079
- self.onmousedown(e, true);
2080
- });
2081
- self.bind(self.cursorh, "mouseup", self.onmouseup);
2082
- }
2083
-
2084
- if (! self.ispage && opt.enablescrollonselection) {
2085
- self.bind(self.win[0], "mousedown", self.onselectionstart);
2086
- self.bind(_doc, "mouseup", self.onselectionend);
2087
- self.bind(self.cursor, "mouseup", self.onselectionend);
2088
- if (self.cursorh) {
2089
- self.bind(self.cursorh, "mouseup", self.onselectionend);
2090
- }
2091
- self.bind(_doc, "mousemove", self.onselectiondrag);
2092
- }
2093
-
2094
- if (self.zoom) {
2095
- self.jqbind(self.zoom, "mouseenter", function () {
2096
- if (self.canshowonmouseevent) {
2097
- self.showCursor();
2098
- }
2099
- self.rail.active = true;
2100
- });
2101
- self.jqbind(self.zoom, "mouseleave", function () {
2102
- self.rail.active = false;
2103
- if (! self.rail.drag) {
2104
- self.hideCursor();
2105
- }
2106
- });
2107
- }
2108
-
2109
- }
2110
- else {
2111
-
2112
- self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.ontouchend);
2113
- if (self.onclick) {
2114
- self.bind(_doc, "click", self.onclick);
2115
- }
2116
-
2117
- if (opt.cursordragontouch) {
2118
- self.bind(self.cursor, "mousedown", self.onmousedown);
2119
- self.bind(self.cursor, "mouseup", self.onmouseup);
2120
- self.cursorh && self.bind(self.cursorh, "mousedown", function (e) {
2121
- self.onmousedown(e, true);
2122
- });
2123
- self.cursorh && self.bind(self.cursorh, "mouseup", self.onmouseup);
2124
- }
2125
- else {
2126
- self.bind(self.rail, "mousedown", function (e) {
2127
- e.preventDefault();
2128
- }); // prevent text selection
2129
- self.railh && self.bind(self.railh, "mousedown", function (e) {
2130
- e.preventDefault();
2131
- });
2132
- }
2133
-
2134
- }
2135
-
2136
-
2137
- if (opt.enablemousewheel) {
2138
- if (! self.isiframe) {
2139
- self.mousewheel((cap.isie && self.ispage) ? _doc : self.win, self.onmousewheel);
2140
- }
2141
- self.mousewheel(self.rail, self.onmousewheel);
2142
- if (self.railh) {
2143
- self.mousewheel(self.railh, self.onmousewheelhr);
2144
- }
2145
- }
2146
-
2147
- if (! self.ispage && ! cap.cantouch && ! (/HTML|^BODY/.test(self.win[0].nodeName))) {
2148
- if (! self.win.attr("tabindex")) {
2149
- self.win.attr({
2150
- "tabindex": ++ tabindexcounter
2151
- });
2152
- }
2153
-
2154
- self.bind(self.win, "focus", function (e) { // better using native events
2155
- domfocus = (self.getTarget(e)).id || self.getTarget(e) || false;
2156
- self.hasfocus = true;
2157
- if (self.canshowonmouseevent) {
2158
- self.noticeCursor();
2159
- }
2160
- });
2161
- self.bind(self.win, "blur", function (e) { // *
2162
- domfocus = false;
2163
- self.hasfocus = false;
2164
- });
2165
-
2166
- self.bind(self.win, "mouseenter", function (e) { // *
2167
- mousefocus = (self.getTarget(e)).id || self.getTarget(e) || false;
2168
- self.hasmousefocus = true;
2169
- if (self.canshowonmouseevent) {
2170
- self.noticeCursor();
2171
- }
2172
- });
2173
- self.bind(self.win, "mouseleave", function (e) { // *
2174
- mousefocus = false;
2175
- self.hasmousefocus = false;
2176
- if (! self.rail.drag) {
2177
- self.hideCursor();
2178
- }
2179
- });
2180
-
2181
- }
2182
-
2183
-
2184
- //Thanks to http://www.quirksmode.org !!
2185
- self.onkeypress = function (e) {
2186
- if (self.railslocked && self.page.maxh === 0) {
2187
- return true;
2188
- }
2189
-
2190
- e = e || _win.event;
2191
- var tg = self.getTarget(e);
2192
- if (tg && /INPUT|TEXTAREA|SELECT|OPTION/.test(tg.nodeName)) {
2193
- var tp = tg.getAttribute('type') || tg.type || false;
2194
- if ((! tp) || ! (/submit|button|cancel/i.tp)) {
2195
- return true;
2196
- }
2197
- }
2198
-
2199
- if ($(tg).attr('contenteditable')) {
2200
- return true;
2201
- }
2202
-
2203
- if (self.hasfocus || (self.hasmousefocus && ! domfocus) || (self.ispage && ! domfocus && ! mousefocus)) {
2204
- var key = e.keyCode;
2205
-
2206
- if (self.railslocked && key != 27) {
2207
- return self.cancelEvent(e);
2208
- }
2209
-
2210
- var ctrl = e.ctrlKey || false;
2211
- var shift = e.shiftKey || false;
2212
-
2213
- var ret = false;
2214
- switch (key) {
2215
- case 38:
2216
- case 63233: //safari
2217
- self.doScrollBy(24 * 3);
2218
- ret = true;
2219
- break;
2220
- case 40:
2221
- case 63235: //safari
2222
- self.doScrollBy(- 24 * 3);
2223
- ret = true;
2224
- break;
2225
- case 37:
2226
- case 63232: //safari
2227
- if (self.railh) {
2228
- (ctrl) ? self.doScrollLeft(0) : self.doScrollLeftBy(24 * 3);
2229
- ret = true;
2230
- }
2231
- break;
2232
- case 39:
2233
- case 63234: //safari
2234
- if (self.railh) {
2235
- (ctrl) ? self.doScrollLeft(self.page.maxw) : self.doScrollLeftBy(- 24 * 3);
2236
- ret = true;
2237
- }
2238
- break;
2239
- case 33:
2240
- case 63276: // safari
2241
- self.doScrollBy(self.view.h);
2242
- ret = true;
2243
- break;
2244
- case 34:
2245
- case 63277: // safari
2246
- self.doScrollBy(- self.view.h);
2247
- ret = true;
2248
- break;
2249
- case 36:
2250
- case 63273: // safari
2251
- (self.railh && ctrl) ? self.doScrollPos(0, 0) : self.doScrollTo(0);
2252
- ret = true;
2253
- break;
2254
- case 35:
2255
- case 63275: // safari
2256
- (self.railh && ctrl) ? self.doScrollPos(self.page.maxw, self.page.maxh) : self.doScrollTo(self.page.maxh);
2257
- ret = true;
2258
- break;
2259
- case 32:
2260
- if (opt.spacebarenabled) {
2261
- (shift) ? self.doScrollBy(self.view.h) : self.doScrollBy(- self.view.h);
2262
- ret = true;
2263
- }
2264
- break;
2265
- case 27: // ESC
2266
- if (self.zoomactive) {
2267
- self.doZoom();
2268
- ret = true;
2269
- }
2270
- break;
2271
- }
2272
- if (ret) {
2273
- return self.cancelEvent(e);
2274
- }
2275
- }
2276
- };
2277
-
2278
- if (opt.enablekeyboard) {
2279
- self.bind(_doc, (cap.isopera && ! cap.isopera12) ? "keypress" : "keydown", self.onkeypress);
2280
- }
2281
-
2282
- self.bind(_doc, "keydown", function (e) {
2283
- var ctrl = e.ctrlKey || false;
2284
- if (ctrl) {
2285
- self.wheelprevented = true;
2286
- }
2287
- });
2288
- self.bind(_doc, "keyup", function (e) {
2289
- var ctrl = e.ctrlKey || false;
2290
- if (! ctrl) {
2291
- self.wheelprevented = false;
2292
- }
2293
- });
2294
- self.bind(_win, "blur", function (e) {
2295
- self.wheelprevented = false;
2296
- });
2297
-
2298
- self.bind(_win, 'resize', self.onscreenresize);
2299
- self.bind(_win, 'orientationchange', self.onscreenresize);
2300
-
2301
- self.bind(_win, "load", self.lazyResize);
2302
-
2303
- if (cap.ischrome && ! self.ispage && ! self.haswrapper) { //chrome void scrollbar bug - it persists in version 26
2304
- var tmp = self.win.attr("style");
2305
- var ww = parseFloat(self.win.css("width")) + 1;
2306
- self.win.css('width', ww);
2307
- self.synched("chromefix", function () {
2308
- self.win.attr("style", tmp);
2309
- });
2310
- }
2311
-
2312
-
2313
- // Trying a cross-browser implementation - good luck!
2314
-
2315
- self.onAttributeChange = function (e) {
2316
- self.lazyResize(self.isieold ? 250 : 30);
2317
- };
2318
-
2319
- if (opt.enableobserver) {
2320
-
2321
- if ((! self.isie11) && (ClsMutationObserver !== false)) { // IE11 crashes #568
2322
- self.observerbody = new ClsMutationObserver(function (mutations) {
2323
- mutations.forEach(function (mut) {
2324
- if (mut.type == "attributes") {
2325
- return ($body.hasClass("modal-open") && $body.hasClass("modal-dialog") && ! $.contains($('.modal-dialog')[0], self.doc[0])) ? self.hide() : self.show(); // Support for Bootstrap modal; Added check if the nice scroll element is inside a modal
2326
- }
2327
- });
2328
- if (self.me.clientWidth != self.page.width || self.me.clientHeight != self.page.height) {
2329
- return self.lazyResize(30);
2330
- }
2331
- });
2332
- self.observerbody.observe(_doc.body, {
2333
- childList: true,
2334
- subtree: true,
2335
- characterData: false,
2336
- attributes: true,
2337
- attributeFilter: ['class']
2338
- });
2339
- }
2340
-
2341
- if (! self.ispage && ! self.haswrapper) {
2342
-
2343
- var _dom = self.win[0];
2344
-
2345
- // redesigned MutationObserver for Chrome18+/Firefox14+/iOS6+ with support for: remove div, add/remove content
2346
- if (ClsMutationObserver !== false) {
2347
- self.observer = new ClsMutationObserver(function (mutations) {
2348
- mutations.forEach(self.onAttributeChange);
2349
- });
2350
- self.observer.observe(_dom, {
2351
- childList: true,
2352
- characterData: false,
2353
- attributes: true,
2354
- subtree: false
2355
- });
2356
- self.observerremover = new ClsMutationObserver(function (mutations) {
2357
- mutations.forEach(function (mo) {
2358
- if (mo.removedNodes.length > 0) {
2359
- for (var dd in mo.removedNodes) {
2360
- if (! ! self && (mo.removedNodes[dd] === _dom)) {
2361
- return self.remove();
2362
- }
2363
- }
2364
- }
2365
- });
2366
- });
2367
- self.observerremover.observe(_dom.parentNode, {
2368
- childList: true,
2369
- characterData: false,
2370
- attributes: false,
2371
- subtree: false
2372
- });
2373
- }
2374
- else {
2375
- self.bind(_dom, (cap.isie && ! cap.isie9) ? "propertychange" : "DOMAttrModified", self.onAttributeChange);
2376
- if (cap.isie9) {
2377
- _dom.attachEvent("onpropertychange", self.onAttributeChange);
2378
- } //IE9 DOMAttrModified bug
2379
- self.bind(_dom, "DOMNodeRemoved", function (e) {
2380
- if (e.target === _dom) {
2381
- self.remove();
2382
- }
2383
- });
2384
- }
2385
- }
2386
-
2387
- }
2388
-
2389
- //
2390
-
2391
- if (! self.ispage && opt.boxzoom) {
2392
- self.bind(_win, "resize", self.resizeZoom);
2393
- }
2394
- if (self.istextarea) {
2395
- self.bind(self.win, "keydown", self.lazyResize);
2396
- self.bind(self.win, "mouseup", self.lazyResize);
2397
- }
2398
-
2399
- self.lazyResize(30);
2400
-
2401
- }
2402
-
2403
- if (this.doc[0].nodeName == 'IFRAME') {
2404
- var oniframeload = function () {
2405
- self.iframexd = false;
2406
- var doc;
2407
- try {
2408
- doc = 'contentDocument' in this ? this.contentDocument : this.contentWindow._doc;
2409
- var a = doc.domain;
2410
- }
2411
- catch (e) {
2412
- self.iframexd = true;
2413
- doc = false;
2414
- }
2415
-
2416
- if (self.iframexd) {
2417
- if ("console" in _win) {
2418
- console.log('NiceScroll error: policy restriced iframe');
2419
- }
2420
- return true; //cross-domain - I can't manage this
2421
- }
2422
-
2423
- self.forcescreen = true;
2424
-
2425
- if (self.isiframe) {
2426
- self.iframe = {
2427
- "doc": $(doc),
2428
- "html": self.doc.contents().find('html')[0],
2429
- "body": self.doc.contents().find('body')[0]
2430
- };
2431
- self.getContentSize = function () {
2432
- return {
2433
- w: Math.max(self.iframe.html.scrollWidth, self.iframe.body.scrollWidth),
2434
- h: Math.max(self.iframe.html.scrollHeight, self.iframe.body.scrollHeight)
2435
- };
2436
- };
2437
- self.docscroll = $(self.iframe.body);
2438
- }
2439
-
2440
- if (! cap.isios && opt.iframeautoresize && ! self.isiframe) {
2441
- self.win.scrollTop(0); // reset position
2442
- self.doc.height(""); //reset height to fix browser bug
2443
- var hh = Math.max(doc.getElementsByTagName('html')[0].scrollHeight, doc.body.scrollHeight);
2444
- self.doc.height(hh);
2445
- }
2446
- self.lazyResize(30);
2447
-
2448
- self.css($(self.iframe.body), _scrollyhidden);
2449
-
2450
- if (cap.isios && self.haswrapper) {
2451
- self.css($(doc.body), {
2452
- '-webkit-transform': 'translate3d(0,0,0)'
2453
- }); // avoid iFrame content clipping - thanks to http://blog.derraab.com/2012/04/02/avoid-iframe-content-clipping-with-css-transform-on-ios/
2454
- }
2455
-
2456
- if ('contentWindow' in this) {
2457
- self.bind(this.contentWindow, "scroll", self.onscroll); //IE8 & minor
2458
- }
2459
- else {
2460
- self.bind(doc, "scroll", self.onscroll);
2461
- }
2462
-
2463
- if (opt.enablemousewheel) {
2464
- self.mousewheel(doc, self.onmousewheel);
2465
- }
2466
-
2467
- if (opt.enablekeyboard) {
2468
- self.bind(doc, (cap.isopera) ? "keypress" : "keydown", self.onkeypress);
2469
- }
2470
-
2471
- if (cap.cantouch) {
2472
- self.bind(doc, "touchstart", self.ontouchstart);
2473
- self.bind(doc, "touchmove", self.ontouchmove);
2474
- }
2475
- else if (opt.emulatetouch) {
2476
- self.bind(doc, "mousedown", self.ontouchstart);
2477
- self.bind(doc, "mousemove", function (e) {
2478
- return self.ontouchmove(e, true);
2479
- });
2480
- if (opt.grabcursorenabled && cap.cursorgrabvalue) {
2481
- self.css($(doc.body), {
2482
- 'cursor': cap.cursorgrabvalue
2483
- });
2484
- }
2485
- }
2486
-
2487
- self.bind(doc, "mouseup", self.ontouchend);
2488
-
2489
- if (self.zoom) {
2490
- if (opt.dblclickzoom) {
2491
- self.bind(doc, 'dblclick', self.doZoom);
2492
- }
2493
- if (self.ongesturezoom) {
2494
- self.bind(doc, "gestureend", self.ongesturezoom);
2495
- }
2496
- }
2497
- };
2498
-
2499
- if (this.doc[0].readyState && this.doc[0].readyState === "complete") {
2500
- setTimeout(function () {
2501
- oniframeload.call(self.doc[0], false);
2502
- }, 500);
2503
- }
2504
- self.bind(this.doc, "load", oniframeload);
2505
-
2506
- }
2507
-
2508
- };
2509
-
2510
- this.showCursor = function (py, px) {
2511
- if (self.cursortimeout) {
2512
- clearTimeout(self.cursortimeout);
2513
- self.cursortimeout = 0;
2514
- }
2515
- if (! self.rail) {
2516
- return;
2517
- }
2518
- if (self.autohidedom) {
2519
- self.autohidedom.stop().css({
2520
- opacity: opt.cursoropacitymax
2521
- });
2522
- self.cursoractive = true;
2523
- }
2524
-
2525
- if (! self.rail.drag || self.rail.drag.pt != 1) {
2526
- if (py !== undefined && py !== false) {
2527
- self.scroll.y = (py / self.scrollratio.y) | 0;
2528
- }
2529
- if (px !== undefined) {
2530
- self.scroll.x = (px / self.scrollratio.x) | 0;
2531
- }
2532
- }
2533
-
2534
- self.cursor.css({
2535
- height: self.cursorheight,
2536
- top: self.scroll.y
2537
- });
2538
- if (self.cursorh) {
2539
- var lx = (self.hasreversehr) ? self.scrollvaluemaxw - self.scroll.x : self.scroll.x;
2540
- self.cursorh.css({
2541
- width: self.cursorwidth,
2542
- left: (! self.rail.align && self.rail.visibility) ? lx + self.rail.width : lx
2543
- });
2544
- self.cursoractive = true;
2545
- }
2546
-
2547
- if (self.zoom) {
2548
- self.zoom.stop().css({
2549
- opacity: opt.cursoropacitymax
2550
- });
2551
- }
2552
- };
2553
-
2554
- this.hideCursor = function (tm) {
2555
- if (self.cursortimeout) {
2556
- return;
2557
- }
2558
- if (! self.rail) {
2559
- return;
2560
- }
2561
- if (! self.autohidedom) {
2562
- return;
2563
- }
2564
-
2565
- if (self.hasmousefocus && opt.autohidemode === "leave") {
2566
- return;
2567
- }
2568
- self.cursortimeout = setTimeout(function () {
2569
- if (! self.rail.active || ! self.showonmouseevent) {
2570
- self.autohidedom.stop().animate({
2571
- opacity: opt.cursoropacitymin
2572
- });
2573
- if (self.zoom) {
2574
- self.zoom.stop().animate({
2575
- opacity: opt.cursoropacitymin
2576
- });
2577
- }
2578
- self.cursoractive = false;
2579
- }
2580
- self.cursortimeout = 0;
2581
- }, tm || opt.hidecursordelay);
2582
- };
2583
-
2584
- this.noticeCursor = function (tm, py, px) {
2585
- self.showCursor(py, px);
2586
- if (! self.rail.active) {
2587
- self.hideCursor(tm);
2588
- }
2589
- };
2590
-
2591
- this.getContentSize =
2592
- (self.ispage) ?
2593
- function () {
2594
- return {
2595
- w: Math.max(_doc.body.scrollWidth, _doc.documentElement.scrollWidth),
2596
- h: Math.max(_doc.body.scrollHeight, _doc.documentElement.scrollHeight)
2597
- };
2598
- } : (self.haswrapper) ?
2599
- function () {
2600
- return {
2601
- w: self.doc[0].offsetWidth,
2602
- h: self.doc[0].offsetHeight
2603
- };
2604
- } : function () {
2605
- return {
2606
- w: self.docscroll[0].scrollWidth,
2607
- h: self.docscroll[0].scrollHeight
2608
- };
2609
- };
2610
-
2611
- this.onResize = function (e, page) {
2612
-
2613
- if (! self || ! self.win) {
2614
- return false;
2615
- }
2616
-
2617
- var premaxh = self.page.maxh,
2618
- premaxw = self.page.maxw,
2619
- previewh = self.view.h,
2620
- previeww = self.view.w;
2621
-
2622
- self.view = {
2623
- w: (self.ispage) ? self.win.width() : self.win[0].clientWidth,
2624
- h: (self.ispage) ? self.win.height() : self.win[0].clientHeight
2625
- };
2626
-
2627
- self.page = (page) ? page : self.getContentSize();
2628
-
2629
- self.page.maxh = Math.max(0, self.page.h - self.view.h);
2630
- self.page.maxw = Math.max(0, self.page.w - self.view.w);
2631
-
2632
- if ((self.page.maxh == premaxh) && (self.page.maxw == premaxw) && (self.view.w == previeww) && (self.view.h == previewh)) {
2633
- // test position
2634
- if (! self.ispage) {
2635
- var pos = self.win.offset();
2636
- if (self.lastposition) {
2637
- var lst = self.lastposition;
2638
- if ((lst.top == pos.top) && (lst.left == pos.left)) {
2639
- return self;
2640
- } //nothing to do
2641
- }
2642
- self.lastposition = pos;
2643
- }
2644
- else {
2645
- return self; //nothing to do
2646
- }
2647
- }
2648
-
2649
- if (self.page.maxh === 0) {
2650
- self.hideRail();
2651
- self.scrollvaluemax = 0;
2652
- self.scroll.y = 0;
2653
- self.scrollratio.y = 0;
2654
- self.cursorheight = 0;
2655
- self.setScrollTop(0);
2656
- if (self.rail) {
2657
- self.rail.scrollable = false;
2658
- }
2659
- }
2660
- else {
2661
- self.page.maxh -= (opt.railpadding.top + opt.railpadding.bottom);
2662
- self.rail.scrollable = true;
2663
- }
2664
-
2665
- if (self.page.maxw === 0) {
2666
- self.hideRailHr();
2667
- self.scrollvaluemaxw = 0;
2668
- self.scroll.x = 0;
2669
- self.scrollratio.x = 0;
2670
- self.cursorwidth = 0;
2671
- self.setScrollLeft(0);
2672
- if (self.railh) {
2673
- self.railh.scrollable = false;
2674
- }
2675
- }
2676
- else {
2677
- self.page.maxw -= (opt.railpadding.left + opt.railpadding.right);
2678
- if (self.railh) {
2679
- self.railh.scrollable = (opt.horizrailenabled);
2680
- }
2681
- }
2682
-
2683
- self.railslocked = (self.locked) || ((self.page.maxh === 0) && (self.page.maxw === 0));
2684
- if (self.railslocked) {
2685
- if (! self.ispage) {
2686
- self.updateScrollBar(self.view);
2687
- }
2688
- return false;
2689
- }
2690
-
2691
- if (! self.hidden) {
2692
- if (! self.rail.visibility) {
2693
- self.showRail();
2694
- }
2695
- if (self.railh && ! self.railh.visibility) {
2696
- self.showRailHr();
2697
- }
2698
- }
2699
-
2700
- if (self.istextarea && self.win.css('resize') && self.win.css('resize') != 'none') {
2701
- self.view.h -= 20;
2702
- }
2703
-
2704
- self.cursorheight = Math.min(self.view.h, Math.round(self.view.h * (self.view.h / self.page.h)));
2705
- self.cursorheight = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorheight);
2706
-
2707
- self.cursorwidth = Math.min(self.view.w, Math.round(self.view.w * (self.view.w / self.page.w)));
2708
- self.cursorwidth = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorwidth);
2709
-
2710
- self.scrollvaluemax = self.view.h - self.cursorheight - (opt.railpadding.top + opt.railpadding.bottom);
2711
- if (! self.hasborderbox) {
2712
- self.scrollvaluemax -= self.cursor[0].offsetHeight - self.cursor[0].clientHeight;
2713
- }
2714
-
2715
- if (self.railh) {
2716
- self.railh.width = (self.page.maxh > 0) ? (self.view.w - self.rail.width) : self.view.w;
2717
- self.scrollvaluemaxw = self.railh.width - self.cursorwidth - (opt.railpadding.left + opt.railpadding.right);
2718
- }
2719
-
2720
- if (! self.ispage) {
2721
- self.updateScrollBar(self.view);
2722
- }
2723
-
2724
- self.scrollratio = {
2725
- x: (self.page.maxw / self.scrollvaluemaxw),
2726
- y: (self.page.maxh / self.scrollvaluemax)
2727
- };
2728
-
2729
- var sy = self.getScrollTop();
2730
- if (sy > self.page.maxh) {
2731
- self.doScrollTop(self.page.maxh);
2732
- }
2733
- else {
2734
- self.scroll.y = (self.getScrollTop() / self.scrollratio.y) | 0;
2735
- self.scroll.x = (self.getScrollLeft() / self.scrollratio.x) | 0;
2736
- if (self.cursoractive) {
2737
- self.noticeCursor();
2738
- }
2739
- }
2740
-
2741
- if (self.scroll.y && (self.getScrollTop() === 0)) {
2742
- self.doScrollTo((self.scroll.y * self.scrollratio.y) | 0);
2743
- }
2744
-
2745
- return self;
2746
- };
2747
-
2748
- this.resize = self.onResize;
2749
-
2750
- var hlazyresize = 0;
2751
-
2752
- this.onscreenresize = function (e) {
2753
- clearTimeout(hlazyresize);
2754
-
2755
- var hiderails = (! self.ispage && ! self.haswrapper);
2756
- if (hiderails) {
2757
- self.hideRails();
2758
- }
2759
-
2760
- hlazyresize = setTimeout(function () {
2761
- if (self) {
2762
- if (hiderails) {
2763
- self.showRails();
2764
- }
2765
- self.resize();
2766
- }
2767
- hlazyresize = 0;
2768
- }, 120);
2769
- };
2770
-
2771
- this.lazyResize = function (tm) { // event debounce
2772
-
2773
- clearTimeout(hlazyresize);
2774
-
2775
- tm = isNaN(tm) ? 240 : tm;
2776
-
2777
- hlazyresize = setTimeout(function () {
2778
- self && self.resize();
2779
- hlazyresize = 0;
2780
- }, tm);
2781
-
2782
- return self;
2783
-
2784
- };
2785
-
2786
- // derived by MDN https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference/wheel
2787
- function _modernWheelEvent (dom, name, fn, bubble) {
2788
- self._bind(dom, name, function (e) {
2789
- e = e || _win.event;
2790
- var event = {
2791
- original: e,
2792
- target: e.target || e.srcElement,
2793
- type: "wheel",
2794
- deltaMode: e.type == "MozMousePixelScroll" ? 0 : 1,
2795
- deltaX: 0,
2796
- deltaZ: 0,
2797
- preventDefault: function () {
2798
- e.preventDefault ? e.preventDefault() : e.returnValue = false;
2799
- return false;
2800
- },
2801
- stopImmediatePropagation: function () {
2802
- (e.stopImmediatePropagation) ? e.stopImmediatePropagation() : e.cancelBubble = true;
2803
- }
2804
- };
2805
-
2806
- if (name == "mousewheel") {
2807
- e.wheelDeltaX && (event.deltaX = - 1 / 40 * e.wheelDeltaX);
2808
- e.wheelDeltaY && (event.deltaY = - 1 / 40 * e.wheelDeltaY);
2809
- ! event.deltaY && ! event.deltaX && (event.deltaY = - 1 / 40 * e.wheelDelta);
2810
- }
2811
- else {
2812
- event.deltaY = e.detail;
2813
- }
2814
-
2815
- return fn.call(dom, event);
2816
- }, bubble);
2817
- }
2818
-
2819
-
2820
- this.jqbind = function (dom, name, fn) { // use jquery bind for non-native events (mouseenter/mouseleave)
2821
- self.events.push({
2822
- e: dom,
2823
- n: name,
2824
- f: fn,
2825
- q: true
2826
- });
2827
- $(dom).on(name, fn);
2828
- };
2829
-
2830
- this.mousewheel = function (dom, fn, bubble) { // bind mousewheel
2831
- var el = ("jquery" in dom) ? dom[0] : dom;
2832
- if ("onwheel" in _doc.createElement("div")) { // Modern browsers support "wheel"
2833
- self._bind(el, "wheel", fn, bubble || false);
2834
- }
2835
- else {
2836
- var wname = (_doc.onmousewheel !== undefined) ? "mousewheel" : "DOMMouseScroll"; // older Webkit+IE support or older Firefox
2837
- _modernWheelEvent(el, wname, fn, bubble || false);
2838
- if (wname == "DOMMouseScroll") {
2839
- _modernWheelEvent(el, "MozMousePixelScroll", fn, bubble || false);
2840
- } // Firefox legacy
2841
- }
2842
- };
2843
-
2844
- var passiveSupported = false;
2845
-
2846
- if (cap.haseventlistener) { // W3C standard event model
2847
-
2848
- // thanks to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
2849
- try {
2850
- var options = Object.defineProperty({}, "passive", {
2851
- get: function () {
2852
- passiveSupported = ! 0;
2853
- }
2854
- });
2855
- _win.addEventListener("test", null, options);
2856
- }
2857
- catch (err) {
2858
- }
2859
-
2860
- this.stopPropagation = function (e) {
2861
- if (! e) {
2862
- return false;
2863
- }
2864
- e = (e.original) ? e.original : e;
2865
- e.stopPropagation();
2866
- return false;
2867
- };
2868
-
2869
- this.cancelEvent = function (e) {
2870
- if (e.cancelable) {
2871
- e.preventDefault();
2872
- }
2873
- e.stopImmediatePropagation();
2874
- if (e.preventManipulation) {
2875
- e.preventManipulation();
2876
- } // IE10+
2877
- return false;
2878
- };
2879
-
2880
- }
2881
- else {
2882
-
2883
- // inspired from https://gist.github.com/jonathantneal/2415137
2884
-
2885
- Event.prototype.preventDefault = function () {
2886
- this.returnValue = false;
2887
- };
2888
-
2889
- Event.prototype.stopPropagation = function () {
2890
- this.cancelBubble = true;
2891
- };
2892
-
2893
- _win.constructor.prototype.addEventListener = _doc.constructor.prototype.addEventListener = Element.prototype.addEventListener = function (type, listener, useCapture) {
2894
- this.attachEvent("on" + type, listener);
2895
- };
2896
- _win.constructor.prototype.removeEventListener = _doc.constructor.prototype.removeEventListener = Element.prototype.removeEventListener = function (type, listener, useCapture) {
2897
- this.detachEvent("on" + type, listener);
2898
- };
2899
-
2900
- // Thanks to http://www.switchonthecode.com !!
2901
- this.cancelEvent = function (e) {
2902
- e = e || _win.event;
2903
- if (e) {
2904
- e.cancelBubble = true;
2905
- e.cancel = true;
2906
- e.returnValue = false;
2907
- }
2908
- return false;
2909
- };
2910
-
2911
- this.stopPropagation = function (e) {
2912
- e = e || _win.event;
2913
- if (e) {
2914
- e.cancelBubble = true;
2915
- }
2916
- return false;
2917
- };
2918
-
2919
- }
2920
-
2921
- this.delegate = function (dom, name, fn, bubble, active) {
2922
-
2923
- var de = delegatevents[name] || false;
2924
-
2925
- if (! de) {
2926
-
2927
- de = {
2928
- a: [],
2929
- l: [],
2930
- f: function (e) {
2931
- var lst = de.l, l = lst.length - 1;
2932
- var r = false;
2933
- for (var a = l ; a >= 0 ; a --) {
2934
- r = lst[a].call(e.target, e);
2935
- if (r === false) {
2936
- return false;
2937
- }
2938
- }
2939
- return r;
2940
- }
2941
- };
2942
-
2943
- self.bind(dom, name, de.f, bubble, active);
2944
-
2945
- delegatevents[name] = de;
2946
-
2947
- }
2948
-
2949
- if (self.ispage) {
2950
- de.a = [self.id].concat(de.a);
2951
- de.l = [fn].concat(de.l);
2952
- }
2953
- else {
2954
- de.a.push(self.id);
2955
- de.l.push(fn);
2956
- }
2957
-
2958
- };
2959
-
2960
- this.undelegate = function (dom, name, fn, bubble, active) {
2961
- var de = delegatevents[name] || false;
2962
- if (de && de.l) { // quick fix #683
2963
- for (var a = 0, l = de.l.length ; a < l ; a ++) {
2964
- if (de.a[a] === self.id) {
2965
- de.a.splice(a);
2966
- de.l.splice(a);
2967
- if (de.a.length === 0) {
2968
- self._unbind(dom, name, de.l.f);
2969
- delegatevents[name] = null;
2970
- }
2971
- }
2972
- }
2973
- }
2974
- };
2975
-
2976
- this.bind = function (dom, name, fn, bubble, active) {
2977
- var el = ("jquery" in dom) ? dom[0] : dom;
2978
- self._bind(el, name, fn, bubble || false, active || false);
2979
- };
2980
-
2981
- this._bind = function (el, name, fn, bubble, active) { // primitive bind
2982
-
2983
- self.events.push({
2984
- e: el,
2985
- n: name,
2986
- f: fn,
2987
- b: bubble,
2988
- q: false
2989
- });
2990
-
2991
- // (passiveSupported && active) ? el.addEventListener(name, fn, {
2992
- // passive: false,
2993
- // capture: bubble
2994
- // }) : el.addEventListener(name, fn, bubble || false);
2995
- // Patched by opajaap according to https://github.com/inuyaksa/jquery.nicescroll/issues/799
2996
- (passiveSupported && (active || el == window.document || el == window.document.body || el == window)) ?
2997
- el.addEventListener(name, fn, { passive: false, capture: bubble }) :
2998
- el.addEventListener(name, fn, bubble || false);
2999
-
3000
-
3001
- };
3002
-
3003
- this._unbind = function (el, name, fn, bub) { // primitive unbind
3004
- if (delegatevents[name]) {
3005
- self.undelegate(el, name, fn, bub);
3006
- }
3007
- else {
3008
- el.removeEventListener(name, fn, bub);
3009
- }
3010
- };
3011
-
3012
- this.unbindAll = function () {
3013
- for (var a = 0 ; a < self.events.length ; a ++) {
3014
- var r = self.events[a];
3015
- (r.q) ? r.e.unbind(r.n, r.f) : self._unbind(r.e, r.n, r.f, r.b);
3016
- }
3017
- };
3018
-
3019
- this.showRails = function () {
3020
- return self.showRail().showRailHr();
3021
- };
3022
-
3023
- this.showRail = function () {
3024
- if ((self.page.maxh !== 0) && (self.ispage || self.win.css('display') != 'none')) {
3025
- //self.visibility = true;
3026
- self.rail.visibility = true;
3027
- self.rail.css('display', 'block');
3028
- }
3029
- return self;
3030
- };
3031
-
3032
- this.showRailHr = function () {
3033
- if (self.railh) {
3034
- if ((self.page.maxw !== 0) && (self.ispage || self.win.css('display') != 'none')) {
3035
- self.railh.visibility = true;
3036
- self.railh.css('display', 'block');
3037
- }
3038
- }
3039
- return self;
3040
- };
3041
-
3042
- this.hideRails = function () {
3043
- return self.hideRail().hideRailHr();
3044
- };
3045
-
3046
- this.hideRail = function () {
3047
- //self.visibility = false;
3048
- self.rail.visibility = false;
3049
- self.rail.css('display', 'none');
3050
- return self;
3051
- };
3052
-
3053
- this.hideRailHr = function () {
3054
- if (self.railh) {
3055
- self.railh.visibility = false;
3056
- self.railh.css('display', 'none');
3057
- }
3058
- return self;
3059
- };
3060
-
3061
- this.show = function () {
3062
- self.hidden = false;
3063
- self.railslocked = false;
3064
- return self.showRails();
3065
- };
3066
-
3067
- this.hide = function () {
3068
- self.hidden = true;
3069
- self.railslocked = true;
3070
- return self.hideRails();
3071
- };
3072
-
3073
- this.toggle = function () {
3074
- return (self.hidden) ? self.show() : self.hide();
3075
- };
3076
-
3077
- this.remove = function () {
3078
- self.stop();
3079
- if (self.cursortimeout) {
3080
- clearTimeout(self.cursortimeout);
3081
- }
3082
- for (var n in self.delaylist) if (self.delaylist[n]) {
3083
- clearAnimationFrame(self.delaylist[n].h);
3084
- }
3085
- self.doZoomOut();
3086
- self.unbindAll();
3087
-
3088
- if (cap.isie9) {
3089
- self.win[0].detachEvent("onpropertychange", self.onAttributeChange);
3090
- } //IE9 DOMAttrModified bug
3091
-
3092
- if (self.observer !== false) {
3093
- self.observer.disconnect();
3094
- }
3095
- if (self.observerremover !== false) {
3096
- self.observerremover.disconnect();
3097
- }
3098
- if (self.observerbody !== false) {
3099
- self.observerbody.disconnect();
3100
- }
3101
-
3102
- self.events = null;
3103
-
3104
- if (self.cursor) {
3105
- self.cursor.remove();
3106
- }
3107
- if (self.cursorh) {
3108
- self.cursorh.remove();
3109
- }
3110
- if (self.rail) {
3111
- self.rail.remove();
3112
- }
3113
- if (self.railh) {
3114
- self.railh.remove();
3115
- }
3116
- if (self.zoom) {
3117
- self.zoom.remove();
3118
- }
3119
- for (var a = 0 ; a < self.saved.css.length ; a ++) {
3120
- var d = self.saved.css[a];
3121
- d[0].css(d[1], (d[2] === undefined) ? '' : d[2]);
3122
- }
3123
- self.saved = false;
3124
- self.me.data('__nicescroll', ''); //erase all traces
3125
-
3126
- // memory leak fixed by GianlucaGuarini - thanks a lot!
3127
- // remove the current nicescroll from the $.nicescroll array & normalize array
3128
- var lst = $.nicescroll;
3129
- lst.each(function (i) {
3130
- if (! this) {
3131
- return;
3132
- }
3133
- if (this.id === self.id) {
3134
- delete lst[i];
3135
- for (var b = ++ i ; b < lst.length ; b ++ , i ++) lst[i] = lst[b];
3136
- lst.length --;
3137
- if (lst.length) {
3138
- delete lst[lst.length];
3139
- }
3140
- }
3141
- });
3142
-
3143
- for (var i in self) {
3144
- self[i] = null;
3145
- delete self[i];
3146
- }
3147
-
3148
- self = null;
3149
-
3150
- };
3151
-
3152
- this.scrollstart = function (fn) {
3153
- this.onscrollstart = fn;
3154
- return self;
3155
- };
3156
- this.scrollend = function (fn) {
3157
- this.onscrollend = fn;
3158
- return self;
3159
- };
3160
- this.scrollcancel = function (fn) {
3161
- this.onscrollcancel = fn;
3162
- return self;
3163
- };
3164
-
3165
- this.zoomin = function (fn) {
3166
- this.onzoomin = fn;
3167
- return self;
3168
- };
3169
- this.zoomout = function (fn) {
3170
- this.onzoomout = fn;
3171
- return self;
3172
- };
3173
-
3174
- this.isScrollable = function (e) {
3175
- var dom = (e.target) ? e.target : e;
3176
- if (dom.nodeName == 'OPTION') {
3177
- return true;
3178
- }
3179
- while (dom && (dom.nodeType == 1) && (dom !== this.me[0]) && ! (/^BODY|HTML/.test(dom.nodeName))) {
3180
- var dd = $(dom);
3181
- var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
3182
- if (/scroll|auto/.test(ov)) {
3183
- return (dom.clientHeight != dom.scrollHeight);
3184
- }
3185
- dom = (dom.parentNode) ? dom.parentNode : false;
3186
- }
3187
- return false;
3188
- };
3189
-
3190
- this.getViewport = function (me) {
3191
- var dom = (me && me.parentNode) ? me.parentNode : false;
3192
- while (dom && (dom.nodeType == 1) && ! (/^BODY|HTML/.test(dom.nodeName))) {
3193
- var dd = $(dom);
3194
- if (/fixed|absolute/.test(dd.css("position"))) {
3195
- return dd;
3196
- }
3197
- var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
3198
- if ((/scroll|auto/.test(ov)) && (dom.clientHeight != dom.scrollHeight)) {
3199
- return dd;
3200
- }
3201
- if (dd.getNiceScroll().length > 0) {
3202
- return dd;
3203
- }
3204
- dom = (dom.parentNode) ? dom.parentNode : false;
3205
- }
3206
- return false;
3207
- };
3208
-
3209
- this.triggerScrollStart = function (cx, cy, rx, ry, ms) {
3210
-
3211
- if (self.onscrollstart) {
3212
- var info = {
3213
- type: "scrollstart",
3214
- current: {
3215
- x: cx,
3216
- y: cy
3217
- },
3218
- request: {
3219
- x: rx,
3220
- y: ry
3221
- },
3222
- end: {
3223
- x: self.newscrollx,
3224
- y: self.newscrolly
3225
- },
3226
- speed: ms
3227
- };
3228
- self.onscrollstart.call(self, info);
3229
- }
3230
-
3231
- };
3232
-
3233
- this.triggerScrollEnd = function () {
3234
- if (self.onscrollend) {
3235
-
3236
- var px = self.getScrollLeft();
3237
- var py = self.getScrollTop();
3238
-
3239
- var info = {
3240
- type: "scrollend",
3241
- current: {
3242
- x: px,
3243
- y: py
3244
- },
3245
- end: {
3246
- x: px,
3247
- y: py
3248
- }
3249
- };
3250
-
3251
- self.onscrollend.call(self, info);
3252
-
3253
- }
3254
-
3255
- };
3256
-
3257
- var scrolldiry = 0, scrolldirx = 0, scrolltmr = 0, scrollspd = 1;
3258
-
3259
- function doScrollRelative (px, py, chkscroll, iswheel) {
3260
-
3261
- if (! self.scrollrunning) {
3262
- self.newscrolly = self.getScrollTop();
3263
- self.newscrollx = self.getScrollLeft();
3264
- scrolltmr = now();
3265
- }
3266
-
3267
- var gap = (now() - scrolltmr);
3268
- scrolltmr = now();
3269
-
3270
- if (gap > 350) {
3271
- scrollspd = 1;
3272
- }
3273
- else {
3274
- scrollspd += (2 - scrollspd) / 10;
3275
- }
3276
-
3277
- px = px * scrollspd | 0;
3278
- py = py * scrollspd | 0;
3279
-
3280
- if (px) {
3281
-
3282
- if (iswheel) { // mouse-only
3283
- if (px < 0) { // fix apple magic mouse swipe back/forward
3284
- if (self.getScrollLeft() >= self.page.maxw) {
3285
- return true;
3286
- }
3287
- }
3288
- else {
3289
- if (self.getScrollLeft() <= 0) {
3290
- return true;
3291
- }
3292
- }
3293
- }
3294
-
3295
- var dx = px > 0 ? 1 : - 1;
3296
-
3297
- if (scrolldirx !== dx) {
3298
- if (self.scrollmom) {
3299
- self.scrollmom.stop();
3300
- }
3301
- self.newscrollx = self.getScrollLeft();
3302
- scrolldirx = dx;
3303
- }
3304
-
3305
- self.lastdeltax -= px;
3306
-
3307
- }
3308
-
3309
- if (py) {
3310
-
3311
- var chk = (function () {
3312
- var top = self.getScrollTop();
3313
- if (py < 0) {
3314
- if (top >= self.page.maxh) {
3315
- return true;
3316
- }
3317
- }
3318
- else {
3319
- if (top <= 0) {
3320
- return true;
3321
- }
3322
- }
3323
- })();
3324
-
3325
- if (chk) {
3326
- if (opt.nativeparentscrolling && chkscroll && ! self.ispage && ! self.zoomactive) {
3327
- return true;
3328
- }
3329
- var ny = self.view.h >> 1;
3330
- if (self.newscrolly < - ny) {
3331
- self.newscrolly = - ny;
3332
- py = - 1;
3333
- }
3334
- else if (self.newscrolly > self.page.maxh + ny) {
3335
- self.newscrolly = self.page.maxh + ny;
3336
- py = 1;
3337
- }
3338
- else {
3339
- py = 0;
3340
- }
3341
- }
3342
-
3343
- var dy = py > 0 ? 1 : - 1;
3344
-
3345
- if (scrolldiry !== dy) {
3346
- if (self.scrollmom) {
3347
- self.scrollmom.stop();
3348
- }
3349
- self.newscrolly = self.getScrollTop();
3350
- scrolldiry = dy;
3351
- }
3352
-
3353
- self.lastdeltay -= py;
3354
-
3355
- }
3356
-
3357
- if (py || px) {
3358
- self.synched("relativexy", function () {
3359
-
3360
- var dty = self.lastdeltay + self.newscrolly;
3361
- self.lastdeltay = 0;
3362
-
3363
- var dtx = self.lastdeltax + self.newscrollx;
3364
- self.lastdeltax = 0;
3365
-
3366
- if (! self.rail.drag) {
3367
- self.doScrollPos(dtx, dty);
3368
- }
3369
-
3370
- });
3371
- }
3372
-
3373
- }
3374
-
3375
- var hasparentscrollingphase = false;
3376
-
3377
- function execScrollWheel (e, hr, chkscroll) {
3378
- var px, py;
3379
-
3380
- if (! chkscroll && hasparentscrollingphase) {
3381
- return true;
3382
- }
3383
-
3384
- if (e.deltaMode === 0) { // PIXEL
3385
- px = - (e.deltaX * (opt.mousescrollstep / (18 * 3))) | 0;
3386
- py = - (e.deltaY * (opt.mousescrollstep / (18 * 3))) | 0;
3387
- }
3388
- else if (e.deltaMode === 1) { // LINE
3389
- px = - (e.deltaX * opt.mousescrollstep * 50 / 80) | 0;
3390
- py = - (e.deltaY * opt.mousescrollstep * 50 / 80) | 0;
3391
- }
3392
-
3393
- if (hr && opt.oneaxismousemode && (px === 0) && py) { // classic vertical-only mousewheel + browser with x/y support
3394
- px = py;
3395
- py = 0;
3396
-
3397
- if (chkscroll) {
3398
- var hrend = (px < 0) ? (self.getScrollLeft() >= self.page.maxw) : (self.getScrollLeft() <= 0);
3399
- if (hrend) { // preserve vertical scrolling
3400
- py = px;
3401
- px = 0;
3402
- }
3403
- }
3404
-
3405
- }
3406
-
3407
- // invert horizontal direction for rtl mode
3408
- if (self.isrtlmode) {
3409
- px = - px;
3410
- }
3411
-
3412
- var chk = doScrollRelative(px, py, chkscroll, true);
3413
-
3414
- if (chk) {
3415
- if (chkscroll) {
3416
- hasparentscrollingphase = true;
3417
- }
3418
- }
3419
- else {
3420
- hasparentscrollingphase = false;
3421
- e.stopImmediatePropagation();
3422
- return e.preventDefault();
3423
- }
3424
-
3425
- }
3426
-
3427
- this.onmousewheel = function (e) {
3428
- if (self.wheelprevented || self.locked) {
3429
- return false;
3430
- }
3431
- if (self.railslocked) {
3432
- self.debounced("checkunlock", self.resize, 250);
3433
- return false;
3434
- }
3435
- if (self.rail.drag) {
3436
- return self.cancelEvent(e);
3437
- }
3438
-
3439
- if (opt.oneaxismousemode === "auto" && e.deltaX !== 0) {
3440
- opt.oneaxismousemode = false;
3441
- } // check two-axis mouse support (not very elegant)
3442
-
3443
- if (opt.oneaxismousemode && e.deltaX === 0) {
3444
- if (! self.rail.scrollable) {
3445
- if (self.railh && self.railh.scrollable) {
3446
- return self.onmousewheelhr(e);
3447
- }
3448
- else {
3449
- return true;
3450
- }
3451
- }
3452
- }
3453
-
3454
- var nw = now();
3455
- var chk = false;
3456
- if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
3457
- self.nativescrollingarea = self.isScrollable(e);
3458
- chk = true;
3459
- }
3460
- self.checkarea = nw;
3461
- if (self.nativescrollingarea) {
3462
- return true;
3463
- } // this isn't my business
3464
- var ret = execScrollWheel(e, false, chk);
3465
- if (ret) {
3466
- self.checkarea = 0;
3467
- }
3468
- return ret;
3469
- };
3470
-
3471
- this.onmousewheelhr = function (e) {
3472
- if (self.wheelprevented) {
3473
- return;
3474
- }
3475
- if (self.railslocked || ! self.railh.scrollable) {
3476
- return true;
3477
- }
3478
- if (self.rail.drag) {
3479
- return self.cancelEvent(e);
3480
- }
3481
-
3482
- var nw = now();
3483
- var chk = false;
3484
- if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
3485
- self.nativescrollingarea = self.isScrollable(e);
3486
- chk = true;
3487
- }
3488
- self.checkarea = nw;
3489
- if (self.nativescrollingarea) {
3490
- return true;
3491
- } // this is not my business
3492
- if (self.railslocked) {
3493
- return self.cancelEvent(e);
3494
- }
3495
-
3496
- return execScrollWheel(e, true, chk);
3497
- };
3498
-
3499
- this.stop = function () {
3500
- self.cancelScroll();
3501
- if (self.scrollmon) {
3502
- self.scrollmon.stop();
3503
- }
3504
- self.cursorfreezed = false;
3505
- self.scroll.y = Math.round(self.getScrollTop() * (1 / self.scrollratio.y));
3506
- self.noticeCursor();
3507
- return self;
3508
- };
3509
-
3510
- this.getTransitionSpeed = function (dif) {
3511
-
3512
- return 80 + (dif / 72) * opt.scrollspeed | 0;
3513
-
3514
- };
3515
-
3516
- if (! opt.smoothscroll) {
3517
- this.doScrollLeft = function (x, spd) { //direct
3518
- var y = self.getScrollTop();
3519
- self.doScrollPos(x, y, spd);
3520
- };
3521
- this.doScrollTop = function (y, spd) { //direct
3522
- var x = self.getScrollLeft();
3523
- self.doScrollPos(x, y, spd);
3524
- };
3525
- this.doScrollPos = function (x, y, spd) { //direct
3526
- var nx = (x > self.page.maxw) ? self.page.maxw : x;
3527
- if (nx < 0) {
3528
- nx = 0;
3529
- }
3530
- var ny = (y > self.page.maxh) ? self.page.maxh : y;
3531
- if (ny < 0) {
3532
- ny = 0;
3533
- }
3534
- self.synched('scroll', function () {
3535
- self.setScrollTop(ny);
3536
- self.setScrollLeft(nx);
3537
- });
3538
- };
3539
- this.cancelScroll = function () {
3540
- }; // direct
3541
-
3542
- }
3543
- else if (self.ishwscroll && cap.hastransition && opt.usetransition && ! ! opt.smoothscroll) {
3544
-
3545
- var lasttransitionstyle = '';
3546
-
3547
- this.resetTransition = function () {
3548
- lasttransitionstyle = '';
3549
- self.doc.css(cap.prefixstyle + 'transition-duration', '0ms');
3550
- };
3551
-
3552
- this.prepareTransition = function (dif, istime) {
3553
- var ex = (istime) ? dif : self.getTransitionSpeed(dif);
3554
- var trans = ex + 'ms';
3555
- if (lasttransitionstyle !== trans) {
3556
- lasttransitionstyle = trans;
3557
- self.doc.css(cap.prefixstyle + 'transition-duration', trans);
3558
- }
3559
- return ex;
3560
- };
3561
-
3562
- this.doScrollLeft = function (x, spd) { //trans
3563
- var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3564
- self.doScrollPos(x, y, spd);
3565
- };
3566
-
3567
- this.doScrollTop = function (y, spd) { //trans
3568
- var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3569
- self.doScrollPos(x, y, spd);
3570
- };
3571
-
3572
- this.cursorupdate = {
3573
- running: false,
3574
- start: function () {
3575
- var m = this;
3576
-
3577
- if (m.running) {
3578
- return;
3579
- }
3580
- m.running = true;
3581
-
3582
- var loop = function () {
3583
- if (m.running) {
3584
- setAnimationFrame(loop);
3585
- }
3586
- self.showCursor(self.getScrollTop(), self.getScrollLeft());
3587
- self.notifyScrollEvent(self.win[0]);
3588
- };
3589
-
3590
- setAnimationFrame(loop);
3591
- },
3592
- stop: function () {
3593
- this.running = false;
3594
- }
3595
- };
3596
-
3597
- this.doScrollPos = function (x, y, spd) { //trans
3598
-
3599
- var py = self.getScrollTop();
3600
- var px = self.getScrollLeft();
3601
-
3602
- if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) {
3603
- self.cancelScroll();
3604
- } //inverted movement detection
3605
-
3606
- if (! opt.bouncescroll) {
3607
- if (y < 0) {
3608
- y = 0;
3609
- }
3610
- else if (y > self.page.maxh) {
3611
- y = self.page.maxh;
3612
- }
3613
- if (x < 0) {
3614
- x = 0;
3615
- }
3616
- else if (x > self.page.maxw) {
3617
- x = self.page.maxw;
3618
- }
3619
- }
3620
- else {
3621
- if (y < 0) {
3622
- y = y / 2 | 0;
3623
- }
3624
- else if (y > self.page.maxh) {
3625
- y = self.page.maxh + (y - self.page.maxh) / 2 | 0;
3626
- }
3627
- if (x < 0) {
3628
- x = x / 2 | 0;
3629
- }
3630
- else if (x > self.page.maxw) {
3631
- x = self.page.maxw + (x - self.page.maxw) / 2 | 0;
3632
- }
3633
- }
3634
-
3635
- if (self.scrollrunning && x == self.newscrollx && y == self.newscrolly) {
3636
- return false;
3637
- }
3638
-
3639
- self.newscrolly = y;
3640
- self.newscrollx = x;
3641
-
3642
- var top = self.getScrollTop();
3643
- var lft = self.getScrollLeft();
3644
-
3645
- var dst = {};
3646
- dst.x = x - lft;
3647
- dst.y = y - top;
3648
-
3649
- var dd = Math.sqrt((dst.x * dst.x) + (dst.y * dst.y)) | 0;
3650
-
3651
- var ms = self.prepareTransition(dd);
3652
-
3653
- if (! self.scrollrunning) {
3654
- self.scrollrunning = true;
3655
- self.triggerScrollStart(lft, top, x, y, ms);
3656
- self.cursorupdate.start();
3657
- }
3658
-
3659
- self.scrollendtrapped = true;
3660
-
3661
- if (! cap.transitionend) {
3662
- if (self.scrollendtrapped) {
3663
- clearTimeout(self.scrollendtrapped);
3664
- }
3665
- self.scrollendtrapped = setTimeout(self.onScrollTransitionEnd, ms); // simulate transitionend event
3666
- }
3667
-
3668
- self.setScrollTop(self.newscrolly);
3669
- self.setScrollLeft(self.newscrollx);
3670
-
3671
- };
3672
-
3673
- this.cancelScroll = function () {
3674
- if (! self.scrollendtrapped) {
3675
- return true;
3676
- }
3677
- var py = self.getScrollTop();
3678
- var px = self.getScrollLeft();
3679
- self.scrollrunning = false;
3680
- if (! cap.transitionend) {
3681
- clearTimeout(cap.transitionend);
3682
- }
3683
- self.scrollendtrapped = false;
3684
- self.resetTransition();
3685
- self.setScrollTop(py); // fire event onscroll
3686
- if (self.railh) {
3687
- self.setScrollLeft(px);
3688
- }
3689
- if (self.timerscroll && self.timerscroll.tm) {
3690
- clearInterval(self.timerscroll.tm);
3691
- }
3692
- self.timerscroll = false;
3693
-
3694
- self.cursorfreezed = false;
3695
-
3696
- self.cursorupdate.stop();
3697
- self.showCursor(py, px);
3698
- return self;
3699
- };
3700
-
3701
- this.onScrollTransitionEnd = function () {
3702
-
3703
- if (! self.scrollendtrapped) {
3704
- return;
3705
- }
3706
-
3707
- var py = self.getScrollTop();
3708
- var px = self.getScrollLeft();
3709
-
3710
- if (py < 0) {
3711
- py = 0;
3712
- }
3713
- else if (py > self.page.maxh) {
3714
- py = self.page.maxh;
3715
- }
3716
- if (px < 0) {
3717
- px = 0;
3718
- }
3719
- else if (px > self.page.maxw) {
3720
- px = self.page.maxw;
3721
- }
3722
- if ((py != self.newscrolly) || (px != self.newscrollx)) {
3723
- return self.doScrollPos(px, py, opt.snapbackspeed);
3724
- }
3725
-
3726
- if (self.scrollrunning) {
3727
- self.triggerScrollEnd();
3728
- }
3729
- self.scrollrunning = false;
3730
-
3731
- self.scrollendtrapped = false;
3732
- self.resetTransition();
3733
- self.timerscroll = false;
3734
- self.setScrollTop(py); // fire event onscroll
3735
- if (self.railh) {
3736
- self.setScrollLeft(px);
3737
- } // fire event onscroll left
3738
-
3739
- self.cursorupdate.stop();
3740
- self.noticeCursor(false, py, px);
3741
-
3742
- self.cursorfreezed = false;
3743
-
3744
- };
3745
-
3746
- }
3747
- else {
3748
-
3749
- this.doScrollLeft = function (x, spd) { //no-trans
3750
- var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3751
- self.doScrollPos(x, y, spd);
3752
- };
3753
-
3754
- this.doScrollTop = function (y, spd) { //no-trans
3755
- var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3756
- self.doScrollPos(x, y, spd);
3757
- };
3758
-
3759
- this.doScrollPos = function (x, y, spd) { //no-trans
3760
-
3761
- var py = self.getScrollTop();
3762
- var px = self.getScrollLeft();
3763
-
3764
- if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) {
3765
- self.cancelScroll();
3766
- } //inverted movement detection
3767
-
3768
- var clipped = false;
3769
-
3770
- if (! self.bouncescroll || ! self.rail.visibility) {
3771
- if (y < 0) {
3772
- y = 0;
3773
- clipped = true;
3774
- }
3775
- else if (y > self.page.maxh) {
3776
- y = self.page.maxh;
3777
- clipped = true;
3778
- }
3779
- }
3780
- if (! self.bouncescroll || ! self.railh.visibility) {
3781
- if (x < 0) {
3782
- x = 0;
3783
- clipped = true;
3784
- }
3785
- else if (x > self.page.maxw) {
3786
- x = self.page.maxw;
3787
- clipped = true;
3788
- }
3789
- }
3790
-
3791
- if (self.scrollrunning && (self.newscrolly === y) && (self.newscrollx === x)) {
3792
- return true;
3793
- }
3794
-
3795
- self.newscrolly = y;
3796
- self.newscrollx = x;
3797
-
3798
- self.dst = {};
3799
- self.dst.x = x - px;
3800
- self.dst.y = y - py;
3801
- self.dst.px = px;
3802
- self.dst.py = py;
3803
-
3804
- var dd = Math.sqrt((self.dst.x * self.dst.x) + (self.dst.y * self.dst.y)) | 0;
3805
- var ms = self.getTransitionSpeed(dd);
3806
-
3807
- self.bzscroll = {};
3808
-
3809
- var p3 = (clipped) ? 1 : 0.58;
3810
- self.bzscroll.x = new BezierClass(px, self.newscrollx, ms, 0, 0, p3, 1);
3811
- self.bzscroll.y = new BezierClass(py, self.newscrolly, ms, 0, 0, p3, 1);
3812
-
3813
- var loopid = now();
3814
-
3815
- var loop = function () {
3816
-
3817
- if (! self.scrollrunning) {
3818
- return;
3819
- }
3820
- var x = self.bzscroll.y.getPos();
3821
-
3822
- self.setScrollLeft(self.bzscroll.x.getNow());
3823
- self.setScrollTop(self.bzscroll.y.getNow());
3824
-
3825
- if (x <= 1) {
3826
- self.timer = setAnimationFrame(loop);
3827
- }
3828
- else {
3829
- self.scrollrunning = false;
3830
- self.timer = 0;
3831
- self.triggerScrollEnd();
3832
- }
3833
-
3834
- };
3835
-
3836
- if (! self.scrollrunning) {
3837
- self.triggerScrollStart(px, py, x, y, ms);
3838
- self.scrollrunning = true;
3839
- self.timer = setAnimationFrame(loop);
3840
- }
3841
-
3842
- };
3843
-
3844
- this.cancelScroll = function () {
3845
- if (self.timer) {
3846
- clearAnimationFrame(self.timer);
3847
- }
3848
- self.timer = 0;
3849
- self.bzscroll = false;
3850
- self.scrollrunning = false;
3851
- return self;
3852
- };
3853
-
3854
- }
3855
-
3856
- this.doScrollBy = function (stp, relative) {
3857
- doScrollRelative(0, stp);
3858
- };
3859
-
3860
- this.doScrollLeftBy = function (stp, relative) {
3861
- doScrollRelative(stp, 0);
3862
- };
3863
-
3864
- this.doScrollTo = function (pos, relative) {
3865
- var ny = (relative) ? Math.round(pos * self.scrollratio.y) : pos;
3866
- if (ny < 0) {
3867
- ny = 0;
3868
- }
3869
- else if (ny > self.page.maxh) {
3870
- ny = self.page.maxh;
3871
- }
3872
- self.cursorfreezed = false;
3873
- self.doScrollTop(pos);
3874
- };
3875
-
3876
- this.checkContentSize = function () {
3877
- var pg = self.getContentSize();
3878
- if ((pg.h != self.page.h) || (pg.w != self.page.w)) {
3879
- self.resize(false, pg);
3880
- }
3881
- };
3882
-
3883
- self.onscroll = function (e) {
3884
- if (self.rail.drag) {
3885
- return;
3886
- }
3887
- if (! self.cursorfreezed) {
3888
- self.synched('scroll', function () {
3889
- self.scroll.y = Math.round(self.getScrollTop() / self.scrollratio.y);
3890
- if (self.railh) {
3891
- self.scroll.x = Math.round(self.getScrollLeft() / self.scrollratio.x);
3892
- }
3893
- self.noticeCursor();
3894
- });
3895
- }
3896
- };
3897
- self.bind(self.docscroll, "scroll", self.onscroll);
3898
-
3899
- this.doZoomIn = function (e) {
3900
- if (self.zoomactive) {
3901
- return;
3902
- }
3903
- self.zoomactive = true;
3904
-
3905
- self.zoomrestore = {
3906
- style: {}
3907
- };
3908
- var lst = ['position', 'top', 'left', 'zIndex', 'backgroundColor', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight'];
3909
- var win = self.win[0].style;
3910
- for (var a in lst) {
3911
- var pp = lst[a];
3912
- self.zoomrestore.style[pp] = (win[pp] !== undefined) ? win[pp] : '';
3913
- }
3914
-
3915
- self.zoomrestore.style.width = self.win.css('width');
3916
- self.zoomrestore.style.height = self.win.css('height');
3917
-
3918
- self.zoomrestore.padding = {
3919
- w: self.win.outerWidth() - self.win.width(),
3920
- h: self.win.outerHeight() - self.win.height()
3921
- };
3922
-
3923
- if (cap.isios4) {
3924
- self.zoomrestore.scrollTop = $window.scrollTop();
3925
- $window.scrollTop(0);
3926
- }
3927
-
3928
- self.win.css({
3929
- position: (cap.isios4) ? "absolute" : "fixed",
3930
- top: 0,
3931
- left: 0,
3932
- zIndex: globalmaxzindex + 100,
3933
- margin: 0
3934
- });
3935
- var bkg = self.win.css("backgroundColor");
3936
- if ("" === bkg || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg)) {
3937
- self.win.css("backgroundColor", "#fff");
3938
- }
3939
- self.rail.css({
3940
- zIndex: globalmaxzindex + 101
3941
- });
3942
- self.zoom.css({
3943
- zIndex: globalmaxzindex + 102
3944
- });
3945
- self.zoom.css('backgroundPosition', '0 -18px');
3946
- self.resizeZoom();
3947
-
3948
- if (self.onzoomin) {
3949
- self.onzoomin.call(self);
3950
- }
3951
-
3952
- return self.cancelEvent(e);
3953
- };
3954
-
3955
- this.doZoomOut = function (e) {
3956
- if (! self.zoomactive) {
3957
- return;
3958
- }
3959
- self.zoomactive = false;
3960
-
3961
- self.win.css("margin", "");
3962
- self.win.css(self.zoomrestore.style);
3963
-
3964
- if (cap.isios4) {
3965
- $window.scrollTop(self.zoomrestore.scrollTop);
3966
- }
3967
-
3968
- self.rail.css({
3969
- "z-index": self.zindex
3970
- });
3971
- self.zoom.css({
3972
- "z-index": self.zindex
3973
- });
3974
- self.zoomrestore = false;
3975
- self.zoom.css('backgroundPosition', '0 0');
3976
- self.onResize();
3977
-
3978
- if (self.onzoomout) {
3979
- self.onzoomout.call(self);
3980
- }
3981
-
3982
- return self.cancelEvent(e);
3983
- };
3984
-
3985
- this.doZoom = function (e) {
3986
- return (self.zoomactive) ? self.doZoomOut(e) : self.doZoomIn(e);
3987
- };
3988
-
3989
- this.resizeZoom = function () {
3990
- if (! self.zoomactive) {
3991
- return;
3992
- }
3993
-
3994
- var py = self.getScrollTop(); //preserve scrolling position
3995
- self.win.css({
3996
- width: $window.width() - self.zoomrestore.padding.w + "px",
3997
- height: $window.height() - self.zoomrestore.padding.h + "px"
3998
- });
3999
- self.onResize();
4000
-
4001
- self.setScrollTop(Math.min(self.page.maxh, py));
4002
- };
4003
-
4004
- this.init();
4005
-
4006
- $.nicescroll.push(this);
4007
-
4008
- };
4009
-
4010
- // Inspired by the work of Kin Blas
4011
- // http://webpro.host.adobe.com/people/jblas/momentum/includes/jquery.momentum.0.7.js
4012
- var ScrollMomentumClass2D = function (nc) {
4013
- var self = this;
4014
- this.nc = nc;
4015
-
4016
- this.lastx = 0;
4017
- this.lasty = 0;
4018
- this.speedx = 0;
4019
- this.speedy = 0;
4020
- this.lasttime = 0;
4021
- this.steptime = 0;
4022
- this.snapx = false;
4023
- this.snapy = false;
4024
- this.demulx = 0;
4025
- this.demuly = 0;
4026
-
4027
- this.lastscrollx = - 1;
4028
- this.lastscrolly = - 1;
4029
-
4030
- this.chkx = 0;
4031
- this.chky = 0;
4032
-
4033
- this.timer = 0;
4034
-
4035
- this.reset = function (px, py) {
4036
- self.stop();
4037
- self.steptime = 0;
4038
- self.lasttime = now();
4039
- self.speedx = 0;
4040
- self.speedy = 0;
4041
- self.lastx = px;
4042
- self.lasty = py;
4043
- self.lastscrollx = - 1;
4044
- self.lastscrolly = - 1;
4045
- };
4046
-
4047
- this.update = function (px, py) {
4048
- var tm = now();
4049
- self.steptime = tm - self.lasttime;
4050
- self.lasttime = tm;
4051
- var dy = py - self.lasty;
4052
- var dx = px - self.lastx;
4053
- var sy = self.nc.getScrollTop();
4054
- var sx = self.nc.getScrollLeft();
4055
- var newy = sy + dy;
4056
- var newx = sx + dx;
4057
- self.snapx = (newx < 0) || (newx > self.nc.page.maxw);
4058
- self.snapy = (newy < 0) || (newy > self.nc.page.maxh);
4059
- self.speedx = dx;
4060
- self.speedy = dy;
4061
- self.lastx = px;
4062
- self.lasty = py;
4063
- };
4064
-
4065
- this.stop = function () {
4066
- self.nc.unsynched("domomentum2d");
4067
- if (self.timer) {
4068
- clearTimeout(self.timer);
4069
- }
4070
- self.timer = 0;
4071
- self.lastscrollx = - 1;
4072
- self.lastscrolly = - 1;
4073
- };
4074
-
4075
- this.doSnapy = function (nx, ny) {
4076
- var snap = false;
4077
-
4078
- if (ny < 0) {
4079
- ny = 0;
4080
- snap = true;
4081
- }
4082
- else if (ny > self.nc.page.maxh) {
4083
- ny = self.nc.page.maxh;
4084
- snap = true;
4085
- }
4086
-
4087
- if (nx < 0) {
4088
- nx = 0;
4089
- snap = true;
4090
- }
4091
- else if (nx > self.nc.page.maxw) {
4092
- nx = self.nc.page.maxw;
4093
- snap = true;
4094
- }
4095
-
4096
- (snap) ? self.nc.doScrollPos(nx, ny, self.nc.opt.snapbackspeed) : self.nc.triggerScrollEnd();
4097
- };
4098
-
4099
- this.doMomentum = function (gp) {
4100
- var t = now();
4101
- var l = (gp) ? t + gp : self.lasttime;
4102
-
4103
- var sl = self.nc.getScrollLeft();
4104
- var st = self.nc.getScrollTop();
4105
-
4106
- var pageh = self.nc.page.maxh;
4107
- var pagew = self.nc.page.maxw;
4108
-
4109
- self.speedx = (pagew > 0) ? Math.min(60, self.speedx) : 0;
4110
- self.speedy = (pageh > 0) ? Math.min(60, self.speedy) : 0;
4111
-
4112
- var chk = l && (t - l) <= 60;
4113
-
4114
- if ((st < 0) || (st > pageh) || (sl < 0) || (sl > pagew)) {
4115
- chk = false;
4116
- }
4117
-
4118
- var sy = (self.speedy && chk) ? self.speedy : false;
4119
- var sx = (self.speedx && chk) ? self.speedx : false;
4120
-
4121
- if (sy || sx) {
4122
- var tm = Math.max(16, self.steptime); //timeout granularity
4123
-
4124
- if (tm > 50) { // do smooth
4125
- var xm = tm / 50;
4126
- self.speedx *= xm;
4127
- self.speedy *= xm;
4128
- tm = 50;
4129
- }
4130
-
4131
- self.demulxy = 0;
4132
-
4133
- self.lastscrollx = self.nc.getScrollLeft();
4134
- self.chkx = self.lastscrollx;
4135
- self.lastscrolly = self.nc.getScrollTop();
4136
- self.chky = self.lastscrolly;
4137
-
4138
- var nx = self.lastscrollx;
4139
- var ny = self.lastscrolly;
4140
-
4141
- var onscroll = function () {
4142
- var df = ((now() - t) > 600) ? 0.04 : 0.02;
4143
-
4144
- if (self.speedx) {
4145
- nx = Math.floor(self.lastscrollx - (self.speedx * (1 - self.demulxy)));
4146
- self.lastscrollx = nx;
4147
- if ((nx < 0) || (nx > pagew)) {
4148
- df = 0.10;
4149
- }
4150
- }
4151
-
4152
- if (self.speedy) {
4153
- ny = Math.floor(self.lastscrolly - (self.speedy * (1 - self.demulxy)));
4154
- self.lastscrolly = ny;
4155
- if ((ny < 0) || (ny > pageh)) {
4156
- df = 0.10;
4157
- }
4158
- }
4159
-
4160
- self.demulxy = Math.min(1, self.demulxy + df);
4161
-
4162
- self.nc.synched("domomentum2d", function () {
4163
-
4164
- if (self.speedx) {
4165
- var scx = self.nc.getScrollLeft();
4166
- // if (scx != self.chkx) self.stop();
4167
- self.chkx = nx;
4168
- self.nc.setScrollLeft(nx);
4169
- }
4170
-
4171
- if (self.speedy) {
4172
- var scy = self.nc.getScrollTop();
4173
- // if (scy != self.chky) self.stop();
4174
- self.chky = ny;
4175
- self.nc.setScrollTop(ny);
4176
- }
4177
-
4178
- if (! self.timer) {
4179
- self.nc.hideCursor();
4180
- self.doSnapy(nx, ny);
4181
- }
4182
-
4183
- });
4184
-
4185
- if (self.demulxy < 1) {
4186
- self.timer = setTimeout(onscroll, tm);
4187
- }
4188
- else {
4189
- self.stop();
4190
- self.nc.hideCursor();
4191
- self.doSnapy(nx, ny);
4192
- }
4193
- };
4194
-
4195
- onscroll();
4196
-
4197
- }
4198
- else {
4199
- self.doSnapy(self.nc.getScrollLeft(), self.nc.getScrollTop());
4200
- }
4201
-
4202
- };
4203
-
4204
- };
4205
-
4206
-
4207
- // override jQuery scrollTop
4208
- var _scrollTop = jQuery.fn.scrollTop; // preserve original function
4209
-
4210
- jQuery.cssHooks.pageYOffset = {
4211
- get: function (elem, computed, extra) {
4212
- var nice = $.data(elem, '__nicescroll') || false;
4213
- return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(elem);
4214
- },
4215
- set: function (elem, value) {
4216
- var nice = $.data(elem, '__nicescroll') || false;
4217
- (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call(elem, value);
4218
- return this;
4219
- }
4220
- };
4221
-
4222
- jQuery.fn.scrollTop = function (value) {
4223
- if (value === undefined) {
4224
- var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
4225
- return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(this);
4226
- }
4227
- else {
4228
- return this.each(function () {
4229
- var nice = $.data(this, '__nicescroll') || false;
4230
- (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call($(this), value);
4231
- });
4232
- }
4233
- };
4234
-
4235
- // override jQuery scrollLeft
4236
- var _scrollLeft = jQuery.fn.scrollLeft; // preserve original function
4237
-
4238
- $.cssHooks.pageXOffset = {
4239
- get: function (elem, computed, extra) {
4240
- var nice = $.data(elem, '__nicescroll') || false;
4241
- return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(elem);
4242
- },
4243
- set: function (elem, value) {
4244
- var nice = $.data(elem, '__nicescroll') || false;
4245
- (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call(elem, value);
4246
- return this;
4247
- }
4248
- };
4249
-
4250
- jQuery.fn.scrollLeft = function (value) {
4251
- if (value === undefined) {
4252
- var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
4253
- return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(this);
4254
- }
4255
- else {
4256
- return this.each(function () {
4257
- var nice = $.data(this, '__nicescroll') || false;
4258
- (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call($(this), value);
4259
- });
4260
- }
4261
- };
4262
-
4263
- var NiceScrollArray = function (doms) {
4264
- var self = this;
4265
- this.length = 0;
4266
- this.name = "nicescrollarray";
4267
-
4268
- this.each = function (fn) {
4269
- $.each(self, fn);
4270
- return self;
4271
- };
4272
-
4273
- this.push = function (nice) {
4274
- self[self.length] = nice;
4275
- self.length ++;
4276
- };
4277
-
4278
- this.eq = function (idx) {
4279
- return self[idx];
4280
- };
4281
-
4282
- if (doms) {
4283
- for (var a = 0 ; a < doms.length ; a ++) {
4284
- var nice = $.data(doms[a], '__nicescroll') || false;
4285
- if (nice) {
4286
- this[this.length] = nice;
4287
- this.length ++;
4288
- }
4289
- }
4290
- }
4291
-
4292
- return this;
4293
- };
4294
-
4295
- function mplex (el, lst, fn) {
4296
- for (var a = 0, l = lst.length ; a < l ; a ++) fn(el, lst[a]);
4297
- }
4298
-
4299
- mplex(
4300
- NiceScrollArray.prototype, ['show', 'hide', 'toggle', 'onResize', 'resize', 'remove', 'stop', 'doScrollPos'],
4301
- function (e, n) {
4302
- e[n] = function () {
4303
- var args = arguments;
4304
- return this.each(function () {
4305
- this[n].apply(this, args);
4306
- });
4307
- };
4308
- }
4309
- );
4310
-
4311
- jQuery.fn.getNiceScroll = function (index) {
4312
- if (index === undefined) {
4313
- return new NiceScrollArray(this);
4314
- }
4315
- else {
4316
- return this[index] && $.data(this[index], '__nicescroll') || false;
4317
- }
4318
- };
4319
-
4320
- var pseudos = jQuery.expr.pseudos || jQuery.expr[':']; // jQuery 3 migration
4321
- pseudos.nicescroll = function (a) {
4322
- return $.data(a, '__nicescroll') !== undefined;
4323
- };
4324
-
4325
- $.fn.niceScroll = function (wrapper, _opt) {
4326
- if (_opt === undefined && typeof wrapper == "object" && ! ("jquery" in wrapper)) {
4327
- _opt = wrapper;
4328
- wrapper = false;
4329
- }
4330
-
4331
- var ret = new NiceScrollArray();
4332
-
4333
- this.each(function () {
4334
- var $this = $(this);
4335
-
4336
- var opt = $.extend({}, _opt); // cloning
4337
-
4338
- if (wrapper || false) {
4339
- var wrp = $(wrapper);
4340
- opt.doc = (wrp.length > 1) ? $(wrapper, $this) : wrp;
4341
- opt.win = $this;
4342
- }
4343
- var docundef = ! ("doc" in opt);
4344
- if (! docundef && ! ("win" in opt)) {
4345
- opt.win = $this;
4346
- }
4347
-
4348
- var nice = $this.data('__nicescroll') || false;
4349
- if (! nice) {
4350
- opt.doc = opt.doc || $this;
4351
- nice = new NiceScrollClass(opt, $this);
4352
- $this.data('__nicescroll', nice);
4353
- }
4354
- ret.push(nice);
4355
- });
4356
-
4357
- return (ret.length === 1) ? ret[0] : ret;
4358
- };
4359
-
4360
- _win.NiceScroll = {
4361
- getjQuery: function () {
4362
- return jQuery;
4363
- }
4364
- };
4365
-
4366
- if (! $.nicescroll) {
4367
- $.nicescroll = new NiceScrollArray();
4368
- $.nicescroll.options = _globaloptions;
4369
- }
4370
-
4371
- }));
1
+ /* jquery.nicescroll
2
+ -- version 3.7.6
3
+ -- copyright 2017-07-19 InuYaksa*2017
4
+ -- licensed under the MIT
5
+ --
6
+ -- https://nicescroll.areaaperta.com/
7
+ -- https://github.com/inuyaksa/jquery.nicescroll
8
+ --
9
+ */
10
+
11
+ /* jshint expr: true */
12
+
13
+ (function (factory) {
14
+ if (typeof define === 'function' && define.amd) {
15
+ // AMD. Register as anonymous module.
16
+ define(['jquery'], factory);
17
+ } else if (typeof exports === 'object') {
18
+ // Node/CommonJS.
19
+ module.exports = factory(require('jquery'));
20
+ } else {
21
+ // Browser globals.
22
+ factory(jQuery);
23
+ }
24
+ }(function (jQuery) {
25
+
26
+ "use strict";
27
+
28
+ // globals
29
+ var domfocus = false,
30
+ mousefocus = false,
31
+ tabindexcounter = 0,
32
+ ascrailcounter = 2000,
33
+ globalmaxzindex = 0;
34
+
35
+ var $ = jQuery, // sandbox
36
+ _doc = document,
37
+ _win = window,
38
+ $window = $(_win);
39
+
40
+ var delegatevents = [];
41
+
42
+ // http://stackoverflow.com/questions/2161159/get-script-path
43
+ function getScriptPath() {
44
+ var scripts = _doc.currentScript || (function () { var s = _doc.getElementsByTagName('script'); return (s.length) ? s[s.length - 1] : false; })();
45
+ var path = scripts ? scripts.src.split('?')[0] : '';
46
+ return (path.split('/').length > 0) ? path.split('/').slice(0, -1).join('/') + '/' : '';
47
+ }
48
+
49
+ // based on code by Paul Irish https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
50
+ var setAnimationFrame = _win.requestAnimationFrame || _win.webkitRequestAnimationFrame || _win.mozRequestAnimationFrame || false;
51
+ var clearAnimationFrame = _win.cancelAnimationFrame || _win.webkitCancelAnimationFrame || _win.mozCancelAnimationFrame || false;
52
+
53
+ if (!setAnimationFrame) {
54
+ var anilasttime = 0;
55
+ setAnimationFrame = function (callback, element) {
56
+ var currTime = new Date().getTime();
57
+ var timeToCall = Math.max(0, 16 - (currTime - anilasttime));
58
+ var id = _win.setTimeout(function () { callback(currTime + timeToCall); },
59
+ timeToCall);
60
+ anilasttime = currTime + timeToCall;
61
+ return id;
62
+ };
63
+ clearAnimationFrame = function (id) {
64
+ _win.clearTimeout(id);
65
+ };
66
+ } else {
67
+ if (!_win.cancelAnimationFrame) clearAnimationFrame = function (id) { };
68
+ }
69
+
70
+ var ClsMutationObserver = _win.MutationObserver || _win.WebKitMutationObserver || false;
71
+
72
+ var now = Date.now || function () { return new Date().getTime(); };
73
+
74
+ var _globaloptions = {
75
+ zindex: "auto",
76
+ cursoropacitymin: 0,
77
+ cursoropacitymax: 1,
78
+ cursorcolor: "#424242",
79
+ cursorwidth: "6px",
80
+ cursorborder: "1px solid #fff",
81
+ cursorborderradius: "5px",
82
+ scrollspeed: 40,
83
+ mousescrollstep: 9 * 3,
84
+ touchbehavior: false, // deprecated
85
+ emulatetouch: false, // replacing touchbehavior
86
+ hwacceleration: true,
87
+ usetransition: true,
88
+ boxzoom: false,
89
+ dblclickzoom: true,
90
+ gesturezoom: true,
91
+ grabcursorenabled: true,
92
+ autohidemode: true,
93
+ background: "",
94
+ iframeautoresize: true,
95
+ cursorminheight: 32,
96
+ preservenativescrolling: true,
97
+ railoffset: false,
98
+ railhoffset: false,
99
+ bouncescroll: true,
100
+ spacebarenabled: true,
101
+ railpadding: {
102
+ top: 0,
103
+ right: 0,
104
+ left: 0,
105
+ bottom: 0
106
+ },
107
+ disableoutline: true,
108
+ horizrailenabled: true,
109
+ railalign: "right",
110
+ railvalign: "bottom",
111
+ enabletranslate3d: true,
112
+ enablemousewheel: true,
113
+ enablekeyboard: true,
114
+ smoothscroll: true,
115
+ sensitiverail: true,
116
+ enablemouselockapi: true,
117
+ // cursormaxheight:false,
118
+ cursorfixedheight: false,
119
+ directionlockdeadzone: 6,
120
+ hidecursordelay: 400,
121
+ nativeparentscrolling: true,
122
+ enablescrollonselection: true,
123
+ overflowx: true,
124
+ overflowy: true,
125
+ cursordragspeed: 0.3,
126
+ rtlmode: "auto",
127
+ cursordragontouch: false,
128
+ oneaxismousemode: "auto",
129
+ scriptpath: getScriptPath(),
130
+ preventmultitouchscrolling: true,
131
+ disablemutationobserver: false,
132
+ enableobserver: true,
133
+ scrollbarid: false,
134
+ scrollCLass: false
135
+ };
136
+
137
+ var browserdetected = false;
138
+
139
+ var getBrowserDetection = function () {
140
+
141
+ if (browserdetected) return browserdetected;
142
+
143
+ var _el = _doc.createElement('DIV'),
144
+ _style = _el.style,
145
+ _agent = navigator.userAgent,
146
+ _platform = navigator.platform,
147
+ d = {};
148
+
149
+ d.haspointerlock = "pointerLockElement" in _doc || "webkitPointerLockElement" in _doc || "mozPointerLockElement" in _doc;
150
+
151
+ d.isopera = ("opera" in _win); // 12-
152
+ d.isopera12 = (d.isopera && ("getUserMedia" in navigator));
153
+ d.isoperamini = (Object.prototype.toString.call(_win.operamini) === "[object OperaMini]");
154
+
155
+ d.isie = (("all" in _doc) && ("attachEvent" in _el) && !d.isopera); //IE10-
156
+ d.isieold = (d.isie && !("msInterpolationMode" in _style)); // IE6 and older
157
+ d.isie7 = d.isie && !d.isieold && (!("documentMode" in _doc) || (_doc.documentMode === 7));
158
+ d.isie8 = d.isie && ("documentMode" in _doc) && (_doc.documentMode === 8);
159
+ d.isie9 = d.isie && ("performance" in _win) && (_doc.documentMode === 9);
160
+ d.isie10 = d.isie && ("performance" in _win) && (_doc.documentMode === 10);
161
+ d.isie11 = ("msRequestFullscreen" in _el) && (_doc.documentMode >= 11); // IE11+
162
+
163
+ d.ismsedge = ("msCredentials" in _win); // MS Edge 14+
164
+
165
+ d.ismozilla = ("MozAppearance" in _style);
166
+
167
+ d.iswebkit = !d.ismsedge && ("WebkitAppearance" in _style);
168
+
169
+ d.ischrome = d.iswebkit && ("chrome" in _win);
170
+ d.ischrome38 = (d.ischrome && ("touchAction" in _style)); // behavior changed in touch emulation
171
+ d.ischrome22 = (!d.ischrome38) && (d.ischrome && d.haspointerlock);
172
+ d.ischrome26 = (!d.ischrome38) && (d.ischrome && ("transition" in _style)); // issue with transform detection (maintain prefix)
173
+
174
+ d.cantouch = ("ontouchstart" in _doc.documentElement) || ("ontouchstart" in _win); // with detection for Chrome Touch Emulation
175
+ d.hasw3ctouch = (_win.PointerEvent || false) && ((navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); //IE11 pointer events, following W3C Pointer Events spec
176
+ d.hasmstouch = (!d.hasw3ctouch) && (_win.MSPointerEvent || false); // IE10 pointer events
177
+
178
+ d.ismac = /^mac$/i.test(_platform);
179
+
180
+ d.isios = d.cantouch && /iphone|ipad|ipod/i.test(_platform);
181
+ d.isios4 = d.isios && !("seal" in Object);
182
+ d.isios7 = d.isios && ("webkitHidden" in _doc); //iOS 7+
183
+ d.isios8 = d.isios && ("hidden" in _doc); //iOS 8+
184
+ d.isios10 = d.isios && _win.Proxy; //iOS 10+
185
+
186
+ d.isandroid = (/android/i.test(_agent));
187
+
188
+ d.haseventlistener = ("addEventListener" in _el);
189
+
190
+ d.trstyle = false;
191
+ d.hastransform = false;
192
+ d.hastranslate3d = false;
193
+ d.transitionstyle = false;
194
+ d.hastransition = false;
195
+ d.transitionend = false;
196
+
197
+ d.trstyle = "transform";
198
+ d.hastransform = ("transform" in _style) || (function () {
199
+ var check = ['msTransform', 'webkitTransform', 'MozTransform', 'OTransform'];
200
+ for (var a = 0, c = check.length; a < c; a++) {
201
+ if (_style[check[a]] !== undefined) {
202
+ d.trstyle = check[a];
203
+ break;
204
+ }
205
+ }
206
+ d.hastransform = (!!d.trstyle);
207
+ })();
208
+
209
+ if (d.hastransform) {
210
+ _style[d.trstyle] = "translate3d(1px,2px,3px)";
211
+ d.hastranslate3d = /translate3d/.test(_style[d.trstyle]);
212
+ }
213
+
214
+ d.transitionstyle = "transition";
215
+ d.prefixstyle = '';
216
+ d.transitionend = "transitionend";
217
+
218
+ d.hastransition = ("transition" in _style) || (function () {
219
+
220
+ d.transitionend = false;
221
+ var check = ['webkitTransition', 'msTransition', 'MozTransition', 'OTransition', 'OTransition', 'KhtmlTransition'];
222
+ var prefix = ['-webkit-', '-ms-', '-moz-', '-o-', '-o', '-khtml-'];
223
+ var evs = ['webkitTransitionEnd', 'msTransitionEnd', 'transitionend', 'otransitionend', 'oTransitionEnd', 'KhtmlTransitionEnd'];
224
+ for (var a = 0, c = check.length; a < c; a++) {
225
+ if (check[a] in _style) {
226
+ d.transitionstyle = check[a];
227
+ d.prefixstyle = prefix[a];
228
+ d.transitionend = evs[a];
229
+ break;
230
+ }
231
+ }
232
+ if (d.ischrome26) d.prefixstyle = prefix[1]; // always use prefix
233
+
234
+ d.hastransition = (d.transitionstyle);
235
+
236
+ })();
237
+
238
+ function detectCursorGrab() {
239
+ var lst = ['grab', '-webkit-grab', '-moz-grab'];
240
+ if ((d.ischrome && !d.ischrome38) || d.isie) lst = []; // force setting for IE returns false positive and chrome cursor bug
241
+ for (var a = 0, l = lst.length; a < l; a++) {
242
+ var p = lst[a];
243
+ _style.cursor = p;
244
+ if (_style.cursor == p) return p;
245
+ }
246
+ return 'url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize'; // thanks to https://cdnjs.com/ for the openhand cursor!
247
+ }
248
+ d.cursorgrabvalue = detectCursorGrab();
249
+
250
+ d.hasmousecapture = ("setCapture" in _el);
251
+
252
+ d.hasMutationObserver = (ClsMutationObserver !== false);
253
+
254
+ _el = null; //memory released
255
+
256
+ browserdetected = d;
257
+
258
+ return d;
259
+ };
260
+
261
+ var NiceScrollClass = function (myopt, me) {
262
+
263
+ var self = this;
264
+
265
+ this.version = '3.7.6';
266
+ this.name = 'nicescroll';
267
+
268
+ this.me = me;
269
+
270
+ var $body = $("body");
271
+
272
+ var opt = this.opt = {
273
+ doc: $body,
274
+ win: false
275
+ };
276
+
277
+ $.extend(opt, _globaloptions); // clone opts
278
+
279
+ // Options for internal use
280
+ opt.snapbackspeed = 80;
281
+
282
+ if (myopt || false) {
283
+ for (var a in opt) {
284
+ if (myopt[a] !== undefined) opt[a] = myopt[a];
285
+ }
286
+ }
287
+
288
+ if (opt.disablemutationobserver) ClsMutationObserver = false;
289
+
290
+ this.doc = opt.doc;
291
+ this.iddoc = (this.doc && this.doc[0]) ? this.doc[0].id || '' : '';
292
+ this.ispage = /^BODY|HTML/.test((opt.win) ? opt.win[0].nodeName : this.doc[0].nodeName);
293
+ this.haswrapper = (opt.win !== false);
294
+ this.win = opt.win || (this.ispage ? $window : this.doc);
295
+ this.docscroll = (this.ispage && !this.haswrapper) ? $window : this.win;
296
+ this.body = $body;
297
+ this.viewport = false;
298
+
299
+ this.isfixed = false;
300
+
301
+ this.iframe = false;
302
+ this.isiframe = ((this.doc[0].nodeName == 'IFRAME') && (this.win[0].nodeName == 'IFRAME'));
303
+
304
+ this.istextarea = (this.win[0].nodeName == 'TEXTAREA');
305
+
306
+ this.forcescreen = false; //force to use screen position on events
307
+
308
+ this.canshowonmouseevent = (opt.autohidemode != "scroll");
309
+
310
+ // Events jump table
311
+ this.onmousedown = false;
312
+ this.onmouseup = false;
313
+ this.onmousemove = false;
314
+ this.onmousewheel = false;
315
+ this.onkeypress = false;
316
+ this.ongesturezoom = false;
317
+ this.onclick = false;
318
+
319
+ // Nicescroll custom events
320
+ this.onscrollstart = false;
321
+ this.onscrollend = false;
322
+ this.onscrollcancel = false;
323
+
324
+ this.onzoomin = false;
325
+ this.onzoomout = false;
326
+
327
+ // Let's start!
328
+ this.view = false;
329
+ this.page = false;
330
+
331
+ this.scroll = {
332
+ x: 0,
333
+ y: 0
334
+ };
335
+ this.scrollratio = {
336
+ x: 0,
337
+ y: 0
338
+ };
339
+ this.cursorheight = 20;
340
+ this.scrollvaluemax = 0;
341
+
342
+ // http://dev.w3.org/csswg/css-writing-modes-3/#logical-to-physical
343
+ // http://dev.w3.org/csswg/css-writing-modes-3/#svg-writing-mode
344
+ if (opt.rtlmode == "auto") {
345
+ var target = this.win[0] == _win ? this.body : this.win;
346
+ var writingMode = target.css("writing-mode") || target.css("-webkit-writing-mode") || target.css("-ms-writing-mode") || target.css("-moz-writing-mode");
347
+
348
+ if (writingMode == "horizontal-tb" || writingMode == "lr-tb" || writingMode === "") {
349
+ this.isrtlmode = (target.css("direction") == "rtl");
350
+ this.isvertical = false;
351
+ } else {
352
+ this.isrtlmode = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl" || writingMode == "rl-tb");
353
+ this.isvertical = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl");
354
+ }
355
+ } else {
356
+ this.isrtlmode = (opt.rtlmode === true);
357
+ this.isvertical = false;
358
+ }
359
+ // this.checkrtlmode = false;
360
+
361
+ this.scrollrunning = false;
362
+
363
+ this.scrollmom = false;
364
+
365
+ this.observer = false; // observer div changes
366
+ this.observerremover = false; // observer on parent for remove detection
367
+ this.observerbody = false; // observer on body for position change
368
+
369
+ if (opt.scrollbarid !== false) {
370
+ this.id = opt.scrollbarid;
371
+ } else {
372
+ do {
373
+ this.id = "ascrail" + (ascrailcounter++);
374
+ } while (_doc.getElementById(this.id));
375
+ }
376
+
377
+ this.rail = false;
378
+ this.cursor = false;
379
+ this.cursorfreezed = false;
380
+ this.selectiondrag = false;
381
+
382
+ this.zoom = false;
383
+ this.zoomactive = false;
384
+
385
+ this.hasfocus = false;
386
+ this.hasmousefocus = false;
387
+
388
+ //this.visibility = true;
389
+ this.railslocked = false; // locked by resize
390
+ this.locked = false; // prevent lost of locked status sets by user
391
+ this.hidden = false; // rails always hidden
392
+ this.cursoractive = true; // user can interact with cursors
393
+
394
+ this.wheelprevented = false; //prevent mousewheel event
395
+
396
+ this.overflowx = opt.overflowx;
397
+ this.overflowy = opt.overflowy;
398
+
399
+ this.nativescrollingarea = false;
400
+ this.checkarea = 0;
401
+
402
+ this.events = []; // event list for unbind
403
+
404
+ this.saved = {}; // style saved
405
+
406
+ this.delaylist = {};
407
+ this.synclist = {};
408
+
409
+ this.lastdeltax = 0;
410
+ this.lastdeltay = 0;
411
+
412
+ this.detected = getBrowserDetection();
413
+
414
+ var cap = $.extend({}, this.detected);
415
+
416
+ this.canhwscroll = (cap.hastransform && opt.hwacceleration);
417
+ this.ishwscroll = (this.canhwscroll && self.haswrapper);
418
+
419
+ if (!this.isrtlmode) {
420
+ this.hasreversehr = false;
421
+ } else if (this.isvertical) { // RTL mode with reverse horizontal axis
422
+ this.hasreversehr = !(cap.iswebkit || cap.isie || cap.isie11);
423
+ } else {
424
+ this.hasreversehr = !(cap.iswebkit || (cap.isie && !cap.isie10 && !cap.isie11));
425
+ }
426
+
427
+ this.istouchcapable = false; // desktop devices with touch screen support
428
+
429
+ //## Check WebKit-based desktop with touch support
430
+ //## + Firefox 18 nightly build (desktop) false positive (or desktop with touch support)
431
+
432
+ if (!cap.cantouch && (cap.hasw3ctouch || cap.hasmstouch)) { // desktop device with multiple input
433
+ this.istouchcapable = true;
434
+ } else if (cap.cantouch && !cap.isios && !cap.isandroid && (cap.iswebkit || cap.ismozilla)) {
435
+ this.istouchcapable = true;
436
+ }
437
+
438
+ //## disable MouseLock API on user request
439
+ if (!opt.enablemouselockapi) {
440
+ cap.hasmousecapture = false;
441
+ cap.haspointerlock = false;
442
+ }
443
+
444
+ this.debounced = function (name, fn, tm) {
445
+ if (!self) return;
446
+ var dd = self.delaylist[name] || false;
447
+ if (!dd) {
448
+ self.delaylist[name] = {
449
+ h: setAnimationFrame(function () {
450
+ self.delaylist[name].fn.call(self);
451
+ self.delaylist[name] = false;
452
+ }, tm)
453
+ };
454
+ fn.call(self);
455
+ }
456
+ self.delaylist[name].fn = fn;
457
+ };
458
+
459
+
460
+ this.synched = function (name, fn) {
461
+ if (self.synclist[name]) self.synclist[name] = fn;
462
+ else {
463
+ self.synclist[name] = fn;
464
+ setAnimationFrame(function () {
465
+ if (!self) return;
466
+ self.synclist[name] && self.synclist[name].call(self);
467
+ self.synclist[name] = null;
468
+ });
469
+ }
470
+ };
471
+
472
+ this.unsynched = function (name) {
473
+ if (self.synclist[name]) self.synclist[name] = false;
474
+ };
475
+
476
+ this.css = function (el, pars) { // save & set
477
+ for (var n in pars) {
478
+ self.saved.css.push([el, n, el.css(n)]);
479
+ el.css(n, pars[n]);
480
+ }
481
+ };
482
+
483
+ this.scrollTop = function (val) {
484
+ return (val === undefined) ? self.getScrollTop() : self.setScrollTop(val);
485
+ };
486
+
487
+ this.scrollLeft = function (val) {
488
+ return (val === undefined) ? self.getScrollLeft() : self.setScrollLeft(val);
489
+ };
490
+
491
+ // derived by by Dan Pupius www.pupius.net
492
+ var BezierClass = function (st, ed, spd, p1, p2, p3, p4) {
493
+
494
+ this.st = st;
495
+ this.ed = ed;
496
+ this.spd = spd;
497
+
498
+ this.p1 = p1 || 0;
499
+ this.p2 = p2 || 1;
500
+ this.p3 = p3 || 0;
501
+ this.p4 = p4 || 1;
502
+
503
+ this.ts = now();
504
+ this.df = ed - st;
505
+ };
506
+ BezierClass.prototype = {
507
+ B2: function (t) {
508
+ return 3 * (1 - t) * (1 - t) * t;
509
+ },
510
+ B3: function (t) {
511
+ return 3 * (1 - t) * t * t;
512
+ },
513
+ B4: function (t) {
514
+ return t * t * t;
515
+ },
516
+ getPos: function () {
517
+ return (now() - this.ts) / this.spd;
518
+ },
519
+ getNow: function () {
520
+ var pc = (now() - this.ts) / this.spd;
521
+ var bz = this.B2(pc) + this.B3(pc) + this.B4(pc);
522
+ return (pc >= 1) ? this.ed : this.st + (this.df * bz) | 0;
523
+ },
524
+ update: function (ed, spd) {
525
+ this.st = this.getNow();
526
+ this.ed = ed;
527
+ this.spd = spd;
528
+ this.ts = now();
529
+ this.df = this.ed - this.st;
530
+ return this;
531
+ }
532
+ };
533
+
534
+ //derived from http://stackoverflow.com/questions/11236090/
535
+ function getMatrixValues() {
536
+ var tr = self.doc.css(cap.trstyle);
537
+ if (tr && (tr.substr(0, 6) == "matrix")) {
538
+ return tr.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, '').split(/, +/);
539
+ }
540
+ return false;
541
+ }
542
+
543
+ if (this.ishwscroll) { // hw accelerated scroll
544
+
545
+ this.doc.translate = {
546
+ x: 0,
547
+ y: 0,
548
+ tx: "0px",
549
+ ty: "0px"
550
+ };
551
+
552
+ //this one can help to enable hw accel on ios6 http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/
553
+ if (cap.hastranslate3d && cap.isios) this.doc.css("-webkit-backface-visibility", "hidden"); // prevent flickering http://stackoverflow.com/questions/3461441/
554
+
555
+ this.getScrollTop = function (last) {
556
+ if (!last) {
557
+ var mtx = getMatrixValues();
558
+ if (mtx) return (mtx.length == 16) ? -mtx[13] : -mtx[5]; //matrix3d 16 on IE10
559
+ if (self.timerscroll && self.timerscroll.bz) return self.timerscroll.bz.getNow();
560
+ }
561
+ return self.doc.translate.y;
562
+ };
563
+
564
+ this.getScrollLeft = function (last) {
565
+ if (!last) {
566
+ var mtx = getMatrixValues();
567
+ if (mtx) return (mtx.length == 16) ? -mtx[12] : -mtx[4]; //matrix3d 16 on IE10
568
+ if (self.timerscroll && self.timerscroll.bh) return self.timerscroll.bh.getNow();
569
+ }
570
+ return self.doc.translate.x;
571
+ };
572
+
573
+ this.notifyScrollEvent = function (el) {
574
+ var e = _doc.createEvent("UIEvents");
575
+ e.initUIEvent("scroll", false, false, _win, 1);
576
+ e.niceevent = true;
577
+ el.dispatchEvent(e);
578
+ };
579
+
580
+ var cxscrollleft = (this.isrtlmode) ? 1 : -1;
581
+
582
+ if (cap.hastranslate3d && opt.enabletranslate3d) {
583
+ this.setScrollTop = function (val, silent) {
584
+ self.doc.translate.y = val;
585
+ self.doc.translate.ty = (val * -1) + "px";
586
+ self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
587
+ if (!silent) self.notifyScrollEvent(self.win[0]);
588
+ };
589
+ this.setScrollLeft = function (val, silent) {
590
+ self.doc.translate.x = val;
591
+ self.doc.translate.tx = (val * cxscrollleft) + "px";
592
+ self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
593
+ if (!silent) self.notifyScrollEvent(self.win[0]);
594
+ };
595
+ } else {
596
+ this.setScrollTop = function (val, silent) {
597
+ self.doc.translate.y = val;
598
+ self.doc.translate.ty = (val * -1) + "px";
599
+ self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
600
+ if (!silent) self.notifyScrollEvent(self.win[0]);
601
+ };
602
+ this.setScrollLeft = function (val, silent) {
603
+ self.doc.translate.x = val;
604
+ self.doc.translate.tx = (val * cxscrollleft) + "px";
605
+ self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
606
+ if (!silent) self.notifyScrollEvent(self.win[0]);
607
+ };
608
+ }
609
+ } else { // native scroll
610
+
611
+ this.getScrollTop = function () {
612
+ return self.docscroll.scrollTop();
613
+ };
614
+ this.setScrollTop = function (val) {
615
+ self.docscroll.scrollTop(val);
616
+ };
617
+
618
+ this.getScrollLeft = function () {
619
+ var val;
620
+ if (!self.hasreversehr) {
621
+ val = self.docscroll.scrollLeft();
622
+ } else if (self.detected.ismozilla) {
623
+ val = self.page.maxw - Math.abs(self.docscroll.scrollLeft());
624
+ } else {
625
+ val = self.page.maxw - self.docscroll.scrollLeft();
626
+ }
627
+ return val;
628
+ };
629
+ this.setScrollLeft = function (val) {
630
+ return setTimeout(function () {
631
+ if (!self) return;
632
+ if (self.hasreversehr) {
633
+ if (self.detected.ismozilla) {
634
+ val = -(self.page.maxw - val);
635
+ } else {
636
+ val = self.page.maxw - val;
637
+ }
638
+ }
639
+ return self.docscroll.scrollLeft(val);
640
+ }, 1);
641
+ };
642
+ }
643
+
644
+ this.getTarget = function (e) {
645
+ if (!e) return false;
646
+ if (e.target) return e.target;
647
+ if (e.srcElement) return e.srcElement;
648
+ return false;
649
+ };
650
+
651
+ this.hasParent = function (e, id) {
652
+ if (!e) return false;
653
+ var el = e.target || e.srcElement || e || false;
654
+ while (el && el.id != id) {
655
+ el = el.parentNode || false;
656
+ }
657
+ return (el !== false);
658
+ };
659
+
660
+ function getZIndex() {
661
+ var dom = self.win;
662
+ if ("zIndex" in dom) return dom.zIndex(); // use jQuery UI method when available
663
+ while (dom.length > 0) {
664
+ if (dom[0].nodeType == 9) return false;
665
+ var zi = dom.css('zIndex');
666
+ if (!isNaN(zi) && zi !== 0) return parseInt(zi);
667
+ dom = dom.parent();
668
+ }
669
+ return false;
670
+ }
671
+
672
+ //inspired by http://forum.jquery.com/topic/width-includes-border-width-when-set-to-thin-medium-thick-in-ie
673
+ var _convertBorderWidth = {
674
+ "thin": 1,
675
+ "medium": 3,
676
+ "thick": 5
677
+ };
678
+
679
+ function getWidthToPixel(dom, prop, chkheight) {
680
+ var wd = dom.css(prop);
681
+ var px = parseFloat(wd);
682
+ if (isNaN(px)) {
683
+ px = _convertBorderWidth[wd] || 0;
684
+ var brd = (px == 3) ? ((chkheight) ? (self.win.outerHeight() - self.win.innerHeight()) : (self.win.outerWidth() - self.win.innerWidth())) : 1; //DON'T TRUST CSS
685
+ if (self.isie8 && px) px += 1;
686
+ return (brd) ? px : 0;
687
+ }
688
+ return px;
689
+ }
690
+
691
+ this.getDocumentScrollOffset = function () {
692
+ return {
693
+ top: _win.pageYOffset || _doc.documentElement.scrollTop,
694
+ left: _win.pageXOffset || _doc.documentElement.scrollLeft
695
+ };
696
+ };
697
+
698
+ this.getOffset = function () {
699
+ if (self.isfixed) {
700
+ var ofs = self.win.offset(); // fix Chrome auto issue (when right/bottom props only)
701
+ var scrl = self.getDocumentScrollOffset();
702
+ ofs.top -= scrl.top;
703
+ ofs.left -= scrl.left;
704
+ return ofs;
705
+ }
706
+ var ww = self.win.offset();
707
+ if (!self.viewport) return ww;
708
+ var vp = self.viewport.offset();
709
+ return {
710
+ top: ww.top - vp.top,
711
+ left: ww.left - vp.left
712
+ };
713
+ };
714
+
715
+ this.updateScrollBar = function (len) {
716
+ var pos, off;
717
+ if (self.ishwscroll) {
718
+ self.rail.css({
719
+ height: self.win.innerHeight() - (opt.railpadding.top + opt.railpadding.bottom)
720
+ });
721
+ if (self.railh) self.railh.css({
722
+ width: self.win.innerWidth() - (opt.railpadding.left + opt.railpadding.right)
723
+ });
724
+ } else {
725
+ var wpos = self.getOffset();
726
+ pos = {
727
+ top: wpos.top,
728
+ left: wpos.left - (opt.railpadding.left + opt.railpadding.right)
729
+ };
730
+ pos.top += getWidthToPixel(self.win, 'border-top-width', true);
731
+ pos.left += (self.rail.align) ? self.win.outerWidth() - getWidthToPixel(self.win, 'border-right-width') - self.rail.width : getWidthToPixel(self.win, 'border-left-width');
732
+
733
+ off = opt.railoffset;
734
+ if (off) {
735
+ if (off.top) pos.top += off.top;
736
+ if (off.left) pos.left += off.left;
737
+ }
738
+
739
+ if (!self.railslocked) self.rail.css({
740
+ top: pos.top,
741
+ left: pos.left,
742
+ height: ((len) ? len.h : self.win.innerHeight()) - (opt.railpadding.top + opt.railpadding.bottom)
743
+ });
744
+
745
+ if (self.zoom) {
746
+ self.zoom.css({
747
+ top: pos.top + 1,
748
+ left: (self.rail.align == 1) ? pos.left - 20 : pos.left + self.rail.width + 4
749
+ });
750
+ }
751
+
752
+ if (self.railh && !self.railslocked) {
753
+ pos = {
754
+ top: wpos.top,
755
+ left: wpos.left
756
+ };
757
+ off = opt.railhoffset;
758
+ if (off) {
759
+ if (off.top) pos.top += off.top;
760
+ if (off.left) pos.left += off.left;
761
+ }
762
+ var y = (self.railh.align) ? pos.top + getWidthToPixel(self.win, 'border-top-width', true) + self.win.innerHeight() - self.railh.height : pos.top + getWidthToPixel(self.win, 'border-top-width', true);
763
+ var x = pos.left + getWidthToPixel(self.win, 'border-left-width');
764
+ self.railh.css({
765
+ top: y - (opt.railpadding.top + opt.railpadding.bottom),
766
+ left: x,
767
+ width: self.railh.width
768
+ });
769
+ }
770
+
771
+ }
772
+ };
773
+
774
+ this.doRailClick = function (e, dbl, hr) {
775
+ var fn, pg, cur, pos;
776
+
777
+ if (self.railslocked) return;
778
+
779
+ self.cancelEvent(e);
780
+
781
+ if (!("pageY" in e)) {
782
+ e.pageX = e.clientX + _doc.documentElement.scrollLeft;
783
+ e.pageY = e.clientY + _doc.documentElement.scrollTop;
784
+ }
785
+
786
+ if (dbl) {
787
+ fn = (hr) ? self.doScrollLeft : self.doScrollTop;
788
+ cur = (hr) ? ((e.pageX - self.railh.offset().left - (self.cursorwidth / 2)) * self.scrollratio.x) : ((e.pageY - self.rail.offset().top - (self.cursorheight / 2)) * self.scrollratio.y);
789
+ self.unsynched("relativexy");
790
+ fn(cur|0);
791
+ } else {
792
+ fn = (hr) ? self.doScrollLeftBy : self.doScrollBy;
793
+ cur = (hr) ? self.scroll.x : self.scroll.y;
794
+ pos = (hr) ? e.pageX - self.railh.offset().left : e.pageY - self.rail.offset().top;
795
+ pg = (hr) ? self.view.w : self.view.h;
796
+ fn((cur >= pos) ? pg : -pg);
797
+ }
798
+
799
+ };
800
+
801
+ self.newscrolly = self.newscrollx = 0;
802
+
803
+ self.hasanimationframe = ("requestAnimationFrame" in _win);
804
+ self.hascancelanimationframe = ("cancelAnimationFrame" in _win);
805
+
806
+ self.hasborderbox = false;
807
+
808
+ this.init = function () {
809
+
810
+ self.saved.css = [];
811
+
812
+ if (cap.isoperamini) return true; // SORRY, DO NOT WORK!
813
+ if (cap.isandroid && !("hidden" in _doc)) return true; // Android 3- SORRY, DO NOT WORK!
814
+
815
+ opt.emulatetouch = opt.emulatetouch || opt.touchbehavior; // mantain compatibility with "touchbehavior"
816
+
817
+ self.hasborderbox = _win.getComputedStyle && (_win.getComputedStyle(_doc.body)['box-sizing'] === "border-box");
818
+
819
+ var _scrollyhidden = { 'overflow-y': 'hidden' };
820
+ if (cap.isie11 || cap.isie10) _scrollyhidden['-ms-overflow-style'] = 'none'; // IE 10 & 11 is always a world apart!
821
+
822
+ if (self.ishwscroll) {
823
+ this.doc.css(cap.transitionstyle, cap.prefixstyle + 'transform 0ms ease-out');
824
+ if (cap.transitionend) self.bind(self.doc, cap.transitionend, self.onScrollTransitionEnd, false); //I have got to do something usefull!!
825
+ }
826
+
827
+ self.zindex = "auto";
828
+ if (!self.ispage && opt.zindex == "auto") {
829
+ self.zindex = getZIndex() || "auto";
830
+ } else {
831
+ self.zindex = opt.zindex;
832
+ }
833
+
834
+ if (!self.ispage && self.zindex != "auto" && self.zindex > globalmaxzindex) {
835
+ globalmaxzindex = self.zindex;
836
+ }
837
+
838
+ if (self.isie && self.zindex === 0 && opt.zindex == "auto") { // fix IE auto == 0
839
+ self.zindex = "auto";
840
+ }
841
+
842
+ if (!self.ispage || !cap.isieold) {
843
+
844
+ var cont = self.docscroll;
845
+ if (self.ispage) cont = (self.haswrapper) ? self.win : self.doc;
846
+
847
+ self.css(cont, _scrollyhidden);
848
+
849
+ if (self.ispage && (cap.isie11 || cap.isie)) { // IE 7-11
850
+ self.css($("html"), _scrollyhidden);
851
+ }
852
+
853
+ if (cap.isios && !self.ispage && !self.haswrapper) self.css($body, {
854
+ "-webkit-overflow-scrolling": "touch"
855
+ }); //force hw acceleration
856
+
857
+ var cursor = $(_doc.createElement('div'));
858
+ cursor.css({
859
+ position: "relative",
860
+ top: 0,
861
+ "float": "right",
862
+ width: opt.cursorwidth,
863
+ height: 0,
864
+ 'background-color': opt.cursorcolor,
865
+ border: opt.cursorborder,
866
+ 'background-clip': 'padding-box',
867
+ '-webkit-border-radius': opt.cursorborderradius,
868
+ '-moz-border-radius': opt.cursorborderradius,
869
+ 'border-radius': opt.cursorborderradius
870
+ });
871
+
872
+ cursor.addClass('nicescroll-cursors');
873
+
874
+ self.cursor = cursor;
875
+
876
+ var rail = $(_doc.createElement('div'));
877
+ rail.attr('id', self.id);
878
+ rail.addClass('nicescroll-rails nicescroll-rails-vr');
879
+
880
+ if (opt.scrollCLass) {
881
+ rail.addClass(opt.scrollCLass);
882
+ }
883
+
884
+ var v, a, kp = ["left", "right", "top", "bottom"]; //**
885
+ for (var n in kp) {
886
+ a = kp[n];
887
+ v = opt.railpadding[a] || 0;
888
+ v && rail.css("padding-" + a, v + "px");
889
+ }
890
+
891
+ rail.append(cursor);
892
+
893
+ rail.width = Math.max(parseFloat(opt.cursorwidth), cursor.outerWidth());
894
+ rail.css({
895
+ width: rail.width + "px",
896
+ zIndex: self.zindex,
897
+ background: opt.background,
898
+ cursor: "default"
899
+ });
900
+
901
+ rail.visibility = true;
902
+ rail.scrollable = true;
903
+
904
+ rail.align = (opt.railalign == "left") ? 0 : 1;
905
+
906
+ self.rail = rail;
907
+
908
+ self.rail.drag = false;
909
+
910
+ var zoom = false;
911
+ if (opt.boxzoom && !self.ispage && !cap.isieold) {
912
+ zoom = _doc.createElement('div');
913
+
914
+ self.bind(zoom, "click", self.doZoom);
915
+ self.bind(zoom, "mouseenter", function () {
916
+ self.zoom.css('opacity', opt.cursoropacitymax);
917
+ });
918
+ self.bind(zoom, "mouseleave", function () {
919
+ self.zoom.css('opacity', opt.cursoropacitymin);
920
+ });
921
+
922
+ self.zoom = $(zoom);
923
+ self.zoom.css({
924
+ cursor: "pointer",
925
+ zIndex: self.zindex,
926
+ backgroundImage: 'url(' + opt.scriptpath + 'zoomico.png)',
927
+ height: 18,
928
+ width: 18,
929
+ backgroundPosition: '0 0'
930
+ });
931
+ if (opt.dblclickzoom) self.bind(self.win, "dblclick", self.doZoom);
932
+ if (cap.cantouch && opt.gesturezoom) {
933
+ self.ongesturezoom = function (e) {
934
+ if (e.scale > 1.5) self.doZoomIn(e);
935
+ if (e.scale < 0.8) self.doZoomOut(e);
936
+ return self.cancelEvent(e);
937
+ };
938
+ self.bind(self.win, "gestureend", self.ongesturezoom);
939
+ }
940
+ }
941
+
942
+ // init HORIZ
943
+
944
+ self.railh = false;
945
+ var railh;
946
+
947
+ if (opt.horizrailenabled) {
948
+
949
+ self.css(cont, {
950
+ overflowX: 'hidden'
951
+ });
952
+
953
+ cursor = $(_doc.createElement('div'));
954
+ cursor.css({
955
+ position: "absolute",
956
+ top: 0,
957
+ height: opt.cursorwidth,
958
+ width: 0,
959
+ backgroundColor: opt.cursorcolor,
960
+ border: opt.cursorborder,
961
+ backgroundClip: 'padding-box',
962
+ '-webkit-border-radius': opt.cursorborderradius,
963
+ '-moz-border-radius': opt.cursorborderradius,
964
+ 'border-radius': opt.cursorborderradius
965
+ });
966
+
967
+ if (cap.isieold) cursor.css('overflow', 'hidden'); //IE6 horiz scrollbar issue
968
+
969
+ cursor.addClass('nicescroll-cursors');
970
+
971
+ self.cursorh = cursor;
972
+
973
+ railh = $(_doc.createElement('div'));
974
+ railh.attr('id', self.id + '-hr');
975
+ railh.addClass('nicescroll-rails nicescroll-rails-hr');
976
+ if (opt.scrollCLass) {
977
+ railh.addClass(opt.scrollCLass);
978
+ }
979
+
980
+ railh.height = Math.max(parseFloat(opt.cursorwidth), cursor.outerHeight());
981
+ railh.css({
982
+ height: railh.height + "px",
983
+ 'zIndex': self.zindex,
984
+ "background": opt.background
985
+ });
986
+
987
+ railh.append(cursor);
988
+
989
+ railh.visibility = true;
990
+ railh.scrollable = true;
991
+
992
+ railh.align = (opt.railvalign == "top") ? 0 : 1;
993
+
994
+ self.railh = railh;
995
+
996
+ self.railh.drag = false;
997
+
998
+ }
999
+
1000
+ if (self.ispage) {
1001
+
1002
+ rail.css({
1003
+ position: "fixed",
1004
+ top: 0,
1005
+ height: "100%"
1006
+ });
1007
+
1008
+ rail.css((rail.align) ? { right: 0 } : { left: 0 });
1009
+
1010
+ self.body.append(rail);
1011
+ if (self.railh) {
1012
+ railh.css({
1013
+ position: "fixed",
1014
+ left: 0,
1015
+ width: "100%"
1016
+ });
1017
+
1018
+ railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1019
+
1020
+ self.body.append(railh);
1021
+ }
1022
+ } else {
1023
+ if (self.ishwscroll) {
1024
+ if (self.win.css('position') == 'static') self.css(self.win, { 'position': 'relative' });
1025
+ var bd = (self.win[0].nodeName == 'HTML') ? self.body : self.win;
1026
+ $(bd).scrollTop(0).scrollLeft(0); // fix rail position if content already scrolled
1027
+ if (self.zoom) {
1028
+ self.zoom.css({
1029
+ position: "absolute",
1030
+ top: 1,
1031
+ right: 0,
1032
+ "margin-right": rail.width + 4
1033
+ });
1034
+ bd.append(self.zoom);
1035
+ }
1036
+ rail.css({
1037
+ position: "absolute",
1038
+ top: 0
1039
+ });
1040
+ rail.css((rail.align) ? { right: 0 } : { left: 0 });
1041
+ bd.append(rail);
1042
+ if (railh) {
1043
+ railh.css({
1044
+ position: "absolute",
1045
+ left: 0,
1046
+ bottom: 0
1047
+ });
1048
+ railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1049
+ bd.append(railh);
1050
+ }
1051
+ } else {
1052
+ self.isfixed = (self.win.css("position") == "fixed");
1053
+ var rlpos = (self.isfixed) ? "fixed" : "absolute";
1054
+
1055
+ if (!self.isfixed) self.viewport = self.getViewport(self.win[0]);
1056
+ if (self.viewport) {
1057
+ self.body = self.viewport;
1058
+ if (!(/fixed|absolute/.test(self.viewport.css("position")))) self.css(self.viewport, {
1059
+ "position": "relative"
1060
+ });
1061
+ }
1062
+
1063
+ rail.css({
1064
+ position: rlpos
1065
+ });
1066
+ if (self.zoom) self.zoom.css({
1067
+ position: rlpos
1068
+ });
1069
+ self.updateScrollBar();
1070
+ self.body.append(rail);
1071
+ if (self.zoom) self.body.append(self.zoom);
1072
+ if (self.railh) {
1073
+ railh.css({
1074
+ position: rlpos
1075
+ });
1076
+ self.body.append(railh);
1077
+ }
1078
+ }
1079
+
1080
+ if (cap.isios) self.css(self.win, {
1081
+ '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',
1082
+ '-webkit-touch-callout': 'none'
1083
+ }); // prevent grey layer on click
1084
+
1085
+ if (opt.disableoutline) {
1086
+ if (cap.isie) self.win.attr("hideFocus", "true"); // IE, prevent dotted rectangle on focused div
1087
+ if (cap.iswebkit) self.win.css('outline', 'none'); // Webkit outline
1088
+ }
1089
+
1090
+ }
1091
+
1092
+ if (opt.autohidemode === false) {
1093
+ self.autohidedom = false;
1094
+ self.rail.css({
1095
+ opacity: opt.cursoropacitymax
1096
+ });
1097
+ if (self.railh) self.railh.css({
1098
+ opacity: opt.cursoropacitymax
1099
+ });
1100
+ } else if ((opt.autohidemode === true) || (opt.autohidemode === "leave")) {
1101
+ self.autohidedom = $().add(self.rail);
1102
+ if (cap.isie8) self.autohidedom = self.autohidedom.add(self.cursor);
1103
+ if (self.railh) self.autohidedom = self.autohidedom.add(self.railh);
1104
+ if (self.railh && cap.isie8) self.autohidedom = self.autohidedom.add(self.cursorh);
1105
+ } else if (opt.autohidemode == "scroll") {
1106
+ self.autohidedom = $().add(self.rail);
1107
+ if (self.railh) self.autohidedom = self.autohidedom.add(self.railh);
1108
+ } else if (opt.autohidemode == "cursor") {
1109
+ self.autohidedom = $().add(self.cursor);
1110
+ if (self.railh) self.autohidedom = self.autohidedom.add(self.cursorh);
1111
+ } else if (opt.autohidemode == "hidden") {
1112
+ self.autohidedom = false;
1113
+ self.hide();
1114
+ self.railslocked = false;
1115
+ }
1116
+
1117
+ if (cap.cantouch || self.istouchcapable || opt.emulatetouch || cap.hasmstouch) {
1118
+
1119
+ self.scrollmom = new ScrollMomentumClass2D(self);
1120
+
1121
+ var delayedclick = null;
1122
+
1123
+ self.ontouchstart = function (e) {
1124
+
1125
+ if (self.locked) return false;
1126
+
1127
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1128
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) return false; // need test on surface!!
1129
+
1130
+ self.hasmoving = false;
1131
+
1132
+ if (self.scrollmom.timer) {
1133
+ self.triggerScrollEnd();
1134
+ self.scrollmom.stop();
1135
+ }
1136
+
1137
+ if (!self.railslocked) {
1138
+ var tg = self.getTarget(e);
1139
+
1140
+ if (tg) {
1141
+ var skp = (/INPUT/i.test(tg.nodeName)) && (/range/i.test(tg.type));
1142
+ if (skp) return self.stopPropagation(e);
1143
+ }
1144
+
1145
+ var ismouse = (e.type === "mousedown");
1146
+
1147
+ if (!("clientX" in e) && ("changedTouches" in e)) {
1148
+ e.clientX = e.changedTouches[0].clientX;
1149
+ e.clientY = e.changedTouches[0].clientY;
1150
+ }
1151
+
1152
+ if (self.forcescreen) {
1153
+ var le = e;
1154
+ e = {
1155
+ "original": (e.original) ? e.original : e
1156
+ };
1157
+ e.clientX = le.screenX;
1158
+ e.clientY = le.screenY;
1159
+ }
1160
+
1161
+ self.rail.drag = {
1162
+ x: e.clientX,
1163
+ y: e.clientY,
1164
+ sx: self.scroll.x,
1165
+ sy: self.scroll.y,
1166
+ st: self.getScrollTop(),
1167
+ sl: self.getScrollLeft(),
1168
+ pt: 2,
1169
+ dl: false,
1170
+ tg: tg
1171
+ };
1172
+
1173
+ if (self.ispage || !opt.directionlockdeadzone) {
1174
+
1175
+ self.rail.drag.dl = "f";
1176
+
1177
+ } else {
1178
+
1179
+ var view = {
1180
+ w: $window.width(),
1181
+ h: $window.height()
1182
+ };
1183
+
1184
+ var page = self.getContentSize();
1185
+
1186
+ var maxh = page.h - view.h;
1187
+ var maxw = page.w - view.w;
1188
+
1189
+ if (self.rail.scrollable && !self.railh.scrollable) self.rail.drag.ck = (maxh > 0) ? "v" : false;
1190
+ else if (!self.rail.scrollable && self.railh.scrollable) self.rail.drag.ck = (maxw > 0) ? "h" : false;
1191
+ else self.rail.drag.ck = false;
1192
+
1193
+ }
1194
+
1195
+ if (opt.emulatetouch && self.isiframe && cap.isie) {
1196
+ var wp = self.win.position();
1197
+ self.rail.drag.x += wp.left;
1198
+ self.rail.drag.y += wp.top;
1199
+ }
1200
+
1201
+ self.hasmoving = false;
1202
+ self.lastmouseup = false;
1203
+ self.scrollmom.reset(e.clientX, e.clientY);
1204
+
1205
+ if (tg&&ismouse) {
1206
+
1207
+ var ip = /INPUT|SELECT|BUTTON|TEXTAREA/i.test(tg.nodeName);
1208
+ if (!ip) {
1209
+ if (cap.hasmousecapture) tg.setCapture();
1210
+ if (opt.emulatetouch) {
1211
+ if (tg.onclick && !(tg._onclick || false)) { // intercept DOM0 onclick event
1212
+ tg._onclick = tg.onclick;
1213
+ tg.onclick = function (e) {
1214
+ if (self.hasmoving) return false;
1215
+ tg._onclick.call(this, e);
1216
+ };
1217
+ }
1218
+ return self.cancelEvent(e);
1219
+ }
1220
+ return self.stopPropagation(e);
1221
+ }
1222
+
1223
+ if (/SUBMIT|CANCEL|BUTTON/i.test($(tg).attr('type'))) {
1224
+ self.preventclick = {
1225
+ "tg": tg,
1226
+ "click": false
1227
+ };
1228
+ }
1229
+
1230
+ }
1231
+ }
1232
+
1233
+ };
1234
+
1235
+ self.ontouchend = function (e) {
1236
+
1237
+ if (!self.rail.drag) return true;
1238
+
1239
+ if (self.rail.drag.pt == 2) {
1240
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1241
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) return false;
1242
+
1243
+ self.rail.drag = false;
1244
+
1245
+ var ismouse = (e.type === "mouseup");
1246
+
1247
+ if (self.hasmoving) {
1248
+ self.scrollmom.doMomentum();
1249
+ self.lastmouseup = true;
1250
+ self.hideCursor();
1251
+ if (cap.hasmousecapture) _doc.releaseCapture();
1252
+ if (ismouse) return self.cancelEvent(e);
1253
+ }
1254
+
1255
+ }
1256
+ else if (self.rail.drag.pt == 1) {
1257
+ return self.onmouseup(e);
1258
+ }
1259
+
1260
+ };
1261
+
1262
+ var moveneedoffset = (opt.emulatetouch && self.isiframe && !cap.hasmousecapture);
1263
+
1264
+ var locktollerance = opt.directionlockdeadzone * 0.3 | 0;
1265
+
1266
+ self.ontouchmove = function (e, byiframe) {
1267
+
1268
+ if (!self.rail.drag) return true;
1269
+
1270
+ if (e.targetTouches && opt.preventmultitouchscrolling) {
1271
+ if (e.targetTouches.length > 1) return true; // multitouch
1272
+ }
1273
+
1274
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1275
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) return true;
1276
+
1277
+ if (self.rail.drag.pt == 2) {
1278
+
1279
+ if (("changedTouches" in e)) {
1280
+ e.clientX = e.changedTouches[0].clientX;
1281
+ e.clientY = e.changedTouches[0].clientY;
1282
+ }
1283
+
1284
+ var ofy, ofx;
1285
+ ofx = ofy = 0;
1286
+
1287
+ if (moveneedoffset && !byiframe) {
1288
+ var wp = self.win.position();
1289
+ ofx = -wp.left;
1290
+ ofy = -wp.top;
1291
+ }
1292
+
1293
+ var fy = e.clientY + ofy;
1294
+ var my = (fy - self.rail.drag.y);
1295
+ var fx = e.clientX + ofx;
1296
+ var mx = (fx - self.rail.drag.x);
1297
+
1298
+ var ny = self.rail.drag.st - my;
1299
+
1300
+ if (self.ishwscroll && opt.bouncescroll) {
1301
+ if (ny < 0) {
1302
+ ny = Math.round(ny / 2);
1303
+ } else if (ny > self.page.maxh) {
1304
+ ny = self.page.maxh + Math.round((ny - self.page.maxh) / 2);
1305
+ }
1306
+ } else {
1307
+ if (ny < 0) {
1308
+ ny = 0;
1309
+ fy = 0;
1310
+ }
1311
+ else if (ny > self.page.maxh) {
1312
+ ny = self.page.maxh;
1313
+ fy = 0;
1314
+ }
1315
+ if (fy === 0 && !self.hasmoving) {
1316
+ if (!self.ispage) self.rail.drag = false;
1317
+ return true;
1318
+ }
1319
+ }
1320
+
1321
+ var nx = self.getScrollLeft();
1322
+
1323
+ if (self.railh && self.railh.scrollable) {
1324
+ nx = (self.isrtlmode) ? mx - self.rail.drag.sl : self.rail.drag.sl - mx;
1325
+
1326
+ if (self.ishwscroll && opt.bouncescroll) {
1327
+ if (nx < 0) {
1328
+ nx = Math.round(nx / 2);
1329
+ } else if (nx > self.page.maxw) {
1330
+ nx = self.page.maxw + Math.round((nx - self.page.maxw) / 2);
1331
+ }
1332
+ } else {
1333
+ if (nx < 0) {
1334
+ nx = 0;
1335
+ fx = 0;
1336
+ }
1337
+ if (nx > self.page.maxw) {
1338
+ nx = self.page.maxw;
1339
+ fx = 0;
1340
+ }
1341
+ }
1342
+
1343
+ }
1344
+
1345
+
1346
+ if (!self.hasmoving) {
1347
+
1348
+ if (self.rail.drag.y === e.clientY && self.rail.drag.x === e.clientX) return self.cancelEvent(e); // prevent first useless move event
1349
+
1350
+ var ay = Math.abs(my);
1351
+ var ax = Math.abs(mx);
1352
+ var dz = opt.directionlockdeadzone;
1353
+
1354
+ if (!self.rail.drag.ck) {
1355
+ if (ay > dz && ax > dz) self.rail.drag.dl = "f";
1356
+ else if (ay > dz) self.rail.drag.dl = (ax > locktollerance) ? "f" : "v";
1357
+ else if (ax > dz) self.rail.drag.dl = (ay > locktollerance) ? "f" : "h";
1358
+ }
1359
+ else if (self.rail.drag.ck == "v") {
1360
+ if (ax > dz && ay <= locktollerance) {
1361
+ self.rail.drag = false;
1362
+ }
1363
+ else if (ay > dz) self.rail.drag.dl = "v";
1364
+
1365
+ }
1366
+ else if (self.rail.drag.ck == "h") {
1367
+
1368
+ if (ay > dz && ax <= locktollerance) {
1369
+ self.rail.drag = false;
1370
+ }
1371
+ else if (ax > dz) self.rail.drag.dl = "h";
1372
+
1373
+ }
1374
+
1375
+ if (!self.rail.drag.dl) return self.cancelEvent(e);
1376
+
1377
+ self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1378
+ self.hasmoving = true;
1379
+ }
1380
+
1381
+ if (self.preventclick && !self.preventclick.click) {
1382
+ self.preventclick.click = self.preventclick.tg.onclick || false;
1383
+ self.preventclick.tg.onclick = self.onpreventclick;
1384
+ }
1385
+
1386
+ if (self.rail.drag.dl) {
1387
+ if (self.rail.drag.dl == "v") nx = self.rail.drag.sl;
1388
+ else if (self.rail.drag.dl == "h") ny = self.rail.drag.st;
1389
+ }
1390
+
1391
+ self.synched("touchmove", function () {
1392
+ if (self.rail.drag && (self.rail.drag.pt == 2)) {
1393
+ if (self.prepareTransition) self.resetTransition();
1394
+ if (self.rail.scrollable) self.setScrollTop(ny);
1395
+ self.scrollmom.update(fx, fy);
1396
+ if (self.railh && self.railh.scrollable) {
1397
+ self.setScrollLeft(nx);
1398
+ self.showCursor(ny, nx);
1399
+ } else {
1400
+ self.showCursor(ny);
1401
+ }
1402
+ if (cap.isie10) _doc.selection.clear();
1403
+ }
1404
+ });
1405
+
1406
+ return self.cancelEvent(e);
1407
+
1408
+ }
1409
+ else if (self.rail.drag.pt == 1) { // drag on cursor
1410
+ return self.onmousemove(e);
1411
+ }
1412
+
1413
+ };
1414
+
1415
+ self.ontouchstartCursor = function (e, hronly) {
1416
+ if (self.rail.drag && self.rail.drag.pt != 3) return;
1417
+ if (self.locked) return self.cancelEvent(e);
1418
+ self.cancelScroll();
1419
+ self.rail.drag = {
1420
+ x: e.touches[0].clientX,
1421
+ y: e.touches[0].clientY,
1422
+ sx: self.scroll.x,
1423
+ sy: self.scroll.y,
1424
+ pt: 3,
1425
+ hr: (!!hronly)
1426
+ };
1427
+ var tg = self.getTarget(e);
1428
+ if (!self.ispage && cap.hasmousecapture) tg.setCapture();
1429
+ if (self.isiframe && !cap.hasmousecapture) {
1430
+ self.saved.csspointerevents = self.doc.css("pointer-events");
1431
+ self.css(self.doc, { "pointer-events": "none" });
1432
+ }
1433
+ return self.cancelEvent(e);
1434
+ };
1435
+
1436
+ self.ontouchendCursor = function (e) {
1437
+ if (self.rail.drag) {
1438
+ if (cap.hasmousecapture) _doc.releaseCapture();
1439
+ if (self.isiframe && !cap.hasmousecapture) self.doc.css("pointer-events", self.saved.csspointerevents);
1440
+ if (self.rail.drag.pt != 3) return;
1441
+ self.rail.drag = false;
1442
+ return self.cancelEvent(e);
1443
+ }
1444
+ };
1445
+
1446
+ self.ontouchmoveCursor = function (e) {
1447
+ if (self.rail.drag) {
1448
+ if (self.rail.drag.pt != 3) return;
1449
+
1450
+ self.cursorfreezed = true;
1451
+
1452
+ if (self.rail.drag.hr) {
1453
+ self.scroll.x = self.rail.drag.sx + (e.touches[0].clientX - self.rail.drag.x);
1454
+ if (self.scroll.x < 0) self.scroll.x = 0;
1455
+ var mw = self.scrollvaluemaxw;
1456
+ if (self.scroll.x > mw) self.scroll.x = mw;
1457
+ } else {
1458
+ self.scroll.y = self.rail.drag.sy + (e.touches[0].clientY - self.rail.drag.y);
1459
+ if (self.scroll.y < 0) self.scroll.y = 0;
1460
+ var my = self.scrollvaluemax;
1461
+ if (self.scroll.y > my) self.scroll.y = my;
1462
+ }
1463
+
1464
+ self.synched('touchmove', function () {
1465
+ if (self.rail.drag && (self.rail.drag.pt == 3)) {
1466
+ self.showCursor();
1467
+ if (self.rail.drag.hr) self.doScrollLeft(Math.round(self.scroll.x * self.scrollratio.x), opt.cursordragspeed);
1468
+ else self.doScrollTop(Math.round(self.scroll.y * self.scrollratio.y), opt.cursordragspeed);
1469
+ }
1470
+ });
1471
+
1472
+ return self.cancelEvent(e);
1473
+ }
1474
+
1475
+ };
1476
+
1477
+ }
1478
+
1479
+ self.onmousedown = function (e, hronly) {
1480
+ if (self.rail.drag && self.rail.drag.pt != 1) return;
1481
+ if (self.railslocked) return self.cancelEvent(e);
1482
+ self.cancelScroll();
1483
+ self.rail.drag = {
1484
+ x: e.clientX,
1485
+ y: e.clientY,
1486
+ sx: self.scroll.x,
1487
+ sy: self.scroll.y,
1488
+ pt: 1,
1489
+ hr: hronly || false
1490
+ };
1491
+ var tg = self.getTarget(e);
1492
+
1493
+ if (cap.hasmousecapture) tg.setCapture();
1494
+ if (self.isiframe && !cap.hasmousecapture) {
1495
+ self.saved.csspointerevents = self.doc.css("pointer-events");
1496
+ self.css(self.doc, {
1497
+ "pointer-events": "none"
1498
+ });
1499
+ }
1500
+ self.hasmoving = false;
1501
+ return self.cancelEvent(e);
1502
+ };
1503
+
1504
+ self.onmouseup = function (e) {
1505
+ if (self.rail.drag) {
1506
+ if (self.rail.drag.pt != 1) return true;
1507
+
1508
+ if (cap.hasmousecapture) _doc.releaseCapture();
1509
+ if (self.isiframe && !cap.hasmousecapture) self.doc.css("pointer-events", self.saved.csspointerevents);
1510
+ self.rail.drag = false;
1511
+ self.cursorfreezed = false;
1512
+ if (self.hasmoving) self.triggerScrollEnd();
1513
+ return self.cancelEvent(e);
1514
+ }
1515
+ };
1516
+
1517
+ self.onmousemove = function (e) {
1518
+ if (self.rail.drag) {
1519
+ if (self.rail.drag.pt !== 1) return;
1520
+
1521
+ if (cap.ischrome && e.which === 0) return self.onmouseup(e);
1522
+
1523
+ self.cursorfreezed = true;
1524
+
1525
+ if (!self.hasmoving) self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1526
+
1527
+ self.hasmoving = true;
1528
+
1529
+ if (self.rail.drag.hr) {
1530
+ self.scroll.x = self.rail.drag.sx + (e.clientX - self.rail.drag.x);
1531
+ if (self.scroll.x < 0) self.scroll.x = 0;
1532
+ var mw = self.scrollvaluemaxw;
1533
+ if (self.scroll.x > mw) self.scroll.x = mw;
1534
+ } else {
1535
+ self.scroll.y = self.rail.drag.sy + (e.clientY - self.rail.drag.y);
1536
+ if (self.scroll.y < 0) self.scroll.y = 0;
1537
+ var my = self.scrollvaluemax;
1538
+ if (self.scroll.y > my) self.scroll.y = my;
1539
+ }
1540
+
1541
+ self.synched('mousemove', function () {
1542
+
1543
+ if (self.cursorfreezed) {
1544
+ self.showCursor();
1545
+
1546
+ if (self.rail.drag.hr) {
1547
+ self.scrollLeft(Math.round(self.scroll.x * self.scrollratio.x));
1548
+ } else {
1549
+ self.scrollTop(Math.round(self.scroll.y * self.scrollratio.y));
1550
+ }
1551
+
1552
+ }
1553
+ });
1554
+
1555
+ return self.cancelEvent(e);
1556
+ }
1557
+ else {
1558
+ self.checkarea = 0;
1559
+ }
1560
+ };
1561
+
1562
+ if (cap.cantouch || opt.emulatetouch) {
1563
+
1564
+ self.onpreventclick = function (e) {
1565
+ if (self.preventclick) {
1566
+ self.preventclick.tg.onclick = self.preventclick.click;
1567
+ self.preventclick = false;
1568
+ return self.cancelEvent(e);
1569
+ }
1570
+ };
1571
+
1572
+ self.onclick = (cap.isios) ? false : function (e) { // it needs to check IE11 ???
1573
+ if (self.lastmouseup) {
1574
+ self.lastmouseup = false;
1575
+ return self.cancelEvent(e);
1576
+ } else {
1577
+ return true;
1578
+ }
1579
+ };
1580
+
1581
+ if (opt.grabcursorenabled && cap.cursorgrabvalue) {
1582
+ self.css((self.ispage) ? self.doc : self.win, {
1583
+ 'cursor': cap.cursorgrabvalue
1584
+ });
1585
+ self.css(self.rail, {
1586
+ 'cursor': cap.cursorgrabvalue
1587
+ });
1588
+ }
1589
+
1590
+ } else {
1591
+
1592
+ var checkSelectionScroll = function (e) {
1593
+ if (!self.selectiondrag) return;
1594
+
1595
+ if (e) {
1596
+ var ww = self.win.outerHeight();
1597
+ var df = (e.pageY - self.selectiondrag.top);
1598
+ if (df > 0 && df < ww) df = 0;
1599
+ if (df >= ww) df -= ww;
1600
+ self.selectiondrag.df = df;
1601
+ }
1602
+ if (self.selectiondrag.df === 0) return;
1603
+
1604
+ var rt = -(self.selectiondrag.df*2/6)|0;
1605
+ self.doScrollBy(rt);
1606
+
1607
+ self.debounced("doselectionscroll", function () {
1608
+ checkSelectionScroll();
1609
+ }, 50);
1610
+ };
1611
+
1612
+ if ("getSelection" in _doc) { // A grade - Major browsers
1613
+ self.hasTextSelected = function () {
1614
+ return (_doc.getSelection().rangeCount > 0);
1615
+ };
1616
+ } else if ("selection" in _doc) { //IE9-
1617
+ self.hasTextSelected = function () {
1618
+ return (_doc.selection.type != "None");
1619
+ };
1620
+ } else {
1621
+ self.hasTextSelected = function () { // no support
1622
+ return false;
1623
+ };
1624
+ }
1625
+
1626
+ self.onselectionstart = function (e) {
1627
+ // More testing - severe chrome issues
1628
+ /*
1629
+ if (!self.haswrapper&&(e.which&&e.which==2)) { // fool browser to manage middle button scrolling
1630
+ self.win.css({'overflow':'auto'});
1631
+ setTimeout(function(){
1632
+ self.win.css({'overflow':'hidden'});
1633
+ },10);
1634
+ return true;
1635
+ }
1636
+ */
1637
+ if (self.ispage) return;
1638
+ self.selectiondrag = self.win.offset();
1639
+ };
1640
+
1641
+ self.onselectionend = function (e) {
1642
+ self.selectiondrag = false;
1643
+ };
1644
+ self.onselectiondrag = function (e) {
1645
+ if (!self.selectiondrag) return;
1646
+ if (self.hasTextSelected()) self.debounced("selectionscroll", function () {
1647
+ checkSelectionScroll(e);
1648
+ }, 250);
1649
+ };
1650
+ }
1651
+
1652
+ if (cap.hasw3ctouch) { //IE11+
1653
+ self.css((self.ispage) ? $("html") : self.win, { 'touch-action': 'none' });
1654
+ self.css(self.rail, {
1655
+ 'touch-action': 'none'
1656
+ });
1657
+ self.css(self.cursor, {
1658
+ 'touch-action': 'none'
1659
+ });
1660
+ self.bind(self.win, "pointerdown", self.ontouchstart);
1661
+ self.bind(_doc, "pointerup", self.ontouchend);
1662
+ self.delegate(_doc, "pointermove", self.ontouchmove);
1663
+ } else if (cap.hasmstouch) { //IE10
1664
+ self.css((self.ispage) ? $("html") : self.win, { '-ms-touch-action': 'none' });
1665
+ self.css(self.rail, {
1666
+ '-ms-touch-action': 'none'
1667
+ });
1668
+ self.css(self.cursor, {
1669
+ '-ms-touch-action': 'none'
1670
+ });
1671
+ self.bind(self.win, "MSPointerDown", self.ontouchstart);
1672
+ self.bind(_doc, "MSPointerUp", self.ontouchend);
1673
+ self.delegate(_doc, "MSPointerMove", self.ontouchmove);
1674
+ self.bind(self.cursor, "MSGestureHold", function (e) {
1675
+ e.preventDefault();
1676
+ });
1677
+ self.bind(self.cursor, "contextmenu", function (e) {
1678
+ e.preventDefault();
1679
+ });
1680
+ } else if (cap.cantouch) { // smartphones/touch devices
1681
+ self.bind(self.win, "touchstart", self.ontouchstart, false, true);
1682
+ self.bind(_doc, "touchend", self.ontouchend, false, true);
1683
+ self.bind(_doc, "touchcancel", self.ontouchend, false, true);
1684
+ self.delegate(_doc, "touchmove", self.ontouchmove, false, true);
1685
+ }
1686
+
1687
+ if (opt.emulatetouch) {
1688
+ self.bind(self.win, "mousedown", self.ontouchstart, false, true);
1689
+ self.bind(_doc, "mouseup", self.ontouchend, false, true);
1690
+ self.bind(_doc, "mousemove", self.ontouchmove, false, true);
1691
+ }
1692
+
1693
+ if (opt.cursordragontouch || (!cap.cantouch && !opt.emulatetouch)) {
1694
+
1695
+ self.rail.css({
1696
+ cursor: "default"
1697
+ });
1698
+ self.railh && self.railh.css({
1699
+ cursor: "default"
1700
+ });
1701
+
1702
+ self.jqbind(self.rail, "mouseenter", function () {
1703
+ if (!self.ispage && !self.win.is(":visible")) return false;
1704
+ if (self.canshowonmouseevent) self.showCursor();
1705
+ self.rail.active = true;
1706
+ });
1707
+ self.jqbind(self.rail, "mouseleave", function () {
1708
+ self.rail.active = false;
1709
+ if (!self.rail.drag) self.hideCursor();
1710
+ });
1711
+
1712
+ if (opt.sensitiverail) {
1713
+ self.bind(self.rail, "click", function (e) {
1714
+ self.doRailClick(e, false, false);
1715
+ });
1716
+ self.bind(self.rail, "dblclick", function (e) {
1717
+ self.doRailClick(e, true, false);
1718
+ });
1719
+ self.bind(self.cursor, "click", function (e) {
1720
+ self.cancelEvent(e);
1721
+ });
1722
+ self.bind(self.cursor, "dblclick", function (e) {
1723
+ self.cancelEvent(e);
1724
+ });
1725
+ }
1726
+
1727
+ if (self.railh) {
1728
+ self.jqbind(self.railh, "mouseenter", function () {
1729
+ if (!self.ispage && !self.win.is(":visible")) return false;
1730
+ if (self.canshowonmouseevent) self.showCursor();
1731
+ self.rail.active = true;
1732
+ });
1733
+ self.jqbind(self.railh, "mouseleave", function () {
1734
+ self.rail.active = false;
1735
+ if (!self.rail.drag) self.hideCursor();
1736
+ });
1737
+
1738
+ if (opt.sensitiverail) {
1739
+ self.bind(self.railh, "click", function (e) {
1740
+ self.doRailClick(e, false, true);
1741
+ });
1742
+ self.bind(self.railh, "dblclick", function (e) {
1743
+ self.doRailClick(e, true, true);
1744
+ });
1745
+ self.bind(self.cursorh, "click", function (e) {
1746
+ self.cancelEvent(e);
1747
+ });
1748
+ self.bind(self.cursorh, "dblclick", function (e) {
1749
+ self.cancelEvent(e);
1750
+ });
1751
+ }
1752
+
1753
+ }
1754
+
1755
+ }
1756
+
1757
+ if (opt.cursordragontouch && (this.istouchcapable || cap.cantouch)) {
1758
+ self.bind(self.cursor, "touchstart", self.ontouchstartCursor);
1759
+ self.bind(self.cursor, "touchmove", self.ontouchmoveCursor);
1760
+ self.bind(self.cursor, "touchend", self.ontouchendCursor);
1761
+ self.cursorh && self.bind(self.cursorh, "touchstart", function (e) {
1762
+ self.ontouchstartCursor(e, true);
1763
+ });
1764
+ self.cursorh && self.bind(self.cursorh, "touchmove", self.ontouchmoveCursor);
1765
+ self.cursorh && self.bind(self.cursorh, "touchend", self.ontouchendCursor);
1766
+ }
1767
+
1768
+ // if (!cap.cantouch && !opt.emulatetouch) {
1769
+ if (!opt.emulatetouch && !cap.isandroid && !cap.isios) {
1770
+
1771
+ self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.onmouseup);
1772
+ self.bind(_doc, "mousemove", self.onmousemove);
1773
+ if (self.onclick) self.bind(_doc, "click", self.onclick);
1774
+
1775
+ self.bind(self.cursor, "mousedown", self.onmousedown);
1776
+ self.bind(self.cursor, "mouseup", self.onmouseup);
1777
+
1778
+ if (self.railh) {
1779
+ self.bind(self.cursorh, "mousedown", function (e) {
1780
+ self.onmousedown(e, true);
1781
+ });
1782
+ self.bind(self.cursorh, "mouseup", self.onmouseup);
1783
+ }
1784
+
1785
+ if (!self.ispage && opt.enablescrollonselection) {
1786
+ self.bind(self.win[0], "mousedown", self.onselectionstart);
1787
+ self.bind(_doc, "mouseup", self.onselectionend);
1788
+ self.bind(self.cursor, "mouseup", self.onselectionend);
1789
+ if (self.cursorh) self.bind(self.cursorh, "mouseup", self.onselectionend);
1790
+ self.bind(_doc, "mousemove", self.onselectiondrag);
1791
+ }
1792
+
1793
+ if (self.zoom) {
1794
+ self.jqbind(self.zoom, "mouseenter", function () {
1795
+ if (self.canshowonmouseevent) self.showCursor();
1796
+ self.rail.active = true;
1797
+ });
1798
+ self.jqbind(self.zoom, "mouseleave", function () {
1799
+ self.rail.active = false;
1800
+ if (!self.rail.drag) self.hideCursor();
1801
+ });
1802
+ }
1803
+
1804
+ } else {
1805
+
1806
+ self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.ontouchend);
1807
+ if (self.onclick) self.bind(_doc, "click", self.onclick);
1808
+
1809
+ if (opt.cursordragontouch) {
1810
+ self.bind(self.cursor, "mousedown", self.onmousedown);
1811
+ self.bind(self.cursor, "mouseup", self.onmouseup);
1812
+ self.cursorh && self.bind(self.cursorh, "mousedown", function (e) {
1813
+ self.onmousedown(e, true);
1814
+ });
1815
+ self.cursorh && self.bind(self.cursorh, "mouseup", self.onmouseup);
1816
+ } else {
1817
+ self.bind(self.rail, "mousedown", function (e) { e.preventDefault(); }); // prevent text selection
1818
+ self.railh && self.bind(self.railh, "mousedown", function (e) { e.preventDefault(); });
1819
+ }
1820
+
1821
+ }
1822
+
1823
+
1824
+ if (opt.enablemousewheel) {
1825
+ if (!self.isiframe) self.mousewheel((cap.isie && self.ispage) ? _doc : self.win, self.onmousewheel);
1826
+ self.mousewheel(self.rail, self.onmousewheel);
1827
+ if (self.railh) self.mousewheel(self.railh, self.onmousewheelhr);
1828
+ }
1829
+
1830
+ if (!self.ispage && !cap.cantouch && !(/HTML|^BODY/.test(self.win[0].nodeName))) {
1831
+ if (!self.win.attr("tabindex")) self.win.attr({
1832
+ "tabindex": ++tabindexcounter
1833
+ });
1834
+
1835
+ self.bind(self.win, "focus", function (e) { // better using native events
1836
+ domfocus = (self.getTarget(e)).id || self.getTarget(e) || false;
1837
+ self.hasfocus = true;
1838
+ if (self.canshowonmouseevent) self.noticeCursor();
1839
+ });
1840
+ self.bind(self.win, "blur", function (e) { // *
1841
+ domfocus = false;
1842
+ self.hasfocus = false;
1843
+ });
1844
+
1845
+ self.bind(self.win, "mouseenter", function (e) { // *
1846
+ mousefocus = (self.getTarget(e)).id || self.getTarget(e) || false;
1847
+ self.hasmousefocus = true;
1848
+ if (self.canshowonmouseevent) self.noticeCursor();
1849
+ });
1850
+ self.bind(self.win, "mouseleave", function (e) { // *
1851
+ mousefocus = false;
1852
+ self.hasmousefocus = false;
1853
+ if (!self.rail.drag) self.hideCursor();
1854
+ });
1855
+
1856
+ }
1857
+
1858
+
1859
+ //Thanks to http://www.quirksmode.org !!
1860
+ self.onkeypress = function (e) {
1861
+ if (self.railslocked && self.page.maxh === 0) return true;
1862
+
1863
+ e = e || _win.event;
1864
+ var tg = self.getTarget(e);
1865
+ if (tg && /INPUT|TEXTAREA|SELECT|OPTION/.test(tg.nodeName)) {
1866
+ var tp = tg.getAttribute('type') || tg.type || false;
1867
+ if ((!tp) || !(/submit|button|cancel/i.tp)) return true;
1868
+ }
1869
+
1870
+ if ($(tg).attr('contenteditable')) return true;
1871
+
1872
+ if (self.hasfocus || (self.hasmousefocus && !domfocus) || (self.ispage && !domfocus && !mousefocus)) {
1873
+ var key = e.keyCode;
1874
+
1875
+ if (self.railslocked && key != 27) return self.cancelEvent(e);
1876
+
1877
+ var ctrl = e.ctrlKey || false;
1878
+ var shift = e.shiftKey || false;
1879
+
1880
+ var ret = false;
1881
+ switch (key) {
1882
+ case 38:
1883
+ case 63233: //safari
1884
+ self.doScrollBy(24 * 3);
1885
+ ret = true;
1886
+ break;
1887
+ case 40:
1888
+ case 63235: //safari
1889
+ self.doScrollBy(-24 * 3);
1890
+ ret = true;
1891
+ break;
1892
+ case 37:
1893
+ case 63232: //safari
1894
+ if (self.railh) {
1895
+ (ctrl) ? self.doScrollLeft(0) : self.doScrollLeftBy(24 * 3);
1896
+ ret = true;
1897
+ }
1898
+ break;
1899
+ case 39:
1900
+ case 63234: //safari
1901
+ if (self.railh) {
1902
+ (ctrl) ? self.doScrollLeft(self.page.maxw) : self.doScrollLeftBy(-24 * 3);
1903
+ ret = true;
1904
+ }
1905
+ break;
1906
+ case 33:
1907
+ case 63276: // safari
1908
+ self.doScrollBy(self.view.h);
1909
+ ret = true;
1910
+ break;
1911
+ case 34:
1912
+ case 63277: // safari
1913
+ self.doScrollBy(-self.view.h);
1914
+ ret = true;
1915
+ break;
1916
+ case 36:
1917
+ case 63273: // safari
1918
+ (self.railh && ctrl) ? self.doScrollPos(0, 0) : self.doScrollTo(0);
1919
+ ret = true;
1920
+ break;
1921
+ case 35:
1922
+ case 63275: // safari
1923
+ (self.railh && ctrl) ? self.doScrollPos(self.page.maxw, self.page.maxh) : self.doScrollTo(self.page.maxh);
1924
+ ret = true;
1925
+ break;
1926
+ case 32:
1927
+ if (opt.spacebarenabled) {
1928
+ (shift) ? self.doScrollBy(self.view.h) : self.doScrollBy(-self.view.h);
1929
+ ret = true;
1930
+ }
1931
+ break;
1932
+ case 27: // ESC
1933
+ if (self.zoomactive) {
1934
+ self.doZoom();
1935
+ ret = true;
1936
+ }
1937
+ break;
1938
+ }
1939
+ if (ret) return self.cancelEvent(e);
1940
+ }
1941
+ };
1942
+
1943
+ if (opt.enablekeyboard) self.bind(_doc, (cap.isopera && !cap.isopera12) ? "keypress" : "keydown", self.onkeypress);
1944
+
1945
+ self.bind(_doc, "keydown", function (e) {
1946
+ var ctrl = e.ctrlKey || false;
1947
+ if (ctrl) self.wheelprevented = true;
1948
+ });
1949
+ self.bind(_doc, "keyup", function (e) {
1950
+ var ctrl = e.ctrlKey || false;
1951
+ if (!ctrl) self.wheelprevented = false;
1952
+ });
1953
+ self.bind(_win, "blur", function (e) {
1954
+ self.wheelprevented = false;
1955
+ });
1956
+
1957
+ self.bind(_win, 'resize', self.onscreenresize);
1958
+ self.bind(_win, 'orientationchange', self.onscreenresize);
1959
+
1960
+ self.bind(_win, "load", self.lazyResize);
1961
+
1962
+ if (cap.ischrome && !self.ispage && !self.haswrapper) { //chrome void scrollbar bug - it persists in version 26
1963
+ var tmp = self.win.attr("style");
1964
+ var ww = parseFloat(self.win.css("width")) + 1;
1965
+ self.win.css('width', ww);
1966
+ self.synched("chromefix", function () {
1967
+ self.win.attr("style", tmp);
1968
+ });
1969
+ }
1970
+
1971
+
1972
+ // Trying a cross-browser implementation - good luck!
1973
+
1974
+ self.onAttributeChange = function (e) {
1975
+ self.lazyResize(self.isieold ? 250 : 30);
1976
+ };
1977
+
1978
+ if (opt.enableobserver) {
1979
+
1980
+ if ((!self.isie11) && (ClsMutationObserver !== false)) { // IE11 crashes #568
1981
+ self.observerbody = new ClsMutationObserver(function (mutations) {
1982
+ mutations.forEach(function (mut) {
1983
+ if (mut.type == "attributes") {
1984
+ return ($body.hasClass("modal-open") && $body.hasClass("modal-dialog") && !$.contains($('.modal-dialog')[0], self.doc[0])) ? self.hide() : self.show(); // Support for Bootstrap modal; Added check if the nice scroll element is inside a modal
1985
+ }
1986
+ });
1987
+ if (self.me.clientWidth != self.page.width || self.me.clientHeight != self.page.height) return self.lazyResize(30);
1988
+ });
1989
+ self.observerbody.observe(_doc.body, {
1990
+ childList: true,
1991
+ subtree: true,
1992
+ characterData: false,
1993
+ attributes: true,
1994
+ attributeFilter: ['class']
1995
+ });
1996
+ }
1997
+
1998
+ if (!self.ispage && !self.haswrapper) {
1999
+
2000
+ var _dom = self.win[0];
2001
+
2002
+ // redesigned MutationObserver for Chrome18+/Firefox14+/iOS6+ with support for: remove div, add/remove content
2003
+ if (ClsMutationObserver !== false) {
2004
+ self.observer = new ClsMutationObserver(function (mutations) {
2005
+ mutations.forEach(self.onAttributeChange);
2006
+ });
2007
+ self.observer.observe(_dom, {
2008
+ childList: true,
2009
+ characterData: false,
2010
+ attributes: true,
2011
+ subtree: false
2012
+ });
2013
+ self.observerremover = new ClsMutationObserver(function (mutations) {
2014
+ mutations.forEach(function (mo) {
2015
+ if (mo.removedNodes.length > 0) {
2016
+ for (var dd in mo.removedNodes) {
2017
+ if (!!self && (mo.removedNodes[dd] === _dom)) return self.remove();
2018
+ }
2019
+ }
2020
+ });
2021
+ });
2022
+ self.observerremover.observe(_dom.parentNode, {
2023
+ childList: true,
2024
+ characterData: false,
2025
+ attributes: false,
2026
+ subtree: false
2027
+ });
2028
+ } else {
2029
+ self.bind(_dom, (cap.isie && !cap.isie9) ? "propertychange" : "DOMAttrModified", self.onAttributeChange);
2030
+ if (cap.isie9) _dom.attachEvent("onpropertychange", self.onAttributeChange); //IE9 DOMAttrModified bug
2031
+ self.bind(_dom, "DOMNodeRemoved", function (e) {
2032
+ if (e.target === _dom) self.remove();
2033
+ });
2034
+ }
2035
+ }
2036
+
2037
+ }
2038
+
2039
+ //
2040
+
2041
+ if (!self.ispage && opt.boxzoom) self.bind(_win, "resize", self.resizeZoom);
2042
+ if (self.istextarea) {
2043
+ self.bind(self.win, "keydown", self.lazyResize);
2044
+ self.bind(self.win, "mouseup", self.lazyResize);
2045
+ }
2046
+
2047
+ self.lazyResize(30);
2048
+
2049
+ }
2050
+
2051
+ if (this.doc[0].nodeName == 'IFRAME') {
2052
+ var oniframeload = function () {
2053
+ self.iframexd = false;
2054
+ var doc;
2055
+ try {
2056
+ doc = 'contentDocument' in this ? this.contentDocument : this.contentWindow._doc;
2057
+ var a = doc.domain;
2058
+ } catch (e) {
2059
+ self.iframexd = true;
2060
+ doc = false;
2061
+ }
2062
+
2063
+ if (self.iframexd) {
2064
+ if ("console" in _win) console.log('NiceScroll error: policy restriced iframe');
2065
+ return true; //cross-domain - I can't manage this
2066
+ }
2067
+
2068
+ self.forcescreen = true;
2069
+
2070
+ if (self.isiframe) {
2071
+ self.iframe = {
2072
+ "doc": $(doc),
2073
+ "html": self.doc.contents().find('html')[0],
2074
+ "body": self.doc.contents().find('body')[0]
2075
+ };
2076
+ self.getContentSize = function () {
2077
+ return {
2078
+ w: Math.max(self.iframe.html.scrollWidth, self.iframe.body.scrollWidth),
2079
+ h: Math.max(self.iframe.html.scrollHeight, self.iframe.body.scrollHeight)
2080
+ };
2081
+ };
2082
+ self.docscroll = $(self.iframe.body);
2083
+ }
2084
+
2085
+ if (!cap.isios && opt.iframeautoresize && !self.isiframe) {
2086
+ self.win.scrollTop(0); // reset position
2087
+ self.doc.height(""); //reset height to fix browser bug
2088
+ var hh = Math.max(doc.getElementsByTagName('html')[0].scrollHeight, doc.body.scrollHeight);
2089
+ self.doc.height(hh);
2090
+ }
2091
+ self.lazyResize(30);
2092
+
2093
+ self.css($(self.iframe.body), _scrollyhidden);
2094
+
2095
+ if (cap.isios && self.haswrapper) {
2096
+ self.css($(doc.body), {
2097
+ '-webkit-transform': 'translate3d(0,0,0)'
2098
+ }); // avoid iFrame content clipping - thanks to http://blog.derraab.com/2012/04/02/avoid-iframe-content-clipping-with-css-transform-on-ios/
2099
+ }
2100
+
2101
+ if ('contentWindow' in this) {
2102
+ self.bind(this.contentWindow, "scroll", self.onscroll); //IE8 & minor
2103
+ } else {
2104
+ self.bind(doc, "scroll", self.onscroll);
2105
+ }
2106
+
2107
+ if (opt.enablemousewheel) {
2108
+ self.mousewheel(doc, self.onmousewheel);
2109
+ }
2110
+
2111
+ if (opt.enablekeyboard) self.bind(doc, (cap.isopera) ? "keypress" : "keydown", self.onkeypress);
2112
+
2113
+ if (cap.cantouch) {
2114
+ self.bind(doc, "touchstart", self.ontouchstart);
2115
+ self.bind(doc, "touchmove", self.ontouchmove);
2116
+ }
2117
+ else if (opt.emulatetouch) {
2118
+ self.bind(doc, "mousedown", self.ontouchstart);
2119
+ self.bind(doc, "mousemove", function (e) {
2120
+ return self.ontouchmove(e, true);
2121
+ });
2122
+ if (opt.grabcursorenabled && cap.cursorgrabvalue) self.css($(doc.body), {
2123
+ 'cursor': cap.cursorgrabvalue
2124
+ });
2125
+ }
2126
+
2127
+ self.bind(doc, "mouseup", self.ontouchend);
2128
+
2129
+ if (self.zoom) {
2130
+ if (opt.dblclickzoom) self.bind(doc, 'dblclick', self.doZoom);
2131
+ if (self.ongesturezoom) self.bind(doc, "gestureend", self.ongesturezoom);
2132
+ }
2133
+ };
2134
+
2135
+ if (this.doc[0].readyState && this.doc[0].readyState === "complete") {
2136
+ setTimeout(function () {
2137
+ oniframeload.call(self.doc[0], false);
2138
+ }, 500);
2139
+ }
2140
+ self.bind(this.doc, "load", oniframeload);
2141
+
2142
+ }
2143
+
2144
+ };
2145
+
2146
+ this.showCursor = function (py, px) {
2147
+ if (self.cursortimeout) {
2148
+ clearTimeout(self.cursortimeout);
2149
+ self.cursortimeout = 0;
2150
+ }
2151
+ if (!self.rail) return;
2152
+ if (self.autohidedom) {
2153
+ self.autohidedom.stop().css({
2154
+ opacity: opt.cursoropacitymax
2155
+ });
2156
+ self.cursoractive = true;
2157
+ }
2158
+
2159
+ if (!self.rail.drag || self.rail.drag.pt != 1) {
2160
+ if (py !== undefined && py !== false) {
2161
+ self.scroll.y = (py / self.scrollratio.y) | 0;
2162
+ }
2163
+ if (px !== undefined) {
2164
+ self.scroll.x = (px / self.scrollratio.x) | 0;
2165
+ }
2166
+ }
2167
+
2168
+ self.cursor.css({
2169
+ height: self.cursorheight,
2170
+ top: self.scroll.y
2171
+ });
2172
+ if (self.cursorh) {
2173
+ var lx = (self.hasreversehr) ? self.scrollvaluemaxw - self.scroll.x : self.scroll.x;
2174
+ self.cursorh.css({
2175
+ width: self.cursorwidth,
2176
+ left: (!self.rail.align && self.rail.visibility) ? lx + self.rail.width : lx
2177
+ });
2178
+ self.cursoractive = true;
2179
+ }
2180
+
2181
+ if (self.zoom) self.zoom.stop().css({
2182
+ opacity: opt.cursoropacitymax
2183
+ });
2184
+ };
2185
+
2186
+ this.hideCursor = function (tm) {
2187
+ if (self.cursortimeout) return;
2188
+ if (!self.rail) return;
2189
+ if (!self.autohidedom) return;
2190
+
2191
+ if (self.hasmousefocus && opt.autohidemode === "leave") return;
2192
+ self.cursortimeout = setTimeout(function () {
2193
+ if (!self.rail.active || !self.showonmouseevent) {
2194
+ self.autohidedom.stop().animate({
2195
+ opacity: opt.cursoropacitymin
2196
+ });
2197
+ if (self.zoom) self.zoom.stop().animate({
2198
+ opacity: opt.cursoropacitymin
2199
+ });
2200
+ self.cursoractive = false;
2201
+ }
2202
+ self.cursortimeout = 0;
2203
+ }, tm || opt.hidecursordelay);
2204
+ };
2205
+
2206
+ this.noticeCursor = function (tm, py, px) {
2207
+ self.showCursor(py, px);
2208
+ if (!self.rail.active) self.hideCursor(tm);
2209
+ };
2210
+
2211
+ this.getContentSize =
2212
+ (self.ispage) ?
2213
+ function () {
2214
+ return {
2215
+ w: Math.max(_doc.body.scrollWidth, _doc.documentElement.scrollWidth),
2216
+ h: Math.max(_doc.body.scrollHeight, _doc.documentElement.scrollHeight)
2217
+ };
2218
+ } : (self.haswrapper) ?
2219
+ function () {
2220
+ return {
2221
+ w: self.doc[0].offsetWidth,
2222
+ h: self.doc[0].offsetHeight
2223
+ };
2224
+ } : function () {
2225
+ return {
2226
+ w: self.docscroll[0].scrollWidth,
2227
+ h: self.docscroll[0].scrollHeight
2228
+ };
2229
+ };
2230
+
2231
+ this.onResize = function (e, page) {
2232
+
2233
+ if (!self || !self.win) return false;
2234
+
2235
+ var premaxh = self.page.maxh,
2236
+ premaxw = self.page.maxw,
2237
+ previewh = self.view.h,
2238
+ previeww = self.view.w;
2239
+
2240
+ self.view = {
2241
+ w: (self.ispage) ? self.win.width() : self.win[0].clientWidth,
2242
+ h: (self.ispage) ? self.win.height() : self.win[0].clientHeight
2243
+ };
2244
+
2245
+ self.page = (page) ? page : self.getContentSize();
2246
+
2247
+ self.page.maxh = Math.max(0, self.page.h - self.view.h);
2248
+ self.page.maxw = Math.max(0, self.page.w - self.view.w);
2249
+
2250
+ if ((self.page.maxh == premaxh) && (self.page.maxw == premaxw) && (self.view.w == previeww) && (self.view.h == previewh)) {
2251
+ // test position
2252
+ if (!self.ispage) {
2253
+ var pos = self.win.offset();
2254
+ if (self.lastposition) {
2255
+ var lst = self.lastposition;
2256
+ if ((lst.top == pos.top) && (lst.left == pos.left)) return self; //nothing to do
2257
+ }
2258
+ self.lastposition = pos;
2259
+ } else {
2260
+ return self; //nothing to do
2261
+ }
2262
+ }
2263
+
2264
+ if (self.page.maxh === 0) {
2265
+ self.hideRail();
2266
+ self.scrollvaluemax = 0;
2267
+ self.scroll.y = 0;
2268
+ self.scrollratio.y = 0;
2269
+ self.cursorheight = 0;
2270
+ self.setScrollTop(0);
2271
+ if (self.rail) self.rail.scrollable = false;
2272
+ } else {
2273
+ self.page.maxh -= (opt.railpadding.top + opt.railpadding.bottom);
2274
+ self.rail.scrollable = true;
2275
+ }
2276
+
2277
+ if (self.page.maxw === 0) {
2278
+ self.hideRailHr();
2279
+ self.scrollvaluemaxw = 0;
2280
+ self.scroll.x = 0;
2281
+ self.scrollratio.x = 0;
2282
+ self.cursorwidth = 0;
2283
+ self.setScrollLeft(0);
2284
+ if (self.railh) {
2285
+ self.railh.scrollable = false;
2286
+ }
2287
+ } else {
2288
+ self.page.maxw -= (opt.railpadding.left + opt.railpadding.right);
2289
+ if (self.railh) self.railh.scrollable = (opt.horizrailenabled);
2290
+ }
2291
+
2292
+ self.railslocked = (self.locked) || ((self.page.maxh === 0) && (self.page.maxw === 0));
2293
+ if (self.railslocked) {
2294
+ if (!self.ispage) self.updateScrollBar(self.view);
2295
+ return false;
2296
+ }
2297
+
2298
+ if (!self.hidden) {
2299
+ if (!self.rail.visibility) self.showRail();
2300
+ if (self.railh && !self.railh.visibility) self.showRailHr();
2301
+ }
2302
+
2303
+ if (self.istextarea && self.win.css('resize') && self.win.css('resize') != 'none') self.view.h -= 20;
2304
+
2305
+ self.cursorheight = Math.min(self.view.h, Math.round(self.view.h * (self.view.h / self.page.h)));
2306
+ self.cursorheight = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorheight);
2307
+
2308
+ self.cursorwidth = Math.min(self.view.w, Math.round(self.view.w * (self.view.w / self.page.w)));
2309
+ self.cursorwidth = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorwidth);
2310
+
2311
+ self.scrollvaluemax = self.view.h - self.cursorheight - (opt.railpadding.top + opt.railpadding.bottom);
2312
+ if (!self.hasborderbox) self.scrollvaluemax -= self.cursor[0].offsetHeight - self.cursor[0].clientHeight;
2313
+
2314
+ if (self.railh) {
2315
+ self.railh.width = (self.page.maxh > 0) ? (self.view.w - self.rail.width) : self.view.w;
2316
+ self.scrollvaluemaxw = self.railh.width - self.cursorwidth - (opt.railpadding.left + opt.railpadding.right);
2317
+ }
2318
+
2319
+ if (!self.ispage) self.updateScrollBar(self.view);
2320
+
2321
+ self.scrollratio = {
2322
+ x: (self.page.maxw / self.scrollvaluemaxw),
2323
+ y: (self.page.maxh / self.scrollvaluemax)
2324
+ };
2325
+
2326
+ var sy = self.getScrollTop();
2327
+ if (sy > self.page.maxh) {
2328
+ self.doScrollTop(self.page.maxh);
2329
+ } else {
2330
+ self.scroll.y = (self.getScrollTop() / self.scrollratio.y) | 0;
2331
+ self.scroll.x = (self.getScrollLeft() / self.scrollratio.x) | 0;
2332
+ if (self.cursoractive) self.noticeCursor();
2333
+ }
2334
+
2335
+ if (self.scroll.y && (self.getScrollTop() === 0)) self.doScrollTo((self.scroll.y * self.scrollratio.y)|0);
2336
+
2337
+ return self;
2338
+ };
2339
+
2340
+ this.resize = self.onResize;
2341
+
2342
+ var hlazyresize = 0;
2343
+
2344
+ this.onscreenresize = function(e) {
2345
+ clearTimeout(hlazyresize);
2346
+
2347
+ var hiderails = (!self.ispage && !self.haswrapper);
2348
+ if (hiderails) self.hideRails();
2349
+
2350
+ hlazyresize = setTimeout(function () {
2351
+ if (self) {
2352
+ if (hiderails) self.showRails();
2353
+ self.resize();
2354
+ }
2355
+ hlazyresize=0;
2356
+ }, 120);
2357
+ };
2358
+
2359
+ this.lazyResize = function (tm) { // event debounce
2360
+
2361
+ clearTimeout(hlazyresize);
2362
+
2363
+ tm = isNaN(tm) ? 240 : tm;
2364
+
2365
+ hlazyresize = setTimeout(function () {
2366
+ self && self.resize();
2367
+ hlazyresize=0;
2368
+ }, tm);
2369
+
2370
+ return self;
2371
+
2372
+ };
2373
+
2374
+ // derived by MDN https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference/wheel
2375
+ function _modernWheelEvent(dom, name, fn, bubble) {
2376
+ self._bind(dom, name, function (e) {
2377
+ e = e || _win.event;
2378
+ var event = {
2379
+ original: e,
2380
+ target: e.target || e.srcElement,
2381
+ type: "wheel",
2382
+ deltaMode: e.type == "MozMousePixelScroll" ? 0 : 1,
2383
+ deltaX: 0,
2384
+ deltaZ: 0,
2385
+ preventDefault: function () {
2386
+ e.preventDefault ? e.preventDefault() : e.returnValue = false;
2387
+ return false;
2388
+ },
2389
+ stopImmediatePropagation: function () {
2390
+ (e.stopImmediatePropagation) ? e.stopImmediatePropagation() : e.cancelBubble = true;
2391
+ }
2392
+ };
2393
+
2394
+ if (name == "mousewheel") {
2395
+ e.wheelDeltaX && (event.deltaX = -1 / 40 * e.wheelDeltaX);
2396
+ e.wheelDeltaY && (event.deltaY = -1 / 40 * e.wheelDeltaY);
2397
+ !event.deltaY && !event.deltaX && (event.deltaY = -1 / 40 * e.wheelDelta);
2398
+ } else {
2399
+ event.deltaY = e.detail;
2400
+ }
2401
+
2402
+ return fn.call(dom, event);
2403
+ }, bubble);
2404
+ }
2405
+
2406
+
2407
+
2408
+ this.jqbind = function (dom, name, fn) { // use jquery bind for non-native events (mouseenter/mouseleave)
2409
+ self.events.push({
2410
+ e: dom,
2411
+ n: name,
2412
+ f: fn,
2413
+ q: true
2414
+ });
2415
+ $(dom).on(name, fn);
2416
+ };
2417
+
2418
+ this.mousewheel = function (dom, fn, bubble) { // bind mousewheel
2419
+ var el = ("jquery" in dom) ? dom[0] : dom;
2420
+ if ("onwheel" in _doc.createElement("div")) { // Modern browsers support "wheel"
2421
+ self._bind(el, "wheel", fn, bubble || false);
2422
+ } else {
2423
+ var wname = (_doc.onmousewheel !== undefined) ? "mousewheel" : "DOMMouseScroll"; // older Webkit+IE support or older Firefox
2424
+ _modernWheelEvent(el, wname, fn, bubble || false);
2425
+ if (wname == "DOMMouseScroll") _modernWheelEvent(el, "MozMousePixelScroll", fn, bubble || false); // Firefox legacy
2426
+ }
2427
+ };
2428
+
2429
+ var passiveSupported = false;
2430
+
2431
+ if (cap.haseventlistener) { // W3C standard event model
2432
+
2433
+ // thanks to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
2434
+ try { var options = Object.defineProperty({}, "passive", { get: function () { passiveSupported = !0; } }); _win.addEventListener("test", null, options); } catch (err) { }
2435
+
2436
+ this.stopPropagation = function (e) {
2437
+ if (!e) return false;
2438
+ e = (e.original) ? e.original : e;
2439
+ e.stopPropagation();
2440
+ return false;
2441
+ };
2442
+
2443
+ this.cancelEvent = function(e) {
2444
+ if (e.cancelable) e.preventDefault();
2445
+ e.stopImmediatePropagation();
2446
+ if (e.preventManipulation) e.preventManipulation(); // IE10+
2447
+ return false;
2448
+ };
2449
+
2450
+ } else {
2451
+
2452
+ // inspired from https://gist.github.com/jonathantneal/2415137
2453
+
2454
+ Event.prototype.preventDefault = function () {
2455
+ this.returnValue = false;
2456
+ };
2457
+
2458
+ Event.prototype.stopPropagation = function () {
2459
+ this.cancelBubble = true;
2460
+ };
2461
+
2462
+ _win.constructor.prototype.addEventListener = _doc.constructor.prototype.addEventListener = Element.prototype.addEventListener = function (type, listener, useCapture) {
2463
+ this.attachEvent("on" + type, listener);
2464
+ };
2465
+ _win.constructor.prototype.removeEventListener = _doc.constructor.prototype.removeEventListener = Element.prototype.removeEventListener = function (type, listener, useCapture) {
2466
+ this.detachEvent("on" + type, listener);
2467
+ };
2468
+
2469
+ // Thanks to http://www.switchonthecode.com !!
2470
+ this.cancelEvent = function (e) {
2471
+ e = e || _win.event;
2472
+ if (e) {
2473
+ e.cancelBubble = true;
2474
+ e.cancel = true;
2475
+ e.returnValue = false;
2476
+ }
2477
+ return false;
2478
+ };
2479
+
2480
+ this.stopPropagation = function (e) {
2481
+ e = e || _win.event;
2482
+ if (e) e.cancelBubble = true;
2483
+ return false;
2484
+ };
2485
+
2486
+ }
2487
+
2488
+ this.delegate = function (dom, name, fn, bubble, active) {
2489
+
2490
+ var de = delegatevents[name] || false;
2491
+
2492
+ if (!de) {
2493
+
2494
+ de = {
2495
+ a: [],
2496
+ l: [],
2497
+ f: function (e) {
2498
+ var lst = de.l, l = lst.length - 1;
2499
+ var r = false;
2500
+ for (var a = l; a >= 0; a--) {
2501
+ r = lst[a].call(e.target, e);
2502
+ if (r === false) return false;
2503
+ }
2504
+ return r;
2505
+ }
2506
+ };
2507
+
2508
+ self.bind(dom, name, de.f, bubble, active);
2509
+
2510
+ delegatevents[name] = de;
2511
+
2512
+ }
2513
+
2514
+ if (self.ispage) {
2515
+ de.a = [self.id].concat(de.a);
2516
+ de.l = [fn].concat(de.l);
2517
+ } else {
2518
+ de.a.push(self.id);
2519
+ de.l.push(fn);
2520
+ }
2521
+
2522
+ };
2523
+
2524
+ this.undelegate = function (dom, name, fn, bubble, active) {
2525
+ var de = delegatevents[name]||false;
2526
+ if (de&&de.l) { // quick fix #683
2527
+ for (var a=0,l=de.l.length;a<l;a++) {
2528
+ if (de.a[a] === self.id) {
2529
+ de.a.splice(a);
2530
+ de.l.splice(a);
2531
+ if (de.a.length===0) {
2532
+ self._unbind(dom,name,de.l.f);
2533
+ delegatevents[name] = null;
2534
+ }
2535
+ }
2536
+ }
2537
+ }
2538
+ };
2539
+
2540
+ this.bind = function (dom, name, fn, bubble, active) {
2541
+ var el = ("jquery" in dom) ? dom[0] : dom;
2542
+ self._bind(el, name, fn, bubble || false, active || false);
2543
+ };
2544
+
2545
+ this._bind = function (el, name, fn, bubble, active) { // primitive bind
2546
+
2547
+ self.events.push({
2548
+ e: el,
2549
+ n: name,
2550
+ f: fn,
2551
+ b: bubble,
2552
+ q: false
2553
+ });
2554
+
2555
+ (passiveSupported && active) ? el.addEventListener(name, fn, { passive: false, capture: bubble }) : el.addEventListener(name, fn, bubble || false);
2556
+ };
2557
+
2558
+ this._unbind = function (el, name, fn, bub) { // primitive unbind
2559
+ if (delegatevents[name]) self.undelegate(el, name, fn, bub);
2560
+ else el.removeEventListener(name, fn, bub);
2561
+ };
2562
+
2563
+ this.unbindAll = function () {
2564
+ for (var a = 0; a < self.events.length; a++) {
2565
+ var r = self.events[a];
2566
+ (r.q) ? r.e.unbind(r.n, r.f) : self._unbind(r.e, r.n, r.f, r.b);
2567
+ }
2568
+ };
2569
+
2570
+ this.showRails = function () {
2571
+ return self.showRail().showRailHr();
2572
+ };
2573
+
2574
+ this.showRail = function () {
2575
+ if ((self.page.maxh !== 0) && (self.ispage || self.win.css('display') != 'none')) {
2576
+ //self.visibility = true;
2577
+ self.rail.visibility = true;
2578
+ self.rail.css('display', 'block');
2579
+ }
2580
+ return self;
2581
+ };
2582
+
2583
+ this.showRailHr = function () {
2584
+ if (self.railh) {
2585
+ if ((self.page.maxw !== 0) && (self.ispage || self.win.css('display') != 'none')) {
2586
+ self.railh.visibility = true;
2587
+ self.railh.css('display', 'block');
2588
+ }
2589
+ }
2590
+ return self;
2591
+ };
2592
+
2593
+ this.hideRails = function () {
2594
+ return self.hideRail().hideRailHr();
2595
+ };
2596
+
2597
+ this.hideRail = function () {
2598
+ //self.visibility = false;
2599
+ self.rail.visibility = false;
2600
+ self.rail.css('display', 'none');
2601
+ return self;
2602
+ };
2603
+
2604
+ this.hideRailHr = function () {
2605
+ if (self.railh) {
2606
+ self.railh.visibility = false;
2607
+ self.railh.css('display', 'none');
2608
+ }
2609
+ return self;
2610
+ };
2611
+
2612
+ this.show = function () {
2613
+ self.hidden = false;
2614
+ self.railslocked = false;
2615
+ return self.showRails();
2616
+ };
2617
+
2618
+ this.hide = function () {
2619
+ self.hidden = true;
2620
+ self.railslocked = true;
2621
+ return self.hideRails();
2622
+ };
2623
+
2624
+ this.toggle = function () {
2625
+ return (self.hidden) ? self.show() : self.hide();
2626
+ };
2627
+
2628
+ this.remove = function () {
2629
+ self.stop();
2630
+ if (self.cursortimeout) clearTimeout(self.cursortimeout);
2631
+ for (var n in self.delaylist) if (self.delaylist[n]) clearAnimationFrame(self.delaylist[n].h);
2632
+ self.doZoomOut();
2633
+ self.unbindAll();
2634
+
2635
+ if (cap.isie9) self.win[0].detachEvent("onpropertychange", self.onAttributeChange); //IE9 DOMAttrModified bug
2636
+
2637
+ if (self.observer !== false) self.observer.disconnect();
2638
+ if (self.observerremover !== false) self.observerremover.disconnect();
2639
+ if (self.observerbody !== false) self.observerbody.disconnect();
2640
+
2641
+ self.events = null;
2642
+
2643
+ if (self.cursor) {
2644
+ self.cursor.remove();
2645
+ }
2646
+ if (self.cursorh) {
2647
+ self.cursorh.remove();
2648
+ }
2649
+ if (self.rail) {
2650
+ self.rail.remove();
2651
+ }
2652
+ if (self.railh) {
2653
+ self.railh.remove();
2654
+ }
2655
+ if (self.zoom) {
2656
+ self.zoom.remove();
2657
+ }
2658
+ for (var a = 0; a < self.saved.css.length; a++) {
2659
+ var d = self.saved.css[a];
2660
+ d[0].css(d[1], (d[2] === undefined) ? '' : d[2]);
2661
+ }
2662
+ self.saved = false;
2663
+ self.me.data('__nicescroll', ''); //erase all traces
2664
+
2665
+ // memory leak fixed by GianlucaGuarini - thanks a lot!
2666
+ // remove the current nicescroll from the $.nicescroll array & normalize array
2667
+ var lst = $.nicescroll;
2668
+ lst.each(function (i) {
2669
+ if (!this) return;
2670
+ if (this.id === self.id) {
2671
+ delete lst[i];
2672
+ for (var b = ++i; b < lst.length; b++ , i++) lst[i] = lst[b];
2673
+ lst.length--;
2674
+ if (lst.length) delete lst[lst.length];
2675
+ }
2676
+ });
2677
+
2678
+ for (var i in self) {
2679
+ self[i] = null;
2680
+ delete self[i];
2681
+ }
2682
+
2683
+ self = null;
2684
+
2685
+ };
2686
+
2687
+ this.scrollstart = function (fn) {
2688
+ this.onscrollstart = fn;
2689
+ return self;
2690
+ };
2691
+ this.scrollend = function (fn) {
2692
+ this.onscrollend = fn;
2693
+ return self;
2694
+ };
2695
+ this.scrollcancel = function (fn) {
2696
+ this.onscrollcancel = fn;
2697
+ return self;
2698
+ };
2699
+
2700
+ this.zoomin = function (fn) {
2701
+ this.onzoomin = fn;
2702
+ return self;
2703
+ };
2704
+ this.zoomout = function (fn) {
2705
+ this.onzoomout = fn;
2706
+ return self;
2707
+ };
2708
+
2709
+ this.isScrollable = function (e) {
2710
+ var dom = (e.target) ? e.target : e;
2711
+ if (dom.nodeName == 'OPTION') return true;
2712
+ while (dom && (dom.nodeType == 1) && (dom !== this.me[0]) && !(/^BODY|HTML/.test(dom.nodeName))) {
2713
+ var dd = $(dom);
2714
+ var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
2715
+ if (/scroll|auto/.test(ov)) return (dom.clientHeight != dom.scrollHeight);
2716
+ dom = (dom.parentNode) ? dom.parentNode : false;
2717
+ }
2718
+ return false;
2719
+ };
2720
+
2721
+ this.getViewport = function (me) {
2722
+ var dom = (me && me.parentNode) ? me.parentNode : false;
2723
+ while (dom && (dom.nodeType == 1) && !(/^BODY|HTML/.test(dom.nodeName))) {
2724
+ var dd = $(dom);
2725
+ if (/fixed|absolute/.test(dd.css("position"))) return dd;
2726
+ var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
2727
+ if ((/scroll|auto/.test(ov)) && (dom.clientHeight != dom.scrollHeight)) return dd;
2728
+ if (dd.getNiceScroll().length > 0) return dd;
2729
+ dom = (dom.parentNode) ? dom.parentNode : false;
2730
+ }
2731
+ return false;
2732
+ };
2733
+
2734
+ this.triggerScrollStart = function (cx, cy, rx, ry, ms) {
2735
+
2736
+ if (self.onscrollstart) {
2737
+ var info = {
2738
+ type: "scrollstart",
2739
+ current: {
2740
+ x: cx,
2741
+ y: cy
2742
+ },
2743
+ request: {
2744
+ x: rx,
2745
+ y: ry
2746
+ },
2747
+ end: {
2748
+ x: self.newscrollx,
2749
+ y: self.newscrolly
2750
+ },
2751
+ speed: ms
2752
+ };
2753
+ self.onscrollstart.call(self, info);
2754
+ }
2755
+
2756
+ };
2757
+
2758
+ this.triggerScrollEnd = function () {
2759
+ if (self.onscrollend) {
2760
+
2761
+ var px = self.getScrollLeft();
2762
+ var py = self.getScrollTop();
2763
+
2764
+ var info = {
2765
+ type: "scrollend",
2766
+ current: {
2767
+ x: px,
2768
+ y: py
2769
+ },
2770
+ end: {
2771
+ x: px,
2772
+ y: py
2773
+ }
2774
+ };
2775
+
2776
+ self.onscrollend.call(self, info);
2777
+
2778
+ }
2779
+
2780
+ };
2781
+
2782
+ var scrolldiry = 0, scrolldirx = 0, scrolltmr = 0, scrollspd = 1;
2783
+
2784
+ function doScrollRelative(px, py, chkscroll, iswheel) {
2785
+
2786
+ if (!self.scrollrunning) {
2787
+ self.newscrolly = self.getScrollTop();
2788
+ self.newscrollx = self.getScrollLeft();
2789
+ scrolltmr = now();
2790
+ }
2791
+
2792
+ var gap = (now() - scrolltmr);
2793
+ scrolltmr = now();
2794
+
2795
+ if (gap > 350) {
2796
+ scrollspd = 1;
2797
+ } else {
2798
+ scrollspd += (2 - scrollspd) / 10;
2799
+ }
2800
+
2801
+ px = px * scrollspd | 0;
2802
+ py = py * scrollspd | 0;
2803
+
2804
+ if (px) {
2805
+
2806
+ if (iswheel) { // mouse-only
2807
+ if (px < 0) { // fix apple magic mouse swipe back/forward
2808
+ if (self.getScrollLeft() >= self.page.maxw) return true;
2809
+ } else {
2810
+ if (self.getScrollLeft() <= 0) return true;
2811
+ }
2812
+ }
2813
+
2814
+ var dx = px > 0 ? 1 : -1;
2815
+
2816
+ if (scrolldirx !== dx) {
2817
+ if (self.scrollmom) self.scrollmom.stop();
2818
+ self.newscrollx = self.getScrollLeft();
2819
+ scrolldirx = dx;
2820
+ }
2821
+
2822
+ self.lastdeltax -= px;
2823
+
2824
+ }
2825
+
2826
+ if (py) {
2827
+
2828
+ var chk = (function () {
2829
+ var top = self.getScrollTop();
2830
+ if (py < 0) {
2831
+ if (top >= self.page.maxh) return true;
2832
+ } else {
2833
+ if (top <= 0) return true;
2834
+ }
2835
+ })();
2836
+
2837
+ if (chk) {
2838
+ if (opt.nativeparentscrolling && chkscroll && !self.ispage && !self.zoomactive) return true;
2839
+ var ny = self.view.h >> 1;
2840
+ if (self.newscrolly < -ny) { self.newscrolly = -ny; py = -1; }
2841
+ else if (self.newscrolly > self.page.maxh + ny) { self.newscrolly = self.page.maxh + ny; py = 1; }
2842
+ else py = 0;
2843
+ }
2844
+
2845
+ var dy = py > 0 ? 1 : -1;
2846
+
2847
+ if (scrolldiry !== dy) {
2848
+ if (self.scrollmom) self.scrollmom.stop();
2849
+ self.newscrolly = self.getScrollTop();
2850
+ scrolldiry = dy;
2851
+ }
2852
+
2853
+ self.lastdeltay -= py;
2854
+
2855
+ }
2856
+
2857
+ if (py || px) {
2858
+ self.synched("relativexy", function () {
2859
+
2860
+ var dty = self.lastdeltay + self.newscrolly;
2861
+ self.lastdeltay = 0;
2862
+
2863
+ var dtx = self.lastdeltax + self.newscrollx;
2864
+ self.lastdeltax = 0;
2865
+
2866
+ if (!self.rail.drag) self.doScrollPos(dtx, dty);
2867
+
2868
+ });
2869
+ }
2870
+
2871
+ }
2872
+
2873
+ var hasparentscrollingphase = false;
2874
+
2875
+ function execScrollWheel(e, hr, chkscroll) {
2876
+ var px, py;
2877
+
2878
+ if (!chkscroll && hasparentscrollingphase) return true;
2879
+
2880
+ if (e.deltaMode === 0) { // PIXEL
2881
+ px = -(e.deltaX * (opt.mousescrollstep / (18 * 3))) | 0;
2882
+ py = -(e.deltaY * (opt.mousescrollstep / (18 * 3))) | 0;
2883
+ } else if (e.deltaMode === 1) { // LINE
2884
+ px = -(e.deltaX * opt.mousescrollstep * 50 / 80) | 0;
2885
+ py = -(e.deltaY * opt.mousescrollstep * 50 / 80) | 0;
2886
+ }
2887
+
2888
+ if (hr && opt.oneaxismousemode && (px === 0) && py) { // classic vertical-only mousewheel + browser with x/y support
2889
+ px = py;
2890
+ py = 0;
2891
+
2892
+ if (chkscroll) {
2893
+ var hrend = (px < 0) ? (self.getScrollLeft() >= self.page.maxw) : (self.getScrollLeft() <= 0);
2894
+ if (hrend) { // preserve vertical scrolling
2895
+ py = px;
2896
+ px = 0;
2897
+ }
2898
+ }
2899
+
2900
+ }
2901
+
2902
+ // invert horizontal direction for rtl mode
2903
+ if (self.isrtlmode) px = -px;
2904
+
2905
+ var chk = doScrollRelative(px, py, chkscroll, true);
2906
+
2907
+ if (chk) {
2908
+ if (chkscroll) hasparentscrollingphase = true;
2909
+ } else {
2910
+ hasparentscrollingphase = false;
2911
+ e.stopImmediatePropagation();
2912
+ return e.preventDefault();
2913
+ }
2914
+
2915
+ }
2916
+
2917
+ this.onmousewheel = function (e) {
2918
+ if (self.wheelprevented||self.locked) return false;
2919
+ if (self.railslocked) {
2920
+ self.debounced("checkunlock", self.resize, 250);
2921
+ return false;
2922
+ }
2923
+ if (self.rail.drag) return self.cancelEvent(e);
2924
+
2925
+ if (opt.oneaxismousemode === "auto" && e.deltaX !== 0) opt.oneaxismousemode = false; // check two-axis mouse support (not very elegant)
2926
+
2927
+ if (opt.oneaxismousemode && e.deltaX === 0) {
2928
+ if (!self.rail.scrollable) {
2929
+ if (self.railh && self.railh.scrollable) {
2930
+ return self.onmousewheelhr(e);
2931
+ } else {
2932
+ return true;
2933
+ }
2934
+ }
2935
+ }
2936
+
2937
+ var nw = now();
2938
+ var chk = false;
2939
+ if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
2940
+ self.nativescrollingarea = self.isScrollable(e);
2941
+ chk = true;
2942
+ }
2943
+ self.checkarea = nw;
2944
+ if (self.nativescrollingarea) return true; // this isn't my business
2945
+ var ret = execScrollWheel(e, false, chk);
2946
+ if (ret) self.checkarea = 0;
2947
+ return ret;
2948
+ };
2949
+
2950
+ this.onmousewheelhr = function (e) {
2951
+ if (self.wheelprevented) return;
2952
+ if (self.railslocked || !self.railh.scrollable) return true;
2953
+ if (self.rail.drag) return self.cancelEvent(e);
2954
+
2955
+ var nw = now();
2956
+ var chk = false;
2957
+ if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
2958
+ self.nativescrollingarea = self.isScrollable(e);
2959
+ chk = true;
2960
+ }
2961
+ self.checkarea = nw;
2962
+ if (self.nativescrollingarea) return true; // this is not my business
2963
+ if (self.railslocked) return self.cancelEvent(e);
2964
+
2965
+ return execScrollWheel(e, true, chk);
2966
+ };
2967
+
2968
+ this.stop = function () {
2969
+ self.cancelScroll();
2970
+ if (self.scrollmon) self.scrollmon.stop();
2971
+ self.cursorfreezed = false;
2972
+ self.scroll.y = Math.round(self.getScrollTop() * (1 / self.scrollratio.y));
2973
+ self.noticeCursor();
2974
+ return self;
2975
+ };
2976
+
2977
+ this.getTransitionSpeed = function (dif) {
2978
+
2979
+ return 80 + (dif / 72) * opt.scrollspeed |0;
2980
+
2981
+ };
2982
+
2983
+ if (!opt.smoothscroll) {
2984
+ this.doScrollLeft = function (x, spd) { //direct
2985
+ var y = self.getScrollTop();
2986
+ self.doScrollPos(x, y, spd);
2987
+ };
2988
+ this.doScrollTop = function (y, spd) { //direct
2989
+ var x = self.getScrollLeft();
2990
+ self.doScrollPos(x, y, spd);
2991
+ };
2992
+ this.doScrollPos = function (x, y, spd) { //direct
2993
+ var nx = (x > self.page.maxw) ? self.page.maxw : x;
2994
+ if (nx < 0) nx = 0;
2995
+ var ny = (y > self.page.maxh) ? self.page.maxh : y;
2996
+ if (ny < 0) ny = 0;
2997
+ self.synched('scroll', function () {
2998
+ self.setScrollTop(ny);
2999
+ self.setScrollLeft(nx);
3000
+ });
3001
+ };
3002
+ this.cancelScroll = function () { }; // direct
3003
+
3004
+ } else if (self.ishwscroll && cap.hastransition && opt.usetransition && !!opt.smoothscroll) {
3005
+
3006
+ var lasttransitionstyle = '';
3007
+
3008
+ this.resetTransition = function () {
3009
+ lasttransitionstyle = '';
3010
+ self.doc.css(cap.prefixstyle + 'transition-duration', '0ms');
3011
+ };
3012
+
3013
+ this.prepareTransition = function (dif, istime) {
3014
+ var ex = (istime) ? dif : self.getTransitionSpeed(dif);
3015
+ var trans = ex + 'ms';
3016
+ if (lasttransitionstyle !== trans) {
3017
+ lasttransitionstyle = trans;
3018
+ self.doc.css(cap.prefixstyle + 'transition-duration', trans);
3019
+ }
3020
+ return ex;
3021
+ };
3022
+
3023
+ this.doScrollLeft = function (x, spd) { //trans
3024
+ var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3025
+ self.doScrollPos(x, y, spd);
3026
+ };
3027
+
3028
+ this.doScrollTop = function (y, spd) { //trans
3029
+ var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3030
+ self.doScrollPos(x, y, spd);
3031
+ };
3032
+
3033
+ this.cursorupdate = {
3034
+ running: false,
3035
+ start: function () {
3036
+ var m = this;
3037
+
3038
+ if (m.running) return;
3039
+ m.running = true;
3040
+
3041
+ var loop = function () {
3042
+ if (m.running) setAnimationFrame(loop);
3043
+ self.showCursor(self.getScrollTop(), self.getScrollLeft());
3044
+ self.notifyScrollEvent(self.win[0]);
3045
+ };
3046
+
3047
+ setAnimationFrame(loop);
3048
+ },
3049
+ stop: function () {
3050
+ this.running = false;
3051
+ }
3052
+ };
3053
+
3054
+ this.doScrollPos = function (x, y, spd) { //trans
3055
+
3056
+ var py = self.getScrollTop();
3057
+ var px = self.getScrollLeft();
3058
+
3059
+ if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) self.cancelScroll(); //inverted movement detection
3060
+
3061
+ if (!opt.bouncescroll) {
3062
+ if (y < 0) y = 0;
3063
+ else if (y > self.page.maxh) y = self.page.maxh;
3064
+ if (x < 0) x = 0;
3065
+ else if (x > self.page.maxw) x = self.page.maxw;
3066
+ } else {
3067
+ if (y < 0) y = y / 2 | 0;
3068
+ else if (y > self.page.maxh) y = self.page.maxh + (y - self.page.maxh) / 2 | 0;
3069
+ if (x < 0) x = x / 2 | 0;
3070
+ else if (x > self.page.maxw) x = self.page.maxw + (x - self.page.maxw) / 2 | 0;
3071
+ }
3072
+
3073
+ if (self.scrollrunning && x == self.newscrollx && y == self.newscrolly) return false;
3074
+
3075
+ self.newscrolly = y;
3076
+ self.newscrollx = x;
3077
+
3078
+ var top = self.getScrollTop();
3079
+ var lft = self.getScrollLeft();
3080
+
3081
+ var dst = {};
3082
+ dst.x = x - lft;
3083
+ dst.y = y - top;
3084
+
3085
+ var dd = Math.sqrt((dst.x * dst.x) + (dst.y * dst.y)) | 0;
3086
+
3087
+ var ms = self.prepareTransition(dd);
3088
+
3089
+ if (!self.scrollrunning) {
3090
+ self.scrollrunning = true;
3091
+ self.triggerScrollStart(lft, top, x, y, ms);
3092
+ self.cursorupdate.start();
3093
+ }
3094
+
3095
+ self.scrollendtrapped = true;
3096
+
3097
+ if (!cap.transitionend) {
3098
+ if (self.scrollendtrapped) clearTimeout(self.scrollendtrapped);
3099
+ self.scrollendtrapped = setTimeout(self.onScrollTransitionEnd, ms); // simulate transitionend event
3100
+ }
3101
+
3102
+ self.setScrollTop(self.newscrolly);
3103
+ self.setScrollLeft(self.newscrollx);
3104
+
3105
+ };
3106
+
3107
+ this.cancelScroll = function () {
3108
+ if (!self.scrollendtrapped) return true;
3109
+ var py = self.getScrollTop();
3110
+ var px = self.getScrollLeft();
3111
+ self.scrollrunning = false;
3112
+ if (!cap.transitionend) clearTimeout(cap.transitionend);
3113
+ self.scrollendtrapped = false;
3114
+ self.resetTransition();
3115
+ self.setScrollTop(py); // fire event onscroll
3116
+ if (self.railh) self.setScrollLeft(px);
3117
+ if (self.timerscroll && self.timerscroll.tm) clearInterval(self.timerscroll.tm);
3118
+ self.timerscroll = false;
3119
+
3120
+ self.cursorfreezed = false;
3121
+
3122
+ self.cursorupdate.stop();
3123
+ self.showCursor(py, px);
3124
+ return self;
3125
+ };
3126
+
3127
+ this.onScrollTransitionEnd = function () {
3128
+
3129
+ if (!self.scrollendtrapped) return;
3130
+
3131
+ var py = self.getScrollTop();
3132
+ var px = self.getScrollLeft();
3133
+
3134
+ if (py < 0) py = 0;
3135
+ else if (py > self.page.maxh) py = self.page.maxh;
3136
+ if (px < 0) px = 0;
3137
+ else if (px > self.page.maxw) px = self.page.maxw;
3138
+ if ((py != self.newscrolly) || (px != self.newscrollx)) return self.doScrollPos(px, py, opt.snapbackspeed);
3139
+
3140
+ if (self.scrollrunning) self.triggerScrollEnd();
3141
+ self.scrollrunning = false;
3142
+
3143
+ self.scrollendtrapped = false;
3144
+ self.resetTransition();
3145
+ self.timerscroll = false;
3146
+ self.setScrollTop(py); // fire event onscroll
3147
+ if (self.railh) self.setScrollLeft(px); // fire event onscroll left
3148
+
3149
+ self.cursorupdate.stop();
3150
+ self.noticeCursor(false, py, px);
3151
+
3152
+ self.cursorfreezed = false;
3153
+
3154
+ };
3155
+
3156
+ } else {
3157
+
3158
+ this.doScrollLeft = function (x, spd) { //no-trans
3159
+ var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3160
+ self.doScrollPos(x, y, spd);
3161
+ };
3162
+
3163
+ this.doScrollTop = function (y, spd) { //no-trans
3164
+ var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3165
+ self.doScrollPos(x, y, spd);
3166
+ };
3167
+
3168
+ this.doScrollPos = function (x, y, spd) { //no-trans
3169
+
3170
+ var py = self.getScrollTop();
3171
+ var px = self.getScrollLeft();
3172
+
3173
+ if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) self.cancelScroll(); //inverted movement detection
3174
+
3175
+ var clipped = false;
3176
+
3177
+ if (!self.bouncescroll || !self.rail.visibility) {
3178
+ if (y < 0) {
3179
+ y = 0;
3180
+ clipped = true;
3181
+ } else if (y > self.page.maxh) {
3182
+ y = self.page.maxh;
3183
+ clipped = true;
3184
+ }
3185
+ }
3186
+ if (!self.bouncescroll || !self.railh.visibility) {
3187
+ if (x < 0) {
3188
+ x = 0;
3189
+ clipped = true;
3190
+ } else if (x > self.page.maxw) {
3191
+ x = self.page.maxw;
3192
+ clipped = true;
3193
+ }
3194
+ }
3195
+
3196
+ if (self.scrollrunning && (self.newscrolly === y) && (self.newscrollx === x)) return true;
3197
+
3198
+ self.newscrolly = y;
3199
+ self.newscrollx = x;
3200
+
3201
+ self.dst = {};
3202
+ self.dst.x = x - px;
3203
+ self.dst.y = y - py;
3204
+ self.dst.px = px;
3205
+ self.dst.py = py;
3206
+
3207
+ var dd = Math.sqrt((self.dst.x * self.dst.x) + (self.dst.y * self.dst.y)) | 0;
3208
+ var ms = self.getTransitionSpeed(dd);
3209
+
3210
+ self.bzscroll = {};
3211
+
3212
+ var p3 = (clipped) ? 1 : 0.58;
3213
+ self.bzscroll.x = new BezierClass(px, self.newscrollx, ms, 0, 0, p3, 1);
3214
+ self.bzscroll.y = new BezierClass(py, self.newscrolly, ms, 0, 0, p3, 1);
3215
+
3216
+ var loopid = now();
3217
+
3218
+ var loop = function () {
3219
+
3220
+ if (!self.scrollrunning) return;
3221
+ var x = self.bzscroll.y.getPos();
3222
+
3223
+ self.setScrollLeft(self.bzscroll.x.getNow());
3224
+ self.setScrollTop(self.bzscroll.y.getNow());
3225
+
3226
+ if (x <= 1) {
3227
+ self.timer = setAnimationFrame(loop);
3228
+ } else {
3229
+ self.scrollrunning = false;
3230
+ self.timer = 0;
3231
+ self.triggerScrollEnd();
3232
+ }
3233
+
3234
+ };
3235
+
3236
+ if (!self.scrollrunning) {
3237
+ self.triggerScrollStart(px, py, x, y, ms);
3238
+ self.scrollrunning = true;
3239
+ self.timer = setAnimationFrame(loop);
3240
+ }
3241
+
3242
+ };
3243
+
3244
+ this.cancelScroll = function () {
3245
+ if (self.timer) clearAnimationFrame(self.timer);
3246
+ self.timer = 0;
3247
+ self.bzscroll = false;
3248
+ self.scrollrunning = false;
3249
+ return self;
3250
+ };
3251
+
3252
+ }
3253
+
3254
+ this.doScrollBy = function (stp, relative) {
3255
+ doScrollRelative(0, stp);
3256
+ };
3257
+
3258
+ this.doScrollLeftBy = function (stp, relative) {
3259
+ doScrollRelative(stp, 0);
3260
+ };
3261
+
3262
+ this.doScrollTo = function (pos, relative) {
3263
+ var ny = (relative) ? Math.round(pos * self.scrollratio.y) : pos;
3264
+ if (ny < 0) ny = 0;
3265
+ else if (ny > self.page.maxh) ny = self.page.maxh;
3266
+ self.cursorfreezed = false;
3267
+ self.doScrollTop(pos);
3268
+ };
3269
+
3270
+ this.checkContentSize = function () {
3271
+ var pg = self.getContentSize();
3272
+ if ((pg.h != self.page.h) || (pg.w != self.page.w)) self.resize(false, pg);
3273
+ };
3274
+
3275
+ self.onscroll = function (e) {
3276
+ if (self.rail.drag) return;
3277
+ if (!self.cursorfreezed) {
3278
+ self.synched('scroll', function () {
3279
+ self.scroll.y = Math.round(self.getScrollTop() / self.scrollratio.y);
3280
+ if (self.railh) self.scroll.x = Math.round(self.getScrollLeft() / self.scrollratio.x);
3281
+ self.noticeCursor();
3282
+ });
3283
+ }
3284
+ };
3285
+ self.bind(self.docscroll, "scroll", self.onscroll);
3286
+
3287
+ this.doZoomIn = function (e) {
3288
+ if (self.zoomactive) return;
3289
+ self.zoomactive = true;
3290
+
3291
+ self.zoomrestore = {
3292
+ style: {}
3293
+ };
3294
+ var lst = ['position', 'top', 'left', 'zIndex', 'backgroundColor', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight'];
3295
+ var win = self.win[0].style;
3296
+ for (var a in lst) {
3297
+ var pp = lst[a];
3298
+ self.zoomrestore.style[pp] = (win[pp] !== undefined) ? win[pp] : '';
3299
+ }
3300
+
3301
+ self.zoomrestore.style.width = self.win.css('width');
3302
+ self.zoomrestore.style.height = self.win.css('height');
3303
+
3304
+ self.zoomrestore.padding = {
3305
+ w: self.win.outerWidth() - self.win.width(),
3306
+ h: self.win.outerHeight() - self.win.height()
3307
+ };
3308
+
3309
+ if (cap.isios4) {
3310
+ self.zoomrestore.scrollTop = $window.scrollTop();
3311
+ $window.scrollTop(0);
3312
+ }
3313
+
3314
+ self.win.css({
3315
+ position: (cap.isios4) ? "absolute" : "fixed",
3316
+ top: 0,
3317
+ left: 0,
3318
+ zIndex: globalmaxzindex + 100,
3319
+ margin: 0
3320
+ });
3321
+ var bkg = self.win.css("backgroundColor");
3322
+ if ("" === bkg || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg)) self.win.css("backgroundColor", "#fff");
3323
+ self.rail.css({
3324
+ zIndex: globalmaxzindex + 101
3325
+ });
3326
+ self.zoom.css({
3327
+ zIndex: globalmaxzindex + 102
3328
+ });
3329
+ self.zoom.css('backgroundPosition', '0 -18px');
3330
+ self.resizeZoom();
3331
+
3332
+ if (self.onzoomin) self.onzoomin.call(self);
3333
+
3334
+ return self.cancelEvent(e);
3335
+ };
3336
+
3337
+ this.doZoomOut = function (e) {
3338
+ if (!self.zoomactive) return;
3339
+ self.zoomactive = false;
3340
+
3341
+ self.win.css("margin", "");
3342
+ self.win.css(self.zoomrestore.style);
3343
+
3344
+ if (cap.isios4) {
3345
+ $window.scrollTop(self.zoomrestore.scrollTop);
3346
+ }
3347
+
3348
+ self.rail.css({
3349
+ "z-index": self.zindex
3350
+ });
3351
+ self.zoom.css({
3352
+ "z-index": self.zindex
3353
+ });
3354
+ self.zoomrestore = false;
3355
+ self.zoom.css('backgroundPosition', '0 0');
3356
+ self.onResize();
3357
+
3358
+ if (self.onzoomout) self.onzoomout.call(self);
3359
+
3360
+ return self.cancelEvent(e);
3361
+ };
3362
+
3363
+ this.doZoom = function (e) {
3364
+ return (self.zoomactive) ? self.doZoomOut(e) : self.doZoomIn(e);
3365
+ };
3366
+
3367
+ this.resizeZoom = function () {
3368
+ if (!self.zoomactive) return;
3369
+
3370
+ var py = self.getScrollTop(); //preserve scrolling position
3371
+ self.win.css({
3372
+ width: $window.width() - self.zoomrestore.padding.w + "px",
3373
+ height: $window.height() - self.zoomrestore.padding.h + "px"
3374
+ });
3375
+ self.onResize();
3376
+
3377
+ self.setScrollTop(Math.min(self.page.maxh, py));
3378
+ };
3379
+
3380
+ this.init();
3381
+
3382
+ $.nicescroll.push(this);
3383
+
3384
+ };
3385
+
3386
+ // Inspired by the work of Kin Blas
3387
+ // http://webpro.host.adobe.com/people/jblas/momentum/includes/jquery.momentum.0.7.js
3388
+ var ScrollMomentumClass2D = function (nc) {
3389
+ var self = this;
3390
+ this.nc = nc;
3391
+
3392
+ this.lastx = 0;
3393
+ this.lasty = 0;
3394
+ this.speedx = 0;
3395
+ this.speedy = 0;
3396
+ this.lasttime = 0;
3397
+ this.steptime = 0;
3398
+ this.snapx = false;
3399
+ this.snapy = false;
3400
+ this.demulx = 0;
3401
+ this.demuly = 0;
3402
+
3403
+ this.lastscrollx = -1;
3404
+ this.lastscrolly = -1;
3405
+
3406
+ this.chkx = 0;
3407
+ this.chky = 0;
3408
+
3409
+ this.timer = 0;
3410
+
3411
+ this.reset = function (px, py) {
3412
+ self.stop();
3413
+ self.steptime = 0;
3414
+ self.lasttime = now();
3415
+ self.speedx = 0;
3416
+ self.speedy = 0;
3417
+ self.lastx = px;
3418
+ self.lasty = py;
3419
+ self.lastscrollx = -1;
3420
+ self.lastscrolly = -1;
3421
+ };
3422
+
3423
+ this.update = function (px, py) {
3424
+ var tm = now();
3425
+ self.steptime = tm - self.lasttime;
3426
+ self.lasttime = tm;
3427
+ var dy = py - self.lasty;
3428
+ var dx = px - self.lastx;
3429
+ var sy = self.nc.getScrollTop();
3430
+ var sx = self.nc.getScrollLeft();
3431
+ var newy = sy + dy;
3432
+ var newx = sx + dx;
3433
+ self.snapx = (newx < 0) || (newx > self.nc.page.maxw);
3434
+ self.snapy = (newy < 0) || (newy > self.nc.page.maxh);
3435
+ self.speedx = dx;
3436
+ self.speedy = dy;
3437
+ self.lastx = px;
3438
+ self.lasty = py;
3439
+ };
3440
+
3441
+ this.stop = function () {
3442
+ self.nc.unsynched("domomentum2d");
3443
+ if (self.timer) clearTimeout(self.timer);
3444
+ self.timer = 0;
3445
+ self.lastscrollx = -1;
3446
+ self.lastscrolly = -1;
3447
+ };
3448
+
3449
+ this.doSnapy = function (nx, ny) {
3450
+ var snap = false;
3451
+
3452
+ if (ny < 0) {
3453
+ ny = 0;
3454
+ snap = true;
3455
+ } else if (ny > self.nc.page.maxh) {
3456
+ ny = self.nc.page.maxh;
3457
+ snap = true;
3458
+ }
3459
+
3460
+ if (nx < 0) {
3461
+ nx = 0;
3462
+ snap = true;
3463
+ } else if (nx > self.nc.page.maxw) {
3464
+ nx = self.nc.page.maxw;
3465
+ snap = true;
3466
+ }
3467
+
3468
+ (snap) ? self.nc.doScrollPos(nx, ny, self.nc.opt.snapbackspeed) : self.nc.triggerScrollEnd();
3469
+ };
3470
+
3471
+ this.doMomentum = function (gp) {
3472
+ var t = now();
3473
+ var l = (gp) ? t + gp : self.lasttime;
3474
+
3475
+ var sl = self.nc.getScrollLeft();
3476
+ var st = self.nc.getScrollTop();
3477
+
3478
+ var pageh = self.nc.page.maxh;
3479
+ var pagew = self.nc.page.maxw;
3480
+
3481
+ self.speedx = (pagew > 0) ? Math.min(60, self.speedx) : 0;
3482
+ self.speedy = (pageh > 0) ? Math.min(60, self.speedy) : 0;
3483
+
3484
+ var chk = l && (t - l) <= 60;
3485
+
3486
+ if ((st < 0) || (st > pageh) || (sl < 0) || (sl > pagew)) chk = false;
3487
+
3488
+ var sy = (self.speedy && chk) ? self.speedy : false;
3489
+ var sx = (self.speedx && chk) ? self.speedx : false;
3490
+
3491
+ if (sy || sx) {
3492
+ var tm = Math.max(16, self.steptime); //timeout granularity
3493
+
3494
+ if (tm > 50) { // do smooth
3495
+ var xm = tm / 50;
3496
+ self.speedx *= xm;
3497
+ self.speedy *= xm;
3498
+ tm = 50;
3499
+ }
3500
+
3501
+ self.demulxy = 0;
3502
+
3503
+ self.lastscrollx = self.nc.getScrollLeft();
3504
+ self.chkx = self.lastscrollx;
3505
+ self.lastscrolly = self.nc.getScrollTop();
3506
+ self.chky = self.lastscrolly;
3507
+
3508
+ var nx = self.lastscrollx;
3509
+ var ny = self.lastscrolly;
3510
+
3511
+ var onscroll = function () {
3512
+ var df = ((now() - t) > 600) ? 0.04 : 0.02;
3513
+
3514
+ if (self.speedx) {
3515
+ nx = Math.floor(self.lastscrollx - (self.speedx * (1 - self.demulxy)));
3516
+ self.lastscrollx = nx;
3517
+ if ((nx < 0) || (nx > pagew)) df = 0.10;
3518
+ }
3519
+
3520
+ if (self.speedy) {
3521
+ ny = Math.floor(self.lastscrolly - (self.speedy * (1 - self.demulxy)));
3522
+ self.lastscrolly = ny;
3523
+ if ((ny < 0) || (ny > pageh)) df = 0.10;
3524
+ }
3525
+
3526
+ self.demulxy = Math.min(1, self.demulxy + df);
3527
+
3528
+ self.nc.synched("domomentum2d", function () {
3529
+
3530
+ if (self.speedx) {
3531
+ var scx = self.nc.getScrollLeft();
3532
+ // if (scx != self.chkx) self.stop();
3533
+ self.chkx = nx;
3534
+ self.nc.setScrollLeft(nx);
3535
+ }
3536
+
3537
+ if (self.speedy) {
3538
+ var scy = self.nc.getScrollTop();
3539
+ // if (scy != self.chky) self.stop();
3540
+ self.chky = ny;
3541
+ self.nc.setScrollTop(ny);
3542
+ }
3543
+
3544
+ if (!self.timer) {
3545
+ self.nc.hideCursor();
3546
+ self.doSnapy(nx, ny);
3547
+ }
3548
+
3549
+ });
3550
+
3551
+ if (self.demulxy < 1) {
3552
+ self.timer = setTimeout(onscroll, tm);
3553
+ } else {
3554
+ self.stop();
3555
+ self.nc.hideCursor();
3556
+ self.doSnapy(nx, ny);
3557
+ }
3558
+ };
3559
+
3560
+ onscroll();
3561
+
3562
+ } else {
3563
+ self.doSnapy(self.nc.getScrollLeft(), self.nc.getScrollTop());
3564
+ }
3565
+
3566
+ };
3567
+
3568
+ };
3569
+
3570
+
3571
+ // override jQuery scrollTop
3572
+ var _scrollTop = jQuery.fn.scrollTop; // preserve original function
3573
+
3574
+ jQuery.cssHooks.pageYOffset = {
3575
+ get: function (elem, computed, extra) {
3576
+ var nice = $.data(elem, '__nicescroll') || false;
3577
+ return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(elem);
3578
+ },
3579
+ set: function (elem, value) {
3580
+ var nice = $.data(elem, '__nicescroll') || false;
3581
+ (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call(elem, value);
3582
+ return this;
3583
+ }
3584
+ };
3585
+
3586
+ jQuery.fn.scrollTop = function (value) {
3587
+ if (value === undefined) {
3588
+ var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
3589
+ return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(this);
3590
+ } else {
3591
+ return this.each(function () {
3592
+ var nice = $.data(this, '__nicescroll') || false;
3593
+ (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call($(this), value);
3594
+ });
3595
+ }
3596
+ };
3597
+
3598
+ // override jQuery scrollLeft
3599
+ var _scrollLeft = jQuery.fn.scrollLeft; // preserve original function
3600
+
3601
+ $.cssHooks.pageXOffset = {
3602
+ get: function (elem, computed, extra) {
3603
+ var nice = $.data(elem, '__nicescroll') || false;
3604
+ return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(elem);
3605
+ },
3606
+ set: function (elem, value) {
3607
+ var nice = $.data(elem, '__nicescroll') || false;
3608
+ (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call(elem, value);
3609
+ return this;
3610
+ }
3611
+ };
3612
+
3613
+ jQuery.fn.scrollLeft = function (value) {
3614
+ if (value === undefined) {
3615
+ var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
3616
+ return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(this);
3617
+ } else {
3618
+ return this.each(function () {
3619
+ var nice = $.data(this, '__nicescroll') || false;
3620
+ (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call($(this), value);
3621
+ });
3622
+ }
3623
+ };
3624
+
3625
+ var NiceScrollArray = function (doms) {
3626
+ var self = this;
3627
+ this.length = 0;
3628
+ this.name = "nicescrollarray";
3629
+
3630
+ this.each = function (fn) {
3631
+ $.each(self, fn);
3632
+ return self;
3633
+ };
3634
+
3635
+ this.push = function (nice) {
3636
+ self[self.length] = nice;
3637
+ self.length++;
3638
+ };
3639
+
3640
+ this.eq = function (idx) {
3641
+ return self[idx];
3642
+ };
3643
+
3644
+ if (doms) {
3645
+ for (var a = 0; a < doms.length; a++) {
3646
+ var nice = $.data(doms[a], '__nicescroll') || false;
3647
+ if (nice) {
3648
+ this[this.length] = nice;
3649
+ this.length++;
3650
+ }
3651
+ }
3652
+ }
3653
+
3654
+ return this;
3655
+ };
3656
+
3657
+ function mplex(el, lst, fn) {
3658
+ for (var a = 0, l = lst.length; a < l; a++) fn(el, lst[a]);
3659
+ }
3660
+ mplex(
3661
+ NiceScrollArray.prototype, ['show', 'hide', 'toggle', 'onResize', 'resize', 'remove', 'stop', 'doScrollPos'],
3662
+ function (e, n) {
3663
+ e[n] = function () {
3664
+ var args = arguments;
3665
+ return this.each(function () {
3666
+ this[n].apply(this, args);
3667
+ });
3668
+ };
3669
+ }
3670
+ );
3671
+
3672
+ jQuery.fn.getNiceScroll = function (index) {
3673
+ if (index === undefined) {
3674
+ return new NiceScrollArray(this);
3675
+ } else {
3676
+ return this[index] && $.data(this[index], '__nicescroll') || false;
3677
+ }
3678
+ };
3679
+
3680
+ var pseudos = jQuery.expr.pseudos || jQuery.expr[':']; // jQuery 3 migration
3681
+ pseudos.nicescroll = function (a) {
3682
+ return $.data(a, '__nicescroll') !== undefined;
3683
+ };
3684
+
3685
+ $.fn.niceScroll = function (wrapper, _opt) {
3686
+ if (_opt === undefined && typeof wrapper == "object" && !("jquery" in wrapper)) {
3687
+ _opt = wrapper;
3688
+ wrapper = false;
3689
+ }
3690
+
3691
+ var ret = new NiceScrollArray();
3692
+
3693
+ this.each(function () {
3694
+ var $this = $(this);
3695
+
3696
+ var opt = $.extend({}, _opt); // cloning
3697
+
3698
+ if (wrapper || false) {
3699
+ var wrp = $(wrapper);
3700
+ opt.doc = (wrp.length > 1) ? $(wrapper, $this) : wrp;
3701
+ opt.win = $this;
3702
+ }
3703
+ var docundef = !("doc" in opt);
3704
+ if (!docundef && !("win" in opt)) opt.win = $this;
3705
+
3706
+ var nice = $this.data('__nicescroll') || false;
3707
+ if (!nice) {
3708
+ opt.doc = opt.doc || $this;
3709
+ nice = new NiceScrollClass(opt, $this);
3710
+ $this.data('__nicescroll', nice);
3711
+ }
3712
+ ret.push(nice);
3713
+ });
3714
+
3715
+ return (ret.length === 1) ? ret[0] : ret;
3716
+ };
3717
+
3718
+ _win.NiceScroll = {
3719
+ getjQuery: function () {
3720
+ return jQuery;
3721
+ }
3722
+ };
3723
+
3724
+ if (!$.nicescroll) {
3725
+ $.nicescroll = new NiceScrollArray();
3726
+ $.nicescroll.options = _globaloptions;
3727
+ }
3728
+
3729
+ }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/nicescroll/jquery.nicescroll.min.js CHANGED
@@ -1 +1,2 @@
1
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";var E=!1,M=!1,L=0,C=2e3,N=0,P=e,R=document,_=window,I=P(_),O=[];var Y=_.requestAnimationFrame||_.webkitRequestAnimationFrame||_.mozRequestAnimationFrame||!1,H=_.cancelAnimationFrame||_.webkitCancelAnimationFrame||_.mozCancelAnimationFrame||!1;if(Y)_.cancelAnimationFrame||(H=function(e){});else{var s=0;Y=function(e,o){var t=(new Date).getTime(),r=Math.max(0,16-(t-s)),i=_.setTimeout(function(){e(t+r)},r);return s=t+r,i},H=function(e){_.clearTimeout(e)}}function B(){if(i)return i;var e=R.createElement("DIV"),s=e.style,o=navigator.userAgent,t=navigator.platform,n={};return n.haspointerlock="pointerLockElement"in R||"webkitPointerLockElement"in R||"mozPointerLockElement"in R,n.isopera="opera"in _,n.isopera12=n.isopera&&"getUserMedia"in navigator,n.isoperamini="[object OperaMini]"===Object.prototype.toString.call(_.operamini),n.isie="all"in R&&"attachEvent"in e&&!n.isopera,n.isieold=n.isie&&!("msInterpolationMode"in s),n.isie7=n.isie&&!n.isieold&&(!("documentMode"in R)||7===R.documentMode),n.isie8=n.isie&&"documentMode"in R&&8===R.documentMode,n.isie9=n.isie&&"performance"in _&&9===R.documentMode,n.isie10=n.isie&&"performance"in _&&10===R.documentMode,n.isie11="msRequestFullscreen"in e&&11<=R.documentMode,n.ismsedge="msCredentials"in _,n.ismozilla="MozAppearance"in s,n.iswebkit=!n.ismsedge&&"WebkitAppearance"in s,n.ischrome=n.iswebkit&&"chrome"in _,n.ischrome38=n.ischrome&&"touchAction"in s,n.ischrome22=!n.ischrome38&&n.ischrome&&n.haspointerlock,n.ischrome26=!n.ischrome38&&n.ischrome&&"transition"in s,n.cantouch="ontouchstart"in R.documentElement||"ontouchstart"in _,n.hasw3ctouch=!!_.PointerEvent&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints),n.hasmstouch=!n.hasw3ctouch&&(_.MSPointerEvent||!1),n.ismac=/^mac$/i.test(t),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(t),n.isios4=n.isios&&!("seal"in Object),n.isios7=n.isios&&"webkitHidden"in R,n.isios8=n.isios&&"hidden"in R,n.isios10=n.isios&&_.Proxy,n.isandroid=/android/i.test(o),n.haseventlistener="addEventListener"in e,n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1,n.trstyle="transform",n.hastransform="transform"in s||function(){for(var e=["msTransform","webkitTransform","MozTransform","OTransform"],o=0,t=e.length;o<t;o++)if(void 0!==s[e[o]]){n.trstyle=e[o];break}n.hastransform=!!n.trstyle}(),n.hastransform&&(s[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(s[n.trstyle])),n.transitionstyle="transition",n.prefixstyle="",n.transitionend="transitionend",n.hastransition="transition"in s||function(){n.transitionend=!1;for(var e=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],o=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],t=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"],r=0,i=e.length;r<i;r++)if(e[r]in s){n.transitionstyle=e[r],n.prefixstyle=o[r],n.transitionend=t[r];break}n.ischrome26&&(n.prefixstyle=o[1]),n.hastransition=n.transitionstyle}(),n.cursorgrabvalue=function(){var e=["grab","-webkit-grab","-moz-grab"];(n.ischrome&&!n.ischrome38||n.isie)&&(e=[]);for(var o=0,t=e.length;o<t;o++){var r=e[o];if(s.cursor=r,s.cursor==r)return r}return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}(),n.hasmousecapture="setCapture"in e,n.hasMutationObserver=!1!==X,e=null,i=n}function l(e,o){var b=this;this.version="3.7.6",this.name="nicescroll",this.me=o;var y=P("body"),x=this.opt={doc:y,win:!1};if(P.extend(x,A),x.snapbackspeed=80,e)for(var t in x)void 0!==e[t]&&(x[t]=e[t]);if(x.disablemutationobserver&&(X=!1),this.doc=x.doc,this.iddoc=this.doc&&this.doc[0]&&this.doc[0].id||"",this.ispage=/^BODY|HTML/.test(x.win?x.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==x.win,this.win=x.win||(this.ispage?I:this.doc),this.docscroll=this.ispage&&!this.haswrapper?I:this.win,this.body=y,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=x.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==x.rtlmode){var r=this.win[0]==_?this.body:this.win,i=r.css("writing-mode")||r.css("-webkit-writing-mode")||r.css("-ms-writing-mode")||r.css("-moz-writing-mode");"horizontal-tb"==i||"lr-tb"==i||""===i?(this.isrtlmode="rtl"==r.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==i||"tb"==i||"tb-rl"==i||"rl-tb"==i,this.isvertical="vertical-rl"==i||"tb"==i||"tb-rl"==i)}else this.isrtlmode=!0===x.rtlmode,this.isvertical=!1;if(this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,(this.observerbody=!1)!==x.scrollbarid)this.id=x.scrollbarid;else for(;this.id="ascrail"+C++,R.getElementById(this.id););this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=x.overflowx,this.overflowy=x.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=B();var S=P.extend({},this.detected);function d(e,o,t,r,i,s,n){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=s||0,this.p4=n||1,this.ts=D(),this.df=o-e}function s(){var e=b.doc.css(S.trstyle);return!(!e||"matrix"!=e.substr(0,6))&&e.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}if(this.canhwscroll=S.hastransform&&x.hwacceleration,this.ishwscroll=this.canhwscroll&&b.haswrapper,this.isrtlmode?this.isvertical?this.hasreversehr=!(S.iswebkit||S.isie||S.isie11):this.hasreversehr=!(S.iswebkit||S.isie&&!S.isie10&&!S.isie11):this.hasreversehr=!1,this.istouchcapable=!1,(S.cantouch||!S.hasw3ctouch&&!S.hasmstouch)&&(!S.cantouch||S.isios||S.isandroid||!S.iswebkit&&!S.ismozilla)||(this.istouchcapable=!0),x.enablemouselockapi||(S.hasmousecapture=!1,S.haspointerlock=!1),this.debounced=function(e,o,t){b&&(b.delaylist[e]||!1||(b.delaylist[e]={h:Y(function(){b.delaylist[e].fn.call(b),b.delaylist[e]=!1},t)},o.call(b)),b.delaylist[e].fn=o)},this.synched=function(e,o){b.synclist[e]?b.synclist[e]=o:(b.synclist[e]=o,Y(function(){b&&(b.synclist[e]&&b.synclist[e].call(b),b.synclist[e]=null)}))},this.unsynched=function(e){b.synclist[e]&&(b.synclist[e]=!1)},this.css=function(e,o){for(var t in o)b.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrollTop=function(e){return void 0===e?b.getScrollTop():b.setScrollTop(e)},this.scrollLeft=function(e){return void 0===e?b.getScrollLeft():b.setScrollLeft(e)},d.prototype={B2:function(e){return 3*(1-e)*(1-e)*e},B3:function(e){return 3*(1-e)*e*e},B4:function(e){return e*e*e},getPos:function(){return(D()-this.ts)/this.spd},getNow:function(){var e=(D()-this.ts)/this.spd,o=this.B2(e)+this.B3(e)+this.B4(e);return 1<=e?this.ed:this.st+this.df*o|0},update:function(e,o){return this.st=this.getNow(),this.ed=e,this.spd=o,this.ts=D(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},S.hastranslate3d&&S.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(e){if(!e){var o=s();if(o)return 16==o.length?-o[13]:-o[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y},this.getScrollLeft=function(e){if(!e){var o=s();if(o)return 16==o.length?-o[12]:-o[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x},this.notifyScrollEvent=function(e){var o=R.createEvent("UIEvents");o.initUIEvent("scroll",!1,!1,_,1),o.niceevent=!0,e.dispatchEvent(o)};var n=this.isrtlmode?1:-1;S.hastranslate3d&&x.enabletranslate3d?(this.setScrollTop=function(e,o){b.doc.translate.y=e,b.doc.translate.ty=-1*e+"px",b.doc.css(S.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)"),o||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(e,o){b.doc.translate.x=e,b.doc.translate.tx=e*n+"px",b.doc.css(S.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)"),o||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(e,o){b.doc.translate.y=e,b.doc.translate.ty=-1*e+"px",b.doc.css(S.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")"),o||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(e,o){b.doc.translate.x=e,b.doc.translate.tx=e*n+"px",b.doc.css(S.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")"),o||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(e){b.docscroll.scrollTop(e)},this.getScrollLeft=function(){return b.hasreversehr?b.detected.ismozilla?b.page.maxw-Math.abs(b.docscroll.scrollLeft()):b.page.maxw-b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(e){return setTimeout(function(){if(b)return b.hasreversehr&&(e=b.detected.ismozilla?-(b.page.maxw-e):b.page.maxw-e),b.docscroll.scrollLeft(e)},1)};this.getTarget=function(e){return!!e&&(e.target?e.target:!!e.srcElement&&e.srcElement)},this.hasParent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcElement||e||!1;t&&t.id!=o;)t=t.parentNode||!1;return!1!==t};var l={thin:1,medium:3,thick:5};function a(e,o,t){var r=e.css(o),i=parseFloat(r);if(isNaN(i)){var s=3==(i=l[r]||0)?t?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1;return b.isie8&&i&&(i+=1),s?i:0}return i}this.getDocumentScrollOffset=function(){return{top:_.pageYOffset||R.documentElement.scrollTop,left:_.pageXOffset||R.documentElement.scrollLeft}},this.getOffset=function(){if(b.isfixed){var e=b.win.offset(),o=b.getDocumentScrollOffset();return e.top-=o.top,e.left-=o.left,e}var t=b.win.offset();if(!b.viewport)return t;var r=b.viewport.offset();return{top:t.top-r.top,left:t.left-r.left}},this.updateScrollBar=function(e){var o,t;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(x.railpadding.top+x.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-(x.railpadding.left+x.railpadding.right)});else{var r=b.getOffset();if((o={top:r.top,left:r.left-(x.railpadding.left+x.railpadding.right)}).top+=a(b.win,"border-top-width",!0),o.left+=b.rail.align?b.win.outerWidth()-a(b.win,"border-right-width")-b.rail.width:a(b.win,"border-left-width"),(t=x.railoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left)),b.railslocked||b.rail.css({top:o.top,left:o.left,height:(e?e.h:b.win.innerHeight())-(x.railpadding.top+x.railpadding.bottom)}),b.zoom&&b.zoom.css({top:o.top+1,left:1==b.rail.align?o.left-20:o.left+b.rail.width+4}),b.railh&&!b.railslocked){o={top:r.top,left:r.left},(t=x.railhoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left));var i=b.railh.align?o.top+a(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:o.top+a(b.win,"border-top-width",!0),s=o.left+a(b.win,"border-left-width");b.railh.css({top:i-(x.railpadding.top+x.railpadding.bottom),left:s,width:b.railh.width})}}},this.doRailClick=function(e,o,t){var r,i,s,n;b.railslocked||(b.cancelEvent(e),"pageY"in e||(e.pageX=e.clientX+R.documentElement.scrollLeft,e.pageY=e.clientY+R.documentElement.scrollTop),o?(r=t?b.doScrollLeft:b.doScrollTop,s=t?(e.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(e.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y,b.unsynched("relativexy"),r(0|s)):(r=t?b.doScrollLeftBy:b.doScrollBy,s=t?b.scroll.x:b.scroll.y,n=t?e.pageX-b.railh.offset().left:e.pageY-b.rail.offset().top,i=t?b.view.w:b.view.h,r(n<=s?i:-i)))},b.newscrolly=b.newscrollx=0,b.hasanimationframe="requestAnimationFrame"in _,b.hascancelanimationframe="cancelAnimationFrame"in _,b.hasborderbox=!1,this.init=function(){if(b.saved.css=[],S.isoperamini)return!0;if(S.isandroid&&!("hidden"in R))return!0;x.emulatetouch=x.emulatetouch||x.touchbehavior,b.hasborderbox=_.getComputedStyle&&"border-box"===_.getComputedStyle(R.body)["box-sizing"];var t={"overflow-y":"hidden"};if((S.isie11||S.isie10)&&(t["-ms-overflow-style"]="none"),b.ishwscroll&&(this.doc.css(S.transitionstyle,S.prefixstyle+"transform 0ms ease-out"),S.transitionend&&b.bind(b.doc,S.transitionend,b.onScrollTransitionEnd,!1)),b.zindex="auto",b.ispage||"auto"!=x.zindex?b.zindex=x.zindex:b.zindex=function(){var e=b.win;if("zIndex"in e)return e.zIndex();for(;0<e.length;){if(9==e[0].nodeType)return!1;var o=e.css("zIndex");if(!isNaN(o)&&0!==o)return parseInt(o);e=e.parent()}return!1}()||"auto",!b.ispage&&"auto"!=b.zindex&&b.zindex>N&&(N=b.zindex),b.isie&&0===b.zindex&&"auto"==x.zindex&&(b.zindex="auto"),!b.ispage||!S.isieold){var e=b.docscroll;b.ispage&&(e=b.haswrapper?b.win:b.doc),b.css(e,t),b.ispage&&(S.isie11||S.isie)&&b.css(P("html"),t),!S.isios||b.ispage||b.haswrapper||b.css(y,{"-webkit-overflow-scrolling":"touch"});var o=P(R.createElement("div"));o.css({position:"relative",top:0,float:"right",width:x.cursorwidth,height:0,"background-color":x.cursorcolor,border:x.cursorborder,"background-clip":"padding-box","-webkit-border-radius":x.cursorborderradius,"-moz-border-radius":x.cursorborderradius,"border-radius":x.cursorborderradius}),o.addClass("nicescroll-cursors"),b.cursor=o;var r=P(R.createElement("div"));r.attr("id",b.id),r.addClass("nicescroll-rails nicescroll-rails-vr");var i,s,n=["left","right","top","bottom"];for(var l in n)s=n[l],(i=x.railpadding[s]||0)&&r.css("padding-"+s,i+"px");r.append(o),r.width=Math.max(parseFloat(x.cursorwidth),o.outerWidth()),r.css({width:r.width+"px",zIndex:b.zindex,background:x.background,cursor:"default"}),r.visibility=!0,r.scrollable=!0,r.align="left"==x.railalign?0:1,b.rail=r;var a,c=b.rail.drag=!1;if(!x.boxzoom||b.ispage||S.isieold||(c=R.createElement("div"),b.bind(c,"click",b.doZoom),b.bind(c,"mouseenter",function(){b.zoom.css("opacity",x.cursoropacitymax)}),b.bind(c,"mouseleave",function(){b.zoom.css("opacity",x.cursoropacitymin)}),b.zoom=P(c),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+x.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),x.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),S.cantouch&&x.gesturezoom&&(b.ongesturezoom=function(e){return 1.5<e.scale&&b.doZoomIn(e),e.scale<.8&&b.doZoomOut(e),b.cancelEvent(e)},b.bind(b.win,"gestureend",b.ongesturezoom))),b.railh=!1,x.horizrailenabled&&(b.css(e,{overflowX:"hidden"}),(o=P(R.createElement("div"))).css({position:"absolute",top:0,height:x.cursorwidth,width:0,backgroundColor:x.cursorcolor,border:x.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":x.cursorborderradius,"-moz-border-radius":x.cursorborderradius,"border-radius":x.cursorborderradius}),S.isieold&&o.css("overflow","hidden"),o.addClass("nicescroll-cursors"),b.cursorh=o,(a=P(R.createElement("div"))).attr("id",b.id+"-hr"),a.addClass("nicescroll-rails nicescroll-rails-hr"),a.height=Math.max(parseFloat(x.cursorwidth),o.outerHeight()),a.css({height:a.height+"px",zIndex:b.zindex,background:x.background}),a.append(o),a.visibility=!0,a.scrollable=!0,a.align="top"==x.railvalign?0:1,b.railh=a,b.railh.drag=!1),b.ispage)r.css({position:"fixed",top:0,height:"100%"}),r.css(r.align?{right:0}:{left:0}),b.body.append(r),b.railh&&(a.css({position:"fixed",left:0,width:"100%"}),a.css(a.align?{bottom:0}:{top:0}),b.body.append(a));else{if(b.ishwscroll){"static"==b.win.css("position")&&b.css(b.win,{position:"relative"});var d="HTML"==b.win[0].nodeName?b.body:b.win;P(d).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":r.width+4}),d.append(b.zoom)),r.css({position:"absolute",top:0}),r.css(r.align?{right:0}:{left:0}),d.append(r),a&&(a.css({position:"absolute",left:0,bottom:0}),a.css(a.align?{bottom:0}:{top:0}),d.append(a))}else{b.isfixed="fixed"==b.win.css("position");var u=b.isfixed?"fixed":"absolute";b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,/fixed|absolute/.test(b.viewport.css("position"))||b.css(b.viewport,{position:"relative"})),r.css({position:u}),b.zoom&&b.zoom.css({position:u}),b.updateScrollBar(),b.body.append(r),b.zoom&&b.body.append(b.zoom),b.railh&&(a.css({position:u}),b.body.append(a))}S.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),x.disableoutline&&(S.isie&&b.win.attr("hideFocus","true"),S.iswebkit&&b.win.css("outline","none"))}if(!1===x.autohidemode?(b.autohidedom=!1,b.rail.css({opacity:x.cursoropacitymax}),b.railh&&b.railh.css({opacity:x.cursoropacitymax})):!0===x.autohidemode||"leave"===x.autohidemode?(b.autohidedom=P().add(b.rail),S.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&S.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"scroll"==x.autohidemode?(b.autohidedom=P().add(b.rail),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh))):"cursor"==x.autohidemode?(b.autohidedom=P().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"hidden"==x.autohidemode&&(b.autohidedom=!1,b.hide(),b.railslocked=!1),S.cantouch||b.istouchcapable||x.emulatetouch||S.hasmstouch){b.scrollmom=new q(b);b.ontouchstart=function(e){if(b.locked)return!1;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;if(b.hasmoving=!1,b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop()),!b.railslocked){var o=b.getTarget(e);if(o)if(/INPUT/i.test(o.nodeName)&&/range/i.test(o.type))return b.stopPropagation(e);var t="mousedown"===e.type;if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),b.forcescreen){var r=e;(e={original:e.original?e.original:e}).clientX=r.screenX,e.clientY=r.screenY}if(b.rail.drag={x:e.clientX,y:e.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:o},b.ispage||!x.directionlockdeadzone)b.rail.drag.dl="f";else{var i=I.width(),s=I.height(),n=b.getContentSize(),l=n.h-s,a=n.w-i;b.rail.scrollable&&!b.railh.scrollable?b.rail.drag.ck=0<l&&"v":!b.rail.scrollable&&b.railh.scrollable?b.rail.drag.ck=0<a&&"h":b.rail.drag.ck=!1}if(x.emulatetouch&&b.isiframe&&S.isie){var c=b.win.position();b.rail.drag.x+=c.left,b.rail.drag.y+=c.top}if(b.hasmoving=!1,b.lastmouseup=!1,b.scrollmom.reset(e.clientX,e.clientY),o&&t){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(o.nodeName))return S.hasmousecapture&&o.setCapture(),x.emulatetouch?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){if(b.hasmoving)return!1;o._onclick.call(this,e)}),b.cancelEvent(e)):b.stopPropagation(e);/SUBMIT|CANCEL|BUTTON/i.test(P(o).attr("type"))&&(b.preventclick={tg:o,click:!1})}}},b.ontouchend=function(e){if(!b.rail.drag)return!0;if(2==b.rail.drag.pt){if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var o="mouseup"===e.type;if(b.hasmoving&&(b.scrollmom.doMomentum(),b.lastmouseup=!0,b.hideCursor(),S.hasmousecapture&&R.releaseCapture(),o))return b.cancelEvent(e)}else if(1==b.rail.drag.pt)return b.onmouseup(e)};var m=x.emulatetouch&&b.isiframe&&!S.hasmousecapture,f=.3*x.directionlockdeadzone|0;b.ontouchmove=function(e,o){if(!b.rail.drag)return!0;if(e.targetTouches&&x.preventmultitouchscrolling&&1<e.targetTouches.length)return!0;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!0;if(2!=b.rail.drag.pt)return 1==b.rail.drag.pt?b.onmousemove(e):void 0;var t,r;if("changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),r=t=0,m&&!o){var i=b.win.position();r=-i.left,t=-i.top}var s=e.clientY+t,n=s-b.rail.drag.y,l=e.clientX+r,a=l-b.rail.drag.x,c=b.rail.drag.st-n;if(b.ishwscroll&&x.bouncescroll)c<0?c=Math.round(c/2):c>b.page.maxh&&(c=b.page.maxh+Math.round((c-b.page.maxh)/2));else if(c<0?s=c=0:c>b.page.maxh&&(c=b.page.maxh,s=0),0===s&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var d=b.getScrollLeft();if(b.railh&&b.railh.scrollable&&(d=b.isrtlmode?a-b.rail.drag.sl:b.rail.drag.sl-a,b.ishwscroll&&x.bouncescroll?d<0?d=Math.round(d/2):d>b.page.maxw&&(d=b.page.maxw+Math.round((d-b.page.maxw)/2)):(d<0&&(l=d=0),d>b.page.maxw&&(d=b.page.maxw,l=0))),!b.hasmoving){if(b.rail.drag.y===e.clientY&&b.rail.drag.x===e.clientX)return b.cancelEvent(e);var u=Math.abs(n),h=Math.abs(a),p=x.directionlockdeadzone;if(b.rail.drag.ck?"v"==b.rail.drag.ck?p<h&&u<=f?b.rail.drag=!1:p<u&&(b.rail.drag.dl="v"):"h"==b.rail.drag.ck&&(p<u&&h<=f?b.rail.drag=!1:p<h&&(b.rail.drag.dl="h")):p<u&&p<h?b.rail.drag.dl="f":p<u?b.rail.drag.dl=f<h?"f":"v":p<h&&(b.rail.drag.dl=f<u?"f":"h"),!b.rail.drag.dl)return b.cancelEvent(e);b.triggerScrollStart(e.clientX,e.clientY,0,0,0),b.hasmoving=!0}return b.preventclick&&!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick),b.rail.drag.dl&&("v"==b.rail.drag.dl?d=b.rail.drag.sl:"h"==b.rail.drag.dl&&(c=b.rail.drag.st)),b.synched("touchmove",function(){b.rail.drag&&2==b.rail.drag.pt&&(b.prepareTransition&&b.resetTransition(),b.rail.scrollable&&b.setScrollTop(c),b.scrollmom.update(l,s),b.railh&&b.railh.scrollable?(b.setScrollLeft(d),b.showCursor(c,d)):b.showCursor(c),S.isie10&&R.selection.clear())}),b.cancelEvent(e)},b.ontouchstartCursor=function(e,o){if(!b.rail.drag||3==b.rail.drag.pt){if(b.locked)return b.cancelEvent(e);b.cancelScroll(),b.rail.drag={x:e.touches[0].clientX,y:e.touches[0].clientY,sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!o};var t=b.getTarget(e);return!b.ispage&&S.hasmousecapture&&t.setCapture(),b.isiframe&&!S.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"})),b.cancelEvent(e)}},b.ontouchendCursor=function(e){if(b.rail.drag){if(S.hasmousecapture&&R.releaseCapture(),b.isiframe&&!S.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),3!=b.rail.drag.pt)return;return b.rail.drag=!1,b.cancelEvent(e)}},b.ontouchmoveCursor=function(e){if(b.rail.drag){if(3!=b.rail.drag.pt)return;if(b.cursorfreezed=!0,b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(e.touches[0].clientX-b.rail.drag.x),b.scroll.x<0&&(b.scroll.x=0);var o=b.scrollvaluemaxw;b.scroll.x>o&&(b.scroll.x=o)}else{b.scroll.y=b.rail.drag.sy+(e.touches[0].clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0);var t=b.scrollvaluemax;b.scroll.y>t&&(b.scroll.y=t)}return b.synched("touchmove",function(){b.rail.drag&&3==b.rail.drag.pt&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*b.scrollratio.x),x.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),x.cursordragspeed))}),b.cancelEvent(e)}}}if(b.onmousedown=function(e,o){if(!b.rail.drag||1==b.rail.drag.pt){if(b.railslocked)return b.cancelEvent(e);b.cancelScroll(),b.rail.drag={x:e.clientX,y:e.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:o||!1};var t=b.getTarget(e);return S.hasmousecapture&&t.setCapture(),b.isiframe&&!S.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"})),b.hasmoving=!1,b.cancelEvent(e)}},b.onmouseup=function(e){if(b.rail.drag)return 1!=b.rail.drag.pt||(S.hasmousecapture&&R.releaseCapture(),b.isiframe&&!S.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag=!1,b.cursorfreezed=!1,b.hasmoving&&b.triggerScrollEnd(),b.cancelEvent(e))},b.onmousemove=function(e){if(b.rail.drag){if(1!==b.rail.drag.pt)return;if(S.ischrome&&0===e.which)return b.onmouseup(e);if(b.cursorfreezed=!0,b.hasmoving||b.triggerScrollStart(e.clientX,e.clientY,0,0,0),b.hasmoving=!0,b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(e.clientX-b.rail.drag.x),b.scroll.x<0&&(b.scroll.x=0);var o=b.scrollvaluemaxw;b.scroll.x>o&&(b.scroll.x=o)}else{b.scroll.y=b.rail.drag.sy+(e.clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0);var t=b.scrollvaluemax;b.scroll.y>t&&(b.scroll.y=t)}return b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))}),b.cancelEvent(e)}b.checkarea=0},S.cantouch||x.emulatetouch)b.onpreventclick=function(e){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(e)},b.onclick=!S.isios&&function(e){return!b.lastmouseup||(b.lastmouseup=!1,b.cancelEvent(e))},x.grabcursorenabled&&S.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:S.cursorgrabvalue}),b.css(b.rail,{cursor:S.cursorgrabvalue}));else{var h=function(e){if(b.selectiondrag){if(e){var o=b.win.outerHeight(),t=e.pageY-b.selectiondrag.top;0<t&&t<o&&(t=0),o<=t&&(t-=o),b.selectiondrag.df=t}if(0!==b.selectiondrag.df){var r=-2*b.selectiondrag.df/6|0;b.doScrollBy(r),b.debounced("doselectionscroll",function(){h()},50)}}};b.hasTextSelected="getSelection"in R?function(){return 0<R.getSelection().rangeCount}:"selection"in R?function(){return"None"!=R.selection.type}:function(){return!1},b.onselectionstart=function(e){b.ispage||(b.selectiondrag=b.win.offset())},b.onselectionend=function(e){b.selectiondrag=!1},b.onselectiondrag=function(e){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){h(e)},250)}}if(S.hasw3ctouch?(b.css(b.ispage?P("html"):b.win,{"touch-action":"none"}),b.css(b.rail,{"touch-action":"none"}),b.css(b.cursor,{"touch-action":"none"}),b.bind(b.win,"pointerdown",b.ontouchstart),b.bind(R,"pointerup",b.ontouchend),b.delegate(R,"pointermove",b.ontouchmove)):S.hasmstouch?(b.css(b.ispage?P("html"):b.win,{"-ms-touch-action":"none"}),b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(R,"MSPointerUp",b.ontouchend),b.delegate(R,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(e){e.preventDefault()}),b.bind(b.cursor,"contextmenu",function(e){e.preventDefault()})):S.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(R,"touchend",b.ontouchend,!1,!0),b.bind(R,"touchcancel",b.ontouchend,!1,!0),b.delegate(R,"touchmove",b.ontouchmove,!1,!0)),x.emulatetouch&&(b.bind(b.win,"mousedown",b.ontouchstart,!1,!0),b.bind(R,"mouseup",b.ontouchend,!1,!0),b.bind(R,"mousemove",b.ontouchmove,!1,!0)),!x.cursordragontouch&&(S.cantouch||x.emulatetouch)||(b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),b.jqbind(b.rail,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}),x.sensitiverail&&(b.bind(b.rail,"click",function(e){b.doRailClick(e,!1,!1)}),b.bind(b.rail,"dblclick",function(e){b.doRailClick(e,!0,!1)}),b.bind(b.cursor,"click",function(e){b.cancelEvent(e)}),b.bind(b.cursor,"dblclick",function(e){b.cancelEvent(e)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}),x.sensitiverail&&(b.bind(b.railh,"click",function(e){b.doRailClick(e,!1,!0)}),b.bind(b.railh,"dblclick",function(e){b.doRailClick(e,!0,!0)}),b.bind(b.cursorh,"click",function(e){b.cancelEvent(e)}),b.bind(b.cursorh,"dblclick",function(e){b.cancelEvent(e)})))),x.cursordragontouch&&(this.istouchcapable||S.cantouch)&&(b.bind(b.cursor,"touchstart",b.ontouchstartCursor),b.bind(b.cursor,"touchmove",b.ontouchmoveCursor),b.bind(b.cursor,"touchend",b.ontouchendCursor),b.cursorh&&b.bind(b.cursorh,"touchstart",function(e){b.ontouchstartCursor(e,!0)}),b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor)),x.emulatetouch||S.isandroid||S.isios?(b.bind(S.hasmousecapture?b.win:R,"mouseup",b.ontouchend),b.onclick&&b.bind(R,"click",b.onclick),x.cursordragontouch?(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(e){b.onmousedown(e,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",function(e){e.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(e){e.preventDefault()}))):(b.bind(S.hasmousecapture?b.win:R,"mouseup",b.onmouseup),b.bind(R,"mousemove",b.onmousemove),b.onclick&&b.bind(R,"click",b.onclick),b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(e){b.onmousedown(e,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&x.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),b.bind(R,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(R,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}))),x.enablemousewheel&&(b.isiframe||b.mousewheel(S.isie&&b.ispage?R:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&b.mousewheel(b.railh,b.onmousewheelhr)),b.ispage||S.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++L}),b.bind(b.win,"focus",function(e){E=b.getTarget(e).id||b.getTarget(e)||!1,b.hasfocus=!0,b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(e){E=!1,b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(e){M=b.getTarget(e).id||b.getTarget(e)||!1,b.hasmousefocus=!0,b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(e){M=!1,b.hasmousefocus=!1,b.rail.drag||b.hideCursor()})),b.onkeypress=function(e){if(b.railslocked&&0===b.page.maxh)return!0;e=e||_.event;var o=b.getTarget(e);if(o&&/INPUT|TEXTAREA|SELECT|OPTION/.test(o.nodeName)&&(!(o.getAttribute("type")||o.type||!1)||!/submit|button|cancel/i.tp))return!0;if(P(o).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!E||b.ispage&&!E&&!M){var t=e.keyCode;if(b.railslocked&&27!=t)return b.cancelEvent(e);var r=e.ctrlKey||!1,i=e.shiftKey||!1,s=!1;switch(t){case 38:case 63233:b.doScrollBy(72),s=!0;break;case 40:case 63235:b.doScrollBy(-72),s=!0;break;case 37:case 63232:b.railh&&(r?b.doScrollLeft(0):b.doScrollLeftBy(72),s=!0);break;case 39:case 63234:b.railh&&(r?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),s=!0);break;case 33:case 63276:b.doScrollBy(b.view.h),s=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h),s=!0;break;case 36:case 63273:b.railh&&r?b.doScrollPos(0,0):b.doScrollTo(0),s=!0;break;case 35:case 63275:b.railh&&r?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh),s=!0;break;case 32:x.spacebarenabled&&(i?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),s=!0);break;case 27:b.zoomactive&&(b.doZoom(),s=!0)}if(s)return b.cancelEvent(e)}},x.enablekeyboard&&b.bind(R,S.isopera&&!S.isopera12?"keypress":"keydown",b.onkeypress),b.bind(R,"keydown",function(e){!e.ctrlKey&&1||(b.wheelprevented=!0)}),b.bind(R,"keyup",function(e){e.ctrlKey||!1||(b.wheelprevented=!1)}),b.bind(_,"blur",function(e){b.wheelprevented=!1}),b.bind(_,"resize",b.onscreenresize),b.bind(_,"orientationchange",b.onscreenresize),b.bind(_,"load",b.lazyResize),S.ischrome&&!b.ispage&&!b.haswrapper){var p=b.win.attr("style"),g=parseFloat(b.win.css("width"))+1;b.win.css("width",g),b.synched("chromefix",function(){b.win.attr("style",p)})}if(b.onAttributeChange=function(e){b.lazyResize(b.isieold?250:30)},x.enableobserver&&(b.isie11||!1===X||(b.observerbody=new X(function(e){if(e.forEach(function(e){if("attributes"==e.type)return y.hasClass("modal-open")&&y.hasClass("modal-dialog")&&!P.contains(P(".modal-dialog")[0],b.doc[0])?b.hide():b.show()}),b.me.clientWidth!=b.page.width||b.me.clientHeight!=b.page.height)return b.lazyResize(30)}),b.observerbody.observe(R.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var v=b.win[0];!1!==X?(b.observer=new X(function(e){e.forEach(b.onAttributeChange)}),b.observer.observe(v,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new X(function(e){e.forEach(function(e){if(0<e.removedNodes.length)for(var o in e.removedNodes)if(b&&e.removedNodes[o]===v)return b.remove()})}),b.observerremover.observe(v.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(v,S.isie&&!S.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),S.isie9&&v.attachEvent("onpropertychange",b.onAttributeChange),b.bind(v,"DOMNodeRemoved",function(e){e.target===v&&b.remove()}))}!b.ispage&&x.boxzoom&&b.bind(_,"resize",b.resizeZoom),b.istextarea&&(b.bind(b.win,"keydown",b.lazyResize),b.bind(b.win,"mouseup",b.lazyResize)),b.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var w=function(){var o;b.iframexd=!1;try{(o="contentDocument"in this?this.contentDocument:this.contentWindow._doc).domain}catch(e){o=!(b.iframexd=!0)}if(b.iframexd)return"console"in _&&console.log("NiceScroll error: policy restriced iframe"),!0;if(b.forcescreen=!0,b.isiframe&&(b.iframe={doc:P(o),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,b.iframe.body.scrollHeight)}},b.docscroll=P(b.iframe.body)),!S.isios&&x.iframeautoresize&&!b.isiframe){b.win.scrollTop(0),b.doc.height("");var e=Math.max(o.getElementsByTagName("html")[0].scrollHeight,o.body.scrollHeight);b.doc.height(e)}b.lazyResize(30),b.css(P(b.iframe.body),t),S.isios&&b.haswrapper&&b.css(P(o.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(o,"scroll",b.onscroll),x.enablemousewheel&&b.mousewheel(o,b.onmousewheel),x.enablekeyboard&&b.bind(o,S.isopera?"keypress":"keydown",b.onkeypress),S.cantouch?(b.bind(o,"touchstart",b.ontouchstart),b.bind(o,"touchmove",b.ontouchmove)):x.emulatetouch&&(b.bind(o,"mousedown",b.ontouchstart),b.bind(o,"mousemove",function(e){return b.ontouchmove(e,!0)}),x.grabcursorenabled&&S.cursorgrabvalue&&b.css(P(o.body),{cursor:S.cursorgrabvalue})),b.bind(o,"mouseup",b.ontouchend),b.zoom&&(x.dblclickzoom&&b.bind(o,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(o,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout(function(){w.call(b.doc[0],!1)},500),b.bind(this.doc,"load",w)}},this.showCursor=function(e,o){if(b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0),b.rail){if(b.autohidedom&&(b.autohidedom.stop().css({opacity:x.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&1==b.rail.drag.pt||(void 0!==e&&!1!==e&&(b.scroll.y=e/b.scrollratio.y|0),void 0!==o&&(b.scroll.x=o/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh){var t=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x;b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?t+b.rail.width:t}),b.cursoractive=!0}b.zoom&&b.zoom.stop().css({opacity:x.cursoropacitymax})}},this.hideCursor=function(e){b.cursortimeout||b.rail&&b.autohidedom&&(b.hasmousefocus&&"leave"===x.autohidemode||(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:x.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:x.cursoropacitymin}),b.cursoractive=!1),b.cursortimeout=0},e||x.hidecursordelay)))},this.noticeCursor=function(e,o,t){b.showCursor(o,t),b.rail.active||b.hideCursor(e)},this.getContentSize=b.ispage?function(){return{w:Math.max(R.body.scrollWidth,R.documentElement.scrollWidth),h:Math.max(R.body.scrollHeight,R.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc[0].offsetWidth,h:b.doc[0].offsetHeight}}:function(){return{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}},this.onResize=function(e,o){if(!b||!b.win)return!1;var t=b.page.maxh,r=b.page.maxw,i=b.view.h,s=b.view.w;if(b.view={w:b.ispage?b.win.width():b.win[0].clientWidth,h:b.ispage?b.win.height():b.win[0].clientHeight},b.page=o||b.getContentSize(),b.page.maxh=Math.max(0,b.page.h-b.view.h),b.page.maxw=Math.max(0,b.page.w-b.view.w),b.page.maxh==t&&b.page.maxw==r&&b.view.w==s&&b.view.h==i){if(b.ispage)return b;var n=b.win.offset();if(b.lastposition){var l=b.lastposition;if(l.top==n.top&&l.left==n.left)return b}b.lastposition=n}return 0===b.page.maxh?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=x.railpadding.top+x.railpadding.bottom,b.rail.scrollable=!0),0===b.page.maxw?(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh&&(b.railh.scrollable=!1)):(b.page.maxw-=x.railpadding.left+x.railpadding.right,b.railh&&(b.railh.scrollable=x.horizrailenabled)),b.railslocked=b.locked||0===b.page.maxh&&0===b.page.maxw,b.railslocked?(b.ispage||b.updateScrollBar(b.view),!1):(b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr()),b.istextarea&&b.win.css("resize")&&"none"!=b.win.css("resize")&&(b.view.h-=20),b.cursorheight=Math.min(b.view.h,Math.round(b.view.h*(b.view.h/b.page.h))),b.cursorheight=x.cursorfixedheight?x.cursorfixedheight:Math.max(x.cursorminheight,b.cursorheight),b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w*(b.view.w/b.page.w))),b.cursorwidth=x.cursorfixedheight?x.cursorfixedheight:Math.max(x.cursorminheight,b.cursorwidth),b.scrollvaluemax=b.view.h-b.cursorheight-(x.railpadding.top+x.railpadding.bottom),b.hasborderbox||(b.scrollvaluemax-=b.cursor[0].offsetHeight-b.cursor[0].clientHeight),b.railh&&(b.railh.width=0<b.page.maxh?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-(x.railpadding.left+x.railpadding.right)),b.ispage||b.updateScrollBar(b.view),b.scrollratio={x:b.page.maxw/b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax},b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor()),b.scroll.y&&0===b.getScrollTop()&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0),b)},this.resize=b.onResize;var c=0;function u(t,r,i,e){b._bind(t,r,function(e){var o={original:e=e||_.event,target:e.target||e.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==e.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return e.preventDefault?e.preventDefault():e.returnValue=!1,!1},stopImmediatePropagation:function(){e.stopImmediatePropagation?e.stopImmediatePropagation():e.cancelBubble=!0}};return"mousewheel"==r?(e.wheelDeltaX&&(o.deltaX=-.025*e.wheelDeltaX),e.wheelDeltaY&&(o.deltaY=-.025*e.wheelDeltaY),o.deltaY||o.deltaX||(o.deltaY=-.025*e.wheelDelta)):o.deltaY=e.detail,i.call(t,o)},e)}this.onscreenresize=function(e){clearTimeout(c);var o=!b.ispage&&!b.haswrapper;o&&b.hideRails(),c=setTimeout(function(){b&&(o&&b.showRails(),b.resize()),c=0},120)},this.lazyResize=function(e){return clearTimeout(c),e=isNaN(e)?240:e,c=setTimeout(function(){b&&b.resize(),c=0},e),b},this.jqbind=function(e,o,t){b.events.push({e:e,n:o,f:t,q:!0}),P(e).on(o,t)};var h=!(this.mousewheel=function(e,o,t){var r="jquery"in e?e[0]:e;if("onwheel"in R.createElement("div"))b._bind(r,"wheel",o,t||!1);else{var i=void 0!==R.onmousewheel?"mousewheel":"DOMMouseScroll";u(r,i,o,t||!1),"DOMMouseScroll"==i&&u(r,"MozMousePixelScroll",o,t||!1)}});if(S.haseventlistener){try{var p=Object.defineProperty({},"passive",{get:function(){h=!0}});_.addEventListener("test",null,p)}catch(e){}this.stopPropagation=function(e){return e&&(e=e.original?e.original:e).stopPropagation(),!1},this.cancelEvent=function(e){return e.cancelable&&e.preventDefault(),e.stopImmediatePropagation(),e.preventManipulation&&e.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},_.constructor.prototype.addEventListener=R.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(e,o,t){this.attachEvent("on"+e,o)},_.constructor.prototype.removeEventListener=R.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(e,o,t){this.detachEvent("on"+e,o)},this.cancelEvent=function(e){return(e=e||_.event)&&(e.cancelBubble=!0,e.cancel=!0,e.returnValue=!1),!1},this.stopPropagation=function(e){return(e=e||_.event)&&(e.cancelBubble=!0),!1};this.delegate=function(e,o,t,r,i){var s=O[o]||!1;s||(s={a:[],l:[],f:function(e){for(var o=s.l,t=!1,r=o.length-1;0<=r;r--)if(!1===(t=o[r].call(e.target,e)))return!1;return t}},b.bind(e,o,s.f,r,i),O[o]=s),b.ispage?(s.a=[b.id].concat(s.a),s.l=[t].concat(s.l)):(s.a.push(b.id),s.l.push(t))},this.undelegate=function(e,o,t,r,i){var s=O[o]||!1;if(s&&s.l)for(var n=0,l=s.l.length;n<l;n++)s.a[n]===b.id&&(s.a.splice(n),s.l.splice(n),0===s.a.length&&(b._unbind(e,o,s.l.f),O[o]=null))},this.bind=function(e,o,t,r,i){var s="jquery"in e?e[0]:e;b._bind(s,o,t,r||!1,i||!1)},this._bind=function(e,o,t,r,i){b.events.push({e:e,n:o,f:t,b:r,q:!1}),h&&(i||e==window.document||e==window.document.body||e==window)?e.addEventListener(o,t,{passive:!1,capture:r}):e.addEventListener(o,t,r||!1)},this._unbind=function(e,o,t,r){O[o]?b.undelegate(e,o,t,r):e.removeEventListener(o,t,r)},this.unbindAll=function(){for(var e=0;e<b.events.length;e++){var o=b.events[e];o.q?o.e.unbind(o.n,o.f):b._unbind(o.e,o.n,o.f,o.b)}},this.showRails=function(){return b.showRail().showRailHr()},this.showRail=function(){return 0===b.page.maxh||!b.ispage&&"none"==b.win.css("display")||(b.rail.visibility=!0,b.rail.css("display","block")),b},this.showRailHr=function(){return b.railh&&(0===b.page.maxw||!b.ispage&&"none"==b.win.css("display")||(b.railh.visibility=!0,b.railh.css("display","block"))),b},this.hideRails=function(){return b.hideRail().hideRailHr()},this.hideRail=function(){return b.rail.visibility=!1,b.rail.css("display","none"),b},this.hideRailHr=function(){return b.railh&&(b.railh.visibility=!1,b.railh.css("display","none")),b},this.show=function(){return b.hidden=!1,b.railslocked=!1,b.showRails()},this.hide=function(){return b.hidden=!0,b.railslocked=!0,b.hideRails()},this.toggle=function(){return b.hidden?b.show():b.hide()},this.remove=function(){for(var e in b.stop(),b.cursortimeout&&clearTimeout(b.cursortimeout),b.delaylist)b.delaylist[e]&&H(b.delaylist[e].h);b.doZoomOut(),b.unbindAll(),S.isie9&&b.win[0].detachEvent("onpropertychange",b.onAttributeChange),!1!==b.observer&&b.observer.disconnect(),!1!==b.observerremover&&b.observerremover.disconnect(),!1!==b.observerbody&&b.observerbody.disconnect(),b.events=null,b.cursor&&b.cursor.remove(),b.cursorh&&b.cursorh.remove(),b.rail&&b.rail.remove(),b.railh&&b.railh.remove(),b.zoom&&b.zoom.remove();for(var o=0;o<b.saved.css.length;o++){var t=b.saved.css[o];t[0].css(t[1],void 0===t[2]?"":t[2])}b.saved=!1,b.me.data("__nicescroll","");var r=P.nicescroll;for(var i in r.each(function(e){if(this&&this.id===b.id){delete r[e];for(var o=++e;o<r.length;o++,e++)r[e]=r[o];r.length--,r.length&&delete r[r.length]}}),b)b[i]=null,delete b[i];b=null},this.scrollstart=function(e){return this.onscrollstart=e,b},this.scrollend=function(e){return this.onscrollend=e,b},this.scrollcancel=function(e){return this.onscrollcancel=e,b},this.zoomin=function(e){return this.onzoomin=e,b},this.zoomout=function(e){return this.onzoomout=e,b},this.isScrollable=function(e){var o=e.target?e.target:e;if("OPTION"==o.nodeName)return!0;for(;o&&1==o.nodeType&&o!==this.me[0]&&!/^BODY|HTML/.test(o.nodeName);){var t=P(o),r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r))return o.clientHeight!=o.scrollHeight;o=!!o.parentNode&&o.parentNode}return!1},this.getViewport=function(e){for(var o=!(!e||!e.parentNode)&&e.parentNode;o&&1==o.nodeType&&!/^BODY|HTML/.test(o.nodeName);){var t=P(o);if(/fixed|absolute/.test(t.css("position")))return t;var r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r)&&o.clientHeight!=o.scrollHeight)return t;if(0<t.getNiceScroll().length)return t;o=!!o.parentNode&&o.parentNode}return!1},this.triggerScrollStart=function(e,o,t,r,i){if(b.onscrollstart){var s={type:"scrollstart",current:{x:e,y:o},request:{x:t,y:r},end:{x:b.newscrollx,y:b.newscrolly},speed:i};b.onscrollstart.call(b,s)}},this.triggerScrollEnd=function(){if(b.onscrollend){var e=b.getScrollLeft(),o=b.getScrollTop(),t={type:"scrollend",current:{x:e,y:o},end:{x:e,y:o}};b.onscrollend.call(b,t)}};var m=0,f=0,g=0,v=1;function w(e,o,t,r){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),g=D());var i=D()-g;if(g=D(),350<i?v=1:v+=(2-v)/10,o=o*v|0,e=e*v|0){if(r)if(e<0){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(b.getScrollLeft()<=0)return!0;var s=0<e?1:-1;f!==s&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),f=s),b.lastdeltax-=e}if(o){if(function(){var e=b.getScrollTop();if(o<0){if(e>=b.page.maxh)return!0}else if(e<=0)return!0}()){if(x.nativeparentscrolling&&t&&!b.ispage&&!b.zoomactive)return!0;var n=b.view.h>>1;o=b.newscrolly<-n?(b.newscrolly=-n,-1):b.newscrolly>b.page.maxh+n?(b.newscrolly=b.page.maxh+n,1):0}var l=0<o?1:-1;m!==l&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),m=l),b.lastdeltay-=o}(o||e)&&b.synched("relativexy",function(){var e=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var o=b.lastdeltax+b.newscrollx;b.lastdeltax=0,b.rail.drag||b.doScrollPos(o,e)})}var z=!1;function k(e,o,t){var r,i;if(!t&&z)return!0;0===e.deltaMode?(r=-e.deltaX*(x.mousescrollstep/54)|0,i=-e.deltaY*(x.mousescrollstep/54)|0):1===e.deltaMode&&(r=-e.deltaX*x.mousescrollstep*50/80|0,i=-e.deltaY*x.mousescrollstep*50/80|0),o&&x.oneaxismousemode&&0===r&&i&&(r=i,i=0,!t||(r<0?b.getScrollLeft()>=b.page.maxw:b.getScrollLeft()<=0)&&(i=r,r=0));if(b.isrtlmode&&(r=-r),!w(r,i,t,!0))return z=!1,e.stopImmediatePropagation(),e.preventDefault();t&&(z=!0)}if(this.onmousewheel=function(e){if(b.wheelprevented||b.locked)return!1;if(b.railslocked)return b.debounced("checkunlock",b.resize,250),!1;if(b.rail.drag)return b.cancelEvent(e);if("auto"===x.oneaxismousemode&&0!==e.deltaX&&(x.oneaxismousemode=!1),x.oneaxismousemode&&0===e.deltaX&&!b.rail.scrollable)return!b.railh||!b.railh.scrollable||b.onmousewheelhr(e);var o=D(),t=!1;if(x.preservenativescrolling&&b.checkarea+600<o&&(b.nativescrollingarea=b.isScrollable(e),t=!0),b.checkarea=o,b.nativescrollingarea)return!0;var r=k(e,!1,t);return r&&(b.checkarea=0),r},this.onmousewheelhr=function(e){if(!b.wheelprevented){if(b.railslocked||!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(e);var o=D(),t=!1;return x.preservenativescrolling&&b.checkarea+600<o&&(b.nativescrollingarea=b.isScrollable(e),t=!0),b.checkarea=o,!!b.nativescrollingarea||(b.railslocked?b.cancelEvent(e):k(e,!0,t))}},this.stop=function(){return b.cancelScroll(),b.scrollmon&&b.scrollmon.stop(),b.cursorfreezed=!1,b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.noticeCursor(),b},this.getTransitionSpeed=function(e){return 80+e/72*x.scrollspeed|0},x.smoothscroll)if(b.ishwscroll&&S.hastransition&&x.usetransition&&x.smoothscroll){var T="";this.resetTransition=function(){T="",b.doc.css(S.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(e,o){var t=o?e:b.getTransitionSpeed(e),r=t+"ms";return T!==r&&(T=r,b.doc.css(S.prefixstyle+"transition-duration",r)),t},this.doScrollLeft=function(e,o){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,e,o)},this.cursorupdate={running:!1,start:function(){var e=this;if(!e.running){e.running=!0;var o=function(){e.running&&Y(o),b.showCursor(b.getScrollTop(),b.getScrollLeft()),b.notifyScrollEvent(b.win[0])};Y(o)}},stop:function(){this.running=!1}},this.doScrollPos=function(e,o,t){var r=b.getScrollTop(),i=b.getScrollLeft();if(((b.newscrolly-r)*(o-r)<0||(b.newscrollx-i)*(e-i)<0)&&b.cancelScroll(),x.bouncescroll?(o<0?o=o/2|0:o>b.page.maxh&&(o=b.page.maxh+(o-b.page.maxh)/2|0),e<0?e=e/2|0:e>b.page.maxw&&(e=b.page.maxw+(e-b.page.maxw)/2|0)):(o<0?o=0:o>b.page.maxh&&(o=b.page.maxh),e<0?e=0:e>b.page.maxw&&(e=b.page.maxw)),b.scrollrunning&&e==b.newscrollx&&o==b.newscrolly)return!1;b.newscrolly=o,b.newscrollx=e;var s=b.getScrollTop(),n=b.getScrollLeft(),l={};l.x=e-n,l.y=o-s;var a=0|Math.sqrt(l.x*l.x+l.y*l.y),c=b.prepareTransition(a);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(n,s,e,o,c),b.cursorupdate.start()),b.scrollendtrapped=!0,S.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,c)),b.setScrollTop(b.newscrolly),b.setScrollLeft(b.newscrollx)},this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var e=b.getScrollTop(),o=b.getScrollLeft();return b.scrollrunning=!1,S.transitionend||clearTimeout(S.transitionend),b.scrollendtrapped=!1,b.resetTransition(),b.setScrollTop(e),b.railh&&b.setScrollLeft(o),b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm),b.timerscroll=!1,b.cursorfreezed=!1,b.cursorupdate.stop(),b.showCursor(e,o),b},this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var e=b.getScrollTop(),o=b.getScrollLeft();if(e<0?e=0:e>b.page.maxh&&(e=b.page.maxh),o<0?o=0:o>b.page.maxw&&(o=b.page.maxw),e!=b.newscrolly||o!=b.newscrollx)return b.doScrollPos(o,e,x.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd(),b.scrollrunning=!1,b.scrollendtrapped=!1,b.resetTransition(),b.timerscroll=!1,b.setScrollTop(e),b.railh&&b.setScrollLeft(o),b.cursorupdate.stop(),b.noticeCursor(!1,e,o),b.cursorfreezed=!1}}}else this.doScrollLeft=function(e,o){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=b.getScrollTop(),i=b.getScrollLeft();((b.newscrolly-r)*(o-r)<0||(b.newscrollx-i)*(e-i)<0)&&b.cancelScroll();var s=!1;if(b.bouncescroll&&b.rail.visibility||(o<0?s=!(o=0):o>b.page.maxh&&(o=b.page.maxh,s=!0)),b.bouncescroll&&b.railh.visibility||(e<0?s=!(e=0):e>b.page.maxw&&(e=b.page.maxw,s=!0)),b.scrollrunning&&b.newscrolly===o&&b.newscrollx===e)return!0;b.newscrolly=o,b.newscrollx=e,b.dst={},b.dst.x=e-i,b.dst.y=o-r,b.dst.px=i,b.dst.py=r;var n=0|Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y),l=b.getTransitionSpeed(n);b.bzscroll={};var a=s?1:.58;b.bzscroll.x=new d(i,b.newscrollx,l,0,0,a,1),b.bzscroll.y=new d(r,b.newscrolly,l,0,0,a,1);D();var c=function(){if(b.scrollrunning){var e=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow()),b.setScrollTop(b.bzscroll.y.getNow()),e<=1?b.timer=Y(c):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(i,r,e,o,l),b.scrollrunning=!0,b.timer=Y(c))},this.cancelScroll=function(){return b.timer&&H(b.timer),b.timer=0,b.bzscroll=!1,b.scrollrunning=!1,b};else this.doScrollLeft=function(e,o){var t=b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.getScrollLeft();b.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=e>b.page.maxw?b.page.maxw:e;r<0&&(r=0);var i=o>b.page.maxh?b.page.maxh:o;i<0&&(i=0),b.synched("scroll",function(){b.setScrollTop(i),b.setScrollLeft(r)})},this.cancelScroll=function(){};this.doScrollBy=function(e,o){w(0,e)},this.doScrollLeftBy=function(e,o){w(e,0)},this.doScrollTo=function(e,o){var t=o?Math.round(e*b.scrollratio.y):e;t<0?t=0:t>b.page.maxh&&(t=b.page.maxh),b.cursorfreezed=!1,b.doScrollTop(e)},this.checkContentSize=function(){var e=b.getContentSize();e.h==b.page.h&&e.w==b.page.w||b.resize(!1,e)},b.onscroll=function(e){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()/b.scrollratio.y),b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()/b.scrollratio.x)),b.noticeCursor()})},b.bind(b.docscroll,"scroll",b.onscroll),this.doZoomIn=function(e){if(!b.zoomactive){b.zoomactive=!0,b.zoomrestore={style:{}};var o=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],t=b.win[0].style;for(var r in o){var i=o[r];b.zoomrestore.style[i]=void 0!==t[i]?t[i]:""}b.zoomrestore.style.width=b.win.css("width"),b.zoomrestore.style.height=b.win.css("height"),b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()},S.isios4&&(b.zoomrestore.scrollTop=I.scrollTop(),I.scrollTop(0)),b.win.css({position:S.isios4?"absolute":"fixed",top:0,left:0,zIndex:N+100,margin:0});var s=b.win.css("backgroundColor");return""!==s&&!/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(s)||b.win.css("backgroundColor","#fff"),b.rail.css({zIndex:N+101}),b.zoom.css({zIndex:N+102}),b.zoom.css("backgroundPosition","0 -18px"),b.resizeZoom(),b.onzoomin&&b.onzoomin.call(b),b.cancelEvent(e)}},this.doZoomOut=function(e){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),S.isios4&&I.scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(e)},this.doZoom=function(e){return b.zoomactive?b.doZoomOut(e):b.doZoomIn(e)},this.resizeZoom=function(){if(b.zoomactive){var e=b.getScrollTop();b.win.css({width:I.width()-b.zoomrestore.padding.w+"px",height:I.height()-b.zoomrestore.padding.h+"px"}),b.onResize(),b.setScrollTop(Math.min(b.page.maxh,e))}},this.init(),P.nicescroll.push(this)}var o,t,r,X=_.MutationObserver||_.WebKitMutationObserver||!1,D=Date.now||function(){return(new Date).getTime()},A={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:(t=R.currentScript||!!(o=R.getElementsByTagName("script")).length&&o[o.length-1],0<(r=t?t.src.split("?")[0]:"").split("/").length?r.split("/").slice(0,-1).join("/")+"/":""),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1},i=!1,q=function(e){var f=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.reset=function(e,o){f.stop(),f.steptime=0,f.lasttime=D(),f.speedx=0,f.speedy=0,f.lastx=e,f.lasty=o,f.lastscrollx=-1,f.lastscrolly=-1},this.update=function(e,o){var t=D();f.steptime=t-f.lasttime,f.lasttime=t;var r=o-f.lasty,i=e-f.lastx,s=f.nc.getScrollTop()+r,n=f.nc.getScrollLeft()+i;f.snapx=n<0||n>f.nc.page.maxw,f.snapy=s<0||s>f.nc.page.maxh,f.speedx=i,f.speedy=r,f.lastx=e,f.lasty=o},this.stop=function(){f.nc.unsynched("domomentum2d"),f.timer&&clearTimeout(f.timer),f.timer=0,f.lastscrollx=-1,f.lastscrolly=-1},this.doSnapy=function(e,o){var t=!1;o<0?t=!(o=0):o>f.nc.page.maxh&&(o=f.nc.page.maxh,t=!0),e<0?t=!(e=0):e>f.nc.page.maxw&&(e=f.nc.page.maxw,t=!0),t?f.nc.doScrollPos(e,o,f.nc.opt.snapbackspeed):f.nc.triggerScrollEnd()},this.doMomentum=function(e){var o=D(),t=e?o+e:f.lasttime,r=f.nc.getScrollLeft(),i=f.nc.getScrollTop(),s=f.nc.page.maxh,n=f.nc.page.maxw;f.speedx=0<n?Math.min(60,f.speedx):0,f.speedy=0<s?Math.min(60,f.speedy):0;var l=t&&o-t<=60;(i<0||s<i||r<0||n<r)&&(l=!1);var a=!(!f.speedy||!l)&&f.speedy,c=!(!f.speedx||!l)&&f.speedx;if(a||c){var d=Math.max(16,f.steptime);if(50<d){var u=d/50;f.speedx*=u,f.speedy*=u,d=50}f.demulxy=0,f.lastscrollx=f.nc.getScrollLeft(),f.chkx=f.lastscrollx,f.lastscrolly=f.nc.getScrollTop(),f.chky=f.lastscrolly;var h=f.lastscrollx,p=f.lastscrolly,m=function(){var e=600<D()-o?.04:.02;f.speedx&&(h=Math.floor(f.lastscrollx-f.speedx*(1-f.demulxy)),((f.lastscrollx=h)<0||n<h)&&(e=.1)),f.speedy&&(p=Math.floor(f.lastscrolly-f.speedy*(1-f.demulxy)),((f.lastscrolly=p)<0||s<p)&&(e=.1)),f.demulxy=Math.min(1,f.demulxy+e),f.nc.synched("domomentum2d",function(){if(f.speedx){f.nc.getScrollLeft();f.chkx=h,f.nc.setScrollLeft(h)}if(f.speedy){f.nc.getScrollTop();f.chky=p,f.nc.setScrollTop(p)}f.timer||(f.nc.hideCursor(),f.doSnapy(h,p))}),f.demulxy<1?f.timer=setTimeout(m,d):(f.stop(),f.nc.hideCursor(),f.doSnapy(h,p))};m()}else f.doSnapy(f.nc.getScrollLeft(),f.nc.getScrollTop())}},n=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(e,o,t){var r=P.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollTop():n.call(e)},set:function(e,o){var t=P.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollTop(parseInt(o)):n.call(e,o),this}},e.fn.scrollTop=function(o){if(void 0!==o)return this.each(function(){var e=P.data(this,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollTop(parseInt(o)):n.call(P(this),o)});var e=this[0]&&P.data(this[0],"__nicescroll")||!1;return e&&e.ishwscroll?e.getScrollTop():n.call(this)};var a=e.fn.scrollLeft;P.cssHooks.pageXOffset={get:function(e,o,t){var r=P.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollLeft():a.call(e)},set:function(e,o){var t=P.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollLeft(parseInt(o)):a.call(e,o),this}},e.fn.scrollLeft=function(o){if(void 0!==o)return this.each(function(){var e=P.data(this,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollLeft(parseInt(o)):a.call(P(this),o)});var e=this[0]&&P.data(this[0],"__nicescroll")||!1;return e&&e.ishwscroll?e.getScrollLeft():a.call(this)};function c(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){return P.each(o,e),o},this.push=function(e){o[o.length]=e,o.length++},this.eq=function(e){return o[e]},e)for(var t=0;t<e.length;t++){var r=P.data(e[t],"__nicescroll")||!1;r&&(this[this.length]=r,this.length++)}return this}!function(e,o,t){for(var r=0,i=o.length;r<i;r++)t(e,o[r])}(c.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(e,o){e[o]=function(){var e=arguments;return this.each(function(){this[o].apply(this,e)})}}),e.fn.getNiceScroll=function(e){return void 0===e?new c(this):this[e]&&P.data(this[e],"__nicescroll")||!1},(e.expr.pseudos||e.expr[":"]).nicescroll=function(e){return void 0!==P.data(e,"__nicescroll")},P.fn.niceScroll=function(i,s){void 0!==s||"object"!=typeof i||"jquery"in i||(s=i,i=!1);var n=new c;return this.each(function(){var e=P(this),o=P.extend({},s);if(i){var t=P(i);o.doc=1<t.length?P(i,e):t,o.win=e}!("doc"in o)||"win"in o||(o.win=e);var r=e.data("__nicescroll")||!1;r||(o.doc=o.doc||e,r=new l(o,e),e.data("__nicescroll",r)),n.push(r)}),1===n.length?n[0]:n},_.NiceScroll={getjQuery:function(){return e}},P.nicescroll||(P.nicescroll=new c,P.nicescroll.options=A)});
 
1
+ /* jquery.nicescroll v3.7.6 InuYaksa - MIT - https://nicescroll.areaaperta.com */
2
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";var o=!1,t=!1,r=0,i=2e3,s=0,n=e,l=document,a=window,c=n(a),d=[],u=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||!1,h=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||!1;if(u)a.cancelAnimationFrame||(h=function(e){});else{var p=0;u=function(e,o){var t=(new Date).getTime(),r=Math.max(0,16-(t-p)),i=a.setTimeout(function(){e(t+r)},r);return p=t+r,i},h=function(e){a.clearTimeout(e)}}var m=a.MutationObserver||a.WebKitMutationObserver||!1,f=Date.now||function(){return(new Date).getTime()},g={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=l.currentScript||function(){var e=l.getElementsByTagName("script");return!!e.length&&e[e.length-1]}(),o=e?e.src.split("?")[0]:"";return o.split("/").length>0?o.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1},v=!1,w=function(){if(v)return v;var e=l.createElement("DIV"),o=e.style,t=navigator.userAgent,r=navigator.platform,i={};return i.haspointerlock="pointerLockElement"in l||"webkitPointerLockElement"in l||"mozPointerLockElement"in l,i.isopera="opera"in a,i.isopera12=i.isopera&&"getUserMedia"in navigator,i.isoperamini="[object OperaMini]"===Object.prototype.toString.call(a.operamini),i.isie="all"in l&&"attachEvent"in e&&!i.isopera,i.isieold=i.isie&&!("msInterpolationMode"in o),i.isie7=i.isie&&!i.isieold&&(!("documentMode"in l)||7===l.documentMode),i.isie8=i.isie&&"documentMode"in l&&8===l.documentMode,i.isie9=i.isie&&"performance"in a&&9===l.documentMode,i.isie10=i.isie&&"performance"in a&&10===l.documentMode,i.isie11="msRequestFullscreen"in e&&l.documentMode>=11,i.ismsedge="msCredentials"in a,i.ismozilla="MozAppearance"in o,i.iswebkit=!i.ismsedge&&"WebkitAppearance"in o,i.ischrome=i.iswebkit&&"chrome"in a,i.ischrome38=i.ischrome&&"touchAction"in o,i.ischrome22=!i.ischrome38&&i.ischrome&&i.haspointerlock,i.ischrome26=!i.ischrome38&&i.ischrome&&"transition"in o,i.cantouch="ontouchstart"in l.documentElement||"ontouchstart"in a,i.hasw3ctouch=(a.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),i.hasmstouch=!i.hasw3ctouch&&(a.MSPointerEvent||!1),i.ismac=/^mac$/i.test(r),i.isios=i.cantouch&&/iphone|ipad|ipod/i.test(r),i.isios4=i.isios&&!("seal"in Object),i.isios7=i.isios&&"webkitHidden"in l,i.isios8=i.isios&&"hidden"in l,i.isios10=i.isios&&a.Proxy,i.isandroid=/android/i.test(t),i.haseventlistener="addEventListener"in e,i.trstyle=!1,i.hastransform=!1,i.hastranslate3d=!1,i.transitionstyle=!1,i.hastransition=!1,i.transitionend=!1,i.trstyle="transform",i.hastransform="transform"in o||function(){for(var e=["msTransform","webkitTransform","MozTransform","OTransform"],t=0,r=e.length;t<r;t++)if(void 0!==o[e[t]]){i.trstyle=e[t];break}i.hastransform=!!i.trstyle}(),i.hastransform&&(o[i.trstyle]="translate3d(1px,2px,3px)",i.hastranslate3d=/translate3d/.test(o[i.trstyle])),i.transitionstyle="transition",i.prefixstyle="",i.transitionend="transitionend",i.hastransition="transition"in o||function(){i.transitionend=!1;for(var e=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],t=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],r=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"],s=0,n=e.length;s<n;s++)if(e[s]in o){i.transitionstyle=e[s],i.prefixstyle=t[s],i.transitionend=r[s];break}i.ischrome26&&(i.prefixstyle=t[1]),i.hastransition=i.transitionstyle}(),i.cursorgrabvalue=function(){var e=["grab","-webkit-grab","-moz-grab"];(i.ischrome&&!i.ischrome38||i.isie)&&(e=[]);for(var t=0,r=e.length;t<r;t++){var s=e[t];if(o.cursor=s,o.cursor==s)return s}return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}(),i.hasmousecapture="setCapture"in e,i.hasMutationObserver=!1!==m,e=null,v=i,i},b=function(e,p){function v(){var e=T.doc.css(P.trstyle);return!(!e||"matrix"!=e.substr(0,6))&&e.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}function b(){var e=T.win;if("zIndex"in e)return e.zIndex();for(;e.length>0;){if(9==e[0].nodeType)return!1;var o=e.css("zIndex");if(!isNaN(o)&&0!==o)return parseInt(o);e=e.parent()}return!1}function x(e,o,t){var r=e.css(o),i=parseFloat(r);if(isNaN(i)){var s=3==(i=I[r]||0)?t?T.win.outerHeight()-T.win.innerHeight():T.win.outerWidth()-T.win.innerWidth():1;return T.isie8&&i&&(i+=1),s?i:0}return i}function S(e,o,t,r){T._bind(e,o,function(r){var i={original:r=r||a.event,target:r.target||r.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==r.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return r.preventDefault?r.preventDefault():r.returnValue=!1,!1},stopImmediatePropagation:function(){r.stopImmediatePropagation?r.stopImmediatePropagation():r.cancelBubble=!0}};return"mousewheel"==o?(r.wheelDeltaX&&(i.deltaX=-.025*r.wheelDeltaX),r.wheelDeltaY&&(i.deltaY=-.025*r.wheelDeltaY),!i.deltaY&&!i.deltaX&&(i.deltaY=-.025*r.wheelDelta)):i.deltaY=r.detail,t.call(e,i)},r)}function z(e,o,t,r){T.scrollrunning||(T.newscrolly=T.getScrollTop(),T.newscrollx=T.getScrollLeft(),D=f());var i=f()-D;if(D=f(),i>350?A=1:A+=(2-A)/10,e=e*A|0,o=o*A|0,e){if(r)if(e<0){if(T.getScrollLeft()>=T.page.maxw)return!0}else if(T.getScrollLeft()<=0)return!0;var s=e>0?1:-1;X!==s&&(T.scrollmom&&T.scrollmom.stop(),T.newscrollx=T.getScrollLeft(),X=s),T.lastdeltax-=e}if(o){if(function(){var e=T.getScrollTop();if(o<0){if(e>=T.page.maxh)return!0}else if(e<=0)return!0}()){if(M.nativeparentscrolling&&t&&!T.ispage&&!T.zoomactive)return!0;var n=T.view.h>>1;T.newscrolly<-n?(T.newscrolly=-n,o=-1):T.newscrolly>T.page.maxh+n?(T.newscrolly=T.page.maxh+n,o=1):o=0}var l=o>0?1:-1;B!==l&&(T.scrollmom&&T.scrollmom.stop(),T.newscrolly=T.getScrollTop(),B=l),T.lastdeltay-=o}(o||e)&&T.synched("relativexy",function(){var e=T.lastdeltay+T.newscrolly;T.lastdeltay=0;var o=T.lastdeltax+T.newscrollx;T.lastdeltax=0,T.rail.drag||T.doScrollPos(o,e)})}function k(e,o,t){var r,i;return!(t||!q)||(0===e.deltaMode?(r=-e.deltaX*(M.mousescrollstep/54)|0,i=-e.deltaY*(M.mousescrollstep/54)|0):1===e.deltaMode&&(r=-e.deltaX*M.mousescrollstep*50/80|0,i=-e.deltaY*M.mousescrollstep*50/80|0),o&&M.oneaxismousemode&&0===r&&i&&(r=i,i=0,t&&(r<0?T.getScrollLeft()>=T.page.maxw:T.getScrollLeft()<=0)&&(i=r,r=0)),T.isrtlmode&&(r=-r),z(r,i,t,!0)?void(t&&(q=!0)):(q=!1,e.stopImmediatePropagation(),e.preventDefault()))}var T=this;this.version="3.7.6",this.name="nicescroll",this.me=p;var E=n("body"),M=this.opt={doc:E,win:!1};if(n.extend(M,g),M.snapbackspeed=80,e)for(var L in M)void 0!==e[L]&&(M[L]=e[L]);if(M.disablemutationobserver&&(m=!1),this.doc=M.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(M.win?M.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==M.win,this.win=M.win||(this.ispage?c:this.doc),this.docscroll=this.ispage&&!this.haswrapper?c:this.win,this.body=E,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=M.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==M.rtlmode){var C=this.win[0]==a?this.body:this.win,N=C.css("writing-mode")||C.css("-webkit-writing-mode")||C.css("-ms-writing-mode")||C.css("-moz-writing-mode");"horizontal-tb"==N||"lr-tb"==N||""===N?(this.isrtlmode="rtl"==C.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==N||"tb"==N||"tb-rl"==N||"rl-tb"==N,this.isvertical="vertical-rl"==N||"tb"==N||"tb-rl"==N)}else this.isrtlmode=!0===M.rtlmode,this.isvertical=!1;if(this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,!1!==M.scrollbarid)this.id=M.scrollbarid;else do{this.id="ascrail"+i++}while(l.getElementById(this.id));this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=M.overflowx,this.overflowy=M.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=w();var P=n.extend({},this.detected);this.canhwscroll=P.hastransform&&M.hwacceleration,this.ishwscroll=this.canhwscroll&&T.haswrapper,this.isrtlmode?this.isvertical?this.hasreversehr=!(P.iswebkit||P.isie||P.isie11):this.hasreversehr=!(P.iswebkit||P.isie&&!P.isie10&&!P.isie11):this.hasreversehr=!1,this.istouchcapable=!1,P.cantouch||!P.hasw3ctouch&&!P.hasmstouch?!P.cantouch||P.isios||P.isandroid||!P.iswebkit&&!P.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0,M.enablemouselockapi||(P.hasmousecapture=!1,P.haspointerlock=!1),this.debounced=function(e,o,t){T&&(T.delaylist[e]||!1||(T.delaylist[e]={h:u(function(){T.delaylist[e].fn.call(T),T.delaylist[e]=!1},t)},o.call(T)),T.delaylist[e].fn=o)},this.synched=function(e,o){T.synclist[e]?T.synclist[e]=o:(T.synclist[e]=o,u(function(){T&&(T.synclist[e]&&T.synclist[e].call(T),T.synclist[e]=null)}))},this.unsynched=function(e){T.synclist[e]&&(T.synclist[e]=!1)},this.css=function(e,o){for(var t in o)T.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrollTop=function(e){return void 0===e?T.getScrollTop():T.setScrollTop(e)},this.scrollLeft=function(e){return void 0===e?T.getScrollLeft():T.setScrollLeft(e)};var R=function(e,o,t,r,i,s,n){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=s||0,this.p4=n||1,this.ts=f(),this.df=o-e};if(R.prototype={B2:function(e){return 3*(1-e)*(1-e)*e},B3:function(e){return 3*(1-e)*e*e},B4:function(e){return e*e*e},getPos:function(){return(f()-this.ts)/this.spd},getNow:function(){var e=(f()-this.ts)/this.spd,o=this.B2(e)+this.B3(e)+this.B4(e);return e>=1?this.ed:this.st+this.df*o|0},update:function(e,o){return this.st=this.getNow(),this.ed=e,this.spd=o,this.ts=f(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},P.hastranslate3d&&P.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(e){if(!e){var o=v();if(o)return 16==o.length?-o[13]:-o[5];if(T.timerscroll&&T.timerscroll.bz)return T.timerscroll.bz.getNow()}return T.doc.translate.y},this.getScrollLeft=function(e){if(!e){var o=v();if(o)return 16==o.length?-o[12]:-o[4];if(T.timerscroll&&T.timerscroll.bh)return T.timerscroll.bh.getNow()}return T.doc.translate.x},this.notifyScrollEvent=function(e){var o=l.createEvent("UIEvents");o.initUIEvent("scroll",!1,!1,a,1),o.niceevent=!0,e.dispatchEvent(o)};var _=this.isrtlmode?1:-1;P.hastranslate3d&&M.enabletranslate3d?(this.setScrollTop=function(e,o){T.doc.translate.y=e,T.doc.translate.ty=-1*e+"px",T.doc.css(P.trstyle,"translate3d("+T.doc.translate.tx+","+T.doc.translate.ty+",0)"),o||T.notifyScrollEvent(T.win[0])},this.setScrollLeft=function(e,o){T.doc.translate.x=e,T.doc.translate.tx=e*_+"px",T.doc.css(P.trstyle,"translate3d("+T.doc.translate.tx+","+T.doc.translate.ty+",0)"),o||T.notifyScrollEvent(T.win[0])}):(this.setScrollTop=function(e,o){T.doc.translate.y=e,T.doc.translate.ty=-1*e+"px",T.doc.css(P.trstyle,"translate("+T.doc.translate.tx+","+T.doc.translate.ty+")"),o||T.notifyScrollEvent(T.win[0])},this.setScrollLeft=function(e,o){T.doc.translate.x=e,T.doc.translate.tx=e*_+"px",T.doc.css(P.trstyle,"translate("+T.doc.translate.tx+","+T.doc.translate.ty+")"),o||T.notifyScrollEvent(T.win[0])})}else this.getScrollTop=function(){return T.docscroll.scrollTop()},this.setScrollTop=function(e){T.docscroll.scrollTop(e)},this.getScrollLeft=function(){return T.hasreversehr?T.detected.ismozilla?T.page.maxw-Math.abs(T.docscroll.scrollLeft()):T.page.maxw-T.docscroll.scrollLeft():T.docscroll.scrollLeft()},this.setScrollLeft=function(e){return setTimeout(function(){if(T)return T.hasreversehr&&(e=T.detected.ismozilla?-(T.page.maxw-e):T.page.maxw-e),T.docscroll.scrollLeft(e)},1)};this.getTarget=function(e){return!!e&&(e.target?e.target:!!e.srcElement&&e.srcElement)},this.hasParent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcElement||e||!1;t&&t.id!=o;)t=t.parentNode||!1;return!1!==t};var I={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:a.pageYOffset||l.documentElement.scrollTop,left:a.pageXOffset||l.documentElement.scrollLeft}},this.getOffset=function(){if(T.isfixed){var e=T.win.offset(),o=T.getDocumentScrollOffset();return e.top-=o.top,e.left-=o.left,e}var t=T.win.offset();if(!T.viewport)return t;var r=T.viewport.offset();return{top:t.top-r.top,left:t.left-r.left}},this.updateScrollBar=function(e){var o,t;if(T.ishwscroll)T.rail.css({height:T.win.innerHeight()-(M.railpadding.top+M.railpadding.bottom)}),T.railh&&T.railh.css({width:T.win.innerWidth()-(M.railpadding.left+M.railpadding.right)});else{var r=T.getOffset();if(o={top:r.top,left:r.left-(M.railpadding.left+M.railpadding.right)},o.top+=x(T.win,"border-top-width",!0),o.left+=T.rail.align?T.win.outerWidth()-x(T.win,"border-right-width")-T.rail.width:x(T.win,"border-left-width"),(t=M.railoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left)),T.railslocked||T.rail.css({top:o.top,left:o.left,height:(e?e.h:T.win.innerHeight())-(M.railpadding.top+M.railpadding.bottom)}),T.zoom&&T.zoom.css({top:o.top+1,left:1==T.rail.align?o.left-20:o.left+T.rail.width+4}),T.railh&&!T.railslocked){o={top:r.top,left:r.left},(t=M.railhoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left));var i=T.railh.align?o.top+x(T.win,"border-top-width",!0)+T.win.innerHeight()-T.railh.height:o.top+x(T.win,"border-top-width",!0),s=o.left+x(T.win,"border-left-width");T.railh.css({top:i-(M.railpadding.top+M.railpadding.bottom),left:s,width:T.railh.width})}}},this.doRailClick=function(e,o,t){var r,i,s,n;T.railslocked||(T.cancelEvent(e),"pageY"in e||(e.pageX=e.clientX+l.documentElement.scrollLeft,e.pageY=e.clientY+l.documentElement.scrollTop),o?(r=t?T.doScrollLeft:T.doScrollTop,s=t?(e.pageX-T.railh.offset().left-T.cursorwidth/2)*T.scrollratio.x:(e.pageY-T.rail.offset().top-T.cursorheight/2)*T.scrollratio.y,T.unsynched("relativexy"),r(0|s)):(r=t?T.doScrollLeftBy:T.doScrollBy,s=t?T.scroll.x:T.scroll.y,n=t?e.pageX-T.railh.offset().left:e.pageY-T.rail.offset().top,i=t?T.view.w:T.view.h,r(s>=n?i:-i)))},T.newscrolly=T.newscrollx=0,T.hasanimationframe="requestAnimationFrame"in a,T.hascancelanimationframe="cancelAnimationFrame"in a,T.hasborderbox=!1,this.init=function(){if(T.saved.css=[],P.isoperamini)return!0;if(P.isandroid&&!("hidden"in l))return!0;M.emulatetouch=M.emulatetouch||M.touchbehavior,T.hasborderbox=a.getComputedStyle&&"border-box"===a.getComputedStyle(l.body)["box-sizing"];var e={"overflow-y":"hidden"};if((P.isie11||P.isie10)&&(e["-ms-overflow-style"]="none"),T.ishwscroll&&(this.doc.css(P.transitionstyle,P.prefixstyle+"transform 0ms ease-out"),P.transitionend&&T.bind(T.doc,P.transitionend,T.onScrollTransitionEnd,!1)),T.zindex="auto",T.ispage||"auto"!=M.zindex?T.zindex=M.zindex:T.zindex=b()||"auto",!T.ispage&&"auto"!=T.zindex&&T.zindex>s&&(s=T.zindex),T.isie&&0===T.zindex&&"auto"==M.zindex&&(T.zindex="auto"),!T.ispage||!P.isieold){var i=T.docscroll;T.ispage&&(i=T.haswrapper?T.win:T.doc),T.css(i,e),T.ispage&&(P.isie11||P.isie)&&T.css(n("html"),e),!P.isios||T.ispage||T.haswrapper||T.css(E,{"-webkit-overflow-scrolling":"touch"});var d=n(l.createElement("div"));d.css({position:"relative",top:0,float:"right",width:M.cursorwidth,height:0,"background-color":M.cursorcolor,border:M.cursorborder,"background-clip":"padding-box","-webkit-border-radius":M.cursorborderradius,"-moz-border-radius":M.cursorborderradius,"border-radius":M.cursorborderradius}),d.addClass("nicescroll-cursors"),T.cursor=d;var u=n(l.createElement("div"));u.attr("id",T.id),u.addClass("nicescroll-rails nicescroll-rails-vr");var h,p,f=["left","right","top","bottom"];for(var g in f)p=f[g],(h=M.railpadding[p]||0)&&u.css("padding-"+p,h+"px");u.append(d),u.width=Math.max(parseFloat(M.cursorwidth),d.outerWidth()),u.css({width:u.width+"px",zIndex:T.zindex,background:M.background,cursor:"default"}),u.visibility=!0,u.scrollable=!0,u.align="left"==M.railalign?0:1,T.rail=u,T.rail.drag=!1;var v=!1;!M.boxzoom||T.ispage||P.isieold||(v=l.createElement("div"),T.bind(v,"click",T.doZoom),T.bind(v,"mouseenter",function(){T.zoom.css("opacity",M.cursoropacitymax)}),T.bind(v,"mouseleave",function(){T.zoom.css("opacity",M.cursoropacitymin)}),T.zoom=n(v),T.zoom.css({cursor:"pointer",zIndex:T.zindex,backgroundImage:"url("+M.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),M.dblclickzoom&&T.bind(T.win,"dblclick",T.doZoom),P.cantouch&&M.gesturezoom&&(T.ongesturezoom=function(e){return e.scale>1.5&&T.doZoomIn(e),e.scale<.8&&T.doZoomOut(e),T.cancelEvent(e)},T.bind(T.win,"gestureend",T.ongesturezoom))),T.railh=!1;var w;if(M.horizrailenabled&&(T.css(i,{overflowX:"hidden"}),(d=n(l.createElement("div"))).css({position:"absolute",top:0,height:M.cursorwidth,width:0,backgroundColor:M.cursorcolor,border:M.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":M.cursorborderradius,"-moz-border-radius":M.cursorborderradius,"border-radius":M.cursorborderradius}),P.isieold&&d.css("overflow","hidden"),d.addClass("nicescroll-cursors"),T.cursorh=d,(w=n(l.createElement("div"))).attr("id",T.id+"-hr"),w.addClass("nicescroll-rails nicescroll-rails-hr"),w.height=Math.max(parseFloat(M.cursorwidth),d.outerHeight()),w.css({height:w.height+"px",zIndex:T.zindex,background:M.background}),w.append(d),w.visibility=!0,w.scrollable=!0,w.align="top"==M.railvalign?0:1,T.railh=w,T.railh.drag=!1),T.ispage)u.css({position:"fixed",top:0,height:"100%"}),u.css(u.align?{right:0}:{left:0}),T.body.append(u),T.railh&&(w.css({position:"fixed",left:0,width:"100%"}),w.css(w.align?{bottom:0}:{top:0}),T.body.append(w));else{if(T.ishwscroll){"static"==T.win.css("position")&&T.css(T.win,{position:"relative"});var x="HTML"==T.win[0].nodeName?T.body:T.win;n(x).scrollTop(0).scrollLeft(0),T.zoom&&(T.zoom.css({position:"absolute",top:1,right:0,"margin-right":u.width+4}),x.append(T.zoom)),u.css({position:"absolute",top:0}),u.css(u.align?{right:0}:{left:0}),x.append(u),w&&(w.css({position:"absolute",left:0,bottom:0}),w.css(w.align?{bottom:0}:{top:0}),x.append(w))}else{T.isfixed="fixed"==T.win.css("position");var S=T.isfixed?"fixed":"absolute";T.isfixed||(T.viewport=T.getViewport(T.win[0])),T.viewport&&(T.body=T.viewport,/fixed|absolute/.test(T.viewport.css("position"))||T.css(T.viewport,{position:"relative"})),u.css({position:S}),T.zoom&&T.zoom.css({position:S}),T.updateScrollBar(),T.body.append(u),T.zoom&&T.body.append(T.zoom),T.railh&&(w.css({position:S}),T.body.append(w))}P.isios&&T.css(T.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),M.disableoutline&&(P.isie&&T.win.attr("hideFocus","true"),P.iswebkit&&T.win.css("outline","none"))}if(!1===M.autohidemode?(T.autohidedom=!1,T.rail.css({opacity:M.cursoropacitymax}),T.railh&&T.railh.css({opacity:M.cursoropacitymax})):!0===M.autohidemode||"leave"===M.autohidemode?(T.autohidedom=n().add(T.rail),P.isie8&&(T.autohidedom=T.autohidedom.add(T.cursor)),T.railh&&(T.autohidedom=T.autohidedom.add(T.railh)),T.railh&&P.isie8&&(T.autohidedom=T.autohidedom.add(T.cursorh))):"scroll"==M.autohidemode?(T.autohidedom=n().add(T.rail),T.railh&&(T.autohidedom=T.autohidedom.add(T.railh))):"cursor"==M.autohidemode?(T.autohidedom=n().add(T.cursor),T.railh&&(T.autohidedom=T.autohidedom.add(T.cursorh))):"hidden"==M.autohidemode&&(T.autohidedom=!1,T.hide(),T.railslocked=!1),P.cantouch||T.istouchcapable||M.emulatetouch||P.hasmstouch){T.scrollmom=new y(T);T.ontouchstart=function(e){if(T.locked)return!1;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;if(T.hasmoving=!1,T.scrollmom.timer&&(T.triggerScrollEnd(),T.scrollmom.stop()),!T.railslocked){var o=T.getTarget(e);if(o&&/INPUT/i.test(o.nodeName)&&/range/i.test(o.type))return T.stopPropagation(e);var t="mousedown"===e.type;if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),T.forcescreen){var r=e;(e={original:e.original?e.original:e}).clientX=r.screenX,e.clientY=r.screenY}if(T.rail.drag={x:e.clientX,y:e.clientY,sx:T.scroll.x,sy:T.scroll.y,st:T.getScrollTop(),sl:T.getScrollLeft(),pt:2,dl:!1,tg:o},T.ispage||!M.directionlockdeadzone)T.rail.drag.dl="f";else{var i={w:c.width(),h:c.height()},s=T.getContentSize(),l=s.h-i.h,a=s.w-i.w;T.rail.scrollable&&!T.railh.scrollable?T.rail.drag.ck=l>0&&"v":!T.rail.scrollable&&T.railh.scrollable?T.rail.drag.ck=a>0&&"h":T.rail.drag.ck=!1}if(M.emulatetouch&&T.isiframe&&P.isie){var d=T.win.position();T.rail.drag.x+=d.left,T.rail.drag.y+=d.top}if(T.hasmoving=!1,T.lastmouseup=!1,T.scrollmom.reset(e.clientX,e.clientY),o&&t){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(o.nodeName))return P.hasmousecapture&&o.setCapture(),M.emulatetouch?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){if(T.hasmoving)return!1;o._onclick.call(this,e)}),T.cancelEvent(e)):T.stopPropagation(e);/SUBMIT|CANCEL|BUTTON/i.test(n(o).attr("type"))&&(T.preventclick={tg:o,click:!1})}}},T.ontouchend=function(e){if(!T.rail.drag)return!0;if(2==T.rail.drag.pt){if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;T.rail.drag=!1;var o="mouseup"===e.type;if(T.hasmoving&&(T.scrollmom.doMomentum(),T.lastmouseup=!0,T.hideCursor(),P.hasmousecapture&&l.releaseCapture(),o))return T.cancelEvent(e)}else if(1==T.rail.drag.pt)return T.onmouseup(e)};var z=M.emulatetouch&&T.isiframe&&!P.hasmousecapture,k=.3*M.directionlockdeadzone|0;T.ontouchmove=function(e,o){if(!T.rail.drag)return!0;if(e.targetTouches&&M.preventmultitouchscrolling&&e.targetTouches.length>1)return!0;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!0;if(2==T.rail.drag.pt){"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY);var t,r;if(r=t=0,z&&!o){var i=T.win.position();r=-i.left,t=-i.top}var s=e.clientY+t,n=s-T.rail.drag.y,a=e.clientX+r,c=a-T.rail.drag.x,d=T.rail.drag.st-n;if(T.ishwscroll&&M.bouncescroll)d<0?d=Math.round(d/2):d>T.page.maxh&&(d=T.page.maxh+Math.round((d-T.page.maxh)/2));else if(d<0?(d=0,s=0):d>T.page.maxh&&(d=T.page.maxh,s=0),0===s&&!T.hasmoving)return T.ispage||(T.rail.drag=!1),!0;var u=T.getScrollLeft();if(T.railh&&T.railh.scrollable&&(u=T.isrtlmode?c-T.rail.drag.sl:T.rail.drag.sl-c,T.ishwscroll&&M.bouncescroll?u<0?u=Math.round(u/2):u>T.page.maxw&&(u=T.page.maxw+Math.round((u-T.page.maxw)/2)):(u<0&&(u=0,a=0),u>T.page.maxw&&(u=T.page.maxw,a=0))),!T.hasmoving){if(T.rail.drag.y===e.clientY&&T.rail.drag.x===e.clientX)return T.cancelEvent(e);var h=Math.abs(n),p=Math.abs(c),m=M.directionlockdeadzone;if(T.rail.drag.ck?"v"==T.rail.drag.ck?p>m&&h<=k?T.rail.drag=!1:h>m&&(T.rail.drag.dl="v"):"h"==T.rail.drag.ck&&(h>m&&p<=k?T.rail.drag=!1:p>m&&(T.rail.drag.dl="h")):h>m&&p>m?T.rail.drag.dl="f":h>m?T.rail.drag.dl=p>k?"f":"v":p>m&&(T.rail.drag.dl=h>k?"f":"h"),!T.rail.drag.dl)return T.cancelEvent(e);T.triggerScrollStart(e.clientX,e.clientY,0,0,0),T.hasmoving=!0}return T.preventclick&&!T.preventclick.click&&(T.preventclick.click=T.preventclick.tg.onclick||!1,T.preventclick.tg.onclick=T.onpreventclick),T.rail.drag.dl&&("v"==T.rail.drag.dl?u=T.rail.drag.sl:"h"==T.rail.drag.dl&&(d=T.rail.drag.st)),T.synched("touchmove",function(){T.rail.drag&&2==T.rail.drag.pt&&(T.prepareTransition&&T.resetTransition(),T.rail.scrollable&&T.setScrollTop(d),T.scrollmom.update(a,s),T.railh&&T.railh.scrollable?(T.setScrollLeft(u),T.showCursor(d,u)):T.showCursor(d),P.isie10&&l.selection.clear())}),T.cancelEvent(e)}return 1==T.rail.drag.pt?T.onmousemove(e):void 0},T.ontouchstartCursor=function(e,o){if(!T.rail.drag||3==T.rail.drag.pt){if(T.locked)return T.cancelEvent(e);T.cancelScroll(),T.rail.drag={x:e.touches[0].clientX,y:e.touches[0].clientY,sx:T.scroll.x,sy:T.scroll.y,pt:3,hr:!!o};var t=T.getTarget(e);return!T.ispage&&P.hasmousecapture&&t.setCapture(),T.isiframe&&!P.hasmousecapture&&(T.saved.csspointerevents=T.doc.css("pointer-events"),T.css(T.doc,{"pointer-events":"none"})),T.cancelEvent(e)}},T.ontouchendCursor=function(e){if(T.rail.drag){if(P.hasmousecapture&&l.releaseCapture(),T.isiframe&&!P.hasmousecapture&&T.doc.css("pointer-events",T.saved.csspointerevents),3!=T.rail.drag.pt)return;return T.rail.drag=!1,T.cancelEvent(e)}},T.ontouchmoveCursor=function(e){if(T.rail.drag){if(3!=T.rail.drag.pt)return;if(T.cursorfreezed=!0,T.rail.drag.hr){T.scroll.x=T.rail.drag.sx+(e.touches[0].clientX-T.rail.drag.x),T.scroll.x<0&&(T.scroll.x=0);var o=T.scrollvaluemaxw;T.scroll.x>o&&(T.scroll.x=o)}else{T.scroll.y=T.rail.drag.sy+(e.touches[0].clientY-T.rail.drag.y),T.scroll.y<0&&(T.scroll.y=0);var t=T.scrollvaluemax;T.scroll.y>t&&(T.scroll.y=t)}return T.synched("touchmove",function(){T.rail.drag&&3==T.rail.drag.pt&&(T.showCursor(),T.rail.drag.hr?T.doScrollLeft(Math.round(T.scroll.x*T.scrollratio.x),M.cursordragspeed):T.doScrollTop(Math.round(T.scroll.y*T.scrollratio.y),M.cursordragspeed))}),T.cancelEvent(e)}}}if(T.onmousedown=function(e,o){if(!T.rail.drag||1==T.rail.drag.pt){if(T.railslocked)return T.cancelEvent(e);T.cancelScroll(),T.rail.drag={x:e.clientX,y:e.clientY,sx:T.scroll.x,sy:T.scroll.y,pt:1,hr:o||!1};var t=T.getTarget(e);return P.hasmousecapture&&t.setCapture(),T.isiframe&&!P.hasmousecapture&&(T.saved.csspointerevents=T.doc.css("pointer-events"),T.css(T.doc,{"pointer-events":"none"})),T.hasmoving=!1,T.cancelEvent(e)}},T.onmouseup=function(e){if(T.rail.drag)return 1!=T.rail.drag.pt||(P.hasmousecapture&&l.releaseCapture(),T.isiframe&&!P.hasmousecapture&&T.doc.css("pointer-events",T.saved.csspointerevents),T.rail.drag=!1,T.cursorfreezed=!1,T.hasmoving&&T.triggerScrollEnd(),T.cancelEvent(e))},T.onmousemove=function(e){if(T.rail.drag){if(1!==T.rail.drag.pt)return;if(P.ischrome&&0===e.which)return T.onmouseup(e);if(T.cursorfreezed=!0,T.hasmoving||T.triggerScrollStart(e.clientX,e.clientY,0,0,0),T.hasmoving=!0,T.rail.drag.hr){T.scroll.x=T.rail.drag.sx+(e.clientX-T.rail.drag.x),T.scroll.x<0&&(T.scroll.x=0);var o=T.scrollvaluemaxw;T.scroll.x>o&&(T.scroll.x=o)}else{T.scroll.y=T.rail.drag.sy+(e.clientY-T.rail.drag.y),T.scroll.y<0&&(T.scroll.y=0);var t=T.scrollvaluemax;T.scroll.y>t&&(T.scroll.y=t)}return T.synched("mousemove",function(){T.cursorfreezed&&(T.showCursor(),T.rail.drag.hr?T.scrollLeft(Math.round(T.scroll.x*T.scrollratio.x)):T.scrollTop(Math.round(T.scroll.y*T.scrollratio.y)))}),T.cancelEvent(e)}T.checkarea=0},P.cantouch||M.emulatetouch)T.onpreventclick=function(e){if(T.preventclick)return T.preventclick.tg.onclick=T.preventclick.click,T.preventclick=!1,T.cancelEvent(e)},T.onclick=!P.isios&&function(e){return!T.lastmouseup||(T.lastmouseup=!1,T.cancelEvent(e))},M.grabcursorenabled&&P.cursorgrabvalue&&(T.css(T.ispage?T.doc:T.win,{cursor:P.cursorgrabvalue}),T.css(T.rail,{cursor:P.cursorgrabvalue}));else{var L=function(e){if(T.selectiondrag){if(e){var o=T.win.outerHeight(),t=e.pageY-T.selectiondrag.top;t>0&&t<o&&(t=0),t>=o&&(t-=o),T.selectiondrag.df=t}if(0!==T.selectiondrag.df){var r=-2*T.selectiondrag.df/6|0;T.doScrollBy(r),T.debounced("doselectionscroll",function(){L()},50)}}};T.hasTextSelected="getSelection"in l?function(){return l.getSelection().rangeCount>0}:"selection"in l?function(){return"None"!=l.selection.type}:function(){return!1},T.onselectionstart=function(e){T.ispage||(T.selectiondrag=T.win.offset())},T.onselectionend=function(e){T.selectiondrag=!1},T.onselectiondrag=function(e){T.selectiondrag&&T.hasTextSelected()&&T.debounced("selectionscroll",function(){L(e)},250)}}if(P.hasw3ctouch?(T.css(T.ispage?n("html"):T.win,{"touch-action":"none"}),T.css(T.rail,{"touch-action":"none"}),T.css(T.cursor,{"touch-action":"none"}),T.bind(T.win,"pointerdown",T.ontouchstart),T.bind(l,"pointerup",T.ontouchend),T.delegate(l,"pointermove",T.ontouchmove)):P.hasmstouch?(T.css(T.ispage?n("html"):T.win,{"-ms-touch-action":"none"}),T.css(T.rail,{"-ms-touch-action":"none"}),T.css(T.cursor,{"-ms-touch-action":"none"}),T.bind(T.win,"MSPointerDown",T.ontouchstart),T.bind(l,"MSPointerUp",T.ontouchend),T.delegate(l,"MSPointerMove",T.ontouchmove),T.bind(T.cursor,"MSGestureHold",function(e){e.preventDefault()}),T.bind(T.cursor,"contextmenu",function(e){e.preventDefault()})):P.cantouch&&(T.bind(T.win,"touchstart",T.ontouchstart,!1,!0),T.bind(l,"touchend",T.ontouchend,!1,!0),T.bind(l,"touchcancel",T.ontouchend,!1,!0),T.delegate(l,"touchmove",T.ontouchmove,!1,!0)),M.emulatetouch&&(T.bind(T.win,"mousedown",T.ontouchstart,!1,!0),T.bind(l,"mouseup",T.ontouchend,!1,!0),T.bind(l,"mousemove",T.ontouchmove,!1,!0)),(M.cursordragontouch||!P.cantouch&&!M.emulatetouch)&&(T.rail.css({cursor:"default"}),T.railh&&T.railh.css({cursor:"default"}),T.jqbind(T.rail,"mouseenter",function(){if(!T.ispage&&!T.win.is(":visible"))return!1;T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.rail,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}),M.sensitiverail&&(T.bind(T.rail,"click",function(e){T.doRailClick(e,!1,!1)}),T.bind(T.rail,"dblclick",function(e){T.doRailClick(e,!0,!1)}),T.bind(T.cursor,"click",function(e){T.cancelEvent(e)}),T.bind(T.cursor,"dblclick",function(e){T.cancelEvent(e)})),T.railh&&(T.jqbind(T.railh,"mouseenter",function(){if(!T.ispage&&!T.win.is(":visible"))return!1;T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.railh,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}),M.sensitiverail&&(T.bind(T.railh,"click",function(e){T.doRailClick(e,!1,!0)}),T.bind(T.railh,"dblclick",function(e){T.doRailClick(e,!0,!0)}),T.bind(T.cursorh,"click",function(e){T.cancelEvent(e)}),T.bind(T.cursorh,"dblclick",function(e){T.cancelEvent(e)})))),M.cursordragontouch&&(this.istouchcapable||P.cantouch)&&(T.bind(T.cursor,"touchstart",T.ontouchstartCursor),T.bind(T.cursor,"touchmove",T.ontouchmoveCursor),T.bind(T.cursor,"touchend",T.ontouchendCursor),T.cursorh&&T.bind(T.cursorh,"touchstart",function(e){T.ontouchstartCursor(e,!0)}),T.cursorh&&T.bind(T.cursorh,"touchmove",T.ontouchmoveCursor),T.cursorh&&T.bind(T.cursorh,"touchend",T.ontouchendCursor)),M.emulatetouch||P.isandroid||P.isios?(T.bind(P.hasmousecapture?T.win:l,"mouseup",T.ontouchend),T.onclick&&T.bind(l,"click",T.onclick),M.cursordragontouch?(T.bind(T.cursor,"mousedown",T.onmousedown),T.bind(T.cursor,"mouseup",T.onmouseup),T.cursorh&&T.bind(T.cursorh,"mousedown",function(e){T.onmousedown(e,!0)}),T.cursorh&&T.bind(T.cursorh,"mouseup",T.onmouseup)):(T.bind(T.rail,"mousedown",function(e){e.preventDefault()}),T.railh&&T.bind(T.railh,"mousedown",function(e){e.preventDefault()}))):(T.bind(P.hasmousecapture?T.win:l,"mouseup",T.onmouseup),T.bind(l,"mousemove",T.onmousemove),T.onclick&&T.bind(l,"click",T.onclick),T.bind(T.cursor,"mousedown",T.onmousedown),T.bind(T.cursor,"mouseup",T.onmouseup),T.railh&&(T.bind(T.cursorh,"mousedown",function(e){T.onmousedown(e,!0)}),T.bind(T.cursorh,"mouseup",T.onmouseup)),!T.ispage&&M.enablescrollonselection&&(T.bind(T.win[0],"mousedown",T.onselectionstart),T.bind(l,"mouseup",T.onselectionend),T.bind(T.cursor,"mouseup",T.onselectionend),T.cursorh&&T.bind(T.cursorh,"mouseup",T.onselectionend),T.bind(l,"mousemove",T.onselectiondrag)),T.zoom&&(T.jqbind(T.zoom,"mouseenter",function(){T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.zoom,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}))),M.enablemousewheel&&(T.isiframe||T.mousewheel(P.isie&&T.ispage?l:T.win,T.onmousewheel),T.mousewheel(T.rail,T.onmousewheel),T.railh&&T.mousewheel(T.railh,T.onmousewheelhr)),T.ispage||P.cantouch||/HTML|^BODY/.test(T.win[0].nodeName)||(T.win.attr("tabindex")||T.win.attr({tabindex:++r}),T.bind(T.win,"focus",function(e){o=T.getTarget(e).id||T.getTarget(e)||!1,T.hasfocus=!0,T.canshowonmouseevent&&T.noticeCursor()}),T.bind(T.win,"blur",function(e){o=!1,T.hasfocus=!1}),T.bind(T.win,"mouseenter",function(e){t=T.getTarget(e).id||T.getTarget(e)||!1,T.hasmousefocus=!0,T.canshowonmouseevent&&T.noticeCursor()}),T.bind(T.win,"mouseleave",function(e){t=!1,T.hasmousefocus=!1,T.rail.drag||T.hideCursor()})),T.onkeypress=function(e){if(T.railslocked&&0===T.page.maxh)return!0;e=e||a.event;var r=T.getTarget(e);if(r&&/INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName)&&(!(r.getAttribute("type")||r.type||!1)||!/submit|button|cancel/i.tp))return!0;if(n(r).attr("contenteditable"))return!0;if(T.hasfocus||T.hasmousefocus&&!o||T.ispage&&!o&&!t){var i=e.keyCode;if(T.railslocked&&27!=i)return T.cancelEvent(e);var s=e.ctrlKey||!1,l=e.shiftKey||!1,c=!1;switch(i){case 38:case 63233:T.doScrollBy(72),c=!0;break;case 40:case 63235:T.doScrollBy(-72),c=!0;break;case 37:case 63232:T.railh&&(s?T.doScrollLeft(0):T.doScrollLeftBy(72),c=!0);break;case 39:case 63234:T.railh&&(s?T.doScrollLeft(T.page.maxw):T.doScrollLeftBy(-72),c=!0);break;case 33:case 63276:T.doScrollBy(T.view.h),c=!0;break;case 34:case 63277:T.doScrollBy(-T.view.h),c=!0;break;case 36:case 63273:T.railh&&s?T.doScrollPos(0,0):T.doScrollTo(0),c=!0;break;case 35:case 63275:T.railh&&s?T.doScrollPos(T.page.maxw,T.page.maxh):T.doScrollTo(T.page.maxh),c=!0;break;case 32:M.spacebarenabled&&(l?T.doScrollBy(T.view.h):T.doScrollBy(-T.view.h),c=!0);break;case 27:T.zoomactive&&(T.doZoom(),c=!0)}if(c)return T.cancelEvent(e)}},M.enablekeyboard&&T.bind(l,P.isopera&&!P.isopera12?"keypress":"keydown",T.onkeypress),T.bind(l,"keydown",function(e){(e.ctrlKey||!1)&&(T.wheelprevented=!0)}),T.bind(l,"keyup",function(e){e.ctrlKey||!1||(T.wheelprevented=!1)}),T.bind(a,"blur",function(e){T.wheelprevented=!1}),T.bind(a,"resize",T.onscreenresize),T.bind(a,"orientationchange",T.onscreenresize),T.bind(a,"load",T.lazyResize),P.ischrome&&!T.ispage&&!T.haswrapper){var C=T.win.attr("style"),N=parseFloat(T.win.css("width"))+1;T.win.css("width",N),T.synched("chromefix",function(){T.win.attr("style",C)})}if(T.onAttributeChange=function(e){T.lazyResize(T.isieold?250:30)},M.enableobserver&&(T.isie11||!1===m||(T.observerbody=new m(function(e){if(e.forEach(function(e){if("attributes"==e.type)return E.hasClass("modal-open")&&E.hasClass("modal-dialog")&&!n.contains(n(".modal-dialog")[0],T.doc[0])?T.hide():T.show()}),T.me.clientWidth!=T.page.width||T.me.clientHeight!=T.page.height)return T.lazyResize(30)}),T.observerbody.observe(l.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!T.ispage&&!T.haswrapper)){var R=T.win[0];!1!==m?(T.observer=new m(function(e){e.forEach(T.onAttributeChange)}),T.observer.observe(R,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),T.observerremover=new m(function(e){e.forEach(function(e){if(e.removedNodes.length>0)for(var o in e.removedNodes)if(T&&e.removedNodes[o]===R)return T.remove()})}),T.observerremover.observe(R.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(T.bind(R,P.isie&&!P.isie9?"propertychange":"DOMAttrModified",T.onAttributeChange),P.isie9&&R.attachEvent("onpropertychange",T.onAttributeChange),T.bind(R,"DOMNodeRemoved",function(e){e.target===R&&T.remove()}))}!T.ispage&&M.boxzoom&&T.bind(a,"resize",T.resizeZoom),T.istextarea&&(T.bind(T.win,"keydown",T.lazyResize),T.bind(T.win,"mouseup",T.lazyResize)),T.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var _=function(){T.iframexd=!1;var o;try{(o="contentDocument"in this?this.contentDocument:this.contentWindow._doc).domain}catch(e){T.iframexd=!0,o=!1}if(T.iframexd)return"console"in a&&console.log("NiceScroll error: policy restriced iframe"),!0;if(T.forcescreen=!0,T.isiframe&&(T.iframe={doc:n(o),html:T.doc.contents().find("html")[0],body:T.doc.contents().find("body")[0]},T.getContentSize=function(){return{w:Math.max(T.iframe.html.scrollWidth,T.iframe.body.scrollWidth),h:Math.max(T.iframe.html.scrollHeight,T.iframe.body.scrollHeight)}},T.docscroll=n(T.iframe.body)),!P.isios&&M.iframeautoresize&&!T.isiframe){T.win.scrollTop(0),T.doc.height("");var t=Math.max(o.getElementsByTagName("html")[0].scrollHeight,o.body.scrollHeight);T.doc.height(t)}T.lazyResize(30),T.css(n(T.iframe.body),e),P.isios&&T.haswrapper&&T.css(n(o.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentWindow"in this?T.bind(this.contentWindow,"scroll",T.onscroll):T.bind(o,"scroll",T.onscroll),M.enablemousewheel&&T.mousewheel(o,T.onmousewheel),M.enablekeyboard&&T.bind(o,P.isopera?"keypress":"keydown",T.onkeypress),P.cantouch?(T.bind(o,"touchstart",T.ontouchstart),T.bind(o,"touchmove",T.ontouchmove)):M.emulatetouch&&(T.bind(o,"mousedown",T.ontouchstart),T.bind(o,"mousemove",function(e){return T.ontouchmove(e,!0)}),M.grabcursorenabled&&P.cursorgrabvalue&&T.css(n(o.body),{cursor:P.cursorgrabvalue})),T.bind(o,"mouseup",T.ontouchend),T.zoom&&(M.dblclickzoom&&T.bind(o,"dblclick",T.doZoom),T.ongesturezoom&&T.bind(o,"gestureend",T.ongesturezoom))};this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout(function(){_.call(T.doc[0],!1)},500),T.bind(this.doc,"load",_)}},this.showCursor=function(e,o){if(T.cursortimeout&&(clearTimeout(T.cursortimeout),T.cursortimeout=0),T.rail){if(T.autohidedom&&(T.autohidedom.stop().css({opacity:M.cursoropacitymax}),T.cursoractive=!0),T.rail.drag&&1==T.rail.drag.pt||(void 0!==e&&!1!==e&&(T.scroll.y=e/T.scrollratio.y|0),void 0!==o&&(T.scroll.x=o/T.scrollratio.x|0)),T.cursor.css({height:T.cursorheight,top:T.scroll.y}),T.cursorh){var t=T.hasreversehr?T.scrollvaluemaxw-T.scroll.x:T.scroll.x;T.cursorh.css({width:T.cursorwidth,left:!T.rail.align&&T.rail.visibility?t+T.rail.width:t}),T.cursoractive=!0}T.zoom&&T.zoom.stop().css({opacity:M.cursoropacitymax})}},this.hideCursor=function(e){T.cursortimeout||T.rail&&T.autohidedom&&(T.hasmousefocus&&"leave"===M.autohidemode||(T.cursortimeout=setTimeout(function(){T.rail.active&&T.showonmouseevent||(T.autohidedom.stop().animate({opacity:M.cursoropacitymin}),T.zoom&&T.zoom.stop().animate({opacity:M.cursoropacitymin}),T.cursoractive=!1),T.cursortimeout=0},e||M.hidecursordelay)))},this.noticeCursor=function(e,o,t){T.showCursor(o,t),T.rail.active||T.hideCursor(e)},this.getContentSize=T.ispage?function(){return{w:Math.max(l.body.scrollWidth,l.documentElement.scrollWidth),h:Math.max(l.body.scrollHeight,l.documentElement.scrollHeight)}}:T.haswrapper?function(){return{w:T.doc[0].offsetWidth,h:T.doc[0].offsetHeight}}:function(){return{w:T.docscroll[0].scrollWidth,h:T.docscroll[0].scrollHeight}},this.onResize=function(e,o){if(!T||!T.win)return!1;var t=T.page.maxh,r=T.page.maxw,i=T.view.h,s=T.view.w;if(T.view={w:T.ispage?T.win.width():T.win[0].clientWidth,h:T.ispage?T.win.height():T.win[0].clientHeight},T.page=o||T.getContentSize(),T.page.maxh=Math.max(0,T.page.h-T.view.h),T.page.maxw=Math.max(0,T.page.w-T.view.w),T.page.maxh==t&&T.page.maxw==r&&T.view.w==s&&T.view.h==i){if(T.ispage)return T;var n=T.win.offset();if(T.lastposition){var l=T.lastposition;if(l.top==n.top&&l.left==n.left)return T}T.lastposition=n}return 0===T.page.maxh?(T.hideRail(),T.scrollvaluemax=0,T.scroll.y=0,T.scrollratio.y=0,T.cursorheight=0,T.setScrollTop(0),T.rail&&(T.rail.scrollable=!1)):(T.page.maxh-=M.railpadding.top+M.railpadding.bottom,T.rail.scrollable=!0),0===T.page.maxw?(T.hideRailHr(),T.scrollvaluemaxw=0,T.scroll.x=0,T.scrollratio.x=0,T.cursorwidth=0,T.setScrollLeft(0),T.railh&&(T.railh.scrollable=!1)):(T.page.maxw-=M.railpadding.left+M.railpadding.right,T.railh&&(T.railh.scrollable=M.horizrailenabled)),T.railslocked=T.locked||0===T.page.maxh&&0===T.page.maxw,T.railslocked?(T.ispage||T.updateScrollBar(T.view),!1):(T.hidden||(T.rail.visibility||T.showRail(),T.railh&&!T.railh.visibility&&T.showRailHr()),T.istextarea&&T.win.css("resize")&&"none"!=T.win.css("resize")&&(T.view.h-=20),T.cursorheight=Math.min(T.view.h,Math.round(T.view.h*(T.view.h/T.page.h))),T.cursorheight=M.cursorfixedheight?M.cursorfixedheight:Math.max(M.cursorminheight,T.cursorheight),T.cursorwidth=Math.min(T.view.w,Math.round(T.view.w*(T.view.w/T.page.w))),T.cursorwidth=M.cursorfixedheight?M.cursorfixedheight:Math.max(M.cursorminheight,T.cursorwidth),T.scrollvaluemax=T.view.h-T.cursorheight-(M.railpadding.top+M.railpadding.bottom),T.hasborderbox||(T.scrollvaluemax-=T.cursor[0].offsetHeight-T.cursor[0].clientHeight),T.railh&&(T.railh.width=T.page.maxh>0?T.view.w-T.rail.width:T.view.w,T.scrollvaluemaxw=T.railh.width-T.cursorwidth-(M.railpadding.left+M.railpadding.right)),T.ispage||T.updateScrollBar(T.view),T.scrollratio={x:T.page.maxw/T.scrollvaluemaxw,y:T.page.maxh/T.scrollvaluemax},T.getScrollTop()>T.page.maxh?T.doScrollTop(T.page.maxh):(T.scroll.y=T.getScrollTop()/T.scrollratio.y|0,T.scroll.x=T.getScrollLeft()/T.scrollratio.x|0,T.cursoractive&&T.noticeCursor()),T.scroll.y&&0===T.getScrollTop()&&T.doScrollTo(T.scroll.y*T.scrollratio.y|0),T)},this.resize=T.onResize;var O=0;this.onscreenresize=function(e){clearTimeout(O);var o=!T.ispage&&!T.haswrapper;o&&T.hideRails(),O=setTimeout(function(){T&&(o&&T.showRails(),T.resize()),O=0},120)},this.lazyResize=function(e){return clearTimeout(O),e=isNaN(e)?240:e,O=setTimeout(function(){T&&T.resize(),O=0},e),T},this.jqbind=function(e,o,t){T.events.push({e:e,n:o,f:t,q:!0}),n(e).on(o,t)},this.mousewheel=function(e,o,t){var r="jquery"in e?e[0]:e;if("onwheel"in l.createElement("div"))T._bind(r,"wheel",o,t||!1);else{var i=void 0!==l.onmousewheel?"mousewheel":"DOMMouseScroll";S(r,i,o,t||!1),"DOMMouseScroll"==i&&S(r,"MozMousePixelScroll",o,t||!1)}};var Y=!1;if(P.haseventlistener){try{var H=Object.defineProperty({},"passive",{get:function(){Y=!0}});a.addEventListener("test",null,H)}catch(e){}this.stopPropagation=function(e){return!!e&&((e=e.original?e.original:e).stopPropagation(),!1)},this.cancelEvent=function(e){return e.cancelable&&e.preventDefault(),e.stopImmediatePropagation(),e.preventManipulation&&e.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},a.constructor.prototype.addEventListener=l.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(e,o,t){this.attachEvent("on"+e,o)},a.constructor.prototype.removeEventListener=l.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(e,o,t){this.detachEvent("on"+e,o)},this.cancelEvent=function(e){return(e=e||a.event)&&(e.cancelBubble=!0,e.cancel=!0,e.returnValue=!1),!1},this.stopPropagation=function(e){return(e=e||a.event)&&(e.cancelBubble=!0),!1};this.delegate=function(e,o,t,r,i){var s=d[o]||!1;s||(s={a:[],l:[],f:function(e){for(var o=s.l,t=!1,r=o.length-1;r>=0;r--)if(!1===(t=o[r].call(e.target,e)))return!1;return t}},T.bind(e,o,s.f,r,i),d[o]=s),T.ispage?(s.a=[T.id].concat(s.a),s.l=[t].concat(s.l)):(s.a.push(T.id),s.l.push(t))},this.undelegate=function(e,o,t,r,i){var s=d[o]||!1;if(s&&s.l)for(var n=0,l=s.l.length;n<l;n++)s.a[n]===T.id&&(s.a.splice(n),s.l.splice(n),0===s.a.length&&(T._unbind(e,o,s.l.f),d[o]=null))},this.bind=function(e,o,t,r,i){var s="jquery"in e?e[0]:e;T._bind(s,o,t,r||!1,i||!1)},this._bind=function(e,o,t,r,i){T.events.push({e:e,n:o,f:t,b:r,q:!1}),Y&&i?e.addEventListener(o,t,{passive:!1,capture:r}):e.addEventListener(o,t,r||!1)},this._unbind=function(e,o,t,r){d[o]?T.undelegate(e,o,t,r):e.removeEventListener(o,t,r)},this.unbindAll=function(){for(var e=0;e<T.events.length;e++){var o=T.events[e];o.q?o.e.unbind(o.n,o.f):T._unbind(o.e,o.n,o.f,o.b)}},this.showRails=function(){return T.showRail().showRailHr()},this.showRail=function(){return 0===T.page.maxh||!T.ispage&&"none"==T.win.css("display")||(T.rail.visibility=!0,T.rail.css("display","block")),T},this.showRailHr=function(){return T.railh&&(0===T.page.maxw||!T.ispage&&"none"==T.win.css("display")||(T.railh.visibility=!0,T.railh.css("display","block"))),T},this.hideRails=function(){return T.hideRail().hideRailHr()},this.hideRail=function(){return T.rail.visibility=!1,T.rail.css("display","none"),T},this.hideRailHr=function(){return T.railh&&(T.railh.visibility=!1,T.railh.css("display","none")),T},this.show=function(){return T.hidden=!1,T.railslocked=!1,T.showRails()},this.hide=function(){return T.hidden=!0,T.railslocked=!0,T.hideRails()},this.toggle=function(){return T.hidden?T.show():T.hide()},this.remove=function(){T.stop(),T.cursortimeout&&clearTimeout(T.cursortimeout);for(var e in T.delaylist)T.delaylist[e]&&h(T.delaylist[e].h);T.doZoomOut(),T.unbindAll(),P.isie9&&T.win[0].detachEvent("onpropertychange",T.onAttributeChange),!1!==T.observer&&T.observer.disconnect(),!1!==T.observerremover&&T.observerremover.disconnect(),!1!==T.observerbody&&T.observerbody.disconnect(),T.events=null,T.cursor&&T.cursor.remove(),T.cursorh&&T.cursorh.remove(),T.rail&&T.rail.remove(),T.railh&&T.railh.remove(),T.zoom&&T.zoom.remove();for(var o=0;o<T.saved.css.length;o++){var t=T.saved.css[o];t[0].css(t[1],void 0===t[2]?"":t[2])}T.saved=!1,T.me.data("__nicescroll","");var r=n.nicescroll;r.each(function(e){if(this&&this.id===T.id){delete r[e];for(var o=++e;o<r.length;o++,e++)r[e]=r[o];--r.length&&delete r[r.length]}});for(var i in T)T[i]=null,delete T[i];T=null},this.scrollstart=function(e){return this.onscrollstart=e,T},this.scrollend=function(e){return this.onscrollend=e,T},this.scrollcancel=function(e){return this.onscrollcancel=e,T},this.zoomin=function(e){return this.onzoomin=e,T},this.zoomout=function(e){return this.onzoomout=e,T},this.isScrollable=function(e){var o=e.target?e.target:e;if("OPTION"==o.nodeName)return!0;for(;o&&1==o.nodeType&&o!==this.me[0]&&!/^BODY|HTML/.test(o.nodeName);){var t=n(o),r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r))return o.clientHeight!=o.scrollHeight;o=!!o.parentNode&&o.parentNode}return!1},this.getViewport=function(e){for(var o=!(!e||!e.parentNode)&&e.parentNode;o&&1==o.nodeType&&!/^BODY|HTML/.test(o.nodeName);){var t=n(o);if(/fixed|absolute/.test(t.css("position")))return t;var r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r)&&o.clientHeight!=o.scrollHeight)return t;if(t.getNiceScroll().length>0)return t;o=!!o.parentNode&&o.parentNode}return!1},this.triggerScrollStart=function(e,o,t,r,i){if(T.onscrollstart){var s={type:"scrollstart",current:{x:e,y:o},request:{x:t,y:r},end:{x:T.newscrollx,y:T.newscrolly},speed:i};T.onscrollstart.call(T,s)}},this.triggerScrollEnd=function(){if(T.onscrollend){var e=T.getScrollLeft(),o=T.getScrollTop(),t={type:"scrollend",current:{x:e,y:o},end:{x:e,y:o}};T.onscrollend.call(T,t)}};var B=0,X=0,D=0,A=1,q=!1;if(this.onmousewheel=function(e){if(T.wheelprevented||T.locked)return!1;if(T.railslocked)return T.debounced("checkunlock",T.resize,250),!1;if(T.rail.drag)return T.cancelEvent(e);if("auto"===M.oneaxismousemode&&0!==e.deltaX&&(M.oneaxismousemode=!1),M.oneaxismousemode&&0===e.deltaX&&!T.rail.scrollable)return!T.railh||!T.railh.scrollable||T.onmousewheelhr(e);var o=f(),t=!1;if(M.preservenativescrolling&&T.checkarea+600<o&&(T.nativescrollingarea=T.isScrollable(e),t=!0),T.checkarea=o,T.nativescrollingarea)return!0;var r=k(e,!1,t);return r&&(T.checkarea=0),r},this.onmousewheelhr=function(e){if(!T.wheelprevented){if(T.railslocked||!T.railh.scrollable)return!0;if(T.rail.drag)return T.cancelEvent(e);var o=f(),t=!1;return M.preservenativescrolling&&T.checkarea+600<o&&(T.nativescrollingarea=T.isScrollable(e),t=!0),T.checkarea=o,!!T.nativescrollingarea||(T.railslocked?T.cancelEvent(e):k(e,!0,t))}},this.stop=function(){return T.cancelScroll(),T.scrollmon&&T.scrollmon.stop(),T.cursorfreezed=!1,T.scroll.y=Math.round(T.getScrollTop()*(1/T.scrollratio.y)),T.noticeCursor(),T},this.getTransitionSpeed=function(e){return 80+e/72*M.scrollspeed|0},M.smoothscroll)if(T.ishwscroll&&P.hastransition&&M.usetransition&&M.smoothscroll){var j="";this.resetTransition=function(){j="",T.doc.css(P.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(e,o){var t=o?e:T.getTransitionSpeed(e),r=t+"ms";return j!==r&&(j=r,T.doc.css(P.prefixstyle+"transition-duration",r)),t},this.doScrollLeft=function(e,o){var t=T.scrollrunning?T.newscrolly:T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.scrollrunning?T.newscrollx:T.getScrollLeft();T.doScrollPos(t,e,o)},this.cursorupdate={running:!1,start:function(){var e=this;if(!e.running){e.running=!0;var o=function(){e.running&&u(o),T.showCursor(T.getScrollTop(),T.getScrollLeft()),T.notifyScrollEvent(T.win[0])};u(o)}},stop:function(){this.running=!1}},this.doScrollPos=function(e,o,t){var r=T.getScrollTop(),i=T.getScrollLeft();if(((T.newscrolly-r)*(o-r)<0||(T.newscrollx-i)*(e-i)<0)&&T.cancelScroll(),M.bouncescroll?(o<0?o=o/2|0:o>T.page.maxh&&(o=T.page.maxh+(o-T.page.maxh)/2|0),e<0?e=e/2|0:e>T.page.maxw&&(e=T.page.maxw+(e-T.page.maxw)/2|0)):(o<0?o=0:o>T.page.maxh&&(o=T.page.maxh),e<0?e=0:e>T.page.maxw&&(e=T.page.maxw)),T.scrollrunning&&e==T.newscrollx&&o==T.newscrolly)return!1;T.newscrolly=o,T.newscrollx=e;var s=T.getScrollTop(),n=T.getScrollLeft(),l={};l.x=e-n,l.y=o-s;var a=0|Math.sqrt(l.x*l.x+l.y*l.y),c=T.prepareTransition(a);T.scrollrunning||(T.scrollrunning=!0,T.triggerScrollStart(n,s,e,o,c),T.cursorupdate.start()),T.scrollendtrapped=!0,P.transitionend||(T.scrollendtrapped&&clearTimeout(T.scrollendtrapped),T.scrollendtrapped=setTimeout(T.onScrollTransitionEnd,c)),T.setScrollTop(T.newscrolly),T.setScrollLeft(T.newscrollx)},this.cancelScroll=function(){if(!T.scrollendtrapped)return!0;var e=T.getScrollTop(),o=T.getScrollLeft();return T.scrollrunning=!1,P.transitionend||clearTimeout(P.transitionend),T.scrollendtrapped=!1,T.resetTransition(),T.setScrollTop(e),T.railh&&T.setScrollLeft(o),T.timerscroll&&T.timerscroll.tm&&clearInterval(T.timerscroll.tm),T.timerscroll=!1,T.cursorfreezed=!1,T.cursorupdate.stop(),T.showCursor(e,o),T},this.onScrollTransitionEnd=function(){if(T.scrollendtrapped){var e=T.getScrollTop(),o=T.getScrollLeft();if(e<0?e=0:e>T.page.maxh&&(e=T.page.maxh),o<0?o=0:o>T.page.maxw&&(o=T.page.maxw),e!=T.newscrolly||o!=T.newscrollx)return T.doScrollPos(o,e,M.snapbackspeed);T.scrollrunning&&T.triggerScrollEnd(),T.scrollrunning=!1,T.scrollendtrapped=!1,T.resetTransition(),T.timerscroll=!1,T.setScrollTop(e),T.railh&&T.setScrollLeft(o),T.cursorupdate.stop(),T.noticeCursor(!1,e,o),T.cursorfreezed=!1}}}else this.doScrollLeft=function(e,o){var t=T.scrollrunning?T.newscrolly:T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.scrollrunning?T.newscrollx:T.getScrollLeft();T.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=T.getScrollTop(),i=T.getScrollLeft();((T.newscrolly-r)*(o-r)<0||(T.newscrollx-i)*(e-i)<0)&&T.cancelScroll();var s=!1;if(T.bouncescroll&&T.rail.visibility||(o<0?(o=0,s=!0):o>T.page.maxh&&(o=T.page.maxh,s=!0)),T.bouncescroll&&T.railh.visibility||(e<0?(e=0,s=!0):e>T.page.maxw&&(e=T.page.maxw,s=!0)),T.scrollrunning&&T.newscrolly===o&&T.newscrollx===e)return!0;T.newscrolly=o,T.newscrollx=e,T.dst={},T.dst.x=e-i,T.dst.y=o-r,T.dst.px=i,T.dst.py=r;var n=0|Math.sqrt(T.dst.x*T.dst.x+T.dst.y*T.dst.y),l=T.getTransitionSpeed(n);T.bzscroll={};var a=s?1:.58;T.bzscroll.x=new R(i,T.newscrollx,l,0,0,a,1),T.bzscroll.y=new R(r,T.newscrolly,l,0,0,a,1);f();var c=function(){if(T.scrollrunning){var e=T.bzscroll.y.getPos();T.setScrollLeft(T.bzscroll.x.getNow()),T.setScrollTop(T.bzscroll.y.getNow()),e<=1?T.timer=u(c):(T.scrollrunning=!1,T.timer=0,T.triggerScrollEnd())}};T.scrollrunning||(T.triggerScrollStart(i,r,e,o,l),T.scrollrunning=!0,T.timer=u(c))},this.cancelScroll=function(){return T.timer&&h(T.timer),T.timer=0,T.bzscroll=!1,T.scrollrunning=!1,T};else this.doScrollLeft=function(e,o){var t=T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.getScrollLeft();T.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=e>T.page.maxw?T.page.maxw:e;r<0&&(r=0);var i=o>T.page.maxh?T.page.maxh:o;i<0&&(i=0),T.synched("scroll",function(){T.setScrollTop(i),T.setScrollLeft(r)})},this.cancelScroll=function(){};this.doScrollBy=function(e,o){z(0,e)},this.doScrollLeftBy=function(e,o){z(e,0)},this.doScrollTo=function(e,o){var t=o?Math.round(e*T.scrollratio.y):e;t<0?t=0:t>T.page.maxh&&(t=T.page.maxh),T.cursorfreezed=!1,T.doScrollTop(e)},this.checkContentSize=function(){var e=T.getContentSize();e.h==T.page.h&&e.w==T.page.w||T.resize(!1,e)},T.onscroll=function(e){T.rail.drag||T.cursorfreezed||T.synched("scroll",function(){T.scroll.y=Math.round(T.getScrollTop()/T.scrollratio.y),T.railh&&(T.scroll.x=Math.round(T.getScrollLeft()/T.scrollratio.x)),T.noticeCursor()})},T.bind(T.docscroll,"scroll",T.onscroll),this.doZoomIn=function(e){if(!T.zoomactive){T.zoomactive=!0,T.zoomrestore={style:{}};var o=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],t=T.win[0].style;for(var r in o){var i=o[r];T.zoomrestore.style[i]=void 0!==t[i]?t[i]:""}T.zoomrestore.style.width=T.win.css("width"),T.zoomrestore.style.height=T.win.css("height"),T.zoomrestore.padding={w:T.win.outerWidth()-T.win.width(),h:T.win.outerHeight()-T.win.height()},P.isios4&&(T.zoomrestore.scrollTop=c.scrollTop(),c.scrollTop(0)),T.win.css({position:P.isios4?"absolute":"fixed",top:0,left:0,zIndex:s+100,margin:0});var n=T.win.css("backgroundColor");return(""===n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&T.win.css("backgroundColor","#fff"),T.rail.css({zIndex:s+101}),T.zoom.css({zIndex:s+102}),T.zoom.css("backgroundPosition","0 -18px"),T.resizeZoom(),T.onzoomin&&T.onzoomin.call(T),T.cancelEvent(e)}},this.doZoomOut=function(e){if(T.zoomactive)return T.zoomactive=!1,T.win.css("margin",""),T.win.css(T.zoomrestore.style),P.isios4&&c.scrollTop(T.zoomrestore.scrollTop),T.rail.css({"z-index":T.zindex}),T.zoom.css({"z-index":T.zindex}),T.zoomrestore=!1,T.zoom.css("backgroundPosition","0 0"),T.onResize(),T.onzoomout&&T.onzoomout.call(T),T.cancelEvent(e)},this.doZoom=function(e){return T.zoomactive?T.doZoomOut(e):T.doZoomIn(e)},this.resizeZoom=function(){if(T.zoomactive){var e=T.getScrollTop();T.win.css({width:c.width()-T.zoomrestore.padding.w+"px",height:c.height()-T.zoomrestore.padding.h+"px"}),T.onResize(),T.setScrollTop(Math.min(T.page.maxh,e))}},this.init(),n.nicescroll.push(this)},y=function(e){var o=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.reset=function(e,t){o.stop(),o.steptime=0,o.lasttime=f(),o.speedx=0,o.speedy=0,o.lastx=e,o.lasty=t,o.lastscrollx=-1,o.lastscrolly=-1},this.update=function(e,t){var r=f();o.steptime=r-o.lasttime,o.lasttime=r;var i=t-o.lasty,s=e-o.lastx,n=o.nc.getScrollTop()+i,l=o.nc.getScrollLeft()+s;o.snapx=l<0||l>o.nc.page.maxw,o.snapy=n<0||n>o.nc.page.maxh,o.speedx=s,o.speedy=i,o.lastx=e,o.lasty=t},this.stop=function(){o.nc.unsynched("domomentum2d"),o.timer&&clearTimeout(o.timer),o.timer=0,o.lastscrollx=-1,o.lastscrolly=-1},this.doSnapy=function(e,t){var r=!1;t<0?(t=0,r=!0):t>o.nc.page.maxh&&(t=o.nc.page.maxh,r=!0),e<0?(e=0,r=!0):e>o.nc.page.maxw&&(e=o.nc.page.maxw,r=!0),r?o.nc.doScrollPos(e,t,o.nc.opt.snapbackspeed):o.nc.triggerScrollEnd()},this.doMomentum=function(e){var t=f(),r=e?t+e:o.lasttime,i=o.nc.getScrollLeft(),s=o.nc.getScrollTop(),n=o.nc.page.maxh,l=o.nc.page.maxw;o.speedx=l>0?Math.min(60,o.speedx):0,o.speedy=n>0?Math.min(60,o.speedy):0;var a=r&&t-r<=60;(s<0||s>n||i<0||i>l)&&(a=!1);var c=!(!o.speedy||!a)&&o.speedy,d=!(!o.speedx||!a)&&o.speedx;if(c||d){var u=Math.max(16,o.steptime);if(u>50){var h=u/50;o.speedx*=h,o.speedy*=h,u=50}o.demulxy=0,o.lastscrollx=o.nc.getScrollLeft(),o.chkx=o.lastscrollx,o.lastscrolly=o.nc.getScrollTop(),o.chky=o.lastscrolly;var p=o.lastscrollx,m=o.lastscrolly,g=function(){var e=f()-t>600?.04:.02;o.speedx&&(p=Math.floor(o.lastscrollx-o.speedx*(1-o.demulxy)),o.lastscrollx=p,(p<0||p>l)&&(e=.1)),o.speedy&&(m=Math.floor(o.lastscrolly-o.speedy*(1-o.demulxy)),o.lastscrolly=m,(m<0||m>n)&&(e=.1)),o.demulxy=Math.min(1,o.demulxy+e),o.nc.synched("domomentum2d",function(){if(o.speedx){o.nc.getScrollLeft();o.chkx=p,o.nc.setScrollLeft(p)}if(o.speedy){o.nc.getScrollTop();o.chky=m,o.nc.setScrollTop(m)}o.timer||(o.nc.hideCursor(),o.doSnapy(p,m))}),o.demulxy<1?o.timer=setTimeout(g,u):(o.stop(),o.nc.hideCursor(),o.doSnapy(p,m))};g()}else o.doSnapy(o.nc.getScrollLeft(),o.nc.getScrollTop())}},x=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollTop():x.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollTop(parseInt(o)):x.call(e,o),this}},e.fn.scrollTop=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getScrollTop():x.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollTop(parseInt(e)):x.call(n(this),e)})};var S=e.fn.scrollLeft;n.cssHooks.pageXOffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollLeft():S.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollLeft(parseInt(o)):S.call(e,o),this}},e.fn.scrollLeft=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getScrollLeft():S.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollLeft(parseInt(e)):S.call(n(this),e)})};var z=function(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){return n.each(o,e),o},this.push=function(e){o[o.length]=e,o.length++},this.eq=function(e){return o[e]},e)for(var t=0;t<e.length;t++){var r=n.data(e[t],"__nicescroll")||!1;r&&(this[this.length]=r,this.length++)}return this};!function(e,o,t){for(var r=0,i=o.length;r<i;r++)t(e,o[r])}(z.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(e,o){e[o]=function(){var e=arguments;return this.each(function(){this[o].apply(this,e)})}}),e.fn.getNiceScroll=function(e){return void 0===e?new z(this):this[e]&&n.data(this[e],"__nicescroll")||!1},(e.expr.pseudos||e.expr[":"]).nicescroll=function(e){return void 0!==n.data(e,"__nicescroll")},n.fn.niceScroll=function(e,o){void 0!==o||"object"!=typeof e||"jquery"in e||(o=e,e=!1);var t=new z;return this.each(function(){var r=n(this),i=n.extend({},o);if(e){var s=n(e);i.doc=s.length>1?n(e,r):s,i.win=r}!("doc"in i)||"win"in i||(i.win=r);var l=r.data("__nicescroll")||!1;l||(i.doc=i.doc||r,l=new b(i,r),r.data("__nicescroll",l)),t.push(l)}),1===t.length?t[0]:t},a.NiceScroll={getjQuery:function(){return e}},n.nicescroll||(n.nicescroll=new z,n.nicescroll.options=g)});
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 7.7.07.006
7
  *
8
  */
9
 
@@ -55,7 +55,6 @@ function wppa_restore_settings( $fname, $type = '' ) {
55
  if ( $type == 'skin' ) {
56
  $void_these = array(
57
  'wppa_revision',
58
- 'wppa_resize_on_upload',
59
  'wppa_allow_debug',
60
  'wppa_thumb_linkpage',
61
  'wppa_potd_linkpage',
@@ -1143,12 +1142,14 @@ function wppa_make_360( $id, $degs ) {
1143
 
1144
  // Save new image as o1 source
1145
  $dst_path = wppa_get_o1_source_path( $id );
1146
- if ( ! wppa_imagejpeg( $canvas, $dst_path, 90 ) ) {
1147
  return false;
1148
  }
1149
 
1150
  // Housekeeping
1151
  imagedestroy( $canvas );
 
 
1152
 
1153
  // All done
1154
  return true;
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
55
  if ( $type == 'skin' ) {
56
  $void_these = array(
57
  'wppa_revision',
 
58
  'wppa_allow_debug',
59
  'wppa_thumb_linkpage',
60
  'wppa_potd_linkpage',
1142
 
1143
  // Save new image as o1 source
1144
  $dst_path = wppa_get_o1_source_path( $id );
1145
+ if ( ! wppa_imagejpeg( $canvas, $dst_path, wppa_opt( 'jpeg_quality' ) ) ) {
1146
  return false;
1147
  }
1148
 
1149
  // Housekeeping
1150
  imagedestroy( $canvas );
1151
+ wppa_bump_photo_rev();
1152
+ wppa_bump_thumb_rev();
1153
 
1154
  // All done
1155
  return true;
wppa-ajax-front.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /* wppa-ajax-front.php
3
- *
4
- * Supplies the functionality like wp-admin/admin-ajax.php for wppa frontend ajax requests without using wp-admin files
5
- * version 7.3.00
6
- *
7
- */
8
- define( 'DOING_AJAX', true );
9
-
10
- /** Load WordPress Bootstrap */
11
- require_once ( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-load.php' );
12
-
13
- /** Allow for cross-domain requests (from the frontend). */
14
- send_origin_headers();
15
-
16
- // Require an action parameter
17
- if ( empty( $_REQUEST['action'] ) )
18
- die( '0' );
19
-
20
- // Load the wppa admin functions
21
- require_once 'wppa-admin.php';
22
-
23
- @header( 'Content-Type: text/html; charset=' . wppa_get_option( 'blog_charset' ) );
24
- @header( 'X-Robots-Tag: noindex' );
25
-
26
- send_nosniff_header();
27
- nocache_headers();
28
-
29
- wppa_ajax_callback();
30
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-ajax.php CHANGED
@@ -2,12 +2,43 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.7.06.006
6
  *
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  add_action( 'wp_ajax_wppa', 'wppa_ajax_callback' );
12
  add_action( 'wp_ajax_nopriv_wppa', 'wppa_ajax_callback' );
13
 
@@ -61,10 +92,16 @@ global $wppa;
61
 
62
  if ( wppa_switch( 'log_ajax' ) ) {
63
  $args = '';
 
64
  foreach( array_keys( $_REQUEST ) as $key ) {
 
 
 
65
  $args .= $key . '=' . $_REQUEST[$key] . ', ';
66
  }
67
- wppa_log( 'Ajx', 'Args = ' . $args );
 
 
68
  }
69
 
70
  // Any runtime modifyable settings?
@@ -1560,7 +1597,7 @@ global $wppa;
1560
  'description' => __( 'Automatically created album when a deleted photo was recovered and the original album did no longer exist', 'wp-photo-album-plus' )
1561
  )
1562
  );
1563
-
1564
  if ( $iret ) {
1565
  $real_alb = $iret; // May be different id
1566
  }
@@ -2551,7 +2588,7 @@ global $wppa;
2551
 
2552
  // If set to featured, try to copy to wp media
2553
  if ( $item == 'status' && $value == 'featured' ) {
2554
-
2555
  require_once(ABSPATH . 'wp-admin/includes/media.php');
2556
  require_once(ABSPATH . 'wp-admin/includes/file.php');
2557
  require_once(ABSPATH . 'wp-admin/includes/image.php');
@@ -2588,7 +2625,7 @@ global $wppa;
2588
 
2589
  // This image/file will show on media page...
2590
  $thumb_id = media_handle_sideload( $file, 0, wppa_get_photo_desc( $photo ) );
2591
-
2592
  if ( is_wp_error( $thumb_id ) ) {
2593
  wppa_log( 'err', $thumb_id->get_error_message() );
2594
  }
@@ -2625,7 +2662,7 @@ global $wppa;
2625
 
2626
  // This image/file will show on media page...
2627
  $thumb_id = media_handle_sideload( $file, 0, wppa_get_photo_desc( $photo ) );
2628
-
2629
  if ( is_wp_error( $thumb_id ) ) {
2630
  wppa_log( 'err', $thumb_id->get_error_message() );
2631
  }
@@ -2839,8 +2876,52 @@ global $wppa;
2839
  break;
2840
 
2841
  case 'panorama':
2842
- wppa_update_photo( array( 'id' => $photo, 'panorama' => $value ) );
2843
- $txt = sprintf( __( 'Panorama set to %s', 'wp-photo-album-plus' ), $value );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2844
  wppa_json_photo_update( $photo, $txt );
2845
  break;
2846
 
@@ -2853,20 +2934,32 @@ global $wppa;
2853
  case 'make360':
2854
 
2855
  // If degs == 0, remove it
2856
- if ( ! $value ) {
2857
- wppa_unlink( wppa_get_o1_source_path( $photo ) );
2858
- wppa_update_single_photo( wppa_get_source_path( $photo ), $photo, wppa_get_photo_item( $photo, 'filename' ) );
2859
- wppa_update_photo( array( 'id' => $photo, 'angle' => '0' ) );
2860
- $txt = __( 'Converted photo removed', 'wp-photo-album-plus' );
2861
- }
2862
- else if ( wppa_make_360( $photo, $value ) ) {
2863
- wppa_update_single_photo( wppa_get_o1_source_path( $photo ), $photo, wppa_get_photo_item( $photo, 'filename' ) );
2864
- wppa_update_photo( array( 'id' => $photo, 'angle' => $value ) );
2865
- $txt = __( 'Photo converted', 'wp-photo-album-plus' );
 
 
 
 
 
 
 
 
 
2866
  }
2867
  else {
2868
- $txt = __( 'Photo conversion failed', 'wp-photo-album-plus' );
 
 
2869
  }
 
2870
  wppa_json_photo_update( $photo, $txt );
2871
  break;
2872
 
@@ -3141,10 +3234,7 @@ global $wppa;
3141
  }
3142
  break;
3143
 
3144
- case 'wppa_colwidth': // ?? fixed low high title
3145
- wppa_ajax_check_range( $value, 'auto', '100', false, __( 'Column width.' , 'wp-photo-album-plus') );
3146
- break;
3147
- case 'wppa_initial_colwidth':
3148
  wppa_ajax_check_range( $value, false, '100', false, __( 'Initial width.' , 'wp-photo-album-plus') );
3149
  break;
3150
  case 'wppa_fullsize':
@@ -3169,9 +3259,6 @@ global $wppa;
3169
  case 'wppa_tn_margin':
3170
  wppa_ajax_check_range( $value, false, '0', false, __( 'Thumbnail Spacing' , 'wp-photo-album-plus') );
3171
  break;
3172
- case 'wppa_min_thumbs':
3173
- wppa_ajax_check_range( $value, false, '0', false, __( 'Photocount treshold.' , 'wp-photo-album-plus') );
3174
- break;
3175
  case 'wppa_thumb_page_size':
3176
  wppa_ajax_check_range( $value, false, '0', false, __( 'Thumb page size.' , 'wp-photo-album-plus') );
3177
  break;
@@ -3499,38 +3586,6 @@ global $wppa;
3499
  }
3500
  break;
3501
 
3502
- case 'wppa_i_responsive':
3503
- if ( $value == 'yes' ) {
3504
- wppa_update_option( 'wppa_colwidth', 'auto' );
3505
- wppa_update_option( 'wppa_cover_type', 'default-mcr' );
3506
- }
3507
- if ( $value == 'no' ) {
3508
- wppa_update_option( 'wppa_colwidth', '640' );
3509
- wppa_update_option( 'wppa_cover_type', 'default' );
3510
- }
3511
- break;
3512
-
3513
- case 'wppa_i_downsize':
3514
- if ( $value == 'yes' ) {
3515
- wppa_update_option( 'wppa_resize_on_upload', 'yes' );
3516
- if ( wppa_opt( 'resize_to' ) == '0' ) wppa_update_option( 'wppa_resize_to', '1024x768' );
3517
- }
3518
- if ( $value == 'no' ) {
3519
- wppa_update_option( 'wppa_resize_on_upload', 'no' );
3520
- }
3521
- break;
3522
-
3523
- case 'wppa_i_source':
3524
- if ( $value == 'yes' ) {
3525
- wppa_update_option( 'wppa_keep_source_admin', 'yes' );
3526
- wppa_update_option( 'wppa_keep_source_frontend', 'yes' );
3527
- }
3528
- if ( $value == 'no' ) {
3529
- wppa_update_option( 'wppa_keep_source_admin', 'no' );
3530
- wppa_update_option( 'wppa_keep_source_frontend', 'no' );
3531
- }
3532
- break;
3533
-
3534
  case 'wppa_i_userupload':
3535
  if ( $value == 'yes' ) {
3536
  wppa_update_option( 'wppa_user_upload_on', 'yes' );
@@ -3655,32 +3710,7 @@ global $wppa;
3655
  }
3656
  break;
3657
 
3658
- case 'wppa_i_video':
3659
- if ( $value == 'yes' ) {
3660
- wppa_update_option( 'wppa_enable_video', 'yes' );
3661
- }
3662
- else {
3663
- wppa_update_option( 'wppa_enable_video', 'no' );
3664
- }
3665
- break;
3666
-
3667
- case 'wppa_i_audio':
3668
- if ( $value == 'yes' ) {
3669
- wppa_update_option( 'wppa_enable_audio', 'yes' );
3670
- }
3671
- else {
3672
- wppa_update_option( 'wppa_enable_audio', 'no' );
3673
- }
3674
- break;
3675
 
3676
- case 'wppa_i_pdf':
3677
- if ( $value == 'yes' ) {
3678
- wppa_update_option( 'wppa_enable_pdf', 'yes' );
3679
- }
3680
- else {
3681
- wppa_update_option( 'wppa_enable_pdf', 'no' );
3682
- }
3683
- break;
3684
 
3685
  case 'wppa_i_done':
3686
  $value = 'done';
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.0.00.004
6
  *
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
10
 
11
+ // Load admin-ajax.php if wppa_ajax is in query args
12
+ function wppa_ajax_include() {
13
+ global $wp_query;
14
+
15
+ if ( $wp_query->get( 'wppa_ajax' ) === '1' ) {
16
+ include_once ABSPATH . '/wp-admin/admin-ajax.php';
17
+ exit;
18
+ }
19
+ }
20
+ add_action( 'template_redirect', 'wppa_ajax_include' );
21
+
22
+ // Add rewrite rule
23
+ function wppa_ajax_rewrite_rule() {
24
+
25
+ add_rewrite_rule( 'wppaajax/?$', 'index.php?wppa_ajax=1', 'top' );
26
+ $rewrite_rules = get_option( 'rewrite_rules', array() );
27
+ if ( ! in_array( 'index.php?wppa_ajax=1', $rewrite_rules ) ) {
28
+ flush_rewrite_rules();
29
+ }
30
+ }
31
+ add_action( 'init', 'wppa_ajax_rewrite_rule' );
32
+
33
+ // Add wppa_ajax to query vars
34
+ function wppa_ajax_query_vars( $query_vars ) {
35
+
36
+ $query_vars[] = 'wppa_ajax';
37
+ return $query_vars;
38
+ }
39
+ add_filter( 'query_vars', 'wppa_ajax_query_vars' );
40
+
41
+ // Link ajax callback function
42
  add_action( 'wp_ajax_wppa', 'wppa_ajax_callback' );
43
  add_action( 'wp_ajax_nopriv_wppa', 'wppa_ajax_callback' );
44
 
92
 
93
  if ( wppa_switch( 'log_ajax' ) ) {
94
  $args = '';
95
+ $is_heartbeat = false;
96
  foreach( array_keys( $_REQUEST ) as $key ) {
97
+ if ( $key == 'wppa-option' && $_REQUEST[$key] == 'heartbeat' ) {
98
+ $is_heartbeat = true;
99
+ }
100
  $args .= $key . '=' . $_REQUEST[$key] . ', ';
101
  }
102
+ if ( ! $is_heartbeat ) {
103
+ wppa_log( 'Ajx', 'Args = ' . $args );
104
+ }
105
  }
106
 
107
  // Any runtime modifyable settings?
1597
  'description' => __( 'Automatically created album when a deleted photo was recovered and the original album did no longer exist', 'wp-photo-album-plus' )
1598
  )
1599
  );
1600
+
1601
  if ( $iret ) {
1602
  $real_alb = $iret; // May be different id
1603
  }
2588
 
2589
  // If set to featured, try to copy to wp media
2590
  if ( $item == 'status' && $value == 'featured' ) {
2591
+
2592
  require_once(ABSPATH . 'wp-admin/includes/media.php');
2593
  require_once(ABSPATH . 'wp-admin/includes/file.php');
2594
  require_once(ABSPATH . 'wp-admin/includes/image.php');
2625
 
2626
  // This image/file will show on media page...
2627
  $thumb_id = media_handle_sideload( $file, 0, wppa_get_photo_desc( $photo ) );
2628
+
2629
  if ( is_wp_error( $thumb_id ) ) {
2630
  wppa_log( 'err', $thumb_id->get_error_message() );
2631
  }
2662
 
2663
  // This image/file will show on media page...
2664
  $thumb_id = media_handle_sideload( $file, 0, wppa_get_photo_desc( $photo ) );
2665
+
2666
  if ( is_wp_error( $thumb_id ) ) {
2667
  wppa_log( 'err', $thumb_id->get_error_message() );
2668
  }
2876
  break;
2877
 
2878
  case 'panorama':
2879
+ // If it was 360 and now different, delete o1 file and remake files
2880
+ $cur = wppa_get_photo_item( $photo, 'panorama' );
2881
+ if ( $cur == '1' && $value != '1' ) {
2882
+ $s = wppa_get_o1_source_path( $photo );
2883
+ if ( wppa_is_file( $s ) ) {
2884
+ wppa_unlink( $s );
2885
+ }
2886
+ wppa_remake_files( '', $photo );
2887
+ }
2888
+
2889
+ // Make sure x and y are correct
2890
+ $x = wppa_get_photox( $photo, true );
2891
+ $y = wppa_get_photoy( $photo, true );
2892
+
2893
+ // See if spheric and needs conversion, assume its for 360
2894
+ if ( $value == '1' && $x > 2.01 * $y ) {
2895
+ $bret = wppa_make_360( $photo, 360 );
2896
+ if ( $bret ) {
2897
+ $x = wppa_get_photox( $photo, true );
2898
+ $y = wppa_get_photoy( $photo, true );
2899
+ wppa_update_photo( array( 'id' => $photo,
2900
+ 'panorama' => '1',
2901
+ 'angle' => '360',
2902
+ 'photox' => $x,
2903
+ 'photoy' => $y
2904
+ ) );
2905
+ wppa_remake_files( '', $photo );
2906
+ $txt = sprintf( __( 'Panorama set to %s and converted', 'wp-photo-album-plus' ), $value );
2907
+ }
2908
+ else {
2909
+ $txt = sprintf( __( 'Panorama set to %s but failed to convert', 'wp-photo-album-plus' ), $value );
2910
+ }
2911
+ }
2912
+
2913
+ // Not spheric or no conversion needed
2914
+ else {
2915
+ wppa_update_photo( array( 'id' => $photo,
2916
+ 'panorama' => $value,
2917
+ 'photox' => $x,
2918
+ 'photoy' => $y,
2919
+ 'angle' => '0'
2920
+ ) );
2921
+
2922
+ $txt = sprintf( __( 'Panorama set to %s', 'wp-photo-album-plus' ), $value );
2923
+ }
2924
+
2925
  wppa_json_photo_update( $photo, $txt );
2926
  break;
2927
 
2934
  case 'make360':
2935
 
2936
  // If degs == 0, remove it
2937
+ $s = wppa_get_o1_source_path( $photo );
2938
+ if ( wppa_is_file( $s ) ) wppa_unlink( $s );
2939
+
2940
+ if ( $value ) {
2941
+ $bret = wppa_make_360( $photo, $value );
2942
+ if ( $bret ) {
2943
+ $x = wppa_get_photox( $photo, true );
2944
+ $y = wppa_get_photoy( $photo, true );
2945
+ wppa_update_photo( array( 'id' => $photo,
2946
+ 'angle' => $value,
2947
+ 'photox' => $x,
2948
+ 'photoy' => $y
2949
+ ) );
2950
+ wppa_remake_files( '', $photo );
2951
+ $txt = __( 'Photo converted', 'wp-photo-album-plus' );
2952
+ }
2953
+ else {
2954
+ $txt = __( 'Photo conversion failed', 'wp-photo-album-plus' );
2955
+ }
2956
  }
2957
  else {
2958
+ wppa_update_photo( array( 'id' => $photo, 'angle' => '0' ) );
2959
+ wppa_remake_files( '', $photo );
2960
+ $txt = __( 'Converted photo removed', 'wp-photo-album-plus' );
2961
  }
2962
+
2963
  wppa_json_photo_update( $photo, $txt );
2964
  break;
2965
 
3234
  }
3235
  break;
3236
 
3237
+ case 'wppa_initial_colwidth'://?? fixed low high title
 
 
 
3238
  wppa_ajax_check_range( $value, false, '100', false, __( 'Initial width.' , 'wp-photo-album-plus') );
3239
  break;
3240
  case 'wppa_fullsize':
3259
  case 'wppa_tn_margin':
3260
  wppa_ajax_check_range( $value, false, '0', false, __( 'Thumbnail Spacing' , 'wp-photo-album-plus') );
3261
  break;
 
 
 
3262
  case 'wppa_thumb_page_size':
3263
  wppa_ajax_check_range( $value, false, '0', false, __( 'Thumb page size.' , 'wp-photo-album-plus') );
3264
  break;
3586
  }
3587
  break;
3588
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3589
  case 'wppa_i_userupload':
3590
  if ( $value == 'yes' ) {
3591
  wppa_update_option( 'wppa_user_upload_on', 'yes' );
3710
  }
3711
  break;
3712
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3713
 
 
 
 
 
 
 
 
 
3714
 
3715
  case 'wppa_i_done':
3716
  $value = 'done';
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 7.7.07.006
7
  *
8
  */
9
 
@@ -311,73 +311,99 @@ global $wppa_revno;
311
  $timeup = false;
312
  if ( isset( $_REQUEST['pano-val'] ) ) {
313
 
314
- $p = $_REQUEST['pano-val'];
315
- $tot = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = %d", $edit_id ) );
316
- switch( $p ) {
317
- case '0':
318
- $n = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
319
- SET panorama = 0
320
- WHERE album = %d
321
- ", $edit_id ) );
322
- if ( $tot == $n ) {
323
- $status = __( 'All photos set to non panoramic', 'wp-photo-album-plus' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
- else {
326
- $status = sprintf( __( '%1d photos out of %2d set to non panoramic', 'wp-photo-album-plus' ), $n, $tot );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  }
328
- break;
329
- case '1':
330
- case '2':
331
- $n = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
332
- SET panorama = %d
333
- WHERE album = %d
334
- AND photox > 1.999*photoy
335
- AND ext IN ('jpg','png')
336
- ", $p, $edit_id ) );
337
- if ( $tot == $n ) {
338
- $status = sprintf( __( 'All photos set to %s panorama', 'wp-photo-album-plus' ), $p == 1 ? __( 'spheric', 'wp-photo-album-plus' ) : __( 'flat', 'wp-photo-album-plus' ) );
 
 
 
339
  }
340
  else {
341
- $status = sprintf( __( '%1d photos out of %2d set to %s panorama', 'wp-photo-album-plus' ), $n, $tot, ( $p == 1 ? __( 'spheric', 'wp-photo-album-plus' ) : __( 'flat', 'wp-photo-album-plus' ) ) );
342
  }
343
- if ( $p == 1 ) {
344
- $ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos
345
- WHERE album = %d", $edit_id ) );
346
-
347
- $converted = 0;
348
- foreach( $ids as $id ) {
349
- if ( ! wppa_is_time_up() ) {
350
- if ( wppa_get_photox( $id, true ) > 2.001 * wppa_get_photoy( $id, true ) ) {
351
- if ( ! wppa_is_file( wppa_get_o1_source_path( $id ) ) ) {
352
- wppa_make_360( $id, 360 );
353
- wppa_remake_files( '', $id );
354
- $converted++;
355
- }
356
- }
357
- }
358
- else {
359
- $timeup = true;
360
- }
361
- }
362
-
363
- if ( $converted ) {
364
- $status .= '. ' . sprintf( __( '%d have converted aspect ratio.', 'wp-photo-album-plus' ), $converted );
365
- }
366
 
367
- if ( wppa_is_time_up() ) {
368
- $status .= ' ' . __( 'No time left, the page will be reloaded to continue.', 'wp-photo-album-plus' );
369
- }
370
- }
371
 
372
- break;
373
- default:
374
- $status = __( 'No panorama changes applied', 'wp-photo-album-plus' );
375
  }
 
376
  echo '
377
  <script>
378
  jQuery(document).ready(function(){
379
  jQuery("#albumstatus-'.$edit_id.'").html("'.$status.'");
380
- }); ' . ( $timeup ? 'setTimeout(function(){document.location.reload();}, 6000);' : '' ) . '
381
  </script>';
382
  }
383
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
311
  $timeup = false;
312
  if ( isset( $_REQUEST['pano-val'] ) ) {
313
 
314
+ $pano = $_REQUEST['pano-val'];
315
+ $last = get_option( 'wppa_last_pano_set', '0' );
316
+ $done = '0';
317
+ $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
318
+ WHERE album = %d
319
+ AND id > %d
320
+ AND ext = 'jpg'
321
+ ORDER BY id", $edit_id, $last ), ARRAY_A );
322
+ $tot = count( $todo );
323
+
324
+ if ( $tot ) foreach( $todo as $item ) {
325
+
326
+ // Init this item is not panoramable
327
+ $doit = false;
328
+
329
+ // width must be > 1.99 * height
330
+ $id = $item['id'];
331
+ $x = $item['photox'];
332
+ $y = $item['photoy'];
333
+ if ( $x > 1.99 * $y ) $doit = true;
334
+ if ( ! $doit ) {
335
+ $x = wppa_get_photox( $id, true );
336
+ $y = wppa_get_photoy( $id, true );
337
+ if ( $x > 1.99 * $y ) $doit = true;
338
+ }
339
+
340
+ // Source must exist
341
+ $s = wppa_get_source_path( $id );
342
+ if ( ! wppa_is_file( $s ) ) $doit = false;
343
+
344
+ // Process this item
345
+ if ( $doit ) {
346
+
347
+ // Clear possible existing o1 file
348
+ $o1 = wppa_get_o1_source_path( $id );
349
+ if ( wppa_is_file( $o1 ) ) {
350
+ wppa_unlink( $o1 );
351
  }
352
+
353
+ // Do pano type specific stuff
354
+ switch( $pano ) {
355
+
356
+ case '0': // No longer pano
357
+ wppa_update_photo( array( 'id' => $id, 'panorama' => '0', 'angle' => '0' ) );
358
+ break;
359
+
360
+ case '1': // Spheric
361
+ wppa_update_photo( array( 'id' => $id, 'panorama' => '1', 'angle' => '360' ) );
362
+ wppa_make_360( $id, 360 );
363
+ break;
364
+
365
+ case '2': // Flat
366
+ wppa_update_photo( array( 'id' => $id, 'panorama' => '2', 'angle' => '0' ) );
367
+ break;
368
+
369
+ default:
370
+
371
+ break;
372
  }
373
+
374
+ // Housekeeping
375
+ wppa_remake_files( '', $id );
376
+ wppa_get_photox( $id, true );
377
+ wppa_get_photoy( $id, true );
378
+ update_option( 'wppa_last_pano_set', $id );
379
+ $done++;
380
+
381
+ if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
382
+ $status = __( 'No items processed', 'wp-photo-album-plus' );
383
+ }
384
+ elseif ( $done == $tot ) {
385
+ $status = __( 'All applicable items processed', 'wp-photo-album-plus' );
386
+ delete_option( 'wppa_last_pano_set' );
387
  }
388
  else {
389
+ $status = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
390
  }
391
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
+ // Check for timeout and not done
394
+ $timeup = wppa_is_time_up() && ( $done != $tot );
395
+ if ( $timeup ) break;
396
+ }
397
 
398
+ if ( $timeup ) {
399
+ $status .= ' ' . __( 'No time left, the page will be reloaded to continue. Stay tuned...', 'wp-photo-album-plus' );
 
400
  }
401
+
402
  echo '
403
  <script>
404
  jQuery(document).ready(function(){
405
  jQuery("#albumstatus-'.$edit_id.'").html("'.$status.'");
406
+ }); ' . ( $timeup ? 'setTimeout(function(){document.location.reload();}, 10000);' : '' ) . '
407
  </script>';
408
  }
409
 
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 7.7.04.004
7
  *
8
  */
9
 
@@ -95,7 +95,6 @@ global $wpdb;
95
  $image = wppa_cache_thumb( $coverphoto );
96
  $photocount = wppa_get_photo_count( $albumid );
97
  $albumcount = wppa_get_album_count( $albumid, 'use_treecounts' );
98
- $mincount = wppa_get_mincount();
99
 
100
  // Init links
101
  $title = '';
@@ -108,7 +107,7 @@ global $wpdb;
108
  $onclick_content = '';
109
 
110
  // See if there is substantial content to the album
111
- $has_content = ( $albumcount > '0' ) || ( $photocount > $mincount );
112
 
113
  // What is the albums title linktype
114
  $linktype = $album['cover_linktype'];
@@ -329,7 +328,7 @@ global $wpdb;
329
  $has_content,
330
  $photocount,
331
  $albumcount,
332
- $mincount,
333
  $href_content,
334
  $target,
335
  $onclick_content
@@ -406,7 +405,6 @@ global $wpdb;
406
 
407
  $photocount = wppa_get_photo_count( $albumid );
408
  $albumcount = wppa_get_album_count( $albumid, 'use_treecounts' );
409
- $mincount = wppa_get_mincount();
410
  $title = '';
411
  $linkpage = '';
412
 
@@ -418,7 +416,7 @@ global $wpdb;
418
  $onclick_content = '';
419
 
420
  // See if there is substantial content to the album
421
- $has_content = ( $albumcount > '0' ) || ( $photocount > $mincount );
422
 
423
  // If not specified, use default
424
  $linktype = $album['cover_linktype'];
@@ -580,7 +578,7 @@ global $wpdb;
580
  $has_content,
581
  $photocount,
582
  $albumcount,
583
- $mincount,
584
  $href_content,
585
  $target,
586
  $onclick_content
@@ -631,7 +629,6 @@ global $wpdb;
631
  $image = wppa_cache_thumb( $coverphoto );
632
  $photocount = wppa_get_photo_count( $albumid );
633
  $albumcount = wppa_get_album_count( $albumid, true );
634
- $mincount = wppa_get_mincount();
635
  $title = '';
636
  $linkpage = '';
637
 
@@ -643,7 +640,7 @@ global $wpdb;
643
  $onclick_content = '';
644
 
645
  // See if there is substantial content to the album
646
- $has_content = ( $albumcount > '0' ) || ( $photocount > $mincount );
647
 
648
  // What is the albums title linktype
649
  $linktype = $album['cover_linktype'];
@@ -773,8 +770,15 @@ global $wpdb;
773
  wppa_the_slideshow_browse_link( $photocount, $href_slideshow, $onclick_slideshow, $target );
774
 
775
  // The 'View' link
776
- wppa_album_cover_view_link( $albumid, $has_content, $photocount, $albumcount,
777
- $mincount, $href_content, $target, $onclick_content );
 
 
 
 
 
 
 
778
 
779
  // Close the Cover text frame
780
  wppa_out( '</div>' );
@@ -836,7 +840,6 @@ global $wpdb;
836
  $image = wppa_cache_thumb( $coverphoto );
837
  $photocount = wppa_get_photo_count( $id );
838
  $albumcount = wppa_get_album_count( $id, 'use_treecounts' );
839
- $mincount = wppa_get_mincount();
840
 
841
  // Init links
842
  $title = '';
@@ -845,7 +848,7 @@ global $wpdb;
845
  $onclick_title = '';
846
 
847
  // See if there is substantial content to the album
848
- $has_content = ( $albumcount > '0' ) || ( $photocount > $mincount );
849
 
850
  // What is the albums title linktype
851
  $linktype = $album['cover_linktype'];
@@ -1714,7 +1717,7 @@ function wppa_album_cover_view_link(
1714
  if ( wppa_opt( 'thumbtype' ) == 'none' ) $photocount = '0';
1715
 
1716
  // Still has content
1717
- if ( $photocount > $mincount || $albumcount ) {
1718
 
1719
  // Get treecount data
1720
  // if ( wppa_opt( 'show_treecount' ) != '-none-' ) {
@@ -1743,7 +1746,7 @@ function wppa_album_cover_view_link(
1743
  $na = $albumcount;
1744
  $nta = $treecount['treealbums'] > $albumcount ? $treecount['treealbums'] : '';
1745
  $ntax = $treecount['treealbums'] > $albumcount ? $treecount['treealbums'] : $albumcount;
1746
- $np = $photocount > $mincount ? $photocount : '';
1747
  $ntp = $treecount['treephotos'] > $photocount ? $treecount['treephotos'] : '';
1748
  $ntpx = $treecount['treephotos'] > $photocount ? $treecount['treephotos'] : $photocount;
1749
 
@@ -2227,7 +2230,7 @@ function wppa_the_slideshow_browse_link( $photocount, $href_slideshow, $onclick_
2227
  wppa_out(
2228
  '<div class="wppa-box-text wppa-black wppa-info wppa-slideshow-browse-link wppa-album-cover-link">'
2229
  );
2230
- if ( $photocount > wppa_get_mincount() ) {
2231
  $label = wppa_switch( 'enable_slideshow' ) ?
2232
  __( 'Slideshow', 'wp-photo-album-plus' ) :
2233
  __( 'Browse photos', 'wp-photo-album-plus' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
95
  $image = wppa_cache_thumb( $coverphoto );
96
  $photocount = wppa_get_photo_count( $albumid );
97
  $albumcount = wppa_get_album_count( $albumid, 'use_treecounts' );
 
98
 
99
  // Init links
100
  $title = '';
107
  $onclick_content = '';
108
 
109
  // See if there is substantial content to the album
110
+ $has_content = $albumcount || $photocount;
111
 
112
  // What is the albums title linktype
113
  $linktype = $album['cover_linktype'];
328
  $has_content,
329
  $photocount,
330
  $albumcount,
331
+ '0',
332
  $href_content,
333
  $target,
334
  $onclick_content
405
 
406
  $photocount = wppa_get_photo_count( $albumid );
407
  $albumcount = wppa_get_album_count( $albumid, 'use_treecounts' );
 
408
  $title = '';
409
  $linkpage = '';
410
 
416
  $onclick_content = '';
417
 
418
  // See if there is substantial content to the album
419
+ $has_content = $albumcount || $photocount;
420
 
421
  // If not specified, use default
422
  $linktype = $album['cover_linktype'];
578
  $has_content,
579
  $photocount,
580
  $albumcount,
581
+ '0',
582
  $href_content,
583
  $target,
584
  $onclick_content
629
  $image = wppa_cache_thumb( $coverphoto );
630
  $photocount = wppa_get_photo_count( $albumid );
631
  $albumcount = wppa_get_album_count( $albumid, true );
 
632
  $title = '';
633
  $linkpage = '';
634
 
640
  $onclick_content = '';
641
 
642
  // See if there is substantial content to the album
643
+ $has_content = $albumcount || $photocount;
644
 
645
  // What is the albums title linktype
646
  $linktype = $album['cover_linktype'];
770
  wppa_the_slideshow_browse_link( $photocount, $href_slideshow, $onclick_slideshow, $target );
771
 
772
  // The 'View' link
773
+ wppa_album_cover_view_link( $albumid,
774
+ $has_content,
775
+ $photocount,
776
+ $albumcount,
777
+ '0',
778
+ $href_content,
779
+ $target,
780
+ $onclick_content
781
+ );
782
 
783
  // Close the Cover text frame
784
  wppa_out( '</div>' );
840
  $image = wppa_cache_thumb( $coverphoto );
841
  $photocount = wppa_get_photo_count( $id );
842
  $albumcount = wppa_get_album_count( $id, 'use_treecounts' );
 
843
 
844
  // Init links
845
  $title = '';
848
  $onclick_title = '';
849
 
850
  // See if there is substantial content to the album
851
+ $has_content = $albumcount || $photocount;
852
 
853
  // What is the albums title linktype
854
  $linktype = $album['cover_linktype'];
1717
  if ( wppa_opt( 'thumbtype' ) == 'none' ) $photocount = '0';
1718
 
1719
  // Still has content
1720
+ if ( $photocount || $albumcount ) {
1721
 
1722
  // Get treecount data
1723
  // if ( wppa_opt( 'show_treecount' ) != '-none-' ) {
1746
  $na = $albumcount;
1747
  $nta = $treecount['treealbums'] > $albumcount ? $treecount['treealbums'] : '';
1748
  $ntax = $treecount['treealbums'] > $albumcount ? $treecount['treealbums'] : $albumcount;
1749
+ $np = $photocount;
1750
  $ntp = $treecount['treephotos'] > $photocount ? $treecount['treephotos'] : '';
1751
  $ntpx = $treecount['treephotos'] > $photocount ? $treecount['treephotos'] : $photocount;
1752
 
2230
  wppa_out(
2231
  '<div class="wppa-box-text wppa-black wppa-info wppa-slideshow-browse-link wppa-album-cover-link">'
2232
  );
2233
+ if ( $photocount ) {
2234
  $label = wppa_switch( 'enable_slideshow' ) ?
2235
  __( 'Slideshow', 'wp-photo-album-plus' ) :
2236
  __( 'Browse photos', 'wp-photo-album-plus' );
wppa-album-navigator-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
- * Version 7.3.10
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
@@ -221,7 +221,7 @@ class AlbumNavigatorWidget extends WP_Widget {
221
  foreach ( $albums as $album ) {
222
  $a = $album['id'];
223
  $treecount = wppa_get_treecounts_a( $a );
224
- if ( $treecount['treealbums'] || $treecount['selfphotos'] > wppa_opt( 'min_thumbs' ) || ! $skip ) {
225
  $has_children = wppa_has_children($a);
226
  $result .= '
227
  <li
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
+ * Version 8.0.00.003
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
221
  foreach ( $albums as $album ) {
222
  $a = $album['id'];
223
  $treecount = wppa_get_treecounts_a( $a );
224
+ if ( $treecount['treealbums'] || $treecount['selfphotos'] || ! $skip ) {
225
  $has_children = wppa_has_children($a);
226
  $result .= '
227
  <li
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 7.3.08
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -139,7 +139,7 @@ class AlbumWidget extends WP_Widget {
139
  $thumb = $image;
140
 
141
  // Make the HTML for current picture
142
- if ( $image && ( $imgcount > wppa_opt( 'min_thumbs' ) || $subalbumcount ) ) {
143
  $link = wppa_get_imglnk_a('albwidget', $image['id']);
144
  $file = wppa_get_thumb_path($image['id']);
145
  $imgevents = wppa_get_imgevents('thumb', $image['id'], true);
@@ -160,7 +160,7 @@ class AlbumWidget extends WP_Widget {
160
  $width = $maxw;
161
  $height = $maxw; // !!
162
  $cursor = 'default';
163
- $title = sprintf(__('Upload at least %d photos to this album!', 'wp-photo-album-plus'), wppa_opt( 'min_thumbs' ) - $imgcount + 1);
164
  if ( $imageid ) { // The 'empty album has a cover image
165
  $file = wppa_get_thumb_path( $image['id'] );
166
  $imgstyle_a = wppa_get_imgstyle_a( $image['id'], $file, $maxw, 'center', 'albthumb' );
@@ -178,7 +178,7 @@ class AlbumWidget extends WP_Widget {
178
  $imgurl = wppa_fix_poster_ext( $imgurl, $image['id'] );
179
  }
180
 
181
- if ( $imgcount > wppa_opt( 'min_thumbs' ) || ! wppa_checked( $instance['skip'] ) ) {
182
 
183
  $widget_content .=
184
  '<div' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 8.0.00.003
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
139
  $thumb = $image;
140
 
141
  // Make the HTML for current picture
142
+ if ( $image && ( $imgcount || $subalbumcount ) ) {
143
  $link = wppa_get_imglnk_a('albwidget', $image['id']);
144
  $file = wppa_get_thumb_path($image['id']);
145
  $imgevents = wppa_get_imgevents('thumb', $image['id'], true);
160
  $width = $maxw;
161
  $height = $maxw; // !!
162
  $cursor = 'default';
163
+ $title = __( 'Upload at least 1 photos to this album!', 'wp-photo-album-plus' );
164
  if ( $imageid ) { // The 'empty album has a cover image
165
  $file = wppa_get_thumb_path( $image['id'] );
166
  $imgstyle_a = wppa_get_imgstyle_a( $image['id'], $file, $maxw, 'center', 'albthumb' );
178
  $imgurl = wppa_fix_poster_ext( $imgurl, $image['id'] );
179
  }
180
 
181
+ if ( $imgcount || ! wppa_checked( $instance['skip'] ) ) {
182
 
183
  $widget_content .=
184
  '<div' .
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 7.7.07.002
7
  *
8
  */
9
 
@@ -17,7 +17,7 @@ function wppa_thumb_area( $action ) {
17
  $mocc = wppa( 'mocc' );
18
  $alt = wppa( 'alt' );
19
  $maxh = wppa_opt( 'area_size' );
20
- $nice = wppa_switch( 'nicescroll' );
21
  $overflow = 'visible';
22
  if ( $maxh ) {
23
  if ( $nice ) $overflow = 'hidden';
@@ -125,7 +125,7 @@ function wppa_contest_box() {
125
  $mocc = wppa( 'mocc' );
126
  $alt = wppa( 'alt' );
127
  $maxh = wppa_opt( 'area_size' );
128
- $nice = wppa_switch( 'nicescroll' );
129
  $overflow = 'visible';
130
  if ( $maxh ) {
131
  if ( $nice ) $overflow = 'hidden';
@@ -2976,8 +2976,7 @@ static $albums_granted;
2976
 
2977
  // Create the return url
2978
  if ( $ajax_upload ) {
2979
- $returnurl = wppa_switch( 'ajax_non_admin' ) ? WPPA_URL.'/wppa-ajax-front.php' : admin_url('admin-ajax.php');
2980
- $returnurl .= '?action=wppa&amp;wppa-action=do-fe-upload';
2981
  }
2982
  else {
2983
  $returnurl = wppa_get_permalink();
@@ -3386,7 +3385,7 @@ static $albums_granted;
3386
  ' id="wppa-name-user-' . $mocc . '-' . $seqno . '"' .
3387
  ' type="text"' .
3388
  ' class="wppa-box-text"' .
3389
- ' style="border:1px solid '.wppa_opt( 'bcolor_upload' ).';clear:left; padding:0; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3390
  ' name="wppa-user-name"' .
3391
  ' />' .
3392
  '<div style="clear:left;font-size:10px;" >' .
@@ -3413,7 +3412,7 @@ static $albums_granted;
3413
  '<textarea' .
3414
  ' id="wppa-desc-user-' . $mocc . '-' . $seqno . '"' .
3415
  ' class="wppa-user-textarea wppa-box-text"' .
3416
- ' style="border:1px solid '.wppa_opt( 'bcolor_upload' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3417
  ' name="wppa-user-desc"' .
3418
  ' >' .
3419
  $desc .
@@ -3445,7 +3444,7 @@ static $albums_granted;
3445
  '<input' .
3446
  ' type="text"' .
3447
  ' class="wppa-box-text"' .
3448
- ' style="border:1px solid '.wppa_opt( 'bcolor_upload' ).';clear:left; padding:0; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3449
  ' name="wppa-user-custom-'.$i.'"' .
3450
  ' />';
3451
 
@@ -3602,7 +3601,7 @@ static $albums_granted;
3602
  ' id="wppa-blogit-pretext-'.$yalb.'-'.$mocc.'"' .
3603
  ' name="wppa-blogit-pretext"' .
3604
  ' class=wppa-user-textarea wppa-box-text"' .
3605
- ' style="border:1px solid '.wppa_opt( 'bcolor_upload' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3606
  ' >' .
3607
  '</textarea>' .
3608
  '<h6>' .
@@ -3612,7 +3611,7 @@ static $albums_granted;
3612
  ' id="wppa-blogit-posttext-'.$yalb.'-'.$mocc.'"' .
3613
  ' name="wppa-blogit-posttext"' .
3614
  ' class=wppa-user-textarea wppa-box-text"' .
3615
- ' style="border:1px solid '.wppa_opt( 'bcolor_upload' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3616
  '>' .
3617
  '</textarea>' .
3618
  '</div>';// .
@@ -3664,7 +3663,7 @@ static $albums_granted;
3664
  '<div' .
3665
  ' id="progress-'.$yalb.'-'.$mocc.'"' .
3666
  ' class="wppa-progress "' .
3667
- ' style="width:100%;border-color:'.wppa_opt( 'bcolor_upload' ).'"' .
3668
  ' >' .
3669
  '<div id="bar-'.$yalb.'-'.$mocc.'" class="wppa-bar" ></div>' .
3670
  '<div id="percent-'.$yalb.'-'.$mocc.'" class="wppa-percent" >0%</div >' .
@@ -6614,12 +6613,7 @@ global $wppa_lang;
6614
  $result = '';
6615
 
6616
  // The standard Ajax link
6617
- if ( wppa_switch( 'ajax_non_admin' ) ) {
6618
- $al = WPPA_URL.'/wppa-ajax-front.php?action=wppa&wppa-action=render';
6619
- }
6620
- else {
6621
- $al = admin_url( 'admin-ajax.php' ).'?action=wppa&wppa-action=render';
6622
- }
6623
  $al .= '&wppa-size=' . wppa_get_container_width();
6624
  $al .= '&wppa-moccur=' . $mocc;
6625
  $al .= '&wppa-occur=' . wppa( 'occur' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
17
  $mocc = wppa( 'mocc' );
18
  $alt = wppa( 'alt' );
19
  $maxh = wppa_opt( 'area_size' );
20
+ $nice = wppa_switch( 'nicescroll' ) && ! wppa_is_mobile();
21
  $overflow = 'visible';
22
  if ( $maxh ) {
23
  if ( $nice ) $overflow = 'hidden';
125
  $mocc = wppa( 'mocc' );
126
  $alt = wppa( 'alt' );
127
  $maxh = wppa_opt( 'area_size' );
128
+ $nice = wppa_switch( 'nicescroll' ) && ! wppa_is_mobile();
129
  $overflow = 'visible';
130
  if ( $maxh ) {
131
  if ( $nice ) $overflow = 'hidden';
2976
 
2977
  // Create the return url
2978
  if ( $ajax_upload ) {
2979
+ $returnurl = site_url() . '/wppaajax/?action=wppa&amp;wppa-action=do-fe-upload';
 
2980
  }
2981
  else {
2982
  $returnurl = wppa_get_permalink();
3385
  ' id="wppa-name-user-' . $mocc . '-' . $seqno . '"' .
3386
  ' type="text"' .
3387
  ' class="wppa-box-text"' .
3388
+ ' style="border:1px solid '.wppa_opt( 'bcolor' ).';clear:left; padding:0; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3389
  ' name="wppa-user-name"' .
3390
  ' />' .
3391
  '<div style="clear:left;font-size:10px;" >' .
3412
  '<textarea' .
3413
  ' id="wppa-desc-user-' . $mocc . '-' . $seqno . '"' .
3414
  ' class="wppa-user-textarea wppa-box-text"' .
3415
+ ' style="border:1px solid '.wppa_opt( 'bcolor' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3416
  ' name="wppa-user-desc"' .
3417
  ' >' .
3418
  $desc .
3444
  '<input' .
3445
  ' type="text"' .
3446
  ' class="wppa-box-text"' .
3447
+ ' style="border:1px solid '.wppa_opt( 'bcolor' ).';clear:left; padding:0; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3448
  ' name="wppa-user-custom-'.$i.'"' .
3449
  ' />';
3450
 
3601
  ' id="wppa-blogit-pretext-'.$yalb.'-'.$mocc.'"' .
3602
  ' name="wppa-blogit-pretext"' .
3603
  ' class=wppa-user-textarea wppa-box-text"' .
3604
+ ' style="border:1px solid '.wppa_opt( 'bcolor' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3605
  ' >' .
3606
  '</textarea>' .
3607
  '<h6>' .
3611
  ' id="wppa-blogit-posttext-'.$yalb.'-'.$mocc.'"' .
3612
  ' name="wppa-blogit-posttext"' .
3613
  ' class=wppa-user-textarea wppa-box-text"' .
3614
+ ' style="border:1px solid '.wppa_opt( 'bcolor' ).';clear:left; padding:0; height:120px; width:100%; '.wppa_wcs( 'wppa-box-text' ).'"' .
3615
  '>' .
3616
  '</textarea>' .
3617
  '</div>';// .
3663
  '<div' .
3664
  ' id="progress-'.$yalb.'-'.$mocc.'"' .
3665
  ' class="wppa-progress "' .
3666
+ ' style="width:100%;border-color:'.wppa_opt( 'bcolor' ).'"' .
3667
  ' >' .
3668
  '<div id="bar-'.$yalb.'-'.$mocc.'" class="wppa-bar" ></div>' .
3669
  '<div id="percent-'.$yalb.'-'.$mocc.'" class="wppa-percent" >0%</div >' .
6613
  $result = '';
6614
 
6615
  // The standard Ajax link
6616
+ $al = site_url() . '/wppaajax/?action=wppa&wppa-action=render';
 
 
 
 
 
6617
  $al .= '&wppa-size=' . wppa_get_container_width();
6618
  $al .= '&wppa-moccur=' . $mocc;
6619
  $al .= '&wppa-occur=' . wppa( 'occur' );
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.7.07.004
6
  *
7
  */
8
 
@@ -1527,7 +1527,7 @@ function wppa_check_memory_limit( $verbose = true, $x = '0', $y = '0' ) {
1527
 
1528
  // Calculate number of pixels largest target resized image
1529
  if ( wppa_switch( 'resize_on_upload' ) ) {
1530
- $t = wppa_opt( 'resize_to' );
1531
  if ( $t == '0' ) {
1532
  $to['0'] = wppa_opt( 'fullsize' );
1533
  $to['1'] = wppa_opt( 'maxheight' );
@@ -1925,7 +1925,7 @@ global $wpdb;
1925
  // Filter for must have content
1926
  if ( $args['content'] ) {
1927
  foreach ( array_keys( $albums ) as $albidx ) {
1928
- if ( wppa_get_photo_count( $albums[$albidx]['id'] ) <= wppa_get_mincount() ) unset ( $albums[$albidx] );
1929
  }
1930
  }
1931
  // Add paths
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 8.0.00.003
6
  *
7
  */
8
 
1527
 
1528
  // Calculate number of pixels largest target resized image
1529
  if ( wppa_switch( 'resize_on_upload' ) ) {
1530
+
1531
  if ( $t == '0' ) {
1532
  $to['0'] = wppa_opt( 'fullsize' );
1533
  $to['1'] = wppa_opt( 'maxheight' );
1925
  // Filter for must have content
1926
  if ( $args['content'] ) {
1927
  foreach ( array_keys( $albums ) as $albidx ) {
1928
+ if ( ! wppa_get_photo_count( $albums[$albidx]['id'] ) ) unset ( $albums[$albidx] );
1929
  }
1930
  }
1931
  // Add paths
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 7.7.07.006
7
  *
8
  */
9
 
@@ -74,9 +74,6 @@ horizrailenabled:false,";
74
  'wppa_max_users' => '1000',
75
 
76
  // Table 0: Initial setup
77
- 'wppa_i_responsive' => '',
78
- 'wppa_i_downsize' => '',
79
- 'wppa_i_source' => '',
80
  'wppa_i_userupload' => '',
81
  'wppa_i_rating' => '',
82
  'wppa_i_comment' => '',
@@ -84,20 +81,13 @@ horizrailenabled:false,";
84
  'wppa_i_iptc' => '',
85
  'wppa_i_exif' => '',
86
  'wppa_i_gpx' => '',
87
- 'wppa_i_fotomoto' => '',
88
- 'wppa_i_video' => '',
89
- 'wppa_i_audio' => '',
90
- 'wppa_i_stereo' => '',
91
- 'wppa_i_pdf' => '',
92
  'wppa_i_done' => '',
93
 
94
  // Table I: Sizes
95
  // A System
96
  'wppa_colwidth' => 'auto', // 1
97
  'wppa_initial_colwidth' => '640',
98
- 'wppa_resize_on_upload' => 'yes', // 2
99
- 'wppa_resize_to' => '0', // 3
100
- 'wppa_min_thumbs' => '0', // 4
101
  'wppa_bwidth' => '1', // 5
102
  'wppa_bradius' => '6', // 6
103
  'wppa_box_spacing' => '8', // 7
@@ -461,17 +451,9 @@ horizrailenabled:false,";
461
  'wppa_multimedia_icon_upload' => '',
462
 
463
  // Table III: Backgrounds
464
- 'wppa_bgcolor_even' => '#eeeeee',
465
- 'wppa_bcolor_even' => '#cccccc',
466
- 'wppa_bgcolor_alt' => '#dddddd',
467
- 'wppa_bcolor_alt' => '#bbbbbb',
468
- 'wppa_bgcolor_thumbnail' => '#000000',
469
- 'wppa_bgcolor_nav' => '#dddddd',
470
- 'wppa_bcolor_nav' => '#bbbbbb',
471
- 'wppa_bgcolor_namedesc' => '#dddddd',
472
- 'wppa_bcolor_namedesc' => '#bbbbbb',
473
- 'wppa_bgcolor_com' => '#dddddd',
474
- 'wppa_bcolor_com' => '#bbbbbb',
475
  'wppa_bgcolor_img' => '#eeeeee',
476
  'wppa_bcolor_img' => '',
477
  'wppa_bgcolor_fullimg' => '#cccccc',
@@ -482,30 +464,9 @@ horizrailenabled:false,";
482
  'wppa_bcolor_numbar' => '#cccccc',
483
  'wppa_bgcolor_numbar_active' => '#333333',
484
  'wppa_bcolor_numbar_active' => '#333333',
485
- 'wppa_bgcolor_iptc' => '#dddddd',
486
- 'wppa_bcolor_iptc' => '#bbbbbb',
487
- 'wppa_bgcolor_exif' => '#dddddd',
488
- 'wppa_bcolor_exif' => '#bbbbbb',
489
- 'wppa_bgcolor_share' => '#dddddd',
490
- 'wppa_bcolor_share' => '#bbbbbb',
491
- 'wppa_bgcolor_upload' => '#dddddd',
492
- 'wppa_bcolor_upload' => '#bbbbbb',
493
- 'wppa_bgcolor_multitag' => '#dddddd',
494
- 'wppa_bcolor_multitag' => '#bbbbbb',
495
- 'wppa_bgcolor_tagcloud' => '#dddddd',
496
- 'wppa_bcolor_tagcloud' => '#bbbbbb',
497
- 'wppa_bgcolor_superview' => '#dddddd',
498
- 'wppa_bcolor_superview' => '#bbbbbb',
499
- 'wppa_bgcolor_search' => '#dddddd',
500
- 'wppa_bcolor_search' => '#bbbbbb',
501
- 'wppa_bgcolor_calendar' => '#dddddd',
502
- 'wppa_bcolor_calendar' => '#bbbbbb',
503
- 'wppa_bgcolor_bestof' => '#dddddd',
504
- 'wppa_bcolor_bestof' => '#bbbbbb',
505
- 'wppa_bgcolor_stereo' => '#dddddd',
506
- 'wppa_bcolor_stereo' => '#bbbbbb',
507
- 'wppa_bgcolor_adminschoice' => '#dddddd',
508
- 'wppa_bcolor_adminschoice' => '#bbbbbb',
509
  'wppa_bgcolor_modal' => '#ffffff',
510
  'wppa_bcolor_modal' => '#ffffff',
511
  'wppa_svg_color' => '#666666',
@@ -518,7 +479,6 @@ horizrailenabled:false,";
518
  // Table IV: Behaviour
519
  // A System
520
  'wppa_allow_ajax' => 'yes',
521
- 'wppa_ajax_non_admin' => 'yes',
522
  'wppa_ajax_scroll' => 'yes',
523
  'wppa_non_ajax_scroll' => 'no',
524
  'wppa_ajax_render_modal' => 'no',
@@ -545,7 +505,7 @@ horizrailenabled:false,";
545
  'wppa_custom_style_ie' => '',
546
  'wppa_custom_style_opera' => '',
547
  'wppa_use_custom_style_file' => 'no',
548
- 'wppa_enable_pdf' => 'no', // IV-A30
549
  'wppa_use_custom_theme_file' => 'no',
550
  'wppa_cre_uploads_htaccess' => 'remove',
551
  'wppa_debug_trace_on' => 'no',
@@ -883,7 +843,6 @@ horizrailenabled:false,";
883
  'wppa_upload_frontend_minsize' => '0',
884
  'wppa_upload_frontend_maxsize' => '0',
885
  'wppa_void_dups' => 'no',
886
- 'wppa_home_after_upload' => 'no',
887
  'wppa_fe_alert' => 'all',
888
  'wppa_fe_upload_max_albums' => '500', // VII-B13
889
 
@@ -1176,8 +1135,7 @@ horizrailenabled:false,";
1176
  'wppa_split_namedesc' => 'no',
1177
 
1178
  // H Source file management and import/upload
1179
- 'wppa_keep_source_admin' => 'yes',
1180
- 'wppa_keep_source_frontend' => 'yes',
1181
  'wppa_source_dir' => WPPA_ABSPATH.WPPA_UPLOAD.'/wppa-source',
1182
  'wppa_keep_sync' => 'yes',
1183
  'wppa_remake_add' => 'yes',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
74
  'wppa_max_users' => '1000',
75
 
76
  // Table 0: Initial setup
 
 
 
77
  'wppa_i_userupload' => '',
78
  'wppa_i_rating' => '',
79
  'wppa_i_comment' => '',
81
  'wppa_i_iptc' => '',
82
  'wppa_i_exif' => '',
83
  'wppa_i_gpx' => '',
 
 
 
 
 
84
  'wppa_i_done' => '',
85
 
86
  // Table I: Sizes
87
  // A System
88
  'wppa_colwidth' => 'auto', // 1
89
  'wppa_initial_colwidth' => '640',
90
+ 'wppa_resize_to' => '-1', // 3
 
 
91
  'wppa_bwidth' => '1', // 5
92
  'wppa_bradius' => '6', // 6
93
  'wppa_box_spacing' => '8', // 7
451
  'wppa_multimedia_icon_upload' => '',
452
 
453
  // Table III: Backgrounds
454
+ 'wppa_bgcolor' => '#eeeeee',
455
+ 'wppa_bcolor' => '#cccccc',
456
+
 
 
 
 
 
 
 
 
457
  'wppa_bgcolor_img' => '#eeeeee',
458
  'wppa_bcolor_img' => '',
459
  'wppa_bgcolor_fullimg' => '#cccccc',
464
  'wppa_bcolor_numbar' => '#cccccc',
465
  'wppa_bgcolor_numbar_active' => '#333333',
466
  'wppa_bcolor_numbar_active' => '#333333',
467
+
468
+ 'wppa_bgcolor_thumbnail' => '#000000',
469
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  'wppa_bgcolor_modal' => '#ffffff',
471
  'wppa_bcolor_modal' => '#ffffff',
472
  'wppa_svg_color' => '#666666',
479
  // Table IV: Behaviour
480
  // A System
481
  'wppa_allow_ajax' => 'yes',
 
482
  'wppa_ajax_scroll' => 'yes',
483
  'wppa_non_ajax_scroll' => 'no',
484
  'wppa_ajax_render_modal' => 'no',
505
  'wppa_custom_style_ie' => '',
506
  'wppa_custom_style_opera' => '',
507
  'wppa_use_custom_style_file' => 'no',
508
+ 'wppa_enable_pdf' => 'yes', // IV-A30
509
  'wppa_use_custom_theme_file' => 'no',
510
  'wppa_cre_uploads_htaccess' => 'remove',
511
  'wppa_debug_trace_on' => 'no',
843
  'wppa_upload_frontend_minsize' => '0',
844
  'wppa_upload_frontend_maxsize' => '0',
845
  'wppa_void_dups' => 'no',
 
846
  'wppa_fe_alert' => 'all',
847
  'wppa_fe_upload_max_albums' => '500', // VII-B13
848
 
1135
  'wppa_split_namedesc' => 'no',
1136
 
1137
  // H Source file management and import/upload
1138
+ 'wppa_keep_source' => 'yes',
 
1139
  'wppa_source_dir' => WPPA_ABSPATH.WPPA_UPLOAD.'/wppa-source',
1140
  'wppa_keep_sync' => 'yes',
1141
  'wppa_remake_add' => 'yes',
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 7.7.07.004
7
  *
8
  */
9
 
@@ -53,7 +53,7 @@ global $wppa_current_shortcode_atts;
53
  'overflow' => '',
54
  ), $xatts );
55
 
56
- if ( $atts['nicescroll'] ) {
57
  $nices = true;
58
  $style = 'clear:both;position:relative;overflow:hidden;';
59
  $class = $atts['class'] . ' wppa-div';
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
53
  'overflow' => '',
54
  ), $xatts );
55
 
56
+ if ( $atts['nicescroll'] && ! wppa_is_mobile() ) {
57
  $nices = true;
58
  $style = 'clear:both;position:relative;overflow:hidden;';
59
  $class = $atts['class'] . ' wppa-div';
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 7.7.07.005
7
  *
8
  */
9
 
@@ -31,28 +31,6 @@ global $wppa_current_shortcode_atts;
31
  wppa_dbg_msg( 'Get=' . serialize($_GET) );
32
  wppa_dbg_msg( 'Post=' . serialize($_POST) );
33
 
34
- // List content filters
35
- // Data struct: $wp_filter[$tag]->callbacks[$priority][$idx] = array( 'function' => $function_to_add, 'accepted_args' => $accepted_args );
36
- if ( wppa( 'debug' ) && wppa( 'mocc' ) == '0' ) {
37
- global $wp_filter;
38
-
39
- wppa_dbg_msg( 'Start content filters', 'green' );
40
- foreach( array_keys( $wp_filter ) as $tag ) {
41
- if ( $tag == 'the_content' ) {
42
- $filters = $wp_filter[$tag] -> callbacks;
43
- foreach( array_keys($filters) as $pri ) {
44
- foreach( array_keys( $filters[$pri] ) as $item ) {
45
- if ( ! is_array( $filters[$pri][$item]['function'] ) ) {
46
- wppa_dbg_msg($tag.', Pri:'.$pri.', Func:'.$filters[$pri][$item]['function'].', args='.$filters[$pri][$item]['accepted_args'] );
47
- }
48
- }
49
- }
50
- }
51
- }
52
- wppa_dbg_msg( 'End content filters', 'green' );
53
-
54
- }
55
-
56
  // Process a user upload request, if any. Do it here: it may affect this occurences display
57
  wppa_user_upload();
58
 
@@ -981,7 +959,7 @@ global $wppa_current_shortcode_atts;
981
  }
982
  else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
983
  global $wppa_version;
984
- $expected_version = '7.3.11.002';
985
  if ( $wppa_version != $expected_version ) {
986
  wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
987
  }
@@ -3432,11 +3410,8 @@ function wppa_and_stristr( $string, $branch ) {
3432
  function wppa_get_slide_frame_style() {
3433
 
3434
  $fs = wppa_opt( 'fullsize' );
3435
- $cs = wppa_opt( 'colwidth' );
3436
- if ( $cs == 'auto' ) {
3437
- $cs = $fs;
3438
- wppa( 'auto_colwidth', true );
3439
- }
3440
  $result = '';
3441
  $gfs = ( is_numeric( wppa( 'fullsize' ) ) && wppa( 'fullsize' ) > '1' ) ? wppa( 'fullsize' ) : $fs;
3442
 
@@ -3580,20 +3555,17 @@ function wppa_get_container_width( $netto = false ) {
3580
  $result = wppa( 'fullsize' );
3581
  }
3582
  else {
3583
- $result = wppa_opt( 'colwidth' );
3584
- if ( $result == 'auto' ) {
3585
- if ( wppa( 'max_width' ) ) {
3586
- $result = wppa( 'max_width' );
3587
- }
3588
- else {
3589
- $result = wppa_opt( 'initial_colwidth' ); //'640';
3590
- }
3591
- wppa( 'auto_colwidth', true );
3592
  }
 
3593
  }
3594
  if ( $netto ) {
3595
- $result -= 12; // 2*padding
3596
- $result -= 2 * ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : '0' );
3597
  }
3598
  return $result;
3599
  }
@@ -3618,7 +3590,7 @@ function wppa_get_container_style() {
3618
  // Margin
3619
  $marg = false;
3620
  if ( is_numeric( wppa( 'fullsize' ) ) ) {
3621
- $cw = wppa_opt( 'colwidth' );
3622
  if ( is_numeric( $cw ) ) {
3623
  if ( $cw > ( wppa( 'fullsize' ) + 10 ) ) {
3624
  $marg = '10px;';
@@ -3809,13 +3781,11 @@ global $blog_id;
3809
  wppa_out( wppa_js( "\n" . '<script type="text/javascript" >' ) );
3810
  wppa_out( wppa_js( "\n /* START OCCURRANCE " . wppa( 'mocc' ) . " */" ) );
3811
  // wppa( 'auto_colwidth' ) is set by the filter or by wppa_albums in case called directly
3812
- // wppa_opt( 'colwidth' ) is the option setting
3813
  // script or call has precedence over option setting
3814
  // so: if set by script or call: auto, else if set by option: auto
3815
  $auto = false;
3816
  $contw = wppa_get_container_width();
3817
  if ( wppa( 'auto_colwidth' ) ) $auto = true;
3818
- elseif ( wppa_opt( 'colwidth' ) == 'auto' ) $auto = true;
3819
  elseif ( $contw > 0 && $contw <= 1.0 ) $auto = true;
3820
 
3821
  // If size explitely given and not a fraction, it is static size
@@ -4044,7 +4014,7 @@ function wppa_album_list( $action ) {
4044
  global $cover_count;
4045
  global $cover_count_key;
4046
 
4047
- $nice = wppa_switch( 'nicescroll' );
4048
  $maxh = wppa_opt( 'area_size' );
4049
  $overflow = 'visible';
4050
  $mocc = wppa( 'mocc' );
@@ -4133,7 +4103,7 @@ function wppa_get_npages( $type, $array ) {
4133
  if ( wppa( 'is_cover' ) == '1' ) { // Cover has no thumbs: 0 pages
4134
  $result = '0';
4135
  }
4136
- elseif ( $arraycount <= wppa_get_mincount() ) {
4137
  $result = '0';
4138
  }
4139
  elseif ( $tps != '0' ) {
@@ -4306,7 +4276,7 @@ function wppa_get_preambule() {
4306
  if ( ! wppa_switch( 'slide_wrap' ) && wppa( 'in_widget' ) != 'ss' ) {
4307
  return '0';
4308
  }
4309
- $result = is_numeric( wppa_opt( 'colwidth' ) ) ? wppa_opt( 'colwidth' ) : wppa_opt( 'fullsize' );
4310
  $result = ceil( ceil( $result / wppa_opt( 'thumbsize' ) ) / 2 ) + 2;
4311
  return $result;
4312
  }
@@ -5035,7 +5005,7 @@ global $wppa_upload_succes_id;
5035
  }
5036
  }
5037
  $points = '0';
5038
- $reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
5039
 
5040
  // Init alert text with possible results from wppa_do_frontend_file_upload()
5041
  $alert = $wppa_alert;
@@ -6073,7 +6043,7 @@ global $wppa_lang;
6073
  if ( ! wppa_is_dir ( $root ) ) {
6074
  wppa_mktree( $root );
6075
  }
6076
- $cache_file = $root . '/' . $wppa_lang . '-' . ( is_user_logged_in() ? 'login-' : '' ) . $cache_id;
6077
 
6078
  // Cachefile present?
6079
  if ( wppa_is_file( $cache_file ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
31
  wppa_dbg_msg( 'Get=' . serialize($_GET) );
32
  wppa_dbg_msg( 'Post=' . serialize($_POST) );
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  // Process a user upload request, if any. Do it here: it may affect this occurences display
35
  wppa_user_upload();
36
 
959
  }
960
  else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
961
  global $wppa_version;
962
+ $expected_version = '8.0.00.003';
963
  if ( $wppa_version != $expected_version ) {
964
  wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
965
  }
3410
  function wppa_get_slide_frame_style() {
3411
 
3412
  $fs = wppa_opt( 'fullsize' );
3413
+ $cs = $fs;
3414
+ wppa( 'auto_colwidth', true );
 
 
 
3415
  $result = '';
3416
  $gfs = ( is_numeric( wppa( 'fullsize' ) ) && wppa( 'fullsize' ) > '1' ) ? wppa( 'fullsize' ) : $fs;
3417
 
3555
  $result = wppa( 'fullsize' );
3556
  }
3557
  else {
3558
+ if ( wppa( 'max_width' ) ) {
3559
+ $result = wppa( 'max_width' );
3560
+ }
3561
+ else {
3562
+ $result = wppa_opt( 'initial_colwidth' ); //'640';
 
 
 
 
3563
  }
3564
+ wppa( 'auto_colwidth', true );
3565
  }
3566
  if ( $netto ) {
3567
+ $result -= 12; // 2*padding
3568
+ $result -= 2 * ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : '0' );
3569
  }
3570
  return $result;
3571
  }
3590
  // Margin
3591
  $marg = false;
3592
  if ( is_numeric( wppa( 'fullsize' ) ) ) {
3593
+ $cw = wppa_opt( 'initial_colwidth' );
3594
  if ( is_numeric( $cw ) ) {
3595
  if ( $cw > ( wppa( 'fullsize' ) + 10 ) ) {
3596
  $marg = '10px;';
3781
  wppa_out( wppa_js( "\n" . '<script type="text/javascript" >' ) );
3782
  wppa_out( wppa_js( "\n /* START OCCURRANCE " . wppa( 'mocc' ) . " */" ) );
3783
  // wppa( 'auto_colwidth' ) is set by the filter or by wppa_albums in case called directly
 
3784
  // script or call has precedence over option setting
3785
  // so: if set by script or call: auto, else if set by option: auto
3786
  $auto = false;
3787
  $contw = wppa_get_container_width();
3788
  if ( wppa( 'auto_colwidth' ) ) $auto = true;
 
3789
  elseif ( $contw > 0 && $contw <= 1.0 ) $auto = true;
3790
 
3791
  // If size explitely given and not a fraction, it is static size
4014
  global $cover_count;
4015
  global $cover_count_key;
4016
 
4017
+ $nice = wppa_switch( 'nicescroll' ) && ! wppa_is_mobile();
4018
  $maxh = wppa_opt( 'area_size' );
4019
  $overflow = 'visible';
4020
  $mocc = wppa( 'mocc' );
4103
  if ( wppa( 'is_cover' ) == '1' ) { // Cover has no thumbs: 0 pages
4104
  $result = '0';
4105
  }
4106
+ elseif ( ! $arraycount ) {
4107
  $result = '0';
4108
  }
4109
  elseif ( $tps != '0' ) {
4276
  if ( ! wppa_switch( 'slide_wrap' ) && wppa( 'in_widget' ) != 'ss' ) {
4277
  return '0';
4278
  }
4279
+ $result = wppa_opt( 'initial_colwidth' );
4280
  $result = ceil( ceil( $result / wppa_opt( 'thumbsize' ) ) / 2 ) + 2;
4281
  return $result;
4282
  }
5005
  }
5006
  }
5007
  $points = '0';
5008
+ $reload = false;
5009
 
5010
  // Init alert text with possible results from wppa_do_frontend_file_upload()
5011
  $alert = $wppa_alert;
6043
  if ( ! wppa_is_dir ( $root ) ) {
6044
  wppa_mktree( $root );
6045
  }
6046
+ $cache_file = $root . '/' . $wppa_lang . '-' . ( is_user_logged_in() ? 'login-' : '' ) . ( wppa_is_mobile() ? 'mobile-' : '' ) . $cache_id;
6047
 
6048
  // Cachefile present?
6049
  if ( wppa_is_file( $cache_file ) ) {
wppa-gp-widget.php DELETED
@@ -1,161 +0,0 @@
1
- <?php
2
- /* wppa-gp-widget.php
3
- * Package: wp-photo-album-plus
4
- *
5
- * A text widget that interpretes wppa shortcodes
6
- *
7
- * Version 7.3.08
8
- */
9
-
10
- class WppaGpWidget extends WP_Widget {
11
-
12
- function __construct() {
13
- $widget_ops = array( 'classname' => 'wppa_gp_widget', 'description' => __( 'General purpose widget that may contain [wppa] shortcodes', 'wp-photo-album-plus' ) );
14
- parent::__construct( 'wppa_gp_widget', __( 'WPPA+ Text', 'wp-photo-album-plus' ), $widget_ops );
15
- }
16
-
17
- function widget( $args, $instance ) {
18
-
19
- // Initialize
20
- wppa_widget_timer( 'init' );
21
- wppa_reset_occurrance();
22
- wppa( 'in_widget', 'gp' );
23
- wppa_bump_mocc();
24
- extract( $args );
25
- $instance = wppa_parse_args( (array) $instance, $this->get_defaults() );
26
- $widget_title = apply_filters( 'widget_title', $instance['title'] );
27
- $cache = $instance['cache'];
28
- $cachefile = wppa_get_widget_cache_path( $this->id );
29
-
30
- // Logged in only and logged out?
31
- if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
32
- return;
33
- }
34
-
35
- // Cache?
36
- if ( $cache ) {
37
-
38
- if ( wppa_is_file( $cachefile ) ) {
39
-
40
- // Cache expired?
41
- if ( $cache != 'inf' && wppa_filetime( $cachefile ) < time() - 60 * $cache ) {
42
- wppa_remove_widget_cache_path( $this->id );
43
- }
44
-
45
- // No, use it
46
- else {
47
- echo wppa_get_contents( $cachefile );
48
- echo wppa_widget_timer( 'show', $widget_title, true );
49
- wppa( 'in_widget', false );
50
- return;
51
- }
52
- }
53
- }
54
-
55
- // Other inits
56
-
57
- // Body
58
- $text = $instance['text'];
59
- $text = __( $text );
60
- if ( wppa_checked( $instance['filter'] ) ) { // Do wpautop BEFORE do_shortcode
61
- $text = wpautop( $text );
62
- }
63
- $text = do_shortcode( $text );
64
- $text = apply_filters( 'widget_text', $text ); // If shortcode at wppa filter priority, insert result. See wppa-filter.php
65
-
66
- $widget_content = '
67
- <div' .
68
- ' class="wppa-gp-widget"' .
69
- ' style="margin-top:2px; margin-left:2px;"' .
70
- ' data-wppa="yes"' .
71
- ' >' .
72
- $text .
73
- '</div>' .
74
- '<div style="clear:both"></div>';
75
-
76
- // Output
77
- $result = "\n" . $before_widget;
78
- if ( ! empty( $widget_title ) ) {
79
- $result .= $before_title . $widget_title . $after_title;
80
- }
81
- $result .= $widget_content . $after_widget;
82
-
83
- echo $result;
84
- echo wppa_widget_timer( 'show', $widget_title );
85
-
86
- // Cache?
87
- if ( $cache ) {
88
- wppa_put_contents( $cachefile, $result );
89
- }
90
-
91
- wppa( 'in_widget', false );
92
- wppa( 'fullsize', '' ); // Reset to prevent inheritage of wrong size in case widget is rendered before main column
93
-
94
- }
95
-
96
- function update( $new_instance, $old_instance ) {
97
-
98
- // Completize all parms
99
- $instance = wppa_parse_args( $new_instance, $this->get_defaults() );
100
-
101
- // Sanitize certain args
102
- $instance['title'] = strip_tags( $instance['title'] );
103
- if ( current_user_can('unfiltered_html') ) {
104
- $instance['text'] = $new_instance['text'];
105
- }
106
- else {
107
- $instance['text'] = stripslashes( wp_filter_post_kses( addslashes( $new_instance['text'] ) ) ); // wp_filter_post_kses() expects slashed
108
- }
109
-
110
- wppa_remove_widget_cache_path( $this->id );
111
-
112
- return $instance;
113
-
114
- }
115
-
116
- function form( $instance ) {
117
-
118
- // Defaults
119
- $instance = wppa_parse_args( (array) $instance, $this->get_defaults() );
120
-
121
- // Widget title
122
- echo
123
- wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
124
-
125
- // Text area
126
- echo
127
- wppa_widget_textarea( $this, 'text', $instance['text'], __( 'Enter the content just like a normal text widget. This widget will interpret [wppa] shortcodes', 'wp-photo-album-plus' ) );
128
-
129
- // Run wpautop?
130
- echo
131
- wppa_widget_checkbox( $this, 'filter', $instance['filter'], __( 'Automatically add paragraphs', 'wp-photo-album-plus' ) );
132
-
133
- // Logged in only?
134
- echo
135
- wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
136
-
137
- // Cache
138
- echo
139
- wppa_widget_cache( $this, $instance['cache'] );
140
-
141
- }
142
-
143
- // Set defaults
144
- function get_defaults() {
145
-
146
- $defaults = array( 'title' => __( 'Text', 'wp-photo-album-plus' ),
147
- 'text' => '',
148
- 'filter' => 'no',
149
- 'logonly' => 'no',
150
- 'cache' => '0',
151
- );
152
- return $defaults;
153
- }
154
-
155
- }
156
- // register WppaGpWidget widget
157
- add_action( 'widgets_init', 'wppa_register_WppaGpWidget' );
158
-
159
- function wppa_register_WppaGpWidget() {
160
- register_widget( "WppaGpWidget" );
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 7.7.07.006
7
  *
8
  */
9
 
@@ -613,11 +613,6 @@ global $wppa_session;
613
  printf( _n( 'There is %d possible photo found remote', 'There are %d possible photos found remote', $photocount, 'wp-photo-album-plus' ), $photocount );
614
  }
615
 
616
- // Tell if downsize on
617
- if ( wppa_switch( 'resize_on_upload' ) ) {
618
- echo ' ' . __( 'Photos will be downsized during import.', 'wp-photo-album-plus' );
619
- }
620
-
621
  echo
622
  '</b></p>';
623
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
613
  printf( _n( 'There is %d possible photo found remote', 'There are %d possible photos found remote', $photocount, 'wp-photo-album-plus' ), $photocount );
614
  }
615
 
 
 
 
 
 
616
  echo
617
  '</b></p>';
618
 
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 7.7.04.007
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -13,7 +13,6 @@ require_once 'wppa-search-widget.php';
13
  require_once 'wppa-topten-widget.php';
14
  require_once 'wppa-featen-widget.php';
15
  require_once 'wppa-slideshow-widget.php';
16
- require_once 'wppa-gp-widget.php';
17
  require_once 'wppa-comment-widget.php';
18
  require_once 'wppa-thumbnail-widget.php';
19
  require_once 'wppa-lasten-widget.php';
@@ -80,9 +79,9 @@ if ( is_admin() ) {
80
  require_once 'wppa-non-admin.php';
81
 
82
  /* ADD AJAX */
83
- if ( defined( 'DOING_AJAX' ) ) {
84
  require_once 'wppa-ajax.php';
85
- }
86
 
87
  // To fix a problem in Windows local host systems:
88
  function wppa_trims( $txt ) {
@@ -211,7 +210,7 @@ global $blog_id;
211
 
212
  global $wppa_log_file;
213
  $wppa_log_file = WPPA_UPLOAD_PATH . '/wppa-log.txt';
214
-
215
  define ( 'WPPA_LOCKDIR', WPPA_UPLOAD_PATH . '/locks' );
216
  }
217
 
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.0.00.004
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
13
  require_once 'wppa-topten-widget.php';
14
  require_once 'wppa-featen-widget.php';
15
  require_once 'wppa-slideshow-widget.php';
 
16
  require_once 'wppa-comment-widget.php';
17
  require_once 'wppa-thumbnail-widget.php';
18
  require_once 'wppa-lasten-widget.php';
79
  require_once 'wppa-non-admin.php';
80
 
81
  /* ADD AJAX */
82
+ // if ( defined( 'DOING_AJAX' ) ) {
83
  require_once 'wppa-ajax.php';
84
+ // }
85
 
86
  // To fix a problem in Windows local host systems:
87
  function wppa_trims( $txt ) {
210
 
211
  global $wppa_log_file;
212
  $wppa_log_file = WPPA_UPLOAD_PATH . '/wppa-log.txt';
213
+
214
  define ( 'WPPA_LOCKDIR', WPPA_UPLOAD_PATH . '/locks' );
215
  }
216
 
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
- * Version 7.7.06.001
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -116,8 +116,8 @@ global $wppa_runtime_settings;
116
 
117
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
118
 
119
- if ( wppa_switch( 'ajax_non_admin' ) ) {
120
- $al = WPPA_URL.'/wppa-ajax-front.php?action=wppa&amp;wppa-action=render';
121
  }
122
  else {
123
  $al = admin_url( 'admin-ajax.php' ).'?action=wppa&amp;wppa-action=render';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
+ * Version 8.0.00.003
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
116
 
117
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
118
 
119
+ if ( ! is_admin() ) {
120
+ $al = site_url() . '/wppaajax/?action=wppa&amp;wppa-action=render';
121
  }
122
  else {
123
  $al = admin_url( 'admin-ajax.php' ).'?action=wppa&amp;wppa-action=render';
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.7.05.001
8
  *
9
  */
10
 
@@ -914,7 +914,7 @@ function wppa_unsubscribe_link( $user_id, $listtype ) {
914
 
915
  $user = get_user_by( 'ID', $user_id );
916
  $crypt = crypt( $listtype . $user->ID . $user->login_name, $user->display_name );
917
- $url = admin_url( 'admin-ajax.php' );
918
  $url .= '?action=wppa&wppa-action=mailinglist&list=' . $listtype . '&onoff=off&user=' . $user_id . '&crypt=' . $crypt;
919
 
920
  $link = '<a href="' . $url . '" >';
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 8.0.00.003
8
  *
9
  */
10
 
914
 
915
  $user = get_user_by( 'ID', $user_id );
916
  $crypt = crypt( $listtype . $user->ID . $user->login_name, $user->display_name );
917
+ $url = site_url() . 'wppaajax/'; //admin_url( 'admin-ajax.php' );
918
  $url .= '?action=wppa&wppa-action=mailinglist&list=' . $listtype . '&onoff=off&user=' . $user_id . '&crypt=' . $crypt;
919
 
920
  $link = '<a href="' . $url . '" >';
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 7.7.05.001
7
  *
8
  */
9
 
@@ -1728,7 +1728,7 @@ function wppa_log_page() {
1728
  wppa_do_maintenance_popup( 'wppa_list_errorlog' ) .
1729
 
1730
  '</div>' .
1731
- '<script>setInterval(function(){wppaAjaxReplaceLog();}, 5000);</script>' .
1732
 
1733
  '</div>';
1734
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
1728
  wppa_do_maintenance_popup( 'wppa_list_errorlog' ) .
1729
 
1730
  '</div>' .
1731
+ '<script>setInterval(function(){wppaAjaxReplaceLog();}, 10000);</script>' .
1732
 
1733
  '</div>';
1734
 
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 7.6.04.004
7
  *
8
  */
9
 
@@ -327,11 +327,13 @@ global $wppa_opt;
327
  }
328
 
329
  // Nicescroller
330
- if ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) {
331
- $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
332
- wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, array( 'jquery', 'nicescrollr-easing-min-js' ), 'all' );
333
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
334
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
 
 
335
  }
336
 
337
  // Panorama
@@ -664,6 +666,13 @@ function wppa_redirect() {
664
  $_SERVER["REQUEST_URI"] = $newuri;
665
  wppa_convert_uri_to_get( $newuri );
666
  }
 
 
 
 
 
 
 
667
  }
668
 
669
  /* ADD PAGE SPECIFIC ( http or https ) URLS */
@@ -677,7 +686,7 @@ global $wppa_lang;
677
  wppaImageDirectory = "' . wppa_get_imgdir() . '";
678
  wppaWppaUrl = "' . wppa_get_wppa_url() . '";
679
  wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '";
680
- wppaAjaxUrl = "' . ( wppa_switch( 'ajax_non_admin' ) ? wppa_url( 'wppa-ajax-front.php' ) : admin_url( 'admin-ajax.php' ) ) . '";
681
  wppaUploadUrl = "' . WPPA_UPLOAD_URL . '";
682
  wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ';
683
  wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ';
@@ -714,6 +723,7 @@ wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ).'";
714
  wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ).'";
715
  wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ).'";
716
  wppaFsPolicy = "'.wppa_opt( 'fs_policy' ).'";
 
717
  ';
718
 
719
  // Relative urls?
@@ -846,6 +856,9 @@ function wppa_skip_photon($val, $src, $tag) {
846
  return $result;
847
  }
848
 
 
 
 
849
  /* Create dynamic js init file */
850
  function wppa_create_wppa_init_js() {
851
  global $wppa_api_version;
@@ -951,7 +964,6 @@ wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) .
951
  wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ';
952
  wppaLazyLoad = ' . ( wppa_switch( 'lazy' ) ? 'true' : 'false' ) . ';
953
  wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ';
954
- wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) ? 'true' : 'false' ) . ';
955
  wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '";
956
  wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '";
957
  wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ';
@@ -974,7 +986,7 @@ wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '";';
974
  $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
975
  $aspect = $t[0] / $t[1];
976
  }
977
- elseif ( wppa_opt( 'resize_to' ) ) {
978
  $t = explode( 'x', wppa_opt( 'resize_to' ) );
979
  $aspect = $t[1] / $t[0];
980
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
327
  }
328
 
329
  // Nicescroller
330
+ if ( ! wppa_is_mobile() ) {
331
+ if ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) {
332
+ $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
333
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, array( 'jquery', 'nicescrollr-easing-min-js' ), 'all' );
334
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
335
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
336
+ }
337
  }
338
 
339
  // Panorama
666
  $_SERVER["REQUEST_URI"] = $newuri;
667
  wppa_convert_uri_to_get( $newuri );
668
  }
669
+ /*
670
+ if ( stripos( $uri, '/wppaajax/' ) ) {
671
+ wppa_log( 'obs', 'Doing AJAX directly' );
672
+ wppa_ajax_callback();
673
+ exit();
674
+ }
675
+ */
676
  }
677
 
678
  /* ADD PAGE SPECIFIC ( http or https ) URLS */
686
  wppaImageDirectory = "' . wppa_get_imgdir() . '";
687
  wppaWppaUrl = "' . wppa_get_wppa_url() . '";
688
  wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '";
689
+ wppaAjaxUrl = "' . site_url() . '/wppaajax/";
690
  wppaUploadUrl = "' . WPPA_UPLOAD_URL . '";
691
  wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ';
692
  wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ';
723
  wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ).'";
724
  wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ).'";
725
  wppaFsPolicy = "'.wppa_opt( 'fs_policy' ).'";
726
+ wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ';
727
  ';
728
 
729
  // Relative urls?
856
  return $result;
857
  }
858
 
859
+ /* MAKE SURE TEXT WIDGET SUPPORTS SHORTCODES */
860
+ add_filter( 'widget_text', 'do_shortcode' );
861
+
862
  /* Create dynamic js init file */
863
  function wppa_create_wppa_init_js() {
864
  global $wppa_api_version;
964
  wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ';
965
  wppaLazyLoad = ' . ( wppa_switch( 'lazy' ) ? 'true' : 'false' ) . ';
966
  wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ';
 
967
  wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '";
968
  wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '";
969
  wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ';
986
  $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
987
  $aspect = $t[0] / $t[1];
988
  }
989
+ elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
990
  $t = explode( 'x', wppa_opt( 'resize_to' ) );
991
  $aspect = $t[1] / $t[0];
992
  }
wppa-photo-files.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
- * Version 7.7.03.003
6
  *
7
  */
8
 
@@ -253,15 +253,20 @@ wppa_log('obs','method = '.wppa_opt( 'newphoto_name_method' ).', filename = '.$t
253
  if ( wppa_opt( 'resize_to' ) == '0' ) { // from fullsize
254
  $max_width = wppa_opt( 'fullsize' );
255
  $max_height = wppa_opt( 'maxheight' );
 
 
 
 
256
  }
257
  else { // from selection
258
  $screen = explode( 'x', wppa_opt( 'resize_to' ) );
259
  $max_width = $screen[0];
260
  $max_height = $screen[1];
 
261
  }
262
 
263
  // If Resize on upload is checked
264
- if ( wppa_switch( 'resize_on_upload' ) && wppa_can_resize( $file, max( $max_width, $max_height ) ) ) {
265
 
266
  // ImageMagick
267
  if ( wppa_can_magick() ) {
@@ -291,17 +296,6 @@ wppa_log('obs','method = '.wppa_opt( 'newphoto_name_method' ).', filename = '.$t
291
  }
292
  $src_height = $src_size[1];
293
 
294
- /* // Max sizes
295
- if ( wppa_opt( 'resize_to' ) == '0' ) { // from fullsize
296
- $max_width = wppa_opt( 'fullsize' );
297
- $max_height = wppa_opt( 'maxheight' );
298
- }
299
- else { // from selection
300
- $screen = explode( 'x', wppa_opt( 'resize_to' ) );
301
- $max_width = $screen[0];
302
- $max_height = $screen[1];
303
- }
304
- */
305
  // If orientation needs +/- 90 deg rotation, swap max x and max y
306
  $ori = wppa_get_exif_orientation( $file );
307
  if ( $ori >= 5 && $ori <= 8 ) {
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
+ * Version 8.0.00.003
6
  *
7
  */
8
 
253
  if ( wppa_opt( 'resize_to' ) == '0' ) { // from fullsize
254
  $max_width = wppa_opt( 'fullsize' );
255
  $max_height = wppa_opt( 'maxheight' );
256
+ $do_resize = true;
257
+ }
258
+ elseif ( wppa_opt( 'resize_to' ) == '-1' ) { // no resize
259
+ $do_resize = false;
260
  }
261
  else { // from selection
262
  $screen = explode( 'x', wppa_opt( 'resize_to' ) );
263
  $max_width = $screen[0];
264
  $max_height = $screen[1];
265
+ $do_resize = true;
266
  }
267
 
268
  // If Resize on upload is checked
269
+ if ( $do_resize && wppa_can_resize( $file, max( $max_width, $max_height ) ) ) {
270
 
271
  // ImageMagick
272
  if ( wppa_can_magick() ) {
296
  }
297
  $src_height = $src_size[1];
298
 
 
 
 
 
 
 
 
 
 
 
 
299
  // If orientation needs +/- 90 deg rotation, swap max x and max y
300
  $ori = wppa_get_exif_orientation( $file );
301
  if ( $ori >= 5 && $ori <= 8 ) {
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 7.7.07.006
7
  *
8
  */
9
 
@@ -422,9 +422,9 @@ global $wppa_supported_camara_brands;
422
 
423
  // Check for availability of hires urls in case panorama is on
424
  if ( wppa_switch( 'enable_panorama' ) ) {
425
- if ( wppa_switch( 'resize_on_upload' ) && ! wppa_switch( 'keep_source_admin' ) && ! wppa_switch( 'keep_source_frontend' ) ) {
426
  wppa_warning_message( __( 'You enabled the display of complex panoramic photos', 'wp-photo-album-plus' ) . '<br />' .
427
- __( 'It is strongly recommended that you either do NOT resize (Table I-A2) or save sourcefiles (Table IX-H1 and 2) during upload in order to preserve resolution.', 'wp-photo-album-plus' ) );
428
  }
429
  }
430
 
@@ -432,10 +432,6 @@ global $wppa_supported_camara_brands;
432
  if ( wppa_opt( 'cover_type' ) == 'grid' ) {
433
  $stdmsg = __( 'You selected covertype "Grid with images only" in Table IV-D6.', 'wp-photo-album-plus' ) . '<br />' .
434
  __( 'To assure proper layout, please correct the following configuration issues.', 'wp-photo-album-plus' ) . '<br />';
435
- if ( wppa_opt( 'colwidth' ) != 'auto' ) {
436
- $msg = __( 'Table I-A1 (Column Width) must be set to "auto"', 'wp-photo-album-plus' );
437
- wppa_warning_message( $stdmsg . $msg );
438
- }
439
  if ( wppa_opt( 'max_cover_width' ) > wppa_opt( 'smallsize' ) ) {
440
  $msg = __( 'Table I-D1 (Max Cover width) may not be larger than Table I-D5.1a (Coverphoto size)', 'wp-photo-album-plus' );
441
  wppa_warning_message( $stdmsg . $msg );
@@ -701,33 +697,6 @@ global $wppa_supported_camara_brands;
701
  $tags = '';
702
  wppa_setting_subheader( '', '1', __('To quickly setup WPPA+ please answer the following questions. You can alway change any setting later. <a>Click on me!</a>', 'wp-photo-album-plus'));
703
  {
704
- $name = __('Is your theme <i>responsive</i>?', 'wp-photo-album-plus');
705
- $desc = __('Responsive themes have a layout that varies with the size of the browser window.', 'wp-photo-album-plus');
706
- $help = (__('WPPA+ needs to know this to automatically adept the width of the display to the available width on the page.', 'wp-photo-album-plus'));
707
- $slug = 'wppa_i_responsive';
708
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
709
- $vals = array('', 'yes', 'no');
710
- $html = wppa_select($slug, $opts, $vals);
711
- wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
712
-
713
- $name = __('Do you want to downsize photos during upload?', 'wp-photo-album-plus');
714
- $desc = __('Downsizing photos make them load faster to the visitor, without loosing display quality', 'wp-photo-album-plus');
715
- $help = (__('If you answer yes, the photos will be downsized to max 1024 x 768 pixels. You can change this later, if you like', 'wp-photo-album-plus'));
716
- $slug = 'wppa_i_downsize';
717
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
718
- $vals = array('', 'yes', 'no');
719
- $html = wppa_select($slug, $opts, $vals);
720
- wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
721
-
722
- $name = __('Do you want to save the original photofiles?', 'wp-photo-album-plus');
723
- $desc = __('This will require considerable disk space on the server.', 'wp-photo-album-plus');
724
- $help = (__('If you answer yes, you will be able to remove watermarks you applied with wppa+ in a later stage, redo downsizing to a larger size afterwards, and supply fullsize images for download.', 'wp-photo-album-plus'));
725
- $slug = 'wppa_i_source';
726
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
727
- $vals = array('', 'yes', 'no');
728
- $html = wppa_select($slug, $opts, $vals);
729
- wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
730
-
731
  $name = __('May visitors upload photos?', 'wp-photo-album-plus');
732
  $desc = __('It is safe to do so, but i will have to do some settings to keep it safe!', 'wp-photo-album-plus');
733
  $help = (__('If you answer yes, i will assume you want to enable logged in users to upload photos at the front-end of the website and allow them to edit their photos name and descriptions.', 'wp-photo-album-plus'));
@@ -793,51 +762,6 @@ global $wppa_supported_camara_brands;
793
  $html = wppa_select($slug, $opts, $vals);
794
  wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
795
 
796
- $name = __('Are you going to use Fotomoto?', 'wp-photo-album-plus');
797
- $desc = __('<a href="http://www.fotomoto.com/" target="_blank" >Fotomoto</a> is an on-line print service.', 'wp-photo-album-plus');
798
- $help = (__('If you answer Yes, you will have to open an account on Fotomoto.', 'wp-photo-album-plus'));
799
- $slug = 'wppa_i_fotomoto';
800
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
801
- $vals = array('', 'yes', 'no');
802
- $html = wppa_select($slug, $opts, $vals);
803
- wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
804
-
805
- $name = __('Are you going to add videofiles?', 'wp-photo-album-plus');
806
- $desc = __('You can mix videos and photos in any album.', 'wp-photo-album-plus');
807
- $help = (__('You can configure the details later', 'wp-photo-album-plus'));
808
- $slug = 'wppa_i_video';
809
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
810
- $vals = array('', 'yes', 'no');
811
- $html = wppa_select($slug, $opts, $vals);
812
- wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
813
-
814
- $name = __('Are you going to add audiofiles?', 'wp-photo-album-plus');
815
- $desc = __('You can add audio to photos in any album.', 'wp-photo-album-plus');
816
- $help = (__('You can configure the details later', 'wp-photo-album-plus'));
817
- $slug = 'wppa_i_audio';
818
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
819
- $vals = array('', 'yes', 'no');
820
- $html = wppa_select($slug, $opts, $vals);
821
- wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags);
822
-
823
- $name = __('Are you going to upload 3D stereo photos?', 'wp-photo-album-plus');
824
- $desc = __('You can add l-r and r-l stereo photo pairs.', 'wp-photo-album-plus');
825
- $help = (__('You can configure the details later', 'wp-photo-album-plus'));
826
- $slug = 'wppa_i_stereo';
827
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
828
- $vals = array('', 'yes', 'no');
829
- $html = wppa_select($slug, $opts, $vals);
830
- wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags);
831
-
832
- $name = __('Are you going to upload pdf files?', 'wp-photo-album-plus');
833
- $desc = __('You can add pdf files in any album.', 'wp-photo-album-plus');
834
- $help = (__('You can configure the details later', 'wp-photo-album-plus'));
835
- $slug = 'wppa_i_pdf';
836
- $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus'));
837
- $vals = array('', 'yes', 'no');
838
- $html = wppa_select($slug, $opts, $vals);
839
- wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags);
840
-
841
  $name = __('Done?', 'wp-photo-album-plus');
842
  $desc = __('If you are ready answering these questions, select <b>yes</b>', 'wp-photo-album-plus');
843
  $help = (__('You can change any setting later, and be more specific and add a lot of settings. For now it is enough, go create albums and upload photos!', 'wp-photo-album-plus'));
@@ -890,18 +814,6 @@ global $wppa_supported_camara_brands;
890
 
891
  wppa_setting_subheader( 'A', '1', __( 'WPPA+ global system related size settings' , 'wp-photo-album-plus') );
892
  {
893
- $name = __('Column Width', 'wp-photo-album-plus');
894
- $desc = __('The width of the main column in your theme\'s display area.', 'wp-photo-album-plus');
895
- $help = (__('Enter the width of the main column in your theme\'s display area.', 'wp-photo-album-plus'));
896
- $help .= '<br />'.(__('You should set this value correctly to make sure the fullsize images are properly aligned horizontally.', 'wp-photo-album-plus'));
897
- $help .= '<br />'.(__('You may enter \'auto\' for use in themes that have a floating content column.', 'wp-photo-album-plus'));
898
- $help .= '<br />'.(__('The use of \'auto\' is required for responsive themes.', 'wp-photo-album-plus'));
899
- $slug = 'wppa_colwidth';
900
- $onchange = 'wppaCheckFullHalign()';
901
- $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'), $onchange);
902
- $clas = '';
903
- $tags = 'size,system';
904
- wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
905
 
906
  $name = __('Initial Width', 'wp-photo-album-plus');
907
  $desc = __('The most often displayed colun width in responsive theme', 'wp-photo-album-plus');
@@ -912,24 +824,14 @@ global $wppa_supported_camara_brands;
912
  $tags = 'size,system';
913
  wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
914
 
915
- $name = __('Resize on Upload', 'wp-photo-album-plus');
916
- $desc = __('Indicate if the photos should be resized during upload.', 'wp-photo-album-plus');
917
- $help = (__('If you check this item, the size of the photos will be reduced to the dimension specified in the next item during the upload/import process.', 'wp-photo-album-plus'));
918
- $help .= '<br />'.(__('The photos will never be stretched during upload if they are smaller.', 'wp-photo-album-plus'));
919
- $slug = 'wppa_resize_on_upload';
920
- $onchange = 'wppaCheckResize()';
921
- $html = wppa_checkbox($slug, $onchange);
922
- $clas = '';
923
- $tags = 'size,upload';
924
- wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
925
-
926
  $name = __('Resize to', 'wp-photo-album-plus');
927
  $desc = __('Resize photos to fit within a given area.', 'wp-photo-album-plus');
928
  $help = (__('Specify the screensize for the unscaled photos.', 'wp-photo-album-plus'));
929
  $help .= '<br />'.(__('The use of a non-default value is particularly usefull when you make use of lightbox functionality.', 'wp-photo-album-plus'));
930
  $slug = 'wppa_resize_to';
931
  $px = __('pixels', 'wp-photo-album-plus');
932
- $options = array( __('Fit within rectangle as set in Table I-B1,2', 'wp-photo-album-plus'),
 
933
  '640 x 480 '.$px,
934
  '800 x 600 '.$px,
935
  '1024 x 768 '.$px,
@@ -942,7 +844,8 @@ global $wppa_supported_camara_brands;
942
  '4800 x 2400 '.$px,
943
  '6000 x 3000 '.$px,
944
  );
945
- $values = array( '0',
 
946
  '640x480',
947
  '800x600',
948
  '1024x768',
@@ -960,15 +863,6 @@ global $wppa_supported_camara_brands;
960
  $tags = 'size,upload';
961
  wppa_setting('', '3', $name, $desc, $html, $help, $clas, $tags);
962
 
963
- $name = __('Photocount threshold', 'wp-photo-album-plus');
964
- $desc = __('Number of photos in an album must exceed.', 'wp-photo-album-plus');
965
- $help = (__('Photos do not show up in the album unless there are more than this number of photos in the album. This allows you to have cover photos on an album that contains only sub albums without seeing them in the list of sub albums. Usually set to 0 (always show) or 1 (for one cover photo).', 'wp-photo-album-plus'));
966
- $slug = 'wppa_min_thumbs';
967
- $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus'));
968
- $clas = '';
969
- $tags = 'size,system,album';
970
- wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
971
-
972
  $name = __('Border thickness', 'wp-photo-album-plus');
973
  $desc = __('Thickness of wppa+ box borders.', 'wp-photo-album-plus');
974
  $help = (__('Enter the thickness for the border of the WPPA+ boxes. A number of 0 means: no border.', 'wp-photo-album-plus'));
@@ -3714,24 +3608,24 @@ global $wppa_supported_camara_brands;
3714
  <?php
3715
  $wppa_table = 'III';
3716
 
3717
- wppa_setting_subheader( 'A', '4', __('Slideshow elements backgrounds' , 'wp-photo-album-plus') );
3718
  {
3719
- $name = __('Nav', 'wp-photo-album-plus');
3720
- $desc = __('Navigation bars.', 'wp-photo-album-plus');
3721
- $help = (__('Enter valid CSS colors for navigation backgrounds and borders.', 'wp-photo-album-plus'));
3722
- $slug1 = 'wppa_bgcolor_nav';
3723
- $slug2 = 'wppa_bcolor_nav';
3724
  $slug = array($slug1, $slug2);
3725
  $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3726
  $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3727
  $html = array($html1, $html2);
3728
  $clas = '';
3729
- $tags = 'slide,layout,navi';
3730
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
3731
 
3732
  $name = __('SlideImg', 'wp-photo-album-plus');
3733
  $desc = __('Fullsize Slideshow Photos.', 'wp-photo-album-plus');
3734
- $help = (__('Enter valid CSS colors for fullsize photo backgrounds and borders.', 'wp-photo-album-plus'));
3735
  $help .= '<br />'.(__('The colors may be equal or "transparent"', 'wp-photo-album-plus'));
3736
  $help .= '<br />'.(__('For more information about slideshow image borders see the help on Table I-B4', 'wp-photo-album-plus'));
3737
  $slug1 = 'wppa_bgcolor_fullimg';
@@ -3746,7 +3640,7 @@ global $wppa_supported_camara_brands;
3746
 
3747
  $name = __('Numbar', 'wp-photo-album-plus');
3748
  $desc = __('Number bar box background.', 'wp-photo-album-plus');
3749
- $help = (__('Enter valid CSS colors for numbar box backgrounds and borders.', 'wp-photo-album-plus'));
3750
  $slug1 = 'wppa_bgcolor_numbar';
3751
  $slug2 = 'wppa_bcolor_numbar';
3752
  $slug = array($slug1, $slug2);
@@ -3759,7 +3653,7 @@ global $wppa_supported_camara_brands;
3759
 
3760
  $name = __('Numbar active', 'wp-photo-album-plus');
3761
  $desc = __('Number bar active box background.', 'wp-photo-album-plus');
3762
- $help = (__('Enter valid CSS colors for numbar active box backgrounds and borders.', 'wp-photo-album-plus'));
3763
  $slug1 = 'wppa_bgcolor_numbar_active';
3764
  $slug2 = 'wppa_bcolor_numbar_active';
3765
  $slug = array($slug1, $slug2);
@@ -3770,111 +3664,9 @@ global $wppa_supported_camara_brands;
3770
  $tags = 'slide,layout';
3771
  wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
3772
 
3773
- $name = __('Name/desc', 'wp-photo-album-plus');
3774
- $desc = __('Name and Description bars.', 'wp-photo-album-plus');
3775
- $help = (__('Enter valid CSS colors for name and description box backgrounds and borders.', 'wp-photo-album-plus'));
3776
- $slug1 = 'wppa_bgcolor_namedesc';
3777
- $slug2 = 'wppa_bcolor_namedesc';
3778
- $slug = array($slug1, $slug2);
3779
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3780
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3781
- $html = array($html1, $html2);
3782
- $clas = '';
3783
- $tags = 'slide,meta,layout';
3784
- wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
3785
-
3786
- $name = __('Comments', 'wp-photo-album-plus');
3787
- $desc = __('Comment input and display areas.', 'wp-photo-album-plus');
3788
- $help = (__('Enter valid CSS colors for comment box backgrounds and borders.', 'wp-photo-album-plus'));
3789
- $slug1 = 'wppa_bgcolor_com';
3790
- $slug2 = 'wppa_bcolor_com';
3791
- $slug = array($slug1, $slug2);
3792
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3793
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3794
- $clas = 'wppa_comment_';
3795
- $tags = 'slide,comment,layout';
3796
- $html = array($html1, $html2);
3797
- wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
3798
-
3799
- $name = __('Custom', 'wp-photo-album-plus');
3800
- $desc = __('Custom box background.', 'wp-photo-album-plus');
3801
- $help = (__('Enter valid CSS colors for custom box backgrounds and borders.', 'wp-photo-album-plus'));
3802
- $slug1 = 'wppa_bgcolor_cus';
3803
- $slug2 = 'wppa_bcolor_cus';
3804
- $slug = array($slug1, $slug2);
3805
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3806
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3807
- $html = array($html1, $html2);
3808
- $clas = '';
3809
- $tags = 'slide,layout';
3810
- wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
3811
-
3812
- $name = __('IPTC', 'wp-photo-album-plus');
3813
- $desc = __('IPTC display box background.', 'wp-photo-album-plus');
3814
- $help = (__('Enter valid CSS colors for iptc box backgrounds and borders.', 'wp-photo-album-plus'));
3815
- $slug1 = 'wppa_bgcolor_iptc';
3816
- $slug2 = 'wppa_bcolor_iptc';
3817
- $slug = array($slug1, $slug2);
3818
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3819
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3820
- $html = array($html1, $html2);
3821
- $clas = '';
3822
- $tags = 'slide,meta,layout';
3823
- wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
3824
-
3825
- $name = __('EXIF', 'wp-photo-album-plus');
3826
- $desc = __('EXIF display box background.', 'wp-photo-album-plus');
3827
- $help = (__('Enter valid CSS colors for exif box backgrounds and borders.', 'wp-photo-album-plus'));
3828
- $slug1 = 'wppa_bgcolor_exif';
3829
- $slug2 = 'wppa_bcolor_exif';
3830
- $slug = array($slug1, $slug2);
3831
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3832
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3833
- $html = array($html1, $html2);
3834
- $clas = '';
3835
- $tags = 'slide,meta,layout';
3836
- wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
3837
-
3838
- $name = __('Share', 'wp-photo-album-plus');
3839
- $desc = __('Share box display background.', 'wp-photo-album-plus');
3840
- $help = (__('Enter valid CSS colors for share box backgrounds and borders.', 'wp-photo-album-plus'));
3841
- $slug1 = 'wppa_bgcolor_share';
3842
- $slug2 = 'wppa_bcolor_share';
3843
- $slug = array($slug1, $slug2);
3844
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3845
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3846
- $html = array($html1, $html2);
3847
- $clas = '';
3848
- $tags = 'slide,layout';
3849
- wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
3850
  }
3851
  wppa_setting_subheader( 'B', '4', __('Other backgrounds and colors' , 'wp-photo-album-plus') );
3852
  {
3853
- $name = __('Even', 'wp-photo-album-plus');
3854
- $desc = __('Even background.', 'wp-photo-album-plus');
3855
- $help = (__('Enter valid CSS colors for even numbered backgrounds and borders of album covers and thumbnail displays \'As covers\'.', 'wp-photo-album-plus'));
3856
- $slug1 = 'wppa_bgcolor_even';
3857
- $slug2 = 'wppa_bcolor_even';
3858
- $slug = array($slug1, $slug2);
3859
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3860
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3861
- $html = array($html1, $html2);
3862
- $clas = '';
3863
- $tags = 'layout,album,cover,thumb';
3864
- wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
3865
-
3866
- $name = __('Odd', 'wp-photo-album-plus');
3867
- $desc = __('Odd background.', 'wp-photo-album-plus');
3868
- $help = (__('Enter valid CSS colors for odd numbered backgrounds and borders of album covers and thumbnail displays \'As covers\'.', 'wp-photo-album-plus'));
3869
- $slug1 = 'wppa_bgcolor_alt';
3870
- $slug2 = 'wppa_bcolor_alt';
3871
- $slug = array($slug1, $slug2);
3872
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3873
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3874
- $html = array($html1, $html2);
3875
- $clas = '';
3876
- $tags = 'layout,album,cover,thumb';
3877
- wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
3878
 
3879
  $name = __('Thumbnail padding', 'wp-photo-album-plus');
3880
  $desc = __('Thumbnail padding color if thumbnail aspect is a padded setting.', 'wp-photo-album-plus');
@@ -3902,131 +3694,6 @@ global $wppa_supported_camara_brands;
3902
  $tags = 'layout,cover,album';
3903
  wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags);
3904
 
3905
- $name = __('Upload', 'wp-photo-album-plus');
3906
- $desc = __('Upload box background.', 'wp-photo-album-plus');
3907
- $help = (__('Enter valid CSS colors for upload box backgrounds and borders.', 'wp-photo-album-plus'));
3908
- $help .= '<br />'.(__('See the Upload box, created by the shortcode [wppa type="upload"]', 'wp-photo-album-plus'));
3909
- $slug1 = 'wppa_bgcolor_upload';
3910
- $slug2 = 'wppa_bcolor_upload';
3911
- $slug = array($slug1, $slug2);
3912
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3913
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3914
- $html = array($html1, $html2);
3915
- $clas = '';
3916
- $tags = 'layout,upload';
3917
- wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
3918
-
3919
- $name = __('Multitag', 'wp-photo-album-plus');
3920
- $desc = __('Multitag box background.', 'wp-photo-album-plus');
3921
- $help = (__('Enter valid CSS colors for multitag box backgrounds and borders.', 'wp-photo-album-plus'));
3922
- $help .= '<br />'.(__('See the Multitag search box, created by the shortcode [wppa type="multitag"]', 'wp-photo-album-plus'));
3923
- $slug1 = 'wppa_bgcolor_multitag';
3924
- $slug2 = 'wppa_bcolor_multitag';
3925
- $slug = array($slug1, $slug2);
3926
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3927
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3928
- $html = array($html1, $html2);
3929
- $clas = '';
3930
- $tags = 'layout,search';
3931
- wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
3932
-
3933
- $name = __('Tagcloud', 'wp-photo-album-plus');
3934
- $desc = __('Tagcloud box background.', 'wp-photo-album-plus');
3935
- $help = (__('Enter valid CSS colors for tagcloud box backgrounds and borders.', 'wp-photo-album-plus'));
3936
- $help .= '<br />'.(__('See the Tagcloud search box, created by the shortcode [wppa type="tagcloud"]', 'wp-photo-album-plus'));
3937
- $slug1 = 'wppa_bgcolor_tagcloud';
3938
- $slug2 = 'wppa_bcolor_tagcloud';
3939
- $slug = array($slug1, $slug2);
3940
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3941
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3942
- $html = array($html1, $html2);
3943
- $clas = '';
3944
- $tags = 'layout,search';
3945
- wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
3946
-
3947
- $name = __('Superview', 'wp-photo-album-plus');
3948
- $desc = __('Superview box background.', 'wp-photo-album-plus');
3949
- $help = (__('Enter valid CSS colors for superview box backgrounds and borders.', 'wp-photo-album-plus'));
3950
- $help .= '<br />'.(__('See the Superview search box, created by the shortcode [wppa type="superview"]', 'wp-photo-album-plus'));
3951
- $slug1 = 'wppa_bgcolor_superview';
3952
- $slug2 = 'wppa_bcolor_superview';
3953
- $slug = array($slug1, $slug2);
3954
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3955
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3956
- $html = array($html1, $html2);
3957
- $clas = '';
3958
- $tags = 'layout,search';
3959
- wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
3960
-
3961
- $name = __('Search', 'wp-photo-album-plus');
3962
- $desc = __('Search box background.', 'wp-photo-album-plus');
3963
- $help = (__('Enter valid CSS colors for search box backgrounds and borders.', 'wp-photo-album-plus'));
3964
- $help .= '<br />'.(__('See the Search box, created by the shortcode [wppa type="search"]', 'wp-photo-album-plus'));
3965
- $slug1 = 'wppa_bgcolor_search';
3966
- $slug2 = 'wppa_bcolor_search';
3967
- $slug = array($slug1, $slug2);
3968
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3969
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3970
- $html = array($html1, $html2);
3971
- $clas = '';
3972
- $tags = 'layout,search';
3973
- wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
3974
-
3975
- $name = __('BestOf', 'wp-photo-album-plus');
3976
- $desc = __('BestOf box background.', 'wp-photo-album-plus');
3977
- $help = (__('Enter valid CSS colors for bestof box backgrounds and borders.', 'wp-photo-album-plus'));
3978
- $help .= '<br />'.(__('See the Best of box, created by the shortcode [wppa type="bestof"]', 'wp-photo-album-plus'));
3979
- $slug1 = 'wppa_bgcolor_bestof';
3980
- $slug2 = 'wppa_bcolor_bestof';
3981
- $slug = array($slug1, $slug2);
3982
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3983
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3984
- $html = array($html1, $html2);
3985
- $clas = '';
3986
- $tags = 'layout,search';
3987
- wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
3988
-
3989
- $name = __('Calendar', 'wp-photo-album-plus');
3990
- $desc = __('Calendar box background.', 'wp-photo-album-plus');
3991
- $help = (__('Enter valid CSS colors for calendar box backgrounds and borders.', 'wp-photo-album-plus'));
3992
- $help .= '<br />'.(__('See the Calendar box, created by the shortcode [wppa type="calendar"]', 'wp-photo-album-plus'));
3993
- $slug1 = 'wppa_bgcolor_calendar';
3994
- $slug2 = 'wppa_bcolor_calendar';
3995
- $slug = array($slug1, $slug2);
3996
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3997
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3998
- $html = array($html1, $html2);
3999
- $clas = '';
4000
- $tags = 'layout';
4001
- wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
4002
-
4003
- $name = __('Stereo', 'wp-photo-album-plus');
4004
- $desc = __('Stereo mode selection box background.', 'wp-photo-album-plus');
4005
- $help = (__('Enter valid CSS colors for stereo mode selection box backgrounds and borders.', 'wp-photo-album-plus'));
4006
- $help .= '<br />'.(__('See the Stereo type selection box, created by the shortcode [wppa type="stereo"]', 'wp-photo-album-plus'));
4007
- $slug1 = 'wppa_bgcolor_stereo';
4008
- $slug2 = 'wppa_bcolor_stereo';
4009
- $slug = array($slug1, $slug2);
4010
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
4011
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
4012
- $html = array($html1, $html2);
4013
- $clas = '';
4014
- $tags = 'layout';
4015
- wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
4016
-
4017
- $name = __('Admins Choice', 'wp-photo-album-plus');
4018
- $desc = __('Admins choice box background.', 'wp-photo-album-plus');
4019
- $help = (__('Enter valid CSS colors for admins choice box backgrounds and borders.', 'wp-photo-album-plus'));
4020
- $help .= '<br />'.(__('See the Admins choice box, created by the shortcode [wppa type="choice"]', 'wp-photo-album-plus'));
4021
- $slug1 = 'wppa_bgcolor_adminschoice';
4022
- $slug2 = 'wppa_bcolor_adminschoice';
4023
- $slug = array($slug1, $slug2);
4024
- $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
4025
- $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
4026
- $html = array($html1, $html2);
4027
- $clas = '';
4028
- $tags = 'layout';
4029
- wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
4030
 
4031
  $name = __('Modal render box', 'wp-photo-album-plus');
4032
  $desc = __('The background for the Ajax modal rendering box.', 'wp-photo-album-plus');
@@ -4132,16 +3799,6 @@ global $wppa_supported_camara_brands;
4132
  $tags = 'system';
4133
  wppa_setting($slug, '1.0', $name, $desc, $html, $help, $clas, $tags);
4134
 
4135
- $name = __('Ajax NON Admin', 'wp-photo-album-plus');
4136
- $desc = __('Frontend ajax use no admin files.', 'wp-photo-album-plus');
4137
- $help = (__('If you want to password protect wp-admin, check this box.', 'wp-photo-album-plus'));
4138
- $help .= '<br />'.(__('In rare cases changing page content does not work when this box is checked. Verify the functionality!', 'wp-photo-album-plus'));
4139
- $slug = 'wppa_ajax_non_admin';
4140
- $html = wppa_checkbox($slug);
4141
- $clas = '';
4142
- $tags = 'system';
4143
- wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
4144
-
4145
  $name = __('Modal boxes', 'wp-photo-album-plus');
4146
  $desc = __('Place Ajax rendered content in modal boxes', 'wp-photo-album-plus');
4147
  $help = '';
@@ -7631,17 +7288,6 @@ global $wppa_supported_camara_brands;
7631
  $tags = 'upload';
7632
  wppa_setting($slug, '10.2', $name, $desc, $html, $help, $clas, $tags);
7633
 
7634
- $name = __('Home after Upload', 'wp-photo-album-plus');
7635
- $desc = __('After successfull front-end upload, go to the home page.', 'wp-photo-album-plus');
7636
- $help = '';
7637
- $slug = 'wppa_home_after_upload';
7638
- $html1 = wppa_checkbox($slug);
7639
- $html2 = '';
7640
- $html = array( $html1, $html2 );
7641
- $clas = '';
7642
- $tags = 'upload';
7643
- wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
7644
-
7645
  $name = __('Fe alert', 'wp-photo-album-plus');
7646
  $desc = __('Show alertbox on front-end.', 'wp-photo-album-plus');
7647
  $help = (__('Errors are always reported, credit points only when --- none --- is not selected', 'wp-photo-album-plus'));
@@ -10930,26 +10576,16 @@ global $wppa_supported_camara_brands;
10930
  }
10931
  wppa_setting_subheader( 'H', '1', __( 'Source file management and other upload/import settings and actions.' , 'wp-photo-album-plus') );
10932
  {
10933
- $name = __('Keep sourcefiles admin', 'wp-photo-album-plus');
10934
  $desc = __('Keep the original uploaded and imported photo files.', 'wp-photo-album-plus');
10935
  $help = (__('The files will be kept in a separate directory with subdirectories for each album', 'wp-photo-album-plus'));
10936
  $help .= '<br />'.(__('These files can be used to update the photos used in displaying in wppa+ and optionally for downloading original, un-downsized images.', 'wp-photo-album-plus'));
10937
- $slug = 'wppa_keep_source_admin';
10938
  $html = wppa_checkbox($slug);
10939
  $clas = '';
10940
  $tags = 'system';
10941
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
10942
 
10943
- $name = __('Keep sourcefiles frontend', 'wp-photo-album-plus');
10944
- $desc = __('Keep the original frontend uploaded photo files.', 'wp-photo-album-plus');
10945
- $help = (__('The files will be kept in a separate directory with subdirectories for each album', 'wp-photo-album-plus'));
10946
- $help .= '<br />'.(__('These files can be used to update the photos used in displaying in wppa+ and optionally for downloading original, un-downsized images.', 'wp-photo-album-plus'));
10947
- $slug = 'wppa_keep_source_frontend';
10948
- $html = wppa_checkbox($slug);
10949
- $clas = '';
10950
- $tags = 'system';
10951
- wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
10952
-
10953
  $name = __('Source directory', 'wp-photo-album-plus');
10954
  $desc = __('The path to the directory where the original photofiles will be saved.', 'wp-photo-album-plus');
10955
  $help = (__('You may change the directory path, but it can not be an url.', 'wp-photo-album-plus'));
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
422
 
423
  // Check for availability of hires urls in case panorama is on
424
  if ( wppa_switch( 'enable_panorama' ) ) {
425
+ if ( ! wppa_switch( 'keep_source' ) ) {
426
  wppa_warning_message( __( 'You enabled the display of complex panoramic photos', 'wp-photo-album-plus' ) . '<br />' .
427
+ __( 'It is strongly recommended that you save sourcefiles (Table IX-H1) during upload in order to preserve resolution.', 'wp-photo-album-plus' ) );
428
  }
429
  }
430
 
432
  if ( wppa_opt( 'cover_type' ) == 'grid' ) {
433
  $stdmsg = __( 'You selected covertype "Grid with images only" in Table IV-D6.', 'wp-photo-album-plus' ) . '<br />' .
434
  __( 'To assure proper layout, please correct the following configuration issues.', 'wp-photo-album-plus' ) . '<br />';
 
 
 
 
435
  if ( wppa_opt( 'max_cover_width' ) > wppa_opt( 'smallsize' ) ) {
436
  $msg = __( 'Table I-D1 (Max Cover width) may not be larger than Table I-D5.1a (Coverphoto size)', 'wp-photo-album-plus' );
437
  wppa_warning_message( $stdmsg . $msg );
697
  $tags = '';
698
  wppa_setting_subheader( '', '1', __('To quickly setup WPPA+ please answer the following questions. You can alway change any setting later. <a>Click on me!</a>', 'wp-photo-album-plus'));
699
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
700
  $name = __('May visitors upload photos?', 'wp-photo-album-plus');
701
  $desc = __('It is safe to do so, but i will have to do some settings to keep it safe!', 'wp-photo-album-plus');
702
  $help = (__('If you answer yes, i will assume you want to enable logged in users to upload photos at the front-end of the website and allow them to edit their photos name and descriptions.', 'wp-photo-album-plus'));
762
  $html = wppa_select($slug, $opts, $vals);
763
  wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
764
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  $name = __('Done?', 'wp-photo-album-plus');
766
  $desc = __('If you are ready answering these questions, select <b>yes</b>', 'wp-photo-album-plus');
767
  $help = (__('You can change any setting later, and be more specific and add a lot of settings. For now it is enough, go create albums and upload photos!', 'wp-photo-album-plus'));
814
 
815
  wppa_setting_subheader( 'A', '1', __( 'WPPA+ global system related size settings' , 'wp-photo-album-plus') );
816
  {
 
 
 
 
 
 
 
 
 
 
 
 
817
 
818
  $name = __('Initial Width', 'wp-photo-album-plus');
819
  $desc = __('The most often displayed colun width in responsive theme', 'wp-photo-album-plus');
824
  $tags = 'size,system';
825
  wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
826
 
 
 
 
 
 
 
 
 
 
 
 
827
  $name = __('Resize to', 'wp-photo-album-plus');
828
  $desc = __('Resize photos to fit within a given area.', 'wp-photo-album-plus');
829
  $help = (__('Specify the screensize for the unscaled photos.', 'wp-photo-album-plus'));
830
  $help .= '<br />'.(__('The use of a non-default value is particularly usefull when you make use of lightbox functionality.', 'wp-photo-album-plus'));
831
  $slug = 'wppa_resize_to';
832
  $px = __('pixels', 'wp-photo-album-plus');
833
+ $options = array( __('Do not resize', 'wp-photo-album-plus'),
834
+ __('Fit within rectangle as set in Table I-B1,2', 'wp-photo-album-plus'),
835
  '640 x 480 '.$px,
836
  '800 x 600 '.$px,
837
  '1024 x 768 '.$px,
844
  '4800 x 2400 '.$px,
845
  '6000 x 3000 '.$px,
846
  );
847
+ $values = array( '-1',
848
+ '0',
849
  '640x480',
850
  '800x600',
851
  '1024x768',
863
  $tags = 'size,upload';
864
  wppa_setting('', '3', $name, $desc, $html, $help, $clas, $tags);
865
 
 
 
 
 
 
 
 
 
 
866
  $name = __('Border thickness', 'wp-photo-album-plus');
867
  $desc = __('Thickness of wppa+ box borders.', 'wp-photo-album-plus');
868
  $help = (__('Enter the thickness for the border of the WPPA+ boxes. A number of 0 means: no border.', 'wp-photo-album-plus'));
3608
  <?php
3609
  $wppa_table = 'III';
3610
 
3611
+ wppa_setting_subheader( 'A', '4', __('General backgrounds' , 'wp-photo-album-plus') );
3612
  {
3613
+ $name = __('WPPA box', 'wp-photo-album-plus');
3614
+ $desc = __('WPPA display boxes.', 'wp-photo-album-plus');
3615
+ $help = __('Enter valid CSS colors for backgrounds and borders.', 'wp-photo-album-plus');
3616
+ $slug1 = 'wppa_bgcolor';
3617
+ $slug2 = 'wppa_bcolor';
3618
  $slug = array($slug1, $slug2);
3619
  $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3620
  $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3621
  $html = array($html1, $html2);
3622
  $clas = '';
3623
+ $tags = 'layout';
3624
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
3625
 
3626
  $name = __('SlideImg', 'wp-photo-album-plus');
3627
  $desc = __('Fullsize Slideshow Photos.', 'wp-photo-album-plus');
3628
+ $help = '';
3629
  $help .= '<br />'.(__('The colors may be equal or "transparent"', 'wp-photo-album-plus'));
3630
  $help .= '<br />'.(__('For more information about slideshow image borders see the help on Table I-B4', 'wp-photo-album-plus'));
3631
  $slug1 = 'wppa_bgcolor_fullimg';
3640
 
3641
  $name = __('Numbar', 'wp-photo-album-plus');
3642
  $desc = __('Number bar box background.', 'wp-photo-album-plus');
3643
+ $help = '';
3644
  $slug1 = 'wppa_bgcolor_numbar';
3645
  $slug2 = 'wppa_bcolor_numbar';
3646
  $slug = array($slug1, $slug2);
3653
 
3654
  $name = __('Numbar active', 'wp-photo-album-plus');
3655
  $desc = __('Number bar active box background.', 'wp-photo-album-plus');
3656
+ $help = '';
3657
  $slug1 = 'wppa_bgcolor_numbar_active';
3658
  $slug2 = 'wppa_bcolor_numbar_active';
3659
  $slug = array($slug1, $slug2);
3664
  $tags = 'slide,layout';
3665
  wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
3666
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3667
  }
3668
  wppa_setting_subheader( 'B', '4', __('Other backgrounds and colors' , 'wp-photo-album-plus') );
3669
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3670
 
3671
  $name = __('Thumbnail padding', 'wp-photo-album-plus');
3672
  $desc = __('Thumbnail padding color if thumbnail aspect is a padded setting.', 'wp-photo-album-plus');
3694
  $tags = 'layout,cover,album';
3695
  wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags);
3696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3697
 
3698
  $name = __('Modal render box', 'wp-photo-album-plus');
3699
  $desc = __('The background for the Ajax modal rendering box.', 'wp-photo-album-plus');
3799
  $tags = 'system';
3800
  wppa_setting($slug, '1.0', $name, $desc, $html, $help, $clas, $tags);
3801
 
 
 
 
 
 
 
 
 
 
 
3802
  $name = __('Modal boxes', 'wp-photo-album-plus');
3803
  $desc = __('Place Ajax rendered content in modal boxes', 'wp-photo-album-plus');
3804
  $help = '';
7288
  $tags = 'upload';
7289
  wppa_setting($slug, '10.2', $name, $desc, $html, $help, $clas, $tags);
7290
 
 
 
 
 
 
 
 
 
 
 
 
7291
  $name = __('Fe alert', 'wp-photo-album-plus');
7292
  $desc = __('Show alertbox on front-end.', 'wp-photo-album-plus');
7293
  $help = (__('Errors are always reported, credit points only when --- none --- is not selected', 'wp-photo-album-plus'));
10576
  }
10577
  wppa_setting_subheader( 'H', '1', __( 'Source file management and other upload/import settings and actions.' , 'wp-photo-album-plus') );
10578
  {
10579
+ $name = __('Keep sourcefiles', 'wp-photo-album-plus');
10580
  $desc = __('Keep the original uploaded and imported photo files.', 'wp-photo-album-plus');
10581
  $help = (__('The files will be kept in a separate directory with subdirectories for each album', 'wp-photo-album-plus'));
10582
  $help .= '<br />'.(__('These files can be used to update the photos used in displaying in wppa+ and optionally for downloading original, un-downsized images.', 'wp-photo-album-plus'));
10583
+ $slug = 'wppa_keep_source';
10584
  $html = wppa_checkbox($slug);
10585
  $clas = '';
10586
  $tags = 'system';
10587
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
10588
 
 
 
 
 
 
 
 
 
 
 
10589
  $name = __('Source directory', 'wp-photo-album-plus');
10590
  $desc = __('The path to the directory where the original photofiles will be saved.', 'wp-photo-album-plus');
10591
  $help = (__('You may change the directory path, but it can not be an url.', 'wp-photo-album-plus'));
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 7.7.05.002
7
  *
8
  */
9
 
@@ -210,421 +210,6 @@ global $wppa_error;
210
 
211
  // Convert any changed and remove obsolete setting options
212
  if ( $old_rev > '100' ) { // On update only
213
- if ( $old_rev <= '402' ) {
214
- wppa_convert_setting('wppa_coverphoto_left', 'no', 'wppa_coverphoto_pos', 'right');
215
- wppa_convert_setting('wppa_coverphoto_left', 'yes', 'wppa_coverphoto_pos', 'left');
216
- }
217
- if ( $old_rev <= '440' ) {
218
- wppa_convert_setting('wppa_fadein_after_fadeout', 'yes', 'wppa_animation_type', 'fadeafter');
219
- wppa_convert_setting('wppa_fadein_after_fadeout', 'no', 'wppa_animation_type', 'fadeover');
220
- }
221
- if ( $old_rev <= '450' ) {
222
- wppa_remove_setting('wppa_fadein_after_fadeout');
223
- wppa_copy_setting('wppa_show_bbb', 'wppa_show_bbb_widget');
224
- wppa_convert_setting('wppa_comment_use_gravatar', 'yes', 'wppa_comment_gravatar', 'mm');
225
- wppa_convert_setting('wppa_comment_use_gravatar', 'no', 'wppa_comment_gravatar', 'none');
226
- wppa_remove_setting('wppa_comment_use_gravatar');
227
- wppa_revalue_setting('wppa_start_slide', 'yes', 'run');
228
- wppa_revalue_setting('wppa_start_slide', 'no', 'still');
229
- wppa_rename_setting('wppa_accesslevel', 'wppa_accesslevel_admin');
230
- wppa_remove_setting('wppa_charset');
231
- wppa_remove_setting('wppa_chmod');
232
- wppa_remove_setting('wppa_coverphoto_left');
233
- wppa_remove_setting('wppa_2col_treshold');
234
- wppa_remove_setting('wppa_album_admin_autosave');
235
- wppa_remove_setting('wppa_doublethevotes');
236
- wppa_remove_setting('wppa_halvethevotes');
237
- wppa_remove_setting('wppa_lightbox_overlaycolor');
238
- wppa_remove_setting('wppa_lightbox_overlayopacity');
239
- wppa_remove_setting('wppa_multisite');
240
- wppa_remove_setting('wppa_set_access_by');
241
- wppa_remove_setting('wppa_accesslevel_admin');
242
- wppa_remove_setting('wppa_accesslevel_upload');
243
- wppa_remove_setting('wppa_accesslevel_sidebar');
244
- }
245
- if ( $old_rev <= '452') {
246
- wppa_copy_setting('wppa_fontfamily_numbar', 'wppa_fontfamily_numbar_active');
247
- wppa_copy_setting('wppa_fontsize_numbar', 'wppa_fontsize_numbar_active');
248
- wppa_copy_setting('wppa_fontcolor_numbar', 'wppa_fontcolor_numbar_active');
249
- wppa_copy_setting('wppa_fontweight_numbar', 'wppa_fontweight_numbar_active');
250
- }
251
- if ( $old_rev <= '455') { // rating_count added to WPPA_PHOTOS
252
- $phs = $wpdb->get_results( "SELECT id FROM $wpdb->wppa_photos", ARRAY_A );
253
- if ($phs) foreach ($phs as $ph) {
254
- $cnt = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.WPPA_RATING.' WHERE photo = %s', $ph['id']));
255
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
256
- SET rating_count = %d
257
- WHERE id = %d", $cnt, $ph['id'] ) );
258
- }
259
- }
260
- if ( $old_rev < '470' ) { // single photo re-impl. has its own links, clone from slideshow
261
- wppa_copy_setting('wppa_slideshow_linktype', 'wppa_sphoto_linktype');
262
- wppa_copy_setting('wppa_slideshow_blank', 'wppa_sphoto_blank');
263
- wppa_copy_setting('wppa_slideshow_overrule', 'wppa_sphoto_overrule');
264
- }
265
- if ( $old_rev <= '474' ) { // Convert album and photo descriptions to contain html instead of htmlspecialchars. Allowing html is assumed, if not permitted, wppa_html will convert to specialcars.
266
- // html
267
- $at = 0; $ah = 0; $pt = 0; $ph = 0;
268
- $albs = $wpdb->get_results('SELECT id, description FROM '.WPPA_ALBUMS, ARRAY_A);
269
- if ($albs) {
270
- foreach($albs as $alb) {
271
- $at++;
272
- if (html_entity_decode($alb['description']) != $alb['description']) {
273
- $wpdb->query($wpdb->prepare('UPDATE '.WPPA_ALBUMS.' SET description = %s WHERE id = %s', html_entity_decode($alb['description']), $alb['id']));
274
- $ah++;
275
- }
276
- }
277
- }
278
- $phots = $wpdb->get_results( "SELECT id, description FROM $wpdb->wppa_photos", ARRAY_A);
279
- if ($phots) {
280
- foreach($phots as $phot) {
281
- $pt++;
282
- if (html_entity_decode($phot['description']) != $phot['description']) {
283
- $wpdb->query($wpdb->prepare( "UPDATE $wpdb->wppa_photos
284
- SET description = %s
285
- WHERE id = %d", html_entity_decode( $phot['description'] ), $phot['id'] ) );
286
- $ph++;
287
- }
288
- }
289
- }
290
- if ( WPPA_DEBUG ) if ($ah || $ph) wppa_ok_message($ah.' out of '.$at.' albums and '.$ph.' out of '.$pt.' photos html converted');
291
- }
292
- if ( $old_rev <= '482' ) { // Share box added
293
- $so = wppa_get_option('wppa_slide_order', '0,1,2,3,4,5,6,7,8,9');
294
- if ( strlen($so) == '19' ) {
295
- wppa_update_option('wppa_slide_order', $so.',10');
296
- }
297
- $so = wppa_get_option('wppa_slide_order_split', '0,1,2,3,4,5,6,7,8,9,10');
298
- if ( strlen($so) == '22' ) {
299
- wppa_update_option('wppa_slide_order_split', $so.',11');
300
- }
301
- wppa_remove_setting('wppa_sharetype');
302
- wppa_copy_setting('wppa_bgcolor_namedesc', 'wppa_bgcolor_share');
303
- wppa_copy_setting('wppa_bcolor_namedesc', 'wppa_bcolor_share');
304
-
305
- }
306
- if ( $old_rev <= '4811' ) {
307
- wppa_rename_setting('wppa_comment_count', 'wppa_comten_count');
308
- wppa_rename_setting('wppa_comment_size', 'wppa_comten_size');
309
- }
310
- if ( $old_rev <= '4910' ) {
311
- wppa_copy_setting('wppa_show_bread', 'wppa_show_bread_posts');
312
- wppa_copy_setting('wppa_show_bread', 'wppa_show_bread_pages');
313
- wppa_remove_setting('wppa_show_bread');
314
- }
315
- if ( $old_rev <= '5000' ) {
316
- wppa_remove_setting('wppa_autoclean');
317
- }
318
- if ( $old_rev <= '5010' ) {
319
- wppa_copy_setting('wppa_apply_newphoto_desc', 'wppa_apply_newphoto_desc_user');
320
- }
321
- if ( $old_rev <= '5107' ) {
322
- delete_option('wppa_taglist'); // Forces recreation
323
- }
324
- if ( $old_rev <= '5205' ) {
325
- if ( wppa_get_option('wppa_list_albums_desc', 'nil') == 'yes' ) {
326
- $value = wppa_get_option('wppa_list_albums_by', '0') * '-1';
327
- wppa_update_option('wppa_list_albums_by', $value);
328
- wppa_remove_setting('wppa_list_albums_desc');
329
- }
330
- if ( wppa_get_option('wppa_list_photos_desc', 'nil') == 'yes' ) {
331
- $value = wppa_get_option('wppa_list_photos_by', '0') * '-1';
332
- wppa_update_option('wppa_list_photos_by', $value);
333
- wppa_remove_setting('wppa_list_photos_desc');
334
- }
335
- }
336
-
337
- if ( $old_rev <= '5207' ) {
338
- if ( wppa_get_option( 'wppa_strip_file_ext', 'nil' ) == 'yes' ) {
339
- wppa_update_option( 'wppa_newphoto_name_method', 'noext' );
340
- delete_option( 'wppa_strip_file_ext' );
341
- }
342
- }
343
-
344
- if ( $old_rev <= '5307' ) {
345
- $wpdb->query( "TRUNCATE TABLE ".WPPA_SESSION."" );
346
- }
347
-
348
- if ( $old_rev <= '5308' ) {
349
- wppa_invalidate_treecounts();
350
- }
351
-
352
- if ( $old_rev <= '5410' ) {
353
- wppa_copy_setting( 'wppa_widget_width', 'wppa_potd_widget_width' );
354
- wppa_flush_upldr_cache( 'all' ); // New format
355
- }
356
-
357
- if ( $old_rev == '5421' || $old_rev == '5420.99' ) { // The rev where the bug was
358
- if ( $wppa_revno >= '5422' ) { // The rev where we fix it
359
- if ( wppa_get_option( 'wppa_rating_on', 'no' ) == 'yes' ) { // Only if rating used
360
- if ( wppa_get_option( 'wppa_ajax_non_admin', 'yes' ) == 'no' ) { // Only if backend ajax
361
- update_option( 'wppa_rerate_status', __('Required', 'wp-photo-album-plus') ); // Make sure they see the message
362
- }
363
- }
364
- }
365
- }
366
-
367
- if ( $old_rev <= '5500' ) {
368
- wppa_create_pl_htaccess( wppa_get_option( 'wppa_pl_dirname', 'wppa-pl' ) ); // Remake due to fix in wppa_sanitize_file_name()
369
- }
370
-
371
- if ( $old_rev <= '6103' ) {
372
- wppa_copy_setting( 'wppa_owner_only', 'wppa_upload_owner_only' );
373
- }
374
-
375
- if ( $old_rev <= '6305' ) {
376
- if ( wppa_get_option( 'wppa_comment_captcha' ) == 'no' ) {
377
- update_option( 'wppa_comment_captcha', 'none' );
378
- }
379
- if ( wppa_get_option( 'wppa_comment_captcha' ) == 'yes' ) {
380
- update_option( 'wppa_comment_captcha', 'all' );
381
- }
382
- }
383
-
384
- if ( $old_rev <= '6310' ) {
385
- $wpdb->query("UPDATE $wpdb->wppa_photos SET timestamp = '0' WHERE timestamp = ''");
386
- $wpdb->query("UPDATE $wpdb->wppa_photos SET modified = timestamp WHERE modified = '' OR modified = '0'");
387
- }
388
-
389
- if ( $old_rev <= '6312' ) {
390
- $wpdb->query("UPDATE $wpdb->wppa_albums SET timestamp = '0' WHERE timestamp = ''");
391
- $wpdb->query("UPDATE $wpdb->wppa_albums SET modified = timestamp WHERE modified = '' OR modified = '0'");
392
- wppa_copy_setting( 'wppa_wppa_set_shortcodes', 'wppa_set_shortcodes' );
393
- wppa_remove_setting( 'wppa_wppa_set_shortcodes' );
394
- wppa_copy_setting( 'wppa_max_album_newtime', 'wppa_max_album_modtime' );
395
- wppa_copy_setting( 'wppa_max_photo_newtime', 'wppa_max_photo_modtime' );
396
- }
397
-
398
- if ( $old_rev <= '6316' ) {
399
- wppa_remove_setting( 'wppa_start_symbol_url' );
400
- wppa_remove_setting( 'wppa_pause_symbol_url' );
401
- wppa_remove_setting( 'wppa_stop_symbol_url' );
402
- }
403
-
404
- if ( $old_rev <= '6319' ) {
405
- if ( wppa_get_option( 'wppa_cre_uploads_htaccess', 'no' ) == 'no' ) {
406
- update_option( 'wppa_cre_uploads_htaccess', 'remove' );
407
- }
408
- if ( wppa_get_option( 'wppa_cre_uploads_htaccess', 'no' ) == 'yes' ) {
409
- update_option( 'wppa_cre_uploads_htaccess', 'grant' );
410
- }
411
- }
412
-
413
- if ( $old_rev <= '6403' ) {
414
- wppa_copy_setting( 'wppa_thumbsize', 'wppa_film_thumbsize' );
415
- }
416
-
417
- if ( $old_rev <= '6408' ) {
418
- if ( wppa_get_option( 'wppa_comment_email_required', 'yes' ) ) {
419
- update_option( 'wppa_comment_email_required', 'required', false );
420
- }
421
- else {
422
- update_option( 'wppa_comment_email_required', 'none', false );
423
- }
424
- }
425
-
426
- if ( $old_rev <= '6411' ) {
427
- $old = wppa_get_option( 'wppa_upload_edit', 'no' );
428
- if ( $old == 'no' ) {
429
- update_option( 'wppa_upload_edit', '-none-', false );
430
- }
431
- if ( $old == 'yes' ) {
432
- update_option( 'wppa_upload_edit', 'classic', false );
433
- }
434
- }
435
-
436
- if ( $old_rev <= '6414' ) {
437
- if ( wppa_get_option( 'wppa_upload_edit', 'no' ) != 'no' ) {
438
- update_option( 'wppa_upload_delete', 'yes' );
439
- }
440
- if ( wppa_get_option( 'wppa_upload_edit_users' ) == 'equalname' ) {
441
- update_option( 'wppa_upload_edit_users', 'owner' );
442
- }
443
- }
444
-
445
- if ( $old_rev <= '6417' ) {
446
- $logfile = ABSPATH . 'wp-content/wppa-depot/admin/error.log';
447
- if ( is_file( $logfile ) ) {
448
- unlink( $logfile );
449
- }
450
- update_option( 'wppa_album_crypt_9', wppa_get_unique_album_crypt() );
451
- }
452
-
453
- if ( $old_rev <= '6504' ) {
454
- wppa_rename_setting( 'wppa_widgettitle', 'wppa_potd_title' );
455
- wppa_rename_setting( 'wppa_widget_linkurl', 'wppa_potd_linkurl' );
456
- wppa_rename_setting( 'wppa_widget_linktitle', 'wppa_potd_linktitle' );
457
- wppa_rename_setting( 'wppa_widget_subtitle', 'wppa_potd_subtitle' );
458
- wppa_rename_setting( 'wppa_widget_counter', 'wppa_potd_counter' );
459
- wppa_rename_setting( 'wppa_widget_album', 'wppa_potd_album' );
460
- wppa_rename_setting( 'wppa_widget_status_filter', 'wppa_potd_status_filter' );
461
- wppa_rename_setting( 'wppa_widget_method', 'wppa_potd_method' );
462
- wppa_rename_setting( 'wppa_widget_period', 'wppa_potd_period' );
463
- }
464
-
465
- if ( $old_rev <= '6600' ) {
466
- wppa_create_pl_htaccess( wppa_get_option( 'wppa_pl_dirname', 'wppa-pl' ) ); // Remake due to fix in wppa_create_pl_htaccess() and wppa_get_source_pl()
467
- if ( wppa_get_option( 'wppa_run_wpautop_on_desc' ) == 'yes' ) {
468
- wppa_update_option( 'wppa_wpautop_on_desc', 'wpautop' );
469
- }
470
- if ( wppa_get_option( 'wppa_run_wpautop_on_desc' ) == 'no' ) {
471
- wppa_update_option( 'wppa_wpautop_on_desc', 'nil' );
472
- }
473
- }
474
-
475
- if ( $old_rev <= '6601' ) {
476
- if ( wppa_get_option( 'wppa_bc_url', 'nil' ) != 'nil' ) {
477
- update_option( 'wppa_bc_url', str_replace( '/images/', '/img/', wppa_get_option( 'wppa_bc_url', 'nil' ) ) );
478
- }
479
- }
480
-
481
- if ( $old_rev <= '6602' ) {
482
- if ( wppa_get_option( 'wppa_show_treecount' ) == 'yes' ) {
483
- wppa_update_option( 'wppa_show_treecount', 'detail' );
484
- }
485
- if ( wppa_get_option( 'wppa_show_treecount' ) == 'no' ) {
486
- wppa_update_option( 'wppa_show_treecount', '-none-' );
487
- }
488
- if ( wppa_get_option( 'wppa_count_on_title' ) == 'yes' ) {
489
- wppa_update_option( 'wppa_count_on_title', 'self' );
490
- }
491
- if ( wppa_get_option( 'wppa_count_on_title' ) == 'no' ) {
492
- wppa_update_option( 'wppa_count_on_title', '-none-' );
493
- }
494
-
495
- }
496
-
497
- if ( $old_rev <= '6606' ) {
498
- if ( wppa_get_option( 'wppa_rating_dayly' ) == 'no' ) {
499
- wppa_update_option( 'wppa_rating_dayly', '0' );
500
- }
501
- }
502
-
503
- if ( $old_rev <= '6609' ) {
504
- wppa_schedule_treecount_update();
505
- }
506
-
507
- if ( $old_rev <= '6610' ) {
508
- if ( wppa_get_option( 'wppa_blog_it' ) == 'yes' ) {
509
- wppa_update_option( 'wppa_blog_it', 'optional' );
510
- }
511
- if ( wppa_get_option( 'wppa_blog_it' ) == 'no' ) {
512
- wppa_update_option( 'wppa_blog_it', '-none-' );
513
- }
514
- }
515
-
516
- if ( $old_rev <= '6611' ) {
517
- delete_option( 'wppa_cached_options' );
518
- delete_option( 'wppa_md5_options' );
519
- @ $wpdb->query( "UPDATE " . $wpdb->options . " SET autoload = 'yes' WHERE option_name LIKE 'wppa_%'");
520
- if ( wppa_get_option( 'wppa_fe_alert' ) == 'no' ) {
521
- update_option( 'wppa_fe_alert', '-none-' );
522
- }
523
- if ( wppa_get_option( 'wppa_fe_alert' ) == 'yes' ) {
524
- update_option( 'wppa_fe_alert', 'all' );
525
- }
526
- }
527
-
528
- if ( $old_rev <= '6618' ) {
529
- wppa_schedule_maintenance_proc( 'wppa_remake_index_albums' );
530
- wppa_schedule_maintenance_proc( 'wppa_remake_index_photos' );
531
- }
532
-
533
- if ( $old_rev <= '6626' ) {
534
- wppa_rename_setting( 'wppa_upload_fronend_maxsize', 'wppa_upload_frontend_maxsize' ); // Fix typo
535
- }
536
-
537
- if ( $old_rev <= '6628' ) {
538
- if ( wppa_get_option( 'wppa_gpx_implementation' ) == 'wppa-plus-embedded' ) {
539
- update_option( 'wppa_load_map_api', 'yes' );
540
- }
541
- if ( wppa_get_option( 'wppa_gpx_implementation' ) == 'google-maps-gpx-viewer' ) {
542
- update_option( 'wppa_gpx_implementation', 'external-plugin' );
543
- }
544
- }
545
-
546
- if ( $old_rev <= '6630' ) {
547
- if ( wppa_get_option( 'wppa_upload_edit' ) == 'none' ) {
548
- update_option( 'wppa_upload_edit', '-none-' );
549
- }
550
- }
551
-
552
- if ( $old_rev <= '6800' ) {
553
- $wpdb->query( "ALTER TABLE $wpdb->wppa_iptc MODIFY id bigint(20) NOT NULL AUTO_INCREMENT" );
554
- $wpdb->query( "ALTER TABLE $wpdb->wppa_exif MODIFY id bigint(20) NOT NULL AUTO_INCREMENT" );
555
- $wpdb->query( "ALTER TABLE $wpdb->wppa_index MODIFY id bigint(20) NOT NULL AUTO_INCREMENT" );
556
- delete_option( 'wppa_' . WPPA_IPTC . '_lastkey' );
557
- delete_option( 'wppa_' . WPPA_EXIF . '_lastkey' );
558
- delete_option( 'wppa_' . WPPA_INDEX . '_lastkey' );
559
-
560
- // wppa_schedule_maintenance_proc( 'wppa_format_exif' );
561
- }
562
-
563
- // Fix exiflables that were undefined so far but have a known description by now
564
- if ( $old_rev <= '6801' ) {
565
- if ( function_exists( 'exif_tagname' ) && function_exists( 'exif_read_data' ) ) {
566
- $exif_labels = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_exif WHERE photo = 0 AND description LIKE 'UndefinedTag%'", ARRAY_A );
567
- if ( ! empty( $exif_labels ) ) foreach( $exif_labels as $label ) {
568
- $newdesc = wppa_exif_tagname( $label['tag'] );
569
- if ( $newdesc != $label['description'] ) {
570
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_exif SET description = %s WHERE photo = 0 AND tag = %s", $newdesc, $label['tag'] ) );
571
- wppa_log( 'obs', 'There is a new desc for '.$label['tag'].' being: '.$newdesc );
572
- }
573
- }
574
- wppa_schedule_maintenance_proc( 'wppa_recup' );
575
- }
576
- }
577
-
578
- if ( $old_rev <= '6915' ) {
579
- if ( ! wppa_get_option( 'wppa_album_admin_pagesize', '0' ) ) {
580
- update_option( 'wppa_album_admin_pagesize', '100' );
581
- }
582
- if ( ! wppa_get_option( 'wppa_photo_admin_pagesize', '0' ) ) {
583
- update_option( 'wppa_photo_admin_pagesize', '20' );
584
- }
585
- }
586
-
587
- if ( $old_rev <= '7001' ) {
588
- if ( wppa_get_option( 'wppa_use_pretty_links', 'nil' ) == 'no' ) {
589
- update_option( 'wppa_use_pretty_links', '-none-' );
590
- }
591
- if ( wppa_get_option( 'wppa_use_pretty_links', 'nil' ) == 'yes' ) {
592
- update_option( 'wppa_use_pretty_links', 'classic' );
593
- }
594
-
595
- }
596
-
597
- if ( $old_rev <= '7010' ) {
598
- $met = ini_get( 'max_execution_time' );
599
- $wppamet = wppa_get_option( 'wppa_max_execution_time', '30' );
600
- if ( ( $met > 5 ) && $wppamet > ( $met - '5' ) ) {
601
- update_option( 'wppa_max_execution_time', $met - '5' );
602
- }
603
- $wpdb->query( "UPDATE $wpdb->wppa_albums SET sname = ''" );
604
- $wpdb->query( "UPDATE $wpdb->wppa_photos SET sname = ''" );
605
- wppa_schedule_cleanup( true );
606
- }
607
-
608
- if ( $old_rev <= '7100' ) {
609
-
610
- // Fix audiostub.jpg, it had been overwritten
611
- $fromfile = WPPA_PATH . '/img/audiostub.jpg';
612
- $tofile = WPPA_UPLOAD_PATH . '/audiostub.jpg';
613
- @ wppa_copy( $fromfile, $tofile );
614
-
615
- // Copy documentstub.png, the default documentstub
616
- $fromfile = WPPA_PATH . '/img/documentstub.png';
617
- $tofile = WPPA_UPLOAD_PATH . '/documentstub.png';
618
- @ wppa_copy( $fromfile, $tofile );
619
- }
620
-
621
- if ( $old_rev <= '7102' ) {
622
- wppa_rename_setting( 'wppa_thumb_area_size', 'wppa_area_size' );
623
- }
624
-
625
- if ( $old_rev <= '7203' ) {
626
- $wpdb->query( "UPDATE $wpdb->wppa_albums SET timestamp = modified WHERE timestamp = ''" );
627
- }
628
 
629
  if ( $old_rev <= '7211' ) {
630
 
@@ -666,6 +251,16 @@ global $wppa_error;
666
  delete_option( 'wppa_sent_mails' );
667
  }
668
  }
 
 
 
 
 
 
 
 
 
 
669
  }
670
 
671
  // Check required directories
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
210
 
211
  // Convert any changed and remove obsolete setting options
212
  if ( $old_rev > '100' ) { // On update only
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
  if ( $old_rev <= '7211' ) {
215
 
251
  delete_option( 'wppa_sent_mails' );
252
  }
253
  }
254
+
255
+ if ( $old_rev <= '8001000' ) {
256
+ if ( get_option( 'wppa_resize_on_upload', 'yes' ) == 'no' ) {
257
+ update_option( 'wppa_resize_to', '-1' );
258
+ }
259
+ if ( get_option( 'wppa_keep_source_admin', 'yes' ) == 'no' &&
260
+ get_option( 'wppa_keep_source_frontend', 'yes' ) == 'no' ) {
261
+ update_option( 'wppa_keep_source', 'no' );
262
+ }
263
+ }
264
  }
265
 
266
  // Check required directories
wppa-slideshow.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
- * Version 7.7.07.002
7
  *
8
  */
9
 
@@ -439,7 +439,7 @@ function wppa_slide_frame() {
439
  ' style="overflow:hidden;' . wppa_get_slide_frame_style() . '"' .
440
  ' >' );
441
 
442
- $auto = wppa( 'auto_colwidth' ) || ( wppa_opt( 'colwidth' ) == 'auto' );
443
 
444
  wppa_out( '<div' .
445
  ' id="theslide0-' . wppa( 'mocc' ) . '"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
439
  ' style="overflow:hidden;' . wppa_get_slide_frame_style() . '"' .
440
  ' >' );
441
 
442
+ $auto = wppa( 'auto_colwidth' );
443
 
444
  wppa_out( '<div' .
445
  ' id="theslide0-' . wppa( 'mocc' ) . '"' .
wppa-source.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
- * Version 7.7.03.004
7
  *
8
  */
9
 
@@ -14,35 +14,24 @@ function wppa_save_source( $file, $name, $alb, $always = false ) {
14
  wppa_log('dbg', 'Save source called with always='.$always );
15
  $doit = true;
16
 
17
- // Frontend not enabled and not ajax ?
18
- if ( ! is_admin() && ! wppa_switch( 'keep_source_frontend') ) {
19
- $doit = false;
20
- }
21
-
22
- // Frontend not enabled and ajax ?
23
- if ( isset( $_REQUEST['wppa-action'] ) &&
24
- $_REQUEST['wppa-action'] == 'do-fe-upload' &&
25
- ! wppa_switch( 'keep_source_frontend') ) {
26
- $doit = false;
27
- }
28
-
29
- // Backend not enabled ?
30
- if ( ( ! isset( $_REQUEST['wppa-action'] ) || $_REQUEST['wppa-action'] != 'do-fe-upload' ) &&
31
- is_admin() &&
32
- ! wppa_switch( 'keep_source_admin') ) {
33
- $doit = false;
34
- }
35
 
36
- if ( $doit || $always ) {
37
  wppa_log('dbg', 'Saving source');
38
- if ( ! wppa_is_dir( wppa_opt( 'source_dir' ) ) ) @ wppa_mktree( wppa_opt( 'source_dir' ) );
 
 
39
  $sourcedir = wppa_get_source_dir();
40
- if ( ! wppa_is_dir( $sourcedir ) ) @ wppa_mktree( $sourcedir );
 
 
41
  $albdir = wppa_get_source_album_dir( $alb );
42
- if ( ! wppa_is_dir( $albdir ) ) @ wppa_mktree( $albdir );
 
 
43
  if ( ! wppa_is_dir( $albdir ) ) {
44
  wppa_log( 'Err', 'Could not create source directory ' . $albdir );
45
  }
 
46
  $dest = $albdir . '/' . wppa_sanitize_file_name( $name );
47
  if ( $file != $dest ) {
48
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
+ * Version 8.0.00.004
7
  *
8
  */
9
 
14
  wppa_log('dbg', 'Save source called with always='.$always );
15
  $doit = true;
16
 
17
+ if ( wppa_switch( 'keep_source' ) || $always ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
 
19
  wppa_log('dbg', 'Saving source');
20
+ if ( ! wppa_is_dir( wppa_opt( 'source_dir' ) ) ) {
21
+ @ wppa_mktree( wppa_opt( 'source_dir' ) );
22
+ }
23
  $sourcedir = wppa_get_source_dir();
24
+ if ( ! wppa_is_dir( $sourcedir ) ) {
25
+ @ wppa_mktree( $sourcedir );
26
+ }
27
  $albdir = wppa_get_source_album_dir( $alb );
28
+ if ( ! wppa_is_dir( $albdir ) ) {
29
+ @ wppa_mktree( $albdir );
30
+ }
31
  if ( ! wppa_is_dir( $albdir ) ) {
32
  wppa_log( 'Err', 'Could not create source directory ' . $albdir );
33
  }
34
+
35
  $dest = $albdir . '/' . wppa_sanitize_file_name( $name );
36
  if ( $file != $dest ) {
37
 
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 7.5.04
7
  /*
8
  */
9
 
@@ -25,16 +25,11 @@ global $wppa_dynamic_css_data;
25
 
26
  $content = '
27
  .wppa-box {
28
- ' . ( wppa_opt( 'bwidth' ) > '0' ?
29
- 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; '
30
- : '' ) . '
31
- ' . ( wppa_opt( 'bradius' ) > '0' ?
32
- 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' .
33
- wppa_opt( 'bradius' ) . 'px; ' :
34
- '' ) . '
35
- ' . ( wppa_opt( 'box_spacing' ) ?
36
- 'margin-bottom:' . wppa_opt( 'box_spacing' ) . 'px; ' :
37
- '' ) . '
38
  }';
39
 
40
  $content .= '
@@ -95,50 +90,6 @@ global $wppa_dynamic_css_data;
95
  '' ) . '
96
  }';
97
 
98
- $content .= '
99
- .wppa-comments {
100
- ' . ( wppa_opt( 'bgcolor_com' ) ?
101
- 'background-color:' . wppa_opt( 'bgcolor_com' ) . '; ' :
102
- '' ) . '
103
- ' . ( wppa_opt( 'bcolor_com' ) ?
104
- 'border-color:' . wppa_opt( 'bcolor_com' ) . '; ' :
105
- '' ) . '
106
- }';
107
-
108
- $content .= '
109
- .wppa-iptc {
110
- ' . ( wppa_opt( 'bgcolor_iptc' ) ?
111
- 'background-color:' . wppa_opt( 'bgcolor_iptc' ) . '; ' :
112
- '' ) . '
113
- ' . ( wppa_opt( 'bcolor_iptc' ) ?
114
- 'border-color:' . wppa_opt( 'bcolor_iptc' ) . '; ' :
115
- '' ) . '
116
- }';
117
-
118
- $content .= '
119
- .wppa-exif {
120
- ' . ( wppa_opt( 'bgcolor_exif' ) ? 'background-color:' . wppa_opt( 'bgcolor_exif' ) . '; ' : '' ) . '
121
- ' . ( wppa_opt( 'bcolor_exif' ) ? 'border-color:' . wppa_opt( 'bcolor_exif' ) . '; ' : '' ) . '
122
- }';
123
-
124
- $content .= '
125
- .wppa-share {
126
- ' . ( wppa_opt( 'bgcolor_share' ) ? 'background-color:' . wppa_opt( 'bgcolor_share' ) . '; ' : '' ) . '
127
- ' . ( wppa_opt( 'bcolor_share' ) ? 'border-color:' . wppa_opt( 'bcolor_share' ) . '; ' : '' ) . '
128
- }';
129
-
130
- $content .= '
131
- .wppa-name-desc {
132
- ' . ( wppa_opt( 'bgcolor_namedesc' ) ? 'background-color:' . wppa_opt( 'bgcolor_namedesc' ) . '; ' : '' ) . '
133
- ' . ( wppa_opt( 'bcolor_namedesc' ) ? 'border-color:' . wppa_opt( 'bcolor_namedesc' ) . '; ' : '' ) . '
134
- }';
135
-
136
- $content .= '
137
- .wppa-nav {
138
- ' . ( wppa_opt( 'bgcolor_nav' ) ? 'background-color:' . wppa_opt( 'bgcolor_nav' ) . '; ' : '' ) . '
139
- ' . ( wppa_opt( 'bcolor_nav' ) ? 'border-color:' . wppa_opt( 'bcolor_nav' ) . '; ' : '' ) . '
140
- }';
141
-
142
  $content .= '
143
  .wppa-nav-text {
144
  ' . ( wppa_opt( 'fontfamily_nav' ) ? 'font-family:' . wppa_opt( 'fontfamily_nav' ) . '; ' : '' ) . '
@@ -147,18 +98,6 @@ global $wppa_dynamic_css_data;
147
  ' . ( wppa_opt( 'fontweight_nav' ) ? 'font-weight:' . wppa_opt( 'fontweight_nav' ) . '; ' : '' ) . '
148
  }';
149
 
150
- $content .= '
151
- .wppa-even {
152
- ' . ( wppa_opt( 'bgcolor_even' ) ? 'background-color:' . wppa_opt( 'bgcolor_even' ) . '; ' : '' ) . '
153
- ' . ( wppa_opt( 'bcolor_even' ) ? 'border-color:' . wppa_opt( 'bcolor_even' ) . '; ' : '' ) . '
154
- }';
155
-
156
- $content .= '
157
- .wppa-alt {
158
- ' . ( wppa_opt( 'bgcolor_alt' ) ? 'background-color:' . wppa_opt( 'bgcolor_alt' ) . '; ' : '' ) . '
159
- ' . ( wppa_opt( 'bcolor_alt' ) ? 'border-color:' . wppa_opt( 'bcolor_alt' ) . '; ' : '' ) . '
160
- }';
161
-
162
  $content .= '
163
  .wppa-img {
164
  ' . ( wppa_opt( 'bgcolor_img' ) ? 'background-color:' . wppa_opt( 'bgcolor_img' ) . '; ' : '' ) . '
@@ -188,66 +127,6 @@ global $wppa_dynamic_css_data;
188
  ' . ( wppa_opt( 'fontweight_fulltitle' ) ? 'font-weight:' . wppa_opt( 'fontweight_fulltitle' ) . '; ' : '' ) . '
189
  }';
190
 
191
- $content .= '
192
- .wppa-custom {
193
- ' . ( wppa_opt( 'bgcolor_cus' ) ? 'background-color:' . wppa_opt( 'bgcolor_cus' ) . '; ' : '' ) . '
194
- ' . ( wppa_opt( 'bcolor_cus' ) ? 'border-color:' . wppa_opt( 'bcolor_cus' ) . '; ' : '' ) . '
195
- }';
196
-
197
- $content .= '
198
- .wppa-upload {
199
- ' . ( wppa_opt( 'bgcolor_upload' ) ? 'background-color:' . wppa_opt( 'bgcolor_upload' ) . '; ' : '' ) . '
200
- ' . ( wppa_opt( 'bcolor_upload' ) ? 'border-color:' . wppa_opt( 'bcolor_upload' ) . '; ' : '' ) . '
201
- }';
202
-
203
- $content .= '
204
- .wppa-multitag {
205
- ' . ( wppa_opt( 'bgcolor_multitag' ) ? 'background-color:' . wppa_opt( 'bgcolor_multitag' ) . '; ' : '' ) . '
206
- ' . ( wppa_opt( 'bcolor_multitag' ) ? 'border-color:' . wppa_opt( 'bcolor_multitag' ) . '; ' : '' ) . '
207
- }';
208
-
209
- $content .= '
210
- .wppa-bestof {
211
- ' . ( wppa_opt( 'bgcolor_bestof' ) ? 'background-color:' . wppa_opt( 'bgcolor_bestof' ) . '; ' : '' ) . '
212
- ' . ( wppa_opt( 'bcolor_bestof' ) ? 'border-color:' . wppa_opt( 'bcolor_bestof' ) . '; ' : '' ) . '
213
- }';
214
-
215
- $content .= '
216
- .wppa-stereo {
217
- ' . ( wppa_opt( 'bgcolor_stereo' ) ? 'background-color:' . wppa_opt( 'bgcolor_stereo' ) . '; ' : '' ) . '
218
- ' . ( wppa_opt( 'bcolor_stereo' ) ? 'border-color:' . wppa_opt( 'bcolor_stereo' ) . '; ' : '' ) . '
219
- }';
220
-
221
- $content .= '
222
- .wppa-tagcloud {
223
- ' . ( wppa_opt( 'bgcolor_tagcloud' ) ? 'background-color:' . wppa_opt( 'bgcolor_tagcloud' ) . '; ' : '' ) . '
224
- ' . ( wppa_opt( 'bcolor_tagcloud' ) ? 'border-color:' . wppa_opt( 'bcolor_tagcloud' ) . '; ' : '' ) . '
225
- }';
226
-
227
- $content .= '
228
- .wppa-superview {
229
- ' . ( wppa_opt( 'bgcolor_superview' ) ? 'background-color:' . wppa_opt( 'bgcolor_superview' ) . '; ' : '' ) . '
230
- ' . ( wppa_opt( 'bcolor_superview' ) ? 'border-color:' . wppa_opt( 'bcolor_superview' ) . '; ' : '' ) . '
231
- }';
232
-
233
- $content .= '
234
- .wppa-search {
235
- ' . ( wppa_opt( 'bgcolor_search' ) ? 'background-color:' . wppa_opt( 'bgcolor_search' ) . '; ' : '' ) . '
236
- ' . ( wppa_opt( 'bcolor_search' ) ? 'border-color:' . wppa_opt( 'bcolor_search' ) . '; ' : '' ) . '
237
- }';
238
-
239
- $content .= '
240
- .wppa-calendar {
241
- ' . ( wppa_opt( 'bgcolor_calendar' ) ? 'background-color:' . wppa_opt( 'bgcolor_calendar' ) . '; ' : '' ) . '
242
- ' . ( wppa_opt( 'bcolor_calendar' ) ? 'border-color:' . wppa_opt( 'bcolor_calendar' ) . '; ' : '' ) . '
243
- }';
244
-
245
- $content .= '
246
- .wppa-adminschoice {
247
- ' . ( wppa_opt( 'bgcolor_adminschoice' ) ? 'background-color:' . wppa_opt( 'bgcolor_adminschoice' ) . '; ' : '' ) . '
248
- ' . ( wppa_opt( 'bcolor_adminschoice' ) ? 'border-color:' . wppa_opt( 'bcolor_adminschoice' ) . '; ' : '' ) . '
249
- }';
250
-
251
  // Add miscellaneous styles
252
  if ( ! wppa_switch( 'show_pname' ) ) {
253
  $content .= '
@@ -703,6 +582,14 @@ function wppa_wcs( $class ) {
703
  if ( $opt != '' ) {
704
  $result .= 'margin-bottom:' . $opt . 'px; ';
705
  }
 
 
 
 
 
 
 
 
706
  break;
707
  case 'wppa-mini-box':
708
  $opt = wppa_opt( 'bwidth' );
@@ -755,42 +642,7 @@ function wppa_wcs( $class ) {
755
  $opt = wppa_opt( 'fontweight_box' );
756
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
757
  break;
758
- case 'wppa-comments':
759
- $opt = wppa_opt( 'bgcolor_com' );
760
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
761
- $opt = wppa_opt( 'bcolor_com' );
762
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
763
- break;
764
- case 'wppa-iptc':
765
- $opt = wppa_opt( 'bgcolor_iptc' );
766
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
767
- $opt = wppa_opt( 'bcolor_iptc' );
768
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
769
- break;
770
- case 'wppa-exif':
771
- $opt = wppa_opt( 'bgcolor_exif' );
772
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
773
- $opt = wppa_opt( 'bcolor_exif' );
774
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
775
- break;
776
- case 'wppa-share':
777
- $opt = wppa_opt( 'bgcolor_share' );
778
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
779
- $opt = wppa_opt( 'bcolor_share' );
780
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
781
- break;
782
- case 'wppa-name-desc':
783
- $opt = wppa_opt( 'bgcolor_namedesc' );
784
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
785
- $opt = wppa_opt( 'bcolor_namedesc' );
786
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
787
- break;
788
- case 'wppa-nav':
789
- $opt = wppa_opt( 'bgcolor_nav' );
790
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
791
- $opt = wppa_opt( 'bcolor_nav' );
792
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
793
- break;
794
  case 'wppa-nav-text':
795
  $opt = wppa_opt( 'fontfamily_nav' );
796
  if ( $opt ) $result .= 'font-family:' . $opt . '; ';
@@ -801,18 +653,6 @@ function wppa_wcs( $class ) {
801
  $opt = wppa_opt( 'fontweight_nav' );
802
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
803
  break;
804
- case 'wppa-even':
805
- $opt = wppa_opt( 'bgcolor_even' );
806
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
807
- $opt = wppa_opt( 'bcolor_even' );
808
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
809
- break;
810
- case 'wppa-alt':
811
- $opt = wppa_opt( 'bgcolor_alt' );
812
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
813
- $opt = wppa_opt( 'bcolor_alt' );
814
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
815
- break;
816
  case 'wppa-img':
817
  $opt = wppa_opt( 'bgcolor_img' );
818
  if ( $opt ) $result .= 'background-color:' . $opt . '; ';
@@ -847,66 +687,6 @@ function wppa_wcs( $class ) {
847
  $opt = wppa_opt( 'fontweight_fulltitle' );
848
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
849
  break;
850
- case 'wppa-custom':
851
- $opt = wppa_opt( 'bgcolor_cus' );
852
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
853
- $opt = wppa_opt( 'bcolor_cus' );
854
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
855
- break;
856
- case 'wppa-upload':
857
- $opt = wppa_opt( 'bgcolor_upload' );
858
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
859
- $opt = wppa_opt( 'bcolor_upload' );
860
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
861
- break;
862
- case 'wppa-multitag':
863
- $opt = wppa_opt( 'bgcolor_multitag' );
864
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
865
- $opt = wppa_opt( 'bcolor_multitag' );
866
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
867
- break;
868
- case 'wppa-bestof':
869
- $opt = wppa_opt( 'bgcolor_bestof' );
870
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
871
- $opt = wppa_opt( 'bcolor_bestof' );
872
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
873
- break;
874
- case 'wppa-stereo':
875
- $opt = wppa_opt( 'bgcolor_stereo' );
876
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
877
- $opt = wppa_opt( 'bcolor_stereo' );
878
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
879
- break;
880
- case 'wppa-tagcloud':
881
- $opt = wppa_opt( 'bgcolor_tagcloud' );
882
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
883
- $opt = wppa_opt( 'bcolor_tagcloud' );
884
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
885
- break;
886
- case 'wppa-superview':
887
- $opt = wppa_opt( 'bgcolor_superview' );
888
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
889
- $opt = wppa_opt( 'bcolor_superview' );
890
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
891
- break;
892
- case 'wppa-search':
893
- $opt = wppa_opt( 'bgcolor_search' );
894
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
895
- $opt = wppa_opt( 'bcolor_search' );
896
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
897
- break;
898
- case 'wppa-calendar':
899
- $opt = wppa_opt( 'bgcolor_calendar' );
900
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
901
- $opt = wppa_opt( 'bcolor_calendar' );
902
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
903
- break;
904
- case 'wppa-adminschoice':
905
- $opt = wppa_opt( 'bgcolor_adminschoice' );
906
- if ( $opt ) $result .= 'background-color:' . $opt . '; ';
907
- $opt = wppa_opt( 'bcolor_adminschoice' );
908
- if ( $opt ) $result .= 'border-color:' . $opt . '; ';
909
- break;
910
 
911
  case 'wppa-black':
912
  // $opt = wppa_opt( 'black' );
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 8.0.00.004
7
  /*
8
  */
9
 
25
 
26
  $content = '
27
  .wppa-box {
28
+ ' . ( wppa_opt( 'bwidth' ) > '0' ? 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; ' : '' ) . '
29
+ ' . ( wppa_opt( 'bradius' ) > '0' ? 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' . wppa_opt( 'bradius' ) . 'px; ' : '' ) . '
30
+ ' . ( wppa_opt( 'box_spacing' ) ? 'margin-bottom:' . wppa_opt( 'box_spacing' ) . 'px; ' : '' ) . '
31
+ ' . ( wppa_opt( 'bgcolor' ) ? 'background-color:' . wppa_opt( 'bgcolor' ) . '; ' : '' ) . '
32
+ ' . ( wppa_opt( 'bcolor' ) ? 'border-color:' . wppa_opt( 'bcolor' ) . '; ' : '' ) . '
 
 
 
 
 
33
  }';
34
 
35
  $content .= '
90
  '' ) . '
91
  }';
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  $content .= '
94
  .wppa-nav-text {
95
  ' . ( wppa_opt( 'fontfamily_nav' ) ? 'font-family:' . wppa_opt( 'fontfamily_nav' ) . '; ' : '' ) . '
98
  ' . ( wppa_opt( 'fontweight_nav' ) ? 'font-weight:' . wppa_opt( 'fontweight_nav' ) . '; ' : '' ) . '
99
  }';
100
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  $content .= '
102
  .wppa-img {
103
  ' . ( wppa_opt( 'bgcolor_img' ) ? 'background-color:' . wppa_opt( 'bgcolor_img' ) . '; ' : '' ) . '
127
  ' . ( wppa_opt( 'fontweight_fulltitle' ) ? 'font-weight:' . wppa_opt( 'fontweight_fulltitle' ) . '; ' : '' ) . '
128
  }';
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  // Add miscellaneous styles
131
  if ( ! wppa_switch( 'show_pname' ) ) {
132
  $content .= '
582
  if ( $opt != '' ) {
583
  $result .= 'margin-bottom:' . $opt . 'px; ';
584
  }
585
+ $opt = wppa_opt( 'bgcolor' );
586
+ if ( $opt ) {
587
+ $result .= 'background-color:' . $opt . '; ';
588
+ }
589
+ $opt = wppa_opt( 'bcolor' );
590
+ if ( $opt ) {
591
+ $result .= 'border-color:' . $opt . '; ';
592
+ }
593
  break;
594
  case 'wppa-mini-box':
595
  $opt = wppa_opt( 'bwidth' );
642
  $opt = wppa_opt( 'fontweight_box' );
643
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
644
  break;
645
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  case 'wppa-nav-text':
647
  $opt = wppa_opt( 'fontfamily_nav' );
648
  if ( $opt ) $result .= 'font-family:' . $opt . '; ';
653
  $opt = wppa_opt( 'fontweight_nav' );
654
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
655
  break;
 
 
 
 
 
 
 
 
 
 
 
 
656
  case 'wppa-img':
657
  $opt = wppa_opt( 'bgcolor_img' );
658
  if ( $opt ) $result .= 'background-color:' . $opt . '; ';
687
  $opt = wppa_opt( 'fontweight_fulltitle' );
688
  if ( $opt ) $result .= 'font-weight:' . $opt . '; ';
689
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
 
691
  case 'wppa-black':
692
  // $opt = wppa_opt( 'black' );
wppa-upload-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * A wppa widget to upload photos
6
  *
7
- * Version 7.3.09
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
@@ -68,7 +68,7 @@ class WppaUploadWidget extends WP_Widget {
68
  wppa_user_upload(); // Do the upload if required
69
 
70
  $mocc = wppa( 'mocc' );
71
- $is_responsive = wppa_opt( 'colwidth' ) == 'auto';
72
 
73
  if ( $is_responsive ) { // Responsive widget
74
  $js = wppa_get_responsive_widget_js_html( $mocc );
4
  *
5
  * A wppa widget to upload photos
6
  *
7
+ * Version 8.0.00.003
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
68
  wppa_user_upload(); // Do the upload if required
69
 
70
  $mocc = wppa( 'mocc' );
71
+ $is_responsive = true;
72
 
73
  if ( $is_responsive ) { // Responsive widget
74
  $js = wppa_get_responsive_widget_js_html( $mocc );
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.7.07.004
7
  *
8
  */
9
 
@@ -3458,14 +3458,6 @@ function wppa_sanitize_custom_field( $txt ) {
3458
  return $result;
3459
  }
3460
 
3461
- // Get the minimum number of photos to display ( photocount treshold if not virtuel )
3462
- function wppa_get_mincount() {
3463
-
3464
- if ( wppa_is_virtual() ) return '0';
3465
-
3466
- return wppa_opt( 'min_thumbs' );
3467
- }
3468
-
3469
  // See if a photo is in our admins choice zip
3470
  function wppa_is_photo_in_zip( $id ) {
3471
  global $wpdb;
@@ -5083,7 +5075,7 @@ function wppa_get_thumb_aspect() {
5083
  $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
5084
  $aspect = $t[0] / $t[1];
5085
  }
5086
- elseif ( wppa_opt( 'resize_to' ) ) {
5087
  $t = explode( 'x', wppa_opt( 'resize_to' ) );
5088
  $aspect = $t[1] / $t[0];
5089
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.0.00.003
7
  *
8
  */
9
 
3458
  return $result;
3459
  }
3460
 
 
 
 
 
 
 
 
 
3461
  // See if a photo is in our admins choice zip
3462
  function wppa_is_photo_in_zip( $id ) {
3463
  global $wpdb;
5075
  $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
5076
  $aspect = $t[0] / $t[1];
5077
  }
5078
+ elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
5079
  $t = explode( 'x', wppa_opt( 'resize_to' ) );
5080
  $aspect = $t[1] / $t[0];
5081
  }
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.7.04.007
9
  *
10
  */
11
 
@@ -389,11 +389,13 @@ function wppa_chmod( $fso, $recursive = false ) {
389
 
390
  // Process dir
391
  else {
392
- chmod( $fso, 0755 );
393
- if ( $recursive ) {
394
- $files = wppa_glob( $fso . '/*' );
395
- foreach( $files as $file ) {
396
- wppa_chmod( $file, true );
 
 
397
  }
398
  }
399
  }
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.0.00.003
9
  *
10
  */
11
 
389
 
390
  // Process dir
391
  else {
392
+ if ( is_dir( $fso ) ) {
393
+ chmod( $fso, 0755 );
394
+ if ( $recursive ) {
395
+ $files = wppa_glob( $fso . '/*' );
396
+ foreach( $files as $file ) {
397
+ wppa_chmod( $file, true );
398
+ }
399
  }
400
  }
401
  }
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.7.07.006
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '7.7.07.006'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.0.00.004
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.0.00.004'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30