var is_touch = !!('ontouchstart' in window) || !!('msmaxtouchpoints' in window.navigator); /* msmaxtouchpoints -> ie10 */
var lng = "en";
function vp() {
var e = window, a = 'inner';
if (!('innerWidth' in window )) {
a = 'client';
e = document.documentElement || document.body;
}
return { w : e[ a+'Width' ] , h : e[ a+'Height' ] };
}
function controlliRidim(){
$('.miniblock').css('height', 'auto').stessaAltezza();
$('#block-views-our_activities-block_1 .content .views-row').css('height', 'auto').stessaAltezza();
var hslider = $('#block-views-our_activities-block_1 .content .views-row:first').height();
$('#block-views-our_activities-block_1 .tcviewport, #block-views-our_activities-block_1 .tcoverview, #block-views-our_activities-block_1 .content').height(hslider);
}
$(function() {
lng = $('html').attr('lang');
acctools = '
AAA
';
acctools += ''+Drupal.t('High contrast')+'
';
if($.cookie('fontzoom')){
if($.cookie('fontzoom') == "1em"){
$.removeCookie('fontzoom', { path: '/' });
} else {
$('body').css('font-size', $.cookie('fontzoom'));
}
}
if($.cookie('highcontr')){ $('body').addClass('highcontr'); }
var baseacctools = $('#block-locale-0').length ? '#block-locale-0' : '#search_box';
$(baseacctools).before(acctools);
if($('#block-locale-0 .content ul.links li').length<2){
altralng = lng == "pl" ? "en" : "pl";
linklng = ''+altralng.toUpperCase()+''
$('#block-locale-0 .content ul.links').append(linklng);
}
$('#tzoom > span').click(function(e) {
var i = $(this).parent().children('span').index(this); //follie della 1.3
var fz = (.8+(i/5))+"em";
$('body').css('font-size', fz);
$.cookie('fontzoom', fz, { expires: 1, path: '/' });
controlliRidim();
});
$('#hicntr > span').click(function(e) {
var hc = 'highcontr';
$('body').toggleClass(hc);
if($('body').hasClass(hc)){
$.cookie('highcontr', 1, { expires: 1, path: '/' });
} else {
$.removeCookie('highcontr', { path: '/' });
}
});
/*varie per page tools */
if($('#block-jquery_utils-0 ul.links > li.triggernote').length){
$('#block-jquery_utils-0 ul.links').prepend(''+Drupal.t('Notes')+'');
$('#block-jquery_utils-0 ul.links > li.triggernote, #block-jquery_utils-0 ul.links > li.notesbasket').appendTo($('#notes-sub'));
}
$('#block-jquery_utils-0 ul.links').prepend(''+Drupal.t('Basket')+'');
$('#block-jquery_utils-0 ul.links > li.flag-basket, #block-jquery_utils-0 ul.links > li.gotobasket').appendTo($('#basket-sub'));
$('#block-jquery_utils-0 a.toolsub').click(function(e) {
$('#block-jquery_utils-0 ul.links li.attivo').not($(this).parent()).removeClass('attivo').children('ul').hide(0);
$(this).parent().toggleClass('attivo');
$(this).next('ul').slideToggle(100);
if($("#notes-wrapper > .note-edit-popup.mynote-form").length){
$("#notes-wrapper > .note-edit-popup p.close").click();
}
});
$('#block-jquery_utils-0 ul.links > li > a[href*=#], #block-jquery_utils-0 ul.links > li > ul > li > a[href*=#]').click(function(e) {
e.preventDefault();
});
$('.csrtools .gris > a').click(function(e) {
e.preventDefault();
$(this).parents('.block').next().slideToggle('fast');
});
//*/
/* GRI */
if($('#edit-indicatore-wrapper').length){
$('#edit-indicatore-wrapper label').text(Drupal.t('GRI Search'));
}
/* projects field block */
if($('#proj-block').length){
//$('.node-inner .field-type-nodereference').wrap('');
var ppath = lng == "pl" ? "/inicjatywy-2013" : "/projects";
$('#proj-block .field-item a').each(function(index, element) {
nid = $(this).parent().attr('class').split(" ")[1];
//$(this).attr('href', $(this).attr('href')+"#"+nid);
$(this).attr('href', "/"+lng+ppath+"/#"+nid);
});
$('#proj-block .proj-cont').append('');
$('#proj-block').appendTo($('#sidebar-left-inner'));
$('#proj-block .field-label').append('+');
$('#proj-block .field-label').click(function(e) {
$pl = $(this).children('.plus');
$(this).next('.proj-cont').slideToggle('fast');
$pl.text($pl.text()=="+" ? "—" : "+")
});
}
/* blockquote corner "safe-area" */
$('#content-area blockquote[class^=box] > :first-child').prepend('');
/* cookie disclaimer */
if(!$.cookie('cookieok')){
$('#block-block-7 .content, #block-block-6 .content').addClass('colonnona').wrap('')
$('#cookiedisc').prependTo($('#all-inner'));
$('#cookiedisc .content').prepend(' ');
$('#cookiedisc .x').click(function(e) {
$.cookie('cookieok', 1, { expires: 365, path: '/' });
$('#cookiedisc').slideUp('fast');
});
}
/* fancybox */
$('#content-area a.fancybox').fancybox({
titlePosition: 'inside',
transitionIn: 'elastic',
transitionOut: 'elastic'
});
/* view progetti */
if($('#content-area .view-progetti.view-id-progetti').length){
$('.view-id-progetti .views-row .views-field-title a').click(function(e) { e.preventDefault(); });
$('.view-id-progetti .views-row .views-field-title').click(function(e) {
if(!$(this).parent().hasClass('open')){
$('.view-id-progetti .views-row.open .views-field-body').slideUp('fast');
$('.view-id-progetti .views-row.open').removeClass('open');
$(this).parent().addClass('open');
$(this).next('.views-field-body').slideDown('fast');
} else {
$(this).parent().removeClass('open');
$(this).next('.views-field-body').slideUp('fast');
}
});
if(location.hash){
hsh = location.hash.substr(1);
$('.view-id-progetti .views-field-nid a[name='+hsh+']').parents('.views-row').find('.views-field-title').click();
}
}
/* STAKEHOLDERS MAP */
if($('.stakmap').length){
$mp = $('.stakmap');
$mp.append('');
$mp.append('');
pnt = [
[111, 50]
,[297, 233]
,[546, 234]
,[751, 51]
,[23, 385]
,[151, 385]
,[296, 385]
,[420, 385]
,[546, 385]
,[688, 385]
,[818, 385]
];
pntl = [
[373, 102]
,[397, 205]
,[535, 205]
,[558, 102]
,[373, 130]
,[373, 150]
,[452, 219]
,[467, 209]
,[483, 219]
,[558, 150]
,[558, 130]
];
percl = [
[[185, 102]]
,[[358, 249]]
,[[574, 249]]
,[[770, 102]]
,[[70, 327], [70, 401]]
,[[198, 267], [198, 401]]
,[[452, 390], [342, 390], [342, 401]]
,[[467, 401]]
,[[483, 390], [592, 390], [592, 401]]
,[[734, 267], [734, 401]]
,[[864, 327], [864, 401]]
];
$('.stakmap li').each(function(i, element) {
$t = $(this);
$t.addClass('proc off sml'+i).data('i', i);
$t.css({ 'left': pnt[i][0], 'top': pnt[i][1]});
$mp.append('');
$('span.lc'+i, $mp).css({ 'left': pntl[i][0], 'top': pntl[i][1]}).data('perc', percl[i]).data('i', i);
});
function finePercOld($l){
$l.fadeOut(100);
i = $l.data('i');
$('.stakmap li.sml'+i).removeClass('off').addClass('on');
}
function finePerc($l){
if($('.stakmap li.off').length){
i = $l.data('i');
$('.stakmap li.sml'+i).removeClass('off').addClass('on');
}
var p = $l.data('perc');
var porig = pntl[$l.data('i')];
var dur = 1200/p.length;
//var rit = index*100;
switch(dur){
case(1200):
$l.fadeIn(200).animate({left:porig[0], top:porig[1]}, dur, function(){
if($l.data('i')==1){
animaLuci();
}
});
break;
case(600):
$l.fadeIn(200).animate({left:p[0][0], top:p[0][1]}, dur)
.animate({left:porig[0], top:porig[1]}, dur);
break;
case(400):
$l.fadeIn(200).animate({left:p[1][0], top:p[1][1]}, dur)
.animate({left:p[0][0], top:p[0][1]}, dur)
.animate({left:porig[0], top:porig[1]}, dur);
break;
}
}
function animaLuci(){
$('.stakmap span.luce').each(function(index, element) {
var p = $(this).data('perc');
var dur = 1200/p.length;
var rit = index*100;
switch(dur){
case(1200):
$(this).fadeIn(200).animate({left:p[0][0], top:p[0][1]}, dur, function(){ finePerc($(this)); });
break;
case(600):
$(this).fadeIn(200).animate({left:p[0][0], top:p[0][1]}, dur)
.animate({left:p[1][0], top:p[1][1]}, dur, function(){ finePerc($(this)); });
break;
case(400):
$(this).fadeIn(200).animate({left:p[0][0], top:p[0][1]}, dur)
.animate({left:p[1][0], top:p[1][1]}, dur)
.animate({left:p[2][0], top:p[2][1]}, dur, function(){ finePerc($(this)); });
break;
}
});
}
$('.sm-popups > .sm-popup').each(function(index, element) {
$('.h4', this).wrapInner('');
$(this).data('i', index).addClass('smn'+index);
});
$('.btenea', $mp).one('click', function(){
$(this).addClass('on');
animaLuci();
});
function mostraPop(i){
$('li.active', $mp).removeClass('active');
$('li.sml'+i, $mp).addClass('active');
$('#smpopup').show(0);
$('#smpopup .cont').html($('.sm-popups .smn'+i).html());
var add = 30;
if($('.sm-popups .smn'+(i-1)).length){ $('#smpopup .cont').append('<'); add = 50; }
if($('.sm-popups .smn'+(i+1)).length){ $('#smpopup .cont').append('>'); add = 50; }
hg = $('#smpopup .cont').height()+add;
mtop = -Math.round(hg/2);
$('#smpopup').animate({ height: hg, marginTop: mtop}, 400);
}
$('li a', $mp).click(function(e) {
e.preventDefault();
if($(this).parent().hasClass('on')){
var i = parseInt($(this).parent().data('i'));
mostraPop(i);
}
});
$('#smpopup .cont .next').live("click", function(e) {
var i = parseInt($('li.active', $mp).data('i'));
mostraPop(i+1);
});
$('#smpopup .cont .prev').live("click", function(e) {
var i = parseInt($('li.active', $mp).data('i'));
mostraPop(i-1);
});
$('#smpopup .x').click(function(e) {
$(this).parent().slideUp(200, function(){
$('#smpopup .cont').html('');
});
});
}
/* sovrascrittura cassetto */
$('h4.content-area-cassetto-titolo:first').addClass('cassetto-titolo1');
$('.content-area-cassetto-titolo').unbind('click').click(function() {
$(this).next('div.content-area-cassetto-corpo').stop(true, true).slideToggle('fast').toggleClass('cassetto-corpo-aperto')
.siblings('div.content-area-cassetto-corpo:visible').removeClass('cassetto-corpo-aperto').slideUp('fast');
$(this).toggleClass('cassetto-titolo-aperto').siblings().removeClass('cassetto-titolo-aperto');
});
/* IE7 hacks */
if($('html').hasClass('lt-ie8')){
$('.csrtools ul li').each(function(index, element) { $(this).replaceWith(''+this.innerHTML+' | ');});
$('.csrtools ul').each(function(index, element) { $(this).replaceWith(''+this.innerHTML+'
');});
$('.csrtools').each(function(index, element) { $(this).replaceWith(''); });
}
$('#content-area .content a[href^=http]').externalLink();
});
$(window).load(function(e) {
/* HP */
$('#block-block-9, #block-block-10').addClass('hlslider');
$('#block-views-our_activities-block_1 .content .view:first, .hlslider .hphl:first').addClass('tcviewport');
$('#block-views-our_activities-block_1 .content .view-content:first, .hlslider .hphl > ul:first').addClass('tcoverview');
$('#block-views-our_activities-block_1 .view-header').insertAfter($('#block-views-our_activities-block_1 h2.title'));
$('#block-views-our_activities-block_1 .content').prepend('<');
$('#block-views-our_activities-block_1 .content').append('>');
$('#block-views-our_activities-block_1 .content .views-row').stessaAltezza();
var hslider = $('#block-views-our_activities-block_1 .content .views-row:first').height();
$('#block-views-our_activities-block_1 .tcviewport, #block-views-our_activities-block_1 .tcoverview, #block-views-our_activities-block_1 .content').height(hslider);
$('#block-views-our_activities-block_1').tinycarousel({
duration: 200
});
$('.miniblock').wrapInner('').stessaAltezza();
$('.hlslider .content').prepend('');
hslider = 0;
$('.hlslider .hphl li').each(function(index, element) {
$(this).wrapInner('');
hslider = Math.max(hslider, $(this).height());
$('.hlslider .tcpager').append(''+(index+1)+'');
});
$('.hlslider .tcviewport, .hlslider .tcoverview, .hlslider .content').height(hslider);
$('.hlslider').tinycarousel({
duration: 500,
controls: false,
pager: true,
interval: true,
intervaltime: 5000
});
$('body.front #content-top > .block:lt(3)').stessaAltezza();
/* larghezza input */
if($('#edit-indicatore').length){
$('#block-indicatorisearch-0').show(0).css('visibility', 'hidden');
sommaAltro = $('#edit-indicatore-wrapper label').outerWidth(true) + ($('#edit-indicatore-wrapper').outerWidth(true) - $('#edit-indicatore-wrapper').width());
sommaAltro += $('#indicatorisearch-goto-page .form-submit').outerWidth(true) + $('.indicatori-summ-link').outerWidth(true);
sommaAltro += ($('#edit-indicatore').outerWidth(true) - $('#edit-indicatore').width());
spazioDisp = $('#indicatorisearch-goto-page > div').innerWidth();
$('#edit-indicatore').width(spazioDisp - sommaAltro - 30);
$('#block-indicatorisearch-0').hide(0).css('visibility', 'visible');
}
});
(function($) {
$.fn.stessaAltezza=function(){
var altomax = 0;
this.each(function() {
altomax = Math.max($(this).height(), altomax);
});
this.height(altomax);
};
$.fn.externalLink = function() {
var domain = function(url) {
return url.replace('http://','').replace('https://','').split('/')[0];
};
this.each(function() {
url = $(this).attr('href');
if(url.indexOf('http://')>-1 && domain(location.href) !== domain(url)){
$(this).addClass("ext-link");
$(this).attr('target', "_blank");
}
});
};
})(jQuery);
/*!
* jQuery Cookie Plugin v1.4.0
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else{factory(jQuery)}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\')}try{s=decodeURIComponent(s.replace(pluses,' '))}catch(e){return}try{return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i 0 && oBtnNext.length > 0){
oBtnPrev.click(function(){
if(!$(this).hasClass('disable')){oSelf.move(-1); return false;}
});
oBtnNext.click(function(){
if(!$(this).hasClass('disable')){oSelf.move(1); return false; }
});
}
if(options.pager && oPager.length > 0){
$('.pagenum',oPager).click(setPager);
}
if(options.interval)
{
root.hover(oSelf.stop,oSelf.start);
}
}
function setPager( oEvent ){
if( $( this ).hasClass( "pagenum" ) ){
oSelf.move( parseInt($(this).attr("rel"), 10 ), true );
}
return false;
}
function setTimer()
{
if(options.interval && !bPause)
{
clearTimeout(oTimer);
oTimer = setTimeout(function(){
iCurrent = iCurrent +1 === iSteps ? -1 : iCurrent;
bForward = iCurrent +1 === iSteps ? false : iCurrent === 0 ? true : bForward;
oSelf.move(bForward ? 1 : -1);
}, options.intervaltime);
}
}
this.stop = function () { clearTimeout(oTimer); bPause = true; };
this.start = function () { bPause = false; setTimer(); };
this.move = function (iDirection, bPublic){
iCurrent = bPublic ? iDirection : iCurrent += iDirection;
if((iCurrent > -1 && iCurrent < iSteps) || 1){
var oPosition = {};
oPosition[bAxis ? 'left' : 'top'] = -(iCurrent * (iPageSize * options.display));
oLeftEnd = -(oPages.eq(iCurrent).position().left);
oPosition['left'] = oLeftEnd;
oContent.animate(oPosition,{
queue: false,
duration: options.animation ? options.duration : 0,
complete: function(){
if(typeof options.callback === 'function'){
options.callback.call(this, oPages[iCurrent], iCurrent);
}
}
});
setButtons();
setTimer();
}
};
function initialize () {
iPageSize = bAxis ? $(oPages[0]).outerWidth(true) : $(oPages[0]).outerHeight(true);
var iLeftover = Math.ceil(((bAxis ? oViewport.outerWidth() : oViewport.outerHeight()) / (iPageSize * options.display)) -1);
iSteps = Math.max(1, Math.ceil(oPages.length / options.display) - iLeftover);
iCurrent = Math.min(iSteps, Math.max(1, options.start)) -2;
sz = 0;
oPages.each(function(){ sz += $(this).outerWidth(true); });
oContent.css('width', sz+oPages.length);
oSelf.move(1);
setEvents();
return oSelf;
}
return initialize();
}
$.fn.tinycarousel = function(params){
var options = $.extend({}, $.tiny.carousel.options, params);
this.each(function () { $(this).data('tcl', new Carousel($(this), options)); });
return this;
};
}(jQuery));
/* LIB */
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('The requested content cannot be loaded.
Please try again later.
');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'':''+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b(''),t=b(''),u=b(''),f=b(''));D=b('').append('').appendTo(f);
D.append(j=b(''),E=b(''),n=b(''),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,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.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t