// source --> https://taipeimission.org/wp-content/plugins/embed-facebook/slidewindow/slidewindow_min.js /* Lightweight Image Viewer For Your Website Copyright © 2010 Yury Plashenkov http://www.plashenkov.com/ */ currPath='';overlayOpacity=75;strPrev='Previous Image';strNext='Next Image';strClose='Close';strImgOf='Image %1 of %2';function setWndSize(w,h){var a=document.getElementById('wnd');a.style.width=w+20*2+'px';a.style.height=h+20*2+10+40+'px';a.style.marginLeft=-parseInt(a.style.width)/2+'px';a.style.marginTop=-parseInt(a.style.height)/2+'px';a=document.getElementById('imgTable');a.style.width=w+'px';a.style.height=h+'px'}function clientSize(){var d=document;return[(!d.compatMode||d.compatMode=='CSS1Compat')&&d.documentElement&&d.documentElement.clientWidth||d.body&&d.body.clientWidth,(!d.compatMode||d.compatMode=='CSS1Compat')&&d.documentElement&&d.documentElement.clientHeight||d.body&&d.body.clientHeight]}function scrollSize(){var d=document;return[d.body&&d.body.scrollWidth||d.documentElement&&d.documentElement.scrollWidth,d.body&&d.body.scrollHeight||d.documentElement&&d.documentElement.scrollHeight]}function scrollOffset(){var d=document;return[d.documentElement&&d.documentElement.scrollLeft||d.body&&d.body.scrollLeft,d.documentElement&&d.documentElement.scrollTop||d.body&&d.body.scrollTop]}function setWndPos(a){var b=document.getElementById('wnd');if(a){var c=clientSize(),sc=scrollOffset();b.style.left=c[0]/2+sc[0]+'px';b.style.top=c[1]/2+sc[1]+'px'}else{b.style.left=-parseInt(b.style.width)+'px';b.style.top=-parseInt(b.style.height)+'px'}}var imgArea=null,imgLoad=null,imgMain=null,images=null,titles=null,index=0;function reloadImg(){if(images==null||index<0||index>=images.length)return;var a=document.getElementById('btnPrev');if(index>0){a.src=currPath+'prev.png';a.style.cursor='pointer'}else{a.src=currPath+'prev_disabled.png';a.style.cursor='auto'}a=document.getElementById('btnNext');if(index=0&&index0){index--;reloadImg()}}var modalWnd=null;function showSlideWindow(b,w,h){if(modalWnd==null)return true;var c=document.getElementById('overlay');if(overlayOpacity>0){c.style.opacity=overlayOpacity/100;c.style.filter='alpha(opacity='+overlayOpacity+')';var d=clientSize(),sc=scrollSize();c.style.width=Math.max(d[0],sc[0])+'px';c.style.height=Math.max(d[1],sc[1])+'px'}if(w&&h)setWndSize(w,h);setWndPos(true);modalWnd.style.visibility='visible';var e=function(a){if(!a)a=window.event;switch(a.keyCode){case 32:case 34:case 39:case 40:changeImg(true);return false;case 8:case 33:case 37:case 38:changeImg(false);return false;case 27:hideSlideWindow();return false}return true};if(window.opera)document.onkeypress=e;else document.onkeydown=e;images=[];titles=[];var f=b.parentNode.getElementsByTagName('a'),s='',k;for(var i=0;i');if(k!=-1)s=s.substring(0,k)}titles[titles.length]=s}if(f[i]==b)index=i}reloadImg();return false}function hideSlideWindow(){if(modalWnd==null)return;if(window.opera)document.onkeypress=null;else document.onkeydown=null;modalWnd.style.visibility='hidden';setWndPos(false);var a=document.getElementById('overlay');a.style.width=0;a.style.height=0}function onLoad(){var a=navigator.appVersion.indexOf('MSIE')!=-1&&parseFloat(navigator.appVersion.split('MSIE')[1])<7;var b=document.getElementsByTagName('head')[0];var c=document.createElement('link');c.setAttribute('type','text/css');c.setAttribute('rel','stylesheet');c.setAttribute('href',currPath+'slidewindow.css');b.appendChild(c);var d;if(a){var e=" { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+currPath;var f=".png', sizingMethod='scale') } ";d='#tl'+e+'tl'+f+'#tc'+e+'tc'+f+'#tr'+e+'tr'+f+'#ml'+e+'ml'+f+'#mr'+e+'mr'+f+'#bl'+e+'bl'+f+'#bc'+e+'bc'+f+'#br'+e+'br'+f}else d='#tl { background: url('+currPath+'r-corners.png) 0 0 } #tc { background: url('+currPath+'r-horz.png) 0 0 } #tr { background: url('+currPath+'r-corners.png) 100% 0 } #ml { background: url('+currPath+'r-vert.png) 0 0 } #mr { background: url('+currPath+'r-vert.png) 100% 0 } #bl { background: url('+currPath+'r-corners.png) 0 100% } #bc { background: url('+currPath+'r-horz.png) 0 100% } #br { background: url('+currPath+'r-corners.png) 100% 100% }';var g=document.createElement('style');g.setAttribute('type','text/css');b.appendChild(g);if(g.styleSheet)g.styleSheet.cssText=d;else g.appendChild(document.createTextNode(d));if(a){new Image().src=currPath+'tl.png';new Image().src=currPath+'tc.png';new Image().src=currPath+'tr.png';new Image().src=currPath+'ml.png';new Image().src=currPath+'mr.png';new Image().src=currPath+'bl.png';new Image().src=currPath+'bc.png';new Image().src=currPath+'br.png'}else{new Image().src=currPath+'r-corners.png';new Image().src=currPath+'r-horz.png';new Image().src=currPath+'r-vert.png'}new Image().src=currPath+'loading.gif';new Image().src=currPath+'prev.png';new Image().src=currPath+'next.png';new Image().src=currPath+'prev_disabled.png';new Image().src=currPath+'next_disabled.png';new Image().src=currPath+'close.png';modalWnd=document.createElement('div');modalWnd.style.visibility='hidden';modalWnd.innerHTML='
'+strPrev+''+strNext+'
'+strClose+'
';document.body.appendChild(modalWnd);setWndSize(400,300);setWndPos(false);imgArea=document.getElementById('imgArea');imgLoad=document.createElement('img');imgLoad.src=currPath+'loading.gif';imgArea.appendChild(imgLoad);imgMain=document.createElement('img')}if(window.addEventListener)window.addEventListener('load',onLoad,false);else if(window.attachEvent)window.attachEvent('onload',onLoad);else if(window.onload){var oldLoad=window.onload;window.onload=function(){oldLoad();onLoad()}}else window.onload=onLoad;