
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - tag_cloud_scripts/swfobject.js - */
// http://www.ditedi.it/portal_javascripts/tag_cloud_scripts/swfobject.js?original=1
if(typeof deconcept=="undefined"){var deconcept=new Object()}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.createElement||!document.getElementById){return}
this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1)}
if(id){this.setAttribute("id",id)}
if(w){this.setAttribute("width",w)}
if(h){this.setAttribute("height",h)}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")))}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);if(c){this.addParam("bgcolor",c)}
var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a)}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f},getAttribute:function(_10){return this.attributes[_10]},addParam:function(_11,_12){this.params[_11]=_12},getParams:function(){return this.params},addVariable:function(_13,_14){this.variables[_13]=_14},getVariable:function(_15){return this.variables[_15]},getVariables:function(){return this.variables},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16.push(key+"="+_18[key])}
return _16},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn")}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" "}
var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\""}
_19+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX")}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />"}
var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />"}
_19+="</object>"}
return _19},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}
return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){var _25=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0])}}
catch(e){}
if(_23&&_25.major>_23.major){return _25}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}
catch(e){}}}
return _25};deconcept.PlayerVersion=function(_29){this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;this.minor=parseInt(_29[1])||0;this.rev=parseInt(_29[2])||0};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false}
if(this.major>fv.major){return true}
if(this.minor<fv.minor){return false}
if(this.minor>fv.minor){return true}
if(this.rev<fv.rev){return false}return true};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(q){var _2d=q.indexOf(_2b+"=");var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e)}}return ""}};if(Array.prototype.push==null){Array.prototype.push=function(_2f){this[this.length]=_2f;return this.length}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/* - jquery.mousewheel.pack.js - */
// http://www.ditedi.it/portal_javascripts/jquery.mousewheel.pack.js?original=1
(function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);

/* - jquery.fancybox.js - */
// http://www.ditedi.it/portal_javascripts/jquery.fancybox.js?original=1
(function(jq){var tmp,loading,overlay,wrap,outer,inner,close,nav_left,nav_right,selectedIndex=0,selectedOpts={},selectedArray=[],currentIndex=0,currentOpts={},currentArray=[],ajaxLoader=null,imgPreloader=new Image(),imgRegExp=/\.(jpg|gif|png|bmp|jpeg)(.*)?jq/i, swfRegExp = /[^\.]\.(swf)\s*jq/i,loadingTimer,loadingFrame=1,start_pos,final_pos,busy=false,shadow=20,fx=jq.extend(jq('<div/>')[0],{prop:0}),titleh=0,isIE6=!jq.support.opacity&&!window.XMLHttpRequest,fancybox_abort=function(){loading.hide();imgPreloader.onerror=imgPreloader.onload=null;if(ajaxLoader){ajaxLoader.abort()}
tmp.empty()},fancybox_error=function(){jq.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{'scrolling':'no','padding':20,'transitionIn':'none','transitionOut':'none'})},fancybox_get_viewport=function(){return [jq(window).width(),jq(window).height(),jq(document).scrollLeft(),jq(document).scrollTop()]},fancybox_get_zoom_to=function(){var view=fancybox_get_viewport(),to={},margin=currentOpts.margin,resize=currentOpts.autoScale,horizontal_space=(shadow+margin) * 2,vertical_space=(shadow+margin) * 2,double_padding=(currentOpts.padding * 2),ratio;if(currentOpts.width.toString().indexOf('%')>-1){to.width=((view[0] * parseFloat(currentOpts.width))/100)-(shadow * 2) ;resize=false} else{to.width=currentOpts.width+double_padding}
if(currentOpts.height.toString().indexOf('%')>-1){to.height=((view[1] * parseFloat(currentOpts.height))/100)-(shadow * 2);resize=false} else{to.height=currentOpts.height+double_padding}
if(resize&&(to.width>(view[0]-horizontal_space)||to.height>(view[1]-vertical_space))){if(selectedOpts.type=='image'||selectedOpts.type=='swf'){horizontal_space+=double_padding;vertical_space+=double_padding;ratio=Math.min(Math.min(view[0]-horizontal_space,currentOpts.width)/ currentOpts.width, Math.min( view[1] - vertical_space, currentOpts.height) / currentOpts.height);to.width=Math.round(ratio *(to.width-double_padding))+double_padding;to.height=Math.round(ratio *(to.height-double_padding))+double_padding} else{to.width=Math.min(to.width,(view[0]-horizontal_space));to.height=Math.min(to.height,(view[1]-vertical_space))}}
to.top=view[3]+((view[1]-(to.height+(shadow * 2))) * 0.5);to.left=view[2]+((view[0]-(to.width+(shadow * 2))) * 0.5);if(currentOpts.autoScale===false){to.top=Math.max(view[3]+margin,to.top);to.left=Math.max(view[2]+margin,to.left)}
return to},fancybox_format_title=function(title){if(title&&title.length){switch(currentOpts.titlePosition){case 'inside':return title;case 'over':return '<span id="fancybox-title-over">'+title+'</span>';default:return '<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+title+'</span><span id="fancybox-title-right"></span></span>'}}
return false},fancybox_process_title=function(){var title=currentOpts.title,width=final_pos.width-(currentOpts.padding * 2),titlec='fancybox-title-'+currentOpts.titlePosition;jq('#fancybox-title').remove();titleh=0;if(currentOpts.titleShow===false){return}
title=jq.isFunction(currentOpts.titleFormat)?currentOpts.titleFormat(title,currentArray,currentIndex,currentOpts):fancybox_format_title(title);if(!title||title===''){return}
jq('<div id="fancybox-title" class="'+titlec+'" />').css({'width':width,'paddingLeft':currentOpts.padding,'paddingRight':currentOpts.padding}).html(title).appendTo('body');switch(currentOpts.titlePosition){case 'inside':titleh=jq("#fancybox-title").outerHeight(true)-currentOpts.padding;final_pos.height+=titleh;break;case 'over':jq('#fancybox-title').css('bottom',currentOpts.padding);break;default:jq('#fancybox-title').css('bottom',jq("#fancybox-title").outerHeight(true) *-1);break}
jq('#fancybox-title').appendTo(outer).hide()},fancybox_set_navigation=function(){jq(document).unbind('keydown.fb').bind('keydown.fb', function(e){if(e.keyCode==27&&currentOpts.enableEscapeButton){e.preventDefault();jq.fancybox.close()} else if(e.keyCode==37){e.preventDefault();jq.fancybox.prev()} else if(e.keyCode==39){e.preventDefault();jq.fancybox.next()}});if(jq.fn.mousewheel){wrap.unbind('mousewheel.fb');if(currentArray.length>1){wrap.bind('mousewheel.fb', function(e,delta){e.preventDefault();if(busy||delta===0){return}
if(delta>0){jq.fancybox.prev()} else{jq.fancybox.next()}})}}
if(!currentOpts.showNavArrows){return}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!==0){nav_left.show()}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!=(currentArray.length-1)){nav_right.show()}},fancybox_preload_images=function(){var href,objNext;if((currentArray.length-1)>currentIndex){href=currentArray[currentIndex+1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href}}
if(currentIndex>0){href=currentArray[currentIndex-1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href}}},_finish=function(){inner.css('overflow',(currentOpts.scrolling=='auto'?(currentOpts.type=='image'||currentOpts.type=='iframe'||currentOpts.type=='swf'?'hidden':'auto'):(currentOpts.scrolling=='yes'?'auto':'visible')));if(!jq.support.opacity){inner.get(0).style.removeAttribute('filter');wrap.get(0).style.removeAttribute('filter')}
jq('#fancybox-title').show();if(currentOpts.hideOnContentClick){inner.one('click',jq.fancybox.close)}
if(currentOpts.hideOnOverlayClick){overlay.one('click',jq.fancybox.close)}
if(currentOpts.showCloseButton){close.show()}
fancybox_set_navigation();jq(window).bind("resize.fb",jq.fancybox.center);if(currentOpts.centerOnScroll){jq(window).bind("scroll.fb",jq.fancybox.center)} else{jq(window).unbind("scroll.fb")}
if(jq.isFunction(currentOpts.onComplete)){currentOpts.onComplete(currentArray,currentIndex,currentOpts)}
busy=false;fancybox_preload_images()},fancybox_draw=function(pos){var width=Math.round(start_pos.width+(final_pos.width-start_pos.width) * pos),height=Math.round(start_pos.height+(final_pos.height-start_pos.height) * pos),top=Math.round(start_pos.top+(final_pos.top-start_pos.top) * pos),left=Math.round(start_pos.left+(final_pos.left-start_pos.left) * pos);wrap.css({'width':width+'px','height':height+'px','top':top+'px','left':left+'px'});width=Math.max(width-currentOpts.padding * 2,0);height=Math.max(height-(currentOpts.padding * 2+(titleh * pos)),0);inner.css({'width':width+'px','height':height+'px'});if(typeof final_pos.opacity!=='undefined'){wrap.css('opacity',(pos<0.5?0.5:pos))}},fancybox_get_obj_pos=function(obj){var pos=obj.offset();pos.top+=parseFloat(obj.css('paddingTop'))||0;pos.left+=parseFloat(obj.css('paddingLeft'))||0;pos.top+=parseFloat(obj.css('border-top-width'))||0;pos.left+=parseFloat(obj.css('border-left-width'))||0;pos.width=obj.width();pos.height=obj.height();return pos},fancybox_get_zoom_from=function(){var orig=selectedOpts.orig?jq(selectedOpts.orig):false,from={},pos,view;if(orig&&orig.length){pos=fancybox_get_obj_pos(orig);from={width:(pos.width+(currentOpts.padding * 2)),height:(pos.height+(currentOpts.padding * 2)),top:(pos.top-currentOpts.padding-shadow),left:(pos.left-currentOpts.padding-shadow)}} else{view=fancybox_get_viewport();from={width:1,height:1,top:view[3]+view[1] * 0.5,left:view[2]+view[0] * 0.5}}
return from},fancybox_show=function(){loading.hide();if(wrap.is(":visible")&&jq.isFunction(currentOpts.onCleanup)){if(currentOpts.onCleanup(currentArray,currentIndex,currentOpts)===false){jq.event.trigger('fancybox-cancel');busy=false;return}}
currentArray=selectedArray;currentIndex=selectedIndex;currentOpts=selectedOpts;inner.get(0).scrollTop=0;inner.get(0).scrollLeft=0;if(currentOpts.overlayShow){if(isIE6){jq('select:not(#fancybox-tmp select)').filter(function(){return this.style.visibility!=='hidden'}).css({'visibility':'hidden'}).one('fancybox-cleanup', function(){this.style.visibility='inherit'})}
overlay.css({'background-color':currentOpts.overlayColor,'opacity':currentOpts.overlayOpacity}).unbind().show()}
final_pos=fancybox_get_zoom_to();fancybox_process_title();if(wrap.is(":visible")){jq(close.add(nav_left).add(nav_right)).hide();var pos=wrap.position(),equal;start_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};equal=(start_pos.width==final_pos.width&&start_pos.height==final_pos.height);inner.fadeOut(currentOpts.changeFade, function(){var finish_resizing=function(){inner.html(tmp.contents()).fadeIn(currentOpts.changeFade,_finish)};jq.event.trigger('fancybox-change');inner.empty().css('overflow','hidden');if(equal){inner.css({top:currentOpts.padding,left:currentOpts.padding,width:Math.max(final_pos.width-(currentOpts.padding * 2),1),height:Math.max(final_pos.height-(currentOpts.padding * 2)-titleh,1)});finish_resizing()} else{inner.css({top:currentOpts.padding,left:currentOpts.padding,width:Math.max(start_pos.width-(currentOpts.padding * 2),1),height:Math.max(start_pos.height-(currentOpts.padding * 2),1)});fx.prop=0;jq(fx).animate({prop:1},{duration:currentOpts.changeSpeed,easing:currentOpts.easingChange,step:fancybox_draw,complete:finish_resizing})}});return}
wrap.css('opacity',1);if(currentOpts.transitionIn=='elastic'){start_pos=fancybox_get_zoom_from();inner.css({top:currentOpts.padding,left:currentOpts.padding,width:Math.max(start_pos.width-(currentOpts.padding * 2),1),height:Math.max(start_pos.height-(currentOpts.padding * 2),1)}).html(tmp.contents());wrap.css(start_pos).show();if(currentOpts.opacity){final_pos.opacity=0}
fx.prop=0;jq(fx).animate({prop:1},{duration:currentOpts.speedIn,easing:currentOpts.easingIn,step:fancybox_draw,complete:_finish})} else{inner.css({top:currentOpts.padding,left:currentOpts.padding,width:Math.max(final_pos.width-(currentOpts.padding * 2),1),height:Math.max(final_pos.height-(currentOpts.padding * 2)-titleh,1)}).html(tmp.contents());wrap.css(final_pos).fadeIn(currentOpts.transitionIn=='none'?0:currentOpts.speedIn,_finish)}},fancybox_process_inline=function(){tmp.width(selectedOpts.width);tmp.height(selectedOpts.height);if(selectedOpts.width=='auto'){selectedOpts.width=tmp.width()}
if(selectedOpts.height=='auto'){selectedOpts.height=tmp.height()}
fancybox_show()},fancybox_process_image=function(){busy=true;selectedOpts.width=imgPreloader.width;selectedOpts.height=imgPreloader.height;jq("<img />").attr({'id':'fancybox-img','src':imgPreloader.src,'alt':selectedOpts.title}).appendTo(tmp);fancybox_show()},fancybox_start=function(){fancybox_abort();var obj=selectedArray[selectedIndex],href,type,title,str,emb,selector,data;selectedOpts=jq.extend({},jq.fn.fancybox.defaults,(typeof jq(obj).data('fancybox')=='undefined'?selectedOpts:jq(obj).data('fancybox')));title=obj.title||jq(obj).title||selectedOpts.title||'';if(obj.nodeName&&!selectedOpts.orig){selectedOpts.orig=jq(obj).children("img:first").length?jq(obj).children("img:first"):jq(obj)}
if(title===''&&selectedOpts.orig){title=selectedOpts.orig.attr('alt')}
if(obj.nodeName&&(/^(?:javascript|#)/i).test(obj.href)){href=selectedOpts.href||null} else{href=selectedOpts.href||obj.href||null}
if(selectedOpts.type){type=selectedOpts.type;if(!href){href=selectedOpts.content}} else if(selectedOpts.content){type='html'} else if(href){if(href.match(imgRegExp)){type='image'} else if(href.match(swfRegExp)){type='swf'} else if(jq(obj).hasClass("iframe")){type='iframe'} else if(href.match(/#/)){obj=href.substr(href.indexOf("#"));type=jq(obj).length>0?'inline':'ajax'} else{type='ajax'}} else{type='inline'}
selectedOpts.type=type;selectedOpts.href=href;selectedOpts.title=title;if(selectedOpts.autoDimensions&&selectedOpts.type!=='iframe'&&selectedOpts.type!=='swf'){selectedOpts.width='auto';selectedOpts.height='auto'}
if(selectedOpts.modal){selectedOpts.overlayShow=true;selectedOpts.hideOnOverlayClick=false;selectedOpts.hideOnContentClick=false;selectedOpts.enableEscapeButton=false;selectedOpts.showCloseButton=false}
if(jq.isFunction(selectedOpts.onStart)){if(selectedOpts.onStart(selectedArray,selectedIndex,selectedOpts)===false){busy=false;return}}
tmp.css('padding',(shadow+selectedOpts.padding+selectedOpts.margin));jq('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function(){jq(this).replaceWith(inner.children())});switch(type){case 'html':tmp.html(selectedOpts.content);fancybox_process_inline();break;case 'inline':jq('<div class="fancybox-inline-tmp" />').hide().insertBefore(jq(obj)).bind('fancybox-cleanup', function(){jq(this).replaceWith(inner.children())}).bind('fancybox-cancel', function(){jq(this).replaceWith(tmp.children())});jq(obj).appendTo(tmp);fancybox_process_inline();break;case 'image':busy=false;jq.fancybox.showActivity();imgPreloader=new Image();imgPreloader.onerror=function(){fancybox_error()};imgPreloader.onload=function(){imgPreloader.onerror=null;imgPreloader.onload=null;fancybox_process_image()};imgPreloader.src=href;break;case 'swf':str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"><param name="movie" value="'+href+'"></param>';emb='';jq.each(selectedOpts.swf, function(name,val){str+='<param name="'+name+'" value="'+val+'"></param>';emb+=' '+name+'="'+val+'"'});str+='<embed src="'+href+'" type="application/x-shockwave-flash" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"'+emb+'></embed></object>';tmp.html(str);fancybox_process_inline();break;case 'ajax':selector=href.split('#',2);data=selectedOpts.ajax.data||{};if(selector.length>1){href=selector[0];if(typeof data=="string"){data+='&selector='+selector[1]} else{data.selector=selector[1]}}
busy=false;jq.fancybox.showActivity();ajaxLoader=jq.ajax(jq.extend(selectedOpts.ajax,{url:href,data:data,error:fancybox_error,success: function(data,textStatus,XMLHttpRequest){if(ajaxLoader.status==200){tmp.html(data);fancybox_process_inline()}}}));break;case 'iframe':jq('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'" frameborder="0" hspace="0" scrolling="'+selectedOpts.scrolling+'" src="'+selectedOpts.href+'"></iframe>').appendTo(tmp);fancybox_show();break}},fancybox_animate_loading=function(){if(!loading.is(':visible')){clearInterval(loadingTimer);return}
jq('div',loading).css('top',(loadingFrame *-40)+'px');loadingFrame=(loadingFrame+1)%12},fancybox_init=function(){if(jq("#fancybox-wrap").length){return}
jq('body').append(tmp=jq('<div id="fancybox-tmp"></div>'),loading=jq('<div id="fancybox-loading"><div></div></div>'),overlay=jq('<div id="fancybox-overlay"></div>'),wrap=jq('<div id="fancybox-wrap"></div>'));if(!jq.support.opacity){wrap.addClass('fancybox-ie');loading.addClass('fancybox-ie')}
outer=jq('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(wrap);outer.append(inner=jq('<div id="fancybox-inner"></div>'),close=jq('<a id="fancybox-close"></a>'),nav_left=jq('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),nav_right=jq('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));close.click(jq.fancybox.close);loading.click(jq.fancybox.cancel);nav_left.click(function(e){e.preventDefault();jq.fancybox.prev()});nav_right.click(function(e){e.preventDefault();jq.fancybox.next()});if(isIE6){overlay.get(0).style.setExpression('height',"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");loading.get(0).style.setExpression('top',"(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");outer.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}};jq.fn.fancybox=function(options){jq(this).data('fancybox',jq.extend({},options,(jq.metadata?jq(this).metadata():{}))).unbind('click.fb').bind('click.fb', function(e){e.preventDefault();if(busy){return}
busy=true;jq(this).blur();selectedArray=[];selectedIndex=0;var rel=jq(this).attr('rel')||'';if(!rel||rel==''||rel==='nofollow'){selectedArray.push(this)} else{selectedArray=jq("a[rel="+rel+"], area[rel="+rel+"]");selectedIndex=selectedArray.index(this)}
fancybox_start();return false});return this};jq.fancybox=function(obj){if(busy){return}
busy=true;var opts=typeof arguments[1]!=='undefined'?arguments[1]:{};selectedArray=[];selectedIndex=opts.index||0;if(jq.isArray(obj)){for(var i=0,j=obj.length;i<j;i++){if(typeof obj[i]=='object'){jq(obj[i]).data('fancybox',jq.extend({},opts,obj[i]))} else{obj[i]=jq({}).data('fancybox',jq.extend({content:obj[i]},opts))}}
selectedArray=jQuery.merge(selectedArray,obj)} else{if(typeof obj=='object'){jq(obj).data('fancybox',jq.extend({},opts,obj))} else{obj=jq({}).data('fancybox',jq.extend({content:obj},opts))}
selectedArray.push(obj)}
if(selectedIndex>selectedArray.length||selectedIndex<0){selectedIndex=0}
fancybox_start()};jq.fancybox.showActivity=function(){clearInterval(loadingTimer);loading.show();loadingTimer=setInterval(fancybox_animate_loading,66)};jq.fancybox.hideActivity=function(){loading.hide()};jq.fancybox.next=function(){return jq.fancybox.pos(currentIndex+1)};jq.fancybox.prev=function(){return jq.fancybox.pos(currentIndex-1)};jq.fancybox.pos=function(pos){if(busy){return}
pos=parseInt(pos,10);if(pos>-1&&currentArray.length>pos){selectedIndex=pos;fancybox_start()}
if(currentOpts.cyclic&&currentArray.length>1&&pos<0){selectedIndex=currentArray.length-1;fancybox_start()}
if(currentOpts.cyclic&&currentArray.length>1&&pos>=currentArray.length){selectedIndex=0;fancybox_start()}
return};jq.fancybox.cancel=function(){if(busy){return}
busy=true;jq.event.trigger('fancybox-cancel');fancybox_abort();if(selectedOpts&&jq.isFunction(selectedOpts.onCancel)){selectedOpts.onCancel(selectedArray,selectedIndex,selectedOpts)}
busy=false};jq.fancybox.close=function(){if(busy||wrap.is(':hidden')){return}
busy=true;if(currentOpts&&jq.isFunction(currentOpts.onCleanup)){if(currentOpts.onCleanup(currentArray,currentIndex,currentOpts)===false){busy=false;return}}
fancybox_abort();jq(close.add(nav_left).add(nav_right)).hide();jq('#fancybox-title').remove();wrap.add(inner).add(overlay).unbind();jq(window).unbind("resize.fb scroll.fb");jq(document).unbind('keydown.fb');
function _cleanup(){overlay.fadeOut('fast');wrap.hide();jq.event.trigger('fancybox-cleanup');inner.empty();if(jq.isFunction(currentOpts.onClosed)){currentOpts.onClosed(currentArray,currentIndex,currentOpts)}
currentArray=selectedOpts=[];currentIndex=selectedIndex=0;currentOpts=selectedOpts={};busy=false}
inner.css('overflow','hidden');if(currentOpts.transitionOut=='elastic'){start_pos=fancybox_get_zoom_from();var pos=wrap.position();final_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};if(currentOpts.opacity){final_pos.opacity=1}
fx.prop=1;jq(fx).animate({prop:0},{duration:currentOpts.speedOut,easing:currentOpts.easingOut,step:fancybox_draw,complete:_cleanup})} else{wrap.fadeOut(currentOpts.transitionOut=='none'?0:currentOpts.speedOut,_cleanup)}};jq.fancybox.resize=function(){var c,h;if(busy||wrap.is(':hidden')){return}
busy=true;c=inner.wrapInner("<div style='overflow:auto'></div>").children();h=c.height();wrap.css({height:h+(currentOpts.padding * 2)+titleh});inner.css({height:h});c.replaceWith(c.children());jq.fancybox.center()};jq.fancybox.center=function(){busy=true;var view=fancybox_get_viewport(),margin=currentOpts.margin,to={};to.top=view[3]+((view[1]-((wrap.height()-titleh)+(shadow * 2))) * 0.5);to.left=view[2]+((view[0]-(wrap.width()+(shadow * 2))) * 0.5);to.top=Math.max(view[3]+margin,to.top);to.left=Math.max(view[2]+margin,to.left);wrap.css(to);busy=false};jq.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:'auto',width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:'transparent'},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:'#666',titleShow:true,titlePosition:'outside',titleFormat:null,transitionIn:'fade',transitionOut:'fade',speedIn:300,speedOut:300,changeSpeed:300,changeFade:'fast',easingIn:'swing',easingOut:'swing',showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};jq(document).ready(function(){fancybox_init()})})(jQuery);

