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<images.length-1){a.src=currPath+'next.png';a.style.cursor='pointer'}else{a.src=currPath+'next_disabled.png';a.style.cursor='auto'}if(imgArea.lastChild==imgMain){imgArea.removeChild(imgMain);imgArea.appendChild(imgLoad)}imgMain.onload=function(){if(imgArea.lastChild==imgLoad){imgArea.removeChild(imgLoad);setWndSize(imgMain.width,imgMain.height);imgArea.appendChild(imgMain)}};imgMain.src='';imgMain.src=images[index];a=document.getElementById('imgNum');a.innerHTML=strImgOf.replace('%1',index+1).replace('%2',images.length);a=document.getElementById('imgTitle');if(titles!=null&&index>=0&&index<titles.length)a.innerHTML=titles[index];else a.innerHTML=''}function changeImg(a){if(images==null)return;if(a){if(index<images.length-1){index++;reloadImg()}}else if(index>0){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<f.length;i++){if(f[i].className.indexOf('viewable')!=-1){images[images.length]=f[i].href;k=f[i].innerHTML.indexOf('<!--');if(k!=-1){s=f[i].innerHTML.substring(k+4);k=s.indexOf('-->');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='<div id="overlay" onclick="hideSlideWindow()"></div><table cellpadding="0" cellspacing="0" id="wnd"><tr><td id="tl"></td><td id="tc"></td><td id="tr"></td></tr><tr><td id="ml" rowspan="3"></td><td class="mc"><table cellpadding="0" cellspacing="0" id="imgTable"><tr><td align="center" id="imgArea"></td></tr></table></td><td id="mr" rowspan="3"></td></tr><tr><td class="mc" height="10"></td></tr><tr><td class="mc" height="40"><table cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="left" nowrap><img src="'+currPath+'prev.png" width="58" height="22" alt="'+strPrev+'" id="btnPrev" onclick="changeImg(false)"><img src="'+currPath+'next.png" width="58" height="22" alt="'+strNext+'" id="btnNext" onclick="changeImg(true)"></td><td align="center"><div id="imgNum"></div><div id="imgTitle"></div></td><td align="right"><img src="'+currPath+'close.png" width="66" height="22" alt="'+strClose+'" style="cursor: pointer" onclick="hideSlideWindow()"></td></tr></table></td></tr><tr><td id="bl"></td><td id="bc"></td><td id="br"></td></tr></table>';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;
