(function(){window.JCEMediaBox={options:{popup:{width:'',height:'',legacy:0,overlay:1,overlayopacity:0.8,overlaycolor:'#000000',resize:0,icons:1,fadespeed:500,scalespeed:500,hideobjects:1,scrolling:'fixed',labels:{'close':'Close','next':'Next','previous':'Previous','numbers':'{$current} of {$total}','cancel':'Cancel'}},tooltip:{speed:150,offsets:{x:16,y:16},position:'br',opacity:0.8,background:'#000000',color:'#ffffff'},base:'/',pngfix:false,pngfixclass:'',theme:'standard',themecustom:'',themepath:'plugins/system/jcemediabox/themes',imgpath:'plugins/system/jcemediabox/img'},init:function(a){this.extend(this.options,a);if(this.isIE6)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};this.ready()},ready:function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);return JCEMediaBox._init()},false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);return JCEMediaBox._init()}});if(document.documentElement.doScroll&&window==window.top)(function(){if(JCEMediaBox.domLoaded)return;try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}return JCEMediaBox._init()})()}JCEMediaBox.Event.add(window,"load",function(){return JCEMediaBox._init()})},getSite:function(){var a=this.options.base;if(a){var b=document.location.href;var c=b.split(':\/\/');var d=c[0];var e=c[1];if(e.indexOf(a)!=-1){e=e.substr(0,e.indexOf(a))}else{e=e.substr(0,e.indexOf('/'))||e}return d+'://'+e+a}return null},_init:function(){if(this.domLoaded)return;this.domLoaded=true;var t=this,d=document,na=navigator,ua=na.userAgent;t.isOpera=window.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isIE7=t.isIE&&/MSIE [7]/.test(ua);this.site=this.getSite();if(!this.site)return false;this.Popup.init();this.ToolTip.init()},each:function(o,a,s){var n,l;if(!o)return 0;s=s||o;if(o.length!==undefined){for(n=0,l=o.length;n<l;n++){if(a.call(s,o[n],n,o)===false)return 0}}else{for(n in o){if(o.hasOwnProperty(n)){if(a.call(s,o[n],n,o)===false)return 0}}}return 1},extend:function(o,e){var t=JCEMediaBox,i,l,a=arguments;for(i=1,l=a.length;i<l;i++){e=a[i];t.each(e,function(v,n){if(v!==undefined)o[n]=v})}return o},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'')},DOM:{get:function(s){if(typeof(s)=='string')return document.getElementById(s);return s},select:function(p,o){var t=this,r=[],s,parts,at,tag,each=JCEMediaBox.each;o=o||document;if(p=='*'){return o.getElementsByTagName(p)}if(o.querySelectorAll){return o.querySelectorAll(p)}function inArray(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return true}}return false}s=p.split(',');each(s,function(d){parts=JCEMediaBox.trim(d).split('.');tag=parts[0]||'*';cl=parts[1]||'';if(/\[(.*?)\]/.test(tag)){tag=tag.replace(/(.*?)\[(.*?)\]/,function(a,b,c){at=c;return b})}var e=o.getElementsByTagName(tag);if(cl||at){each(e,function(a){if(cl){if(t.hasClass(a,cl)){if(!inArray(r,a)){r.push(a)}}}if(at){if(a.getAttribute(at)){if(!inArray(r,a)){r.push(a)}}}})}else{r=e}});return r},hasClass:function(a,c){return new RegExp(c).test(a.className)},addClass:function(a,c){if(!this.hasClass(a,c)){a.className=JCEMediaBox.trim(a.className+' '+c)}},removeClass:function(a,c){if(this.hasClass(a,c)){var s=a.className;var b=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");var v=s.replace(b,' ');v=v.replace(/^\s|\s$/g,'');a.className=v}},show:function(a){a.style.display='block'},hide:function(a){a.style.display='none'},remove:function(a){var p=a.parentNode||document.body;p.removeChild(a)},style:function(n,c,v){var d=JCEMediaBox.isIE,r,s;c=c.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});s=n.style;if(typeof v=='undefined'){if(c=='float')c=d?'styleFloat':'cssFloat';r=s[c];if(document.defaultView&&!r){if(/float/i.test(c))c='float';c=c.replace(/[A-Z]/g,function(a){return'-'+a}).toLowerCase();try{r=document.defaultView.getComputedStyle(n,null).getPropertyValue(c)}catch(e){}}if(n.currentStyle&&!r)r=n.currentStyle[c];return r}else{switch(c){case'opacity':v=parseFloat(v);if(d){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block'}s[c]=v;break;case'float':c=d?'styleFloat':'cssFloat';break;default:if(v&&/(margin|padding|width|height|top|bottom|left|right)/.test(c)){v=/^[\-0-9\.]+$/.test(v)?v+'px':v}break}s[c]=v}},styles:function(a,b){var t=this;JCEMediaBox.each(b,function(v,s){return t.style(a,s,v)})},attribute:function(a,s,v){if(typeof v=='undefined'){if(s=='class'){return a.className}v=a.getAttribute(s);if(/^on/.test(s)){v=v.replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1')}if(s=='hspace'&&v==-1){v=''}return v}if(v===''){a.removeAttribute(s)}switch(s){case'style':if(typeof v=='object'){this.styles(a,v)}else{a.style.cssText=v}break;case'class':a.className=v||'';break;default:a.setAttribute(s,v);break}},attributes:function(a,b){var t=this;JCEMediaBox.each(b,function(v,s){t.attribute(a,s,v)})},create:function(a,b,c){var o=document.createElement(a);this.attributes(o,b);if(typeof c!='undefined'){o.innerHTML=c}return o},add:function(n,o,a,h){if(typeof o=='string'){a=a||{};o=this.create(o,a,h)}n.appendChild(o);return o},addBefore:function(n,o,c){if(typeof c=='undefined'){c=n.firstChild}n.insertBefore(o,c)},png:function(a){var s;if(a.nodeName=='IMG'){s=a.src;if(/\.png$/i.test(s)){this.attribute(a,'src',JCEMediaBox.site+'plugins/system/jcemediabox/img/blank.gif');this.style(a,'filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+s+"')")}}else{s=this.style(a,'background-image');if(/\.png/i.test(s)){var b=/url\("(.*)"\)/.exec(s)[1];this.styles(a,{'background-image':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='image')"})}}}},Event:{events:[],add:function(o,n,f,s){var t=this;cb=function(e){if(t.disabled)return;e=e||window.event;if(e&&JCEMediaBox.isIE){if(!e.target){e.target=e.srcElement||document}if(!e.relatedTarget&&e.fromElement){e.relatedTarget=e.fromElement==e.target?e.toElement:e.fromElement}JCEMediaBox.extend(e,{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}})}if(e&&JCEMediaBox.isWebKit){if(e.target.nodeType==3){e.target=e.target.parentNode}}if(!s)return f(e);return f.call(s,e)};function _add(o,n,f){if(o.attachEvent){o.attachEvent('on'+n,f)}else if(o.addEventListener){o.addEventListener(n,f,false)}else{o['on'+n]=f}}t.events.push({obj:o,name:n,func:f,cfunc:cb,scope:s});_add(o,n,cb)},remove:function(o,n,f){var t=this,a=t.events,s=false,r;JCEMediaBox.each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false}});return s},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null}catch(ex){}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e)},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false},destroy:function(){var t=this;JCEMediaBox.each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null});t.events=[];t=null},addUnload:function(f,s){var t=this;f={func:f,scope:s||this};if(!t.unloads){function unload(){var a=t.unloads,o,n;if(a){for(n in a){o=a[n];if(o&&o.func)o.func.call(o.scope,1)}if(window.detachEvent){window.detachEvent('onbeforeunload',fakeUnload);window.detachEvent('onunload',unload)}else if(window.removeEventListener)window.removeEventListener('unload',unload,false);t.unloads=o=a=w=unload=0;if(window.CollectGarbage)CollectGarbage()}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);if(unload)unload();d=0};if(d)d.attachEvent('onstop',stop);window.setTimeout(function(){if(d)d.detachEvent('onstop',stop)},0)}};if(window.attachEvent){window.attachEvent('onunload',unload);window.attachEvent('onbeforeunload',fakeUnload)}else if(window.addEventListener)window.addEventListener('unload',unload,false);t.unloads=[f]}else t.unloads.push(f);return f},removeUnload:function(f){var u=this.unloads,r=null;JCEMediaBox.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false}});return r}},Dimensions:{getWidth:function(){return document.documentElement.clientWidth||document.body.clientWidth||this.innerWidth||0},getHeight:function(){return document.documentElement.clientHeight||document.body.clientHeight||this.innerHeight||0},getScrollHeight:function(){return document.documentElement.scrollHeight||document.body.scrollHeight||0},getScrollWidth:function(){return document.documentElement.scrollWidth||document.body.scrollWidth||0},getScrollTop:function(){return document.documentElement.scrollTop||this.pageYOffset||document.body.scrollTop||0},getScrollbarWidth:function(){var a=JCEMediaBox.each,DOM=JCEMediaBox.DOM;if(this.scrollbarWidth){return this.scrollbarWidth}var b=DOM.add(document.body,'div',{'style':{position:'absolute',visibility:'hidden',width:200,height:200,border:0,margin:0,padding:0,overflow:'hidden'}});var c=DOM.add(b,'div',{'style':{width:'100%',height:200,border:0,margin:0,padding:0}});var d=parseInt(c.offsetWidth);b.style.overflow='scroll';var e=parseInt(c.offsetWidth);if(d==e){e=parseInt(b.clientWidth)}document.body.removeChild(b);this.scrollbarWidth=(d-e);return this.scrollbarWidth},outerWidth:function(n){var v=0,x=0;x=n.offsetWidth;if(!x){JCEMediaBox.each(['padding-left','padding-right','border-left','border-right','width'],function(s){v=parseFloat(JCEMediaBox.DOM.style(n,s));v=/[0-9]/.test(v)?v:0;x=x+v})}return x},outerHeight:function(n){var v=0,x=0;x=n.offsetHeight;if(!x){JCEMediaBox.each(['padding-top','padding-bottom','border-top','border-bottom','height'],function(s){v=parseFloat(JCEMediaBox.DOM.style(n,s));v=/[0-9]/.test(v)?v:0;x=x+v})}return x}},FX:{animate:function(a,b,c,d){var e=JCEMediaBox.DOM;var f={speed:c||100,callback:d||function(){}};var g={};JCEMediaBox.each(b,function(v,s){sv=parseFloat(e.style(a,s));g[s]=[sv,v]});new JCEMediaBox.fx(a,f).custom(g);return true}}};JCEMediaBox.XHR=function(a,b){this.options={method:'GET',async:true,headers:{},data:null,encoding:'utf-8',success:function(){},error:function(){}};JCEMediaBox.extend(this.options,a);this.scope=b||this};JCEMediaBox.XHR.prototype={setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(JCEMediaBox.isIE?new ActiveXObject('Microsoft.XMLHTTP'):false)},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return}this.running=false;var a=0;if((this.transport.status>=200)&&(this.transport.status<300)){var s=this.transport.responseText;var x=this.transport.responseXML;this.options.success.call(this.scope,s,x)}else{this.options.error.call(this.scope,this.transport,this.options)}this.transport.onreadystatechange=function(){};this.transport=null},send:function(a){var t=this,extend=JCEMediaBox.extend;if(this.running){return this}this.running=true;this.setTransport();var b=this.options.method.toUpperCase();if(this.options.urlEncoded&&b=='POST'){var c=(this.options.encoding)?'; charset='+this.options.encoding:'';extend(this.options.headers,{'Content-type':'application/x-www-form-urlencoded'+c})}this.transport.open(b,a,this.options.async);this.transport.onreadystatechange=function(){return t.onStateChange()};if((this.options.method=='post')&&this.transport.overrideMimeType){extend(this.options.headers,{'Connection':'close'})}for(var d in this.options.headers){try{this.transport.setRequestHeader(d,this.options.headers[d])}catch(e){}}this.transport.send(this.options.data)}},JCEMediaBox.fx=function(a,b){this.element=a;this.callback=b.callback;this.speed=b.speed;this.wait=true;this.fps=50;this.now={}};JCEMediaBox.fx.prototype={step:function(){var a=new Date().getTime();if(a<this.time+this.speed){this.cTime=a-this.time;this.setNow()}else{var t=this;this.clearTimer();this.now=this.to;setTimeout(function(){t.callback.call(t.element,t)},10)}this.increase()},setNow:function(){for(p in this.from){this.now[p]=this.compute(this.from[p],this.to[p])}},compute:function(a,b){var c=b-a;return this.transition(this.cTime,a,c,this.speed)},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this},start:function(a,b){var t=this;if(!this.wait)this.clearTimer();if(this.timer)return;this.from=a;this.to=b;this.time=new Date().getTime();this.timer=setInterval(function(){return t.step()},Math.round(1000/this.fps));return this},custom:function(o){if(this.timer&&this.wait)return;var a={};var b={};for(property in o){a[property]=o[property][0];b[property]=o[property][1]}return this.start(a,b)},increase:function(){for(var p in this.now){this.setStyle(this.element,p,this.now[p])}},transition:function(t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},setStyle:function(e,p,v){JCEMediaBox.DOM.style(e,p,v)}},JCEMediaBox.ToolTip={init:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;var d=JCEMediaBox.options.theme=='custom'?JCEMediaBox.options.themecustom:JCEMediaBox.options.theme;this.tooltiptheme='';new JCEMediaBox.XHR({success:function(a,b){var c=/<!-- THEME START -->([\s\S]*?)<!-- THEME END -->/;if(c.test(a)){a=c.exec(a)[1]}t.tooltiptheme=a}}).send(JCEMediaBox.site+JCEMediaBox.options.themepath+'/'+d+'/tooltip.html');function _withinElement(a,e,b){var p=e.relatedTarget;while(p&&p!=a){try{p=p.parentNode}catch(e){p=a}}if(p!=a){return b.call(this)}return false}each(DOM.select('.jcetooltip, .jce_tooltip'),function(a){Event.add(a,'mouseover',function(e){_withinElement(a,e,function(){return t.start(a)})});Event.add(a,'mouseout',function(e){_withinElement(a,e,function(){return t.end(a)})});Event.add(a,'mousemove',function(e){return t.locate(e)})})},create:function(){if(!this.toolTip){var a=JCEMediaBox.DOM;this.toolTip=a.add(document.body,'div',{'style':{'opacity':0},'class':'jcemediabox-tooltip'},this.tooltiptheme)}},start:function(a){var t=this,DOM=JCEMediaBox.DOM;if(!this.tooltiptheme)return false;this.create();var b=a.title||'',title='';if(/::/.test(b)){var c=b.split('::');title=c[0].trim();b=c[1].trim()}var d=a.className.replace(/(jce_?)tooltip/gi,'');this.toolTip.title=a.title;DOM.attribute(a,'title','');var h='';if(title){h+='<h4>'+title+'</h4>'}if(b){h+='<p>'+b+'</p>'}var e=DOM.get('jcemediabox-tooltip-text');if(typeof e=='undefined'){this.toolTip.className='jcemediabox-tooltip-simple';this.toolTip.innerHTML=h}else{e.innerHTML=h}DOM.style(t.toolTip,'visibility','visible');JCEMediaBox.FX.animate(t.toolTip,{'opacity':JCEMediaBox.options.tooltip.opacity},JCEMediaBox.options.tooltip.speed)},end:function(a){var t=this,DOM=JCEMediaBox.DOM;if(!this.tooltiptheme)return false;DOM.attribute(a,'title',this.toolTip.title);DOM.styles(this.toolTip,{'visibility':'hidden','opacity':0})},locate:function(e){if(!this.tooltiptheme)return false;this.create();var o=JCEMediaBox.options.tooltip.offsets;var a={'x':e.pageX||e.clientX+document.documentElement.scrollLeft,'y':e.pageY||e.clientY+document.documentElement.scrollTop};var b={'x':this.toolTip.offsetWidth,'y':this.toolTip.offsetHeight};var c={'x':a.x+o.x,'y':a.y+o.y};var d=0;switch(JCEMediaBox.options.tooltip.position){case'tl':c.x=(a.x-b.x)-o.x;c.y=(a.y-b.y)-(d+o.y);break;case'tr':c.x=a.x+o.x;c.y=(a.y-b.y)-(d+o.y);break;case'tc':c.x=(a.x-Math.round((b.x/2)))+o.x;c.y=(a.y-b.y)-(d+o.y);break;case'bl':c.x=(a.x-b.x)-o.x;c.y=(a.y+Math.round((b.y/2)))-(d+o.y);break;case'br':c.x=a.x+o.x;c.y=a.y+o.y;break;case'bc':c.x=(a.x-(b.x/2))+o.x;c.y=a.y+d+o.y;break}JCEMediaBox.DOM.styles(this.toolTip,{top:c.y,left:c.x})},position:function(a){}},JCEMediaBox.Popup={addons:{'flash':{},'image':{},'html':{}},setAddons:function(n,o){JCEMediaBox.extend(this.addons[n],o)},getAddons:function(n){if(n){return this.addons[n]}return this.addons},getAddon:function(v,n){var t=this,cp=false,r,each=JCEMediaBox.each;addons=this.getAddons(n);each(this.addons,function(o,s){each(o,function(a){r=a.call(this,v);if(typeof r!='undefined'){cp=r}})});return cp},cleanEvent:function(s){return s.replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1')},params:function(s){var a=[],x=[];if(s instanceof Array){x=s}else{if(s.indexOf('&')!=-1){x=s.split(/&(amp;)?/g)}else{x=s.split(/;/g)}}JCEMediaBox.each(x,function(n,i){if(n){n=n.replace(/^([^\[]+)(\[|=|:)([^\]]*)(\]?)$/,function(a,b,c,d){if(d){if(!/[^0-9]/.test(d)){return'"'+b+'":'+parseInt(d)}return'"'+b+'":"'+d+'"'}return''});if(n){a.push(n)}}});return eval('({'+a.join(',')+'})')},getCookie:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e))},setCookie:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"")},convert:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(DOM.select('a[href]'),function(a){if(/com_jce/.test(a.href)){var p,s,r=[];var b=DOM.attribute('onclick');s=b.replace(/&amp;/g,'&').replace(/&#39;/g,"'").split("'");p=t.params(s[0]);img=p['img']||'';title=p['title']||'';if(img){if(!/http:\/\//.test(img)){if(img.charAt(0)=='/'){img=img.substr(1)}img=t.site.replace(/http:\/\/([^\/]+)/,'')+img}DOM.attributes(a,{'href':img,'title':title.replace(/_/,' '),'onclick':''});DOM.addClass(a,'jcepopup')}}})},translate:function(s){var t=this;if(!s){s=this.popup.theme}s=s.replace(/\{#(\w+?)\}/g,function(a,b){return JCEMediaBox.options.popup.labels[b]});return s},styles:function(o){var v,s,x=[];if(!o)return{};JCEMediaBox.each(o.split(';'),function(s,i){s=s.replace(/(.*):(.*)/,function(a,b,c){return"'"+b+"':'"+c+"'"});x.push(s)});return eval('({'+x.join(',')+'})')},getType:function(a){var o={},type;if(/(director|windowsmedia|mplayer|quicktime|real|divx|flash)/.test(a.type)){type=/(director|windowsmedia|mplayer|quicktime|real|divx|flash)/.exec(a.type)[1]}o=this.getAddon(a.src);if(o&&o.type){type=o.type}return type||a.type||'iframe'},mediatype:function(c){var a,cb,mt;c=/(director|windowsmedia|mplayer|quicktime|real|divx|flash)/.exec(c);switch(c[1]){case'director':case'application/x-director':a='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'windowsmedia':case'mplayer':case'application/x-mplayer2':a='6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'quicktime':case'video/quicktime':a='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'real':case'realaudio':case'audio/x-pn-realaudio-plugin':a='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0';mt='audio/x-pn-realaudio-plugin';break;case'divx':case'video/divx':a='67dabfbf-d0ab-41fa-9c46-cc0f21721616';cb='http://go.divx.com/plugin/DivXBrowserPlugin.cab';mt='video/divx';break;default:case'flash':case'application/x-shockwave-flash':a='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0';mt='application/x-shockwave-flash';break}return{'classid':a,'codebase':cb,'mediatype':mt}},islocal:function(s){if(/^(\w+):\/\//.test(s)){return new RegExp('^('+JCEMediaBox.site+')').test(s)}else{return true}},frameWidth:function(){var t=this,w=0,el=this.frame;JCEMediaBox.each(['left','right'],function(s){w=w+parseFloat(JCEMediaBox.DOM.style(el,'padding-'+s))});return parseFloat(this.frame.clientWidth-w)},frameHeight:function(){var t=this,h=0,el=this.frame,DIM=JCEMediaBox.Dimensions;JCEMediaBox.each(['top','bottom'],function(s){h=h+parseFloat(JCEMediaBox.DOM.style(el,'padding-'+s))});h=h+((JCEMediaBox.isIE6||JCEMediaBox.isIE7)?DIM.getScrollbarWidth():0);return parseInt(DIM.getHeight())-h},width:function(){return this.frameWidth()-JCEMediaBox.Dimensions.getScrollbarWidth()},height:function(){var h=0,t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,DIM=JCEMediaBox.Dimensions;each(['top','bottom'],function(s){var a=t['info-'+s];if(a){h=h+parseInt(DIM.outerHeight(a))}});return this.frameHeight()-h},printPage:function(){if(this.active.type=='image'){}else{}},zoom:function(l){var t=this,DOM=JCEMediaBox.DOM,extend=JCEMediaBox.extend,each=JCEMediaBox.each,s,m,x,y;var n=l.firstChild;var o=DOM.create('span');if(n&&n.nodeName=='IMG'){var p=n.getAttribute('align');var q=n.getAttribute('vspace');var r=n.getAttribute('hspace');var w=n.getAttribute('width')||n.style.width||0;var h=n.getAttribute('height')||n.style.height||0;var u={'width':w,'height':h};each(['top','right','bottom','left'],function(b){u['margin-'+b]=DOM.style(n,'margin-'+b);u['padding-'+b]=DOM.style(n,'padding-'+b);each(['width','style','color'],function(a){u['border-'+b+'-'+a]=DOM.style(n,'border-'+b+'-'+a)})});if(/\w+/.test(p)){extend(u,{'float':/left|right/.test(p)?p:'','text-align':/top|middle|bottom/.test(p)?p:''})}if(q>0){extend(u,{'margin-top':parseInt(q),'margin-bottom':parseInt(q)})}if(r>0){extend(u,{'margin-left':parseInt(r),'margin-right':parseInt(r)})}extend(u,{'float':DOM.style(n,'float'),'text-align':n.style.textAlign});function _buildIcon(a,b,c,d){var e,w=d.width||0,h=d.height||0;var f=DOM.add(a,'span',{'class':'jcemediabox-zoom-span','style':c.style.cssText});DOM.styles(f,d);DOM.add(f,c);DOM.add(f,b);each(['style','align','border','hspace','vspace'],function(v,i){c.removeAttribute(v)});DOM.addClass(b,'jcemediabox-zoom-image');e=a.className.match(/icon-(top-right|top-left|bottom-right|bottom-left|left|right|center|centre)/);if(e){e=e[1];e=(/^(left|right)/.test(e))?'bottom '+e:e.replace(/-/,' ')}else{e='bottom right'}var g=-h,left=0;if(JCEMediaBox.isIE6&&/\.png/i.test(DOM.style(b,'background-image'))){var j=parseFloat(DOM.style(b,'width'));var k=parseFloat(DOM.style(b,'height'));if(/(bottom)/.test(e))g=-k;if(/(right)/.test(e))left=w-j;DOM.style(b,'left',left);DOM.style(a,'position','static');DOM.png(b)}DOM.styles(b,{'top':g,'background-position':e});DOM.styles(c,{'margin':0,'padding':0,'float':'none','border':'none'})}if(/^(0|auto)/.test(w)||/^(0|auto)/.test(h)){x=new Image();x.src=n.src;x.onload=function(){extend(u,{width:parseInt(x.width),height:parseInt(x.height)});_buildIcon(l,o,n,u)}}else{_buildIcon(l,o,n,u)}}else{DOM.addClass(o,'jcemediabox-zoom-link');if(DOM.hasClass(l,'icon-left')){DOM.addBefore(l,o)}else{DOM.add(l,o)}if(JCEMediaBox.isIE7){DOM.style(o,'display','inline-block')}}return o},auto:function(){var t=this;JCEMediaBox.each(this.popups,function(a,i){if(a.auto){if(a.auto=='autopopup-single'){var b=t.getCookie('jceutilities_autopopup_'+a.id);if(!b){t.setCookie('jceutilities_autopopup_'+a.id,1);t.start(a)}}else if(a.auto=='autopopup-multiple'){t.start(a)}}})},init:function(){window.jcepopup=this;this.create()},create:function(){var t=this,auto=false,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;this.popups=[],this.popuptheme='';if(JCEMediaBox.options.popup.legacy==1){t.convert()}each(DOM.select('a.jcebox, a.jcelightbox, a.jcepopup, area.jcebox, area.jcelightbox, area.jcepopup'),function(d,i){if(/(jcelightbox|jcebox)/.test(d.className)){DOM.removeClass(d,'jcelightbox');DOM.removeClass(d,'jcebox');DOM.addClass(d,'jcepopup')}if(!DOM.hasClass(d,'nopopup')){if(JCEMediaBox.options.popup.icons==1&&d.nodeName=='A'&&!/(noicon|icon-none|noshow)/.test(d.className)&&d.style.display!='none'){var f=t.zoom(d)}if(DOM.hasClass(d,'noshow')){DOM.hide(d)}var g='',p='';if(!auto&&d.id){if(c=d.className.match(/autopopup-(single|multiple)/)){auto=c[0]}}var h=d.title||'';var j=d.rel||'';if(h&&/(\w+\[.*\])/.test(h)){p=t.params(h);DOM.attribute(d,'title',p.title||'');g=p.group||''}if(j&&/(\w+\[.*\])/.test(j)){var k=[];j=j.replace(/\b((\w+)\[(.*?)\])(;?)/g,function(a,b,c){k.push(b);return''});p=t.params(k);DOM.attribute(d,'rel',j||p.rel||'');g=p.group||''}else{var l='alternate|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark|nofollow|licence|tag|friend';var m='(lightbox(\[(.*?)\])?)';var n='(lyte(box|frame|show)(\[(.*?)\])?)';g=j.replace(new RegExp('\s*('+l+'|'+m+'|'+n+')\s*'),'','gi')}if(d.nodeName=='AREA'){if(!p){p=t.params(d.href)}g=g||'AREA_ELEMENT'}var o={'src':d.href,'title':p.title||h,'group':DOM.hasClass(d,'nogroup')?'':g,'type':p.type||d.type||'','params':p||{},'id':d.id||'','auto':auto};d.href=d.href.replace(/&type=(ajax|text\/html|text\/xml)/,'');t.popups.push(o);Event.add(d,'click',function(e){Event.cancel(e);return t.start(o,i)});auto=false}});var q=JCEMediaBox.options.theme=='custom'?JCEMediaBox.options.themecustom:JCEMediaBox.options.theme;new JCEMediaBox.XHR({success:function(a,b){var c=/<!-- THEME START -->([\s\S]*?)<!-- THEME END -->/;if(c.test(a)){a=c.exec(a)[1]}t.popuptheme=a;t.auto()}}).send(JCEMediaBox.site+JCEMediaBox.options.themepath+'/'+q+'/popup.html')},open:function(a,b,c,d,e){var f={'src':a,'title':b,'group':c,'type':d,'params':e};return this.start(f)},start:function(p,i){var t=this,n=0,x=0,items=[],each=JCEMediaBox.each;if(this.build()){if(p.group){each(this.popups,function(o,x){if(o.group==p.group){items.push(o);if(i&&x==i){n=items.indexOf(o)}}});if(!p.auto&&typeof i=='undefined'){items.push(p);n=items.length-1}}else{items.push(p)}return this.show(items,n)}},build:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;this.page=DOM.add(document.body,'div',{id:'jcemediabox-popup-page'});if(JCEMediaBox.options.popup.overlay==1){this.overlay=DOM.add(this.page,'div',{id:'jcemediabox-popup-overlay',style:{'opacity':0,'background-color':JCEMediaBox.options.popup.overlaycolor}})}if(!this.popuptheme){return false}this.popuptheme=this.popuptheme.replace(/<!--(.*?)-->/g,'');this.popuptheme=this.translate(this.popuptheme);this.frame=DOM.add(this.page,'div',{id:'jcemediabox-popup-frame'},'<div id="jcemediabox-popup-body">'+this.popuptheme+'</div>');each(DOM.select('*[id]',this.frame),function(a){var s=a.id.replace('jcemediabox-popup-','');t[s]=a;DOM.hide(a)});Event.add(this.frame,'click',function(e){if(e.target&&e.target==t.frame){t.close()}});if(this.closelink){Event.add(this.closelink,'click',function(){return t.close()})}if(this.cancellink){Event.add(this.cancellink,'click',function(){return t.close()})}if(this.next){Event.add(this.next,'click',function(){return t.nextItem()})}if(this.prev){Event.add(this.prev,'click',function(){return t.previousItem()})}if(this.numbers){this.numbers.tmpHTML=this.numbers.innerHTML}if(this.print){Event.add(this.print,'click',function(){return t.printPage()})}if(JCEMediaBox.isIE6){DOM.png(this.body);each(DOM.select('*',this.body),function(a){if(DOM.attribute(a,'id')=='jcemediabox-popup-content'){return}DOM.png(a)})}return true},show:function(a,n){var t=this,DOM=JCEMediaBox.DOM,DIM=JCEMediaBox.Dimensions;this.items=a;this.bind(true);DOM.show(this.body);var b=(DIM.getHeight()-DIM.outerHeight(this.body))/2;DOM.style(this.body,'top',b);if(JCEMediaBox.isIE6||JCEMediaBox.options.popup.scrolling=='scroll'){DOM.style(this.page,'position','absolute');DOM.style(this.overlay,'height',DIM.getScrollHeight());DOM.style(this.body,'top',DIM.getScrollTop()+b)}if(JCEMediaBox.options.popup.overlay==1&&this.overlay){DOM.show(this.overlay);JCEMediaBox.FX.animate(this.overlay,{'opacity':JCEMediaBox.options.popup.overlayopacity},JCEMediaBox.options.popup.fadespeed)}return this.change(n)},bind:function(b){var t=this,isIE6=JCEMediaBox.isIE6,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;if(isIE6){each(DOM.select('select'),function(a){if(b){a.tmpStyle=a.style.visibility||''}a.style.visibility=b?'hidden':a.tmpStyle})}if(JCEMediaBox.options.popup.hideobjects){each(DOM.select('object, embed'),function(a){if(a.id=='jcemediabox-popup-object')return;if(b){a.tmpStyle=a.style.visibility||''}a.style.visibility=b?'hidden':a.tmpStyle})}var c=JCEMediaBox.options.popup.scrollpopup;if(b){Event.add(document,'keydown',function(e){t.listener(e)});if(isIE6){Event.add(window,'scroll',function(e){DOM.style(t.overlay,'height',JCEMediaBox.Dimensions.getScrollHeight())});Event.add(window,'scroll',function(e){DOM.style(t.overlay,'width',JCEMediaBox.Dimensions.getScrollWidth())})}}else{if(isIE6||!c){Event.remove(window,'scroll');Event.remove(window,'resize')}Event.remove(document,'keydown')}},listener:function(e){switch(e.keyCode){case 27:this.close();break;case 37:this.previousItem();break;case 39:this.nextItem();break}},queue:function(n){var t=this,s=JCEMediaBox.options.popup.fadespeed,ss=JCEMediaBox.options.popup.scalespeed;var c=false;JCEMediaBox.each(['top','bottom'],function(s){var a=t['info-'+s];if(a){var v=JCEMediaBox.Dimensions.outerHeight(a);var b={};b['top']=s=='top'?v:-v;JCEMediaBox.DOM.style(a,'z-index',-1);JCEMediaBox.FX.animate(a,b,ss,function(){if(!c){c=true;JCEMediaBox.FX.animate(t.content,{'opacity':0},JCEMediaBox.options.popup.fadespeed,function(){return t.change(n)})}})}})},nextItem:function(){if(this.items.length==1)return false;var n=this.index+1;if(n<0||n>=this.items.length){return false}return this.queue(n)},previousItem:function(){if(this.items.length==1)return false;var n=this.index-1;if(n<0||n>=this.items.length){return false}return this.queue(n)},info:function(){var b=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;if(this.caption){var c=this.active.caption||this.active.title||'',text='';var d='([-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+)';var f='((news|telnet|nttp|file|http|ftp|https)://[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~]+)';function processRe(h){h=h.replace(new RegExp(d,'g'),'<a href="mailto:$1" target="_blank" title="$1">$1</a>');h=h.replace(new RegExp(f,'g'),'<a href="$1" target="_blank" title="$1">$1</a>');return h}if(/::/.test(c)){var g=c.split('::');c=g[0].trim();text=g[1].trim()}var h='';if(c){h+='<h4>'+c+'</h4>'}if(text){h+='<p>'+text+'</p>'}this.caption.innerHTML=h;if((JCEMediaBox.isIE6||JCEMediaBox.isIE7)&&!h){this.caption.innerHTML='&nbsp;'}b(DOM.select('*',this.caption),function(a){if(a.nodeName!='A'){b(a.childNodes,function(n,i){if(n.nodeType==3){var s=n.innerText||n.textContent||n.data||null;if(s&&/(@|:\/\/)/.test(s)){if(s=processRe(s)){n.parentNode.innerHTML=s}}}})}})}var t=this,j='',len=this.items.length;if(this.numbers&&len>1){var j=this.numbers.tmpHTML||'{$numbers}';if(/\{\$numbers\}/.test(j)){this.numbers.innerHTML='';for(var i=0;i<len;i++){var n=i+1;var k=DOM.add(this.numbers,'a',{'href':'javascript:;','title':this.items[i].title||n,'class':(this.index==i)?'active':''},n);Event.add(k,'click',function(e){var x=parseInt(e.target.innerHTML)-1;if(t.index==x){return false}return t.queue(x)})}}if(/\{\$(current|total)\}/.test(j)){this.numbers.innerHTML=j.replace('{$current}',this.index+1).replace('{$total}',len)}}else{this.numbers.innerHTML=''}b(['top','bottom'],function(v,i){var a=t['info-'+v];if(a){a.style.visibility='hidden';DOM.show(a);b(DOM.select('*[id]',a),function(s){DOM.show(s)})}});DOM.hide(this.next);DOM.hide(this.prev);if(len>1){if(this.prev){if(this.index>0){DOM.show(this.prev)}else{DOM.hide(this.prev)}}if(this.next){if(this.index<len-1){DOM.show(this.next)}else{DOM.hide(this.next)}}}},change:function(n){var t=this,extend=JCEMediaBox.extend,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,isIE=JCEMediaBox.isIE;var p={},s,o,w,h;if(n<0||n>=this.items.length){return false}this.index=n;this.active={};DOM.show(this.container);if(this.loader){DOM.show(this.loader)}if(this.cancellink){DOM.show(this.cancellink)}if(this.object){this.object=null}this.content.innerHTML='';o=this.items[n];extend(p,this.getAddon(o.src,o.type));extend(p,o.params);extend(this.active,{'src':p.src||o.src,'title':o.title,'caption':p.caption||'','type':p.type||this.getType(o),'params':p||{},'width':p.width||JCEMediaBox.options.popup.width||0,'height':p.height||JCEMediaBox.options.popup.height||0});this.info();switch(this.active.type){case'image':if(this.print&&this.options.print){this.print.style.visibility='visible'}this.img=new Image();this.img.onload=function(){return t.setup()};this.img.src=this.active.src;break;case'flash':case'director':case'shockwave':case'mplayer':case'windowsmedia':case'quicktime':case'realaudio':case'real':case'divx':if(this.print){this.print.style.visibility='hidden'}p.src=this.active.src;var e=/:\/\//.test(p.src)?'':this.site;this.object='';w=this.width();h=this.height();var f=this.mediatype(this.active.type);if(this.active.type=='flash'){p.wmode='transparent';p.base=e}if(/(mplayer|windowsmedia)/i.test(this.active.type)){p.baseurl=e;if(isIE){p.url=p.src;delete p.src}}delete p.title;delete p.group;p.width=this.active.width=p.width||w;p.height=this.active.height=p.height||h;function makeParam(a){var h='';for(n in a){if(a[n]){h+='<param name="'+n+'" value="'+a[n]+'" />'}}return h}var g=/flash/i.test(this.active.type);if(g||isIE){this.object='<object id="jcemediabox-popup-object" ';if(g&&!isIE){this.object+='type="'+f.mediatype+'" data="'+p.src+'" '}else{this.object+='codebase="'+f.codebase+'" classid="clsid:'+f.classid+'" '}for(n in p){if(p[n]!==''){if(/(id|name|width|height|style|type)$/.test(n)){t.object+=n+'="'+decodeURIComponent(p[n])+'"'}}}this.object+='>';for(n in p){if(p[n]!==''&&!/(id|name|width|height|style|type)/.test(n)){t.object+='<param name="'+n+'" value="'+decodeURIComponent(p[n])+'" />'}}this.object+='</object>'}else{this.object='<embed id="jcemediabox-popup-object"';for(n in p){if(p[n]!==''){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}}this.object+='></embed>'}this.active.type='media';this.setup();break;case'ajax':case'text/html':case'text/xml':if(this.print&&this.options.print){this.print.style.visibility='visible'}this.active.width=this.active.width||this.width();this.active.height=this.active.height||this.height();if(this.islocal(this.active.src)){if(!/tmpl=component/i.test(this.active.src)){this.active.src+=/\?/.test(this.active.src)?'&tmpl=component':'?tmpl=component'}this.active.type='ajax'}else{this.active.type='iframe';this.setup()}styles=extend(this.styles(p.styles),{display:'none'});this.ajax=DOM.add(this.content,'div',{id:'jcemediabox-popup-ajax','style':styles});if(JCEMediaBox.isIE6){DOM.style(this.ajax,'margin-right',JCEMediaBox.Dimensions.getScrollbarWidth())}if(JCEMediaBox.isIE7){DOM.style(this.ajax,'padding-right',JCEMediaBox.Dimensions.getScrollbarWidth())}this.active.src=this.active.src.replace(/\&type=(ajax|text\/html|text\/xml)/,'');new JCEMediaBox.XHR({method:'POST',success:function(b,c){var d=b,html=d,re=/<body[^>]*>([\s\S]*?)<\/body>/;if(re.test(d)){html=re.exec(d)[1]}t.ajax.innerHTML=html;if(t.loader){DOM.show(t.loader)}each(DOM.select('a',t.content),function(a){JCEMediaBox.Event.add(a,'click',function(){if(a.href&&a.href.indexOf('#')==-1){t.close()}})});return t.setup()}}).send(this.active.src);break;case'iframe':default:if(this.print){this.print.style.visibility='hidden'}if(this.islocal(this.active.src)){if(!/tmpl=component/i.test(this.active.src)){this.active.src+=/\?/.test(this.active.src)?'&tmpl=component':'?tmpl=component'}}this.active.width=this.active.width||this.width();this.active.height=this.active.height||this.height();this.active.type='iframe';this.setup();break}return false},resize:function(w,h,x,y){if(w>x){h=h*(x/w);w=x;if(h>y){w=w*(y/h);h=y}}else if(h>y){w=w*(y/h);h=y;if(w>x){h=h*(x/w);w=x}}w=Math.round(w);h=Math.round(h);return{width:Math.round(w),height:Math.round(h)}},setup:function(){var t=this,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event,w,h;w=this.active.width;h=this.active.height;if(this.active.type=='image'){var x=this.img.width;var y=this.img.height;w=w||x;h=h||y;if(w!=x||h!=y){var a=this.resize(x,y,w,h);w=a.width;h=a.height}}if(JCEMediaBox.options.popup.resize==1||JCEMediaBox.options.popup.scrolling=='fixed'){var x=this.width();var y=this.height();var a=this.resize(w,h,x,y);w=a.width;h=a.height}DOM.styles(this.content,{width:w,height:h});DOM.hide(this.content);if(this.active.type=='image'){this.content.innerHTML='<img id="jcemediabox-popup-img" src="'+this.active.src+'" title="'+this.active.title+'" width="'+w+'" height="'+h+'" />'}return this.animate()},animate:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,FX=JCEMediaBox.FX,DIM=JCEMediaBox.Dimensions;var d=JCEMediaBox.options.popup.scalespeed,fs=JCEMediaBox.options.popup.fadespeed;var e=DIM.outerWidth(this.content);var f=DIM.outerHeight(this.content);var g=0;each(['top','bottom'],function(v,i){var a=t['info-'+v];if(a){g=g+DIM.outerHeight(a)}});var j=DOM.style(this.page,'position')=='fixed'?0:DIM.getScrollTop();var k=j+(this.frameHeight()/2)-((f+g)/2);DOM.style(this.content,'opacity',0);FX.animate(this.body,{'height':f,'top':k,'width':e},d,function(){if(t.loader){DOM.hide(t.loader)}if(t.active.type=='media'&&t.object){t.content.innerHTML=t.object}DOM.show(t.content);if(t.active.type=='ajax'){DOM.show(t.ajax)}t.content.focus();if(t.active.type=='iframe'){t.iframe=DOM.add(t.content,'iframe',{id:'jcemediabox-popup-iframe',frameBorder:0,allowTransparency:true,scrolling:t.active.params.scrolling||'auto','style':{width:t.active.width,height:t.active.height}});t.iframe.setAttribute('src',t.active.src)}function showInfo(){var b=t['info-top'];if(b){each(DOM.select('*[id]',b),function(a){if(/jcemediabox-popup-(next|prev)/.test(DOM.attribute(a,'id'))){return}DOM.show(a)});var h=DIM.outerHeight(b);DOM.styles(b,{'z-index':-1,'top':h,'visibility':'visible'});FX.animate(b,{'top':0},d,function(){b.style.zIndex=0})}var c=t['info-bottom'];if(c){each(DOM.select('*[id]',c),function(a){if(/jcemediabox-popup-(next|prev)/.test(DOM.attribute(a,'id'))){return}DOM.show(a)});var h=DIM.outerHeight(c);DOM.styles(c,{'z-index':-1,'top':-h,'visibility':'visible'});FX.animate(c,{'top':0},d,function(){c.style.zIndex=0})}if(t.closelink){DOM.show(t.closelink)}}if(JCEMediaBox.isIE&&t.active.type=='media'){DOM.style(t.content,'opacity',1);showInfo()}else{FX.animate(t.content,{'opacity':1},fs,function(){showInfo()})}})},close:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(['img','object','iframe','ajax'],function(i,v){t[v]=null});if(this.closelink){DOM.hide(this.closelink)}this.content.innerHTML='';each(['top','bottom'],function(i,v){if(t['info-'+v]){DOM.hide(t['info-'+v])}});DOM.remove(this.frame);if(this.overlay){if(JCEMediaBox.isIE6){this.bind();DOM.remove(this.page)}else{JCEMediaBox.FX.animate(this.overlay,{'opacity':0},JCEMediaBox.options.popup.fadespeed,function(){t.bind();DOM.remove(t.page)})}}else{DOM.remove(this.page)}return false}}})();JCEMediaBox.Event.addUnload(function(){JCEMediaBox.Event.destroy()});