(function($){$.prettyPhoto={version:'3.1.3'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:5000,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'pp_default',horizontal_padding:20,hideflash:false,wmode:'opaque',autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> \
      <div class="ppt">&nbsp;</div> \
      <div class="pp_top"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
      <div class="pp_content_container"> \
       <div class="pp_left"> \
       <div class="pp_right"> \
        <div class="pp_content"> \
         <div class="pp_loaderIcon"></div> \
         <div class="pp_fade"> \
          <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
          <div class="pp_hoverContainer"> \
           <a class="pp_next" href="#">next</a> \
           <a class="pp_previous" href="#">previous</a> \
          </div> \
          <div id="pp_full_res"></div> \
          <div class="pp_details"> \
           <div class="pp_nav"> \
            <a href="#" class="pp_arrow_previous">Previous</a> \
            <p class="currentTextHolder">0/0</p> \
            <a href="#" class="pp_arrow_next">Next</a> \
           </div> \
           <p class="pp_description"></p> \
           <div class="pp_social">{pp_social}</div> \
           <a class="pp_close" href="#">Close</a> \
          </div> \
         </div> \
        </div> \
       </div> \
       </div> \
      </div> \
      <div class="pp_bottom"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
     </div> \
     <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \
        <a href="#" class="pp_arrow_previous">Previous</a> \
        <div> \
         <ul> \
          {gallery} \
         </ul> \
        </div> \
        <a href="#" class="pp_arrow_next">Next</a> \
       </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:'',social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal)
$.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;if(settings.ie6_fallback&&$.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>30)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a[rel^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize)
$(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;}
$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;_build_overlay(event.target);}
if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking)
setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);}
if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();}
movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;}
if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}
$pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('&'));}
movie='http://www.youtube.com/embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&amp;byline=0&amp;portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
$.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();}
if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight)
return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"&&(settings.ie6_fallback&&!($.browser.msie&&parseInt($.browser.version)==6))){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();}else{$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css('margin-left',-((galleryWidth/2)+(navWidth/2))).find('div:first').width(galleryWidth+5).find('ul').width(fullGalleryWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<totalPage)?Math.floor(set_position/itemsPerPage):totalPage;$.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');}}
function _build_overlay(caller){if(settings.social_tools)
facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));settings.markup=settings.markup.replace('{pp_social}',(settings.social_tools)?facebook_like_link:'');$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';img_src='';}else{classname='';img_src=pp_images[i];}
toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_gallery=$('.pp_pic_holder .pp_gallery'),$pp_gallery_li=$pp_gallery.find('li');$pp_gallery.find('.pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_gallery.find('.pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_gallery_li.each(function(i){$(this).find('a').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};if(!pp_alreadyInitialized&&getHashtag()){pp_alreadyInitialized=true;hashIndex=getHashtag();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf('/'));setTimeout(function(){$("a[rel^='"+hashRel+"']:eq("+hashIndex+")").trigger('click');},50);}
return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function getHashtag(){url=location.href;hashtag=(url.indexOf('#!')!=-1)?decodeURI(url.substring(url.indexOf('#!')+2,url.length)):false;return hashtag;};function setHashtag(){if(typeof theRel=='undefined')return;location.hash='!'+theRel+'/'+rel_index+'/';};function clearHashtag(){url=location.href;hashtag=(url.indexOf('#!prettyPhoto'))?true:false;if(hashtag)location.hash="!prettyPhoto";}
function getParam(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var pp_alreadyInitialized=false;
;/*! js-cookie v2.2.1 | MIT */

!function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function c(d){function e(){}function f(b,c,f){if("undefined"!=typeof document){f=a({path:"/"},e.defaults,f),"number"==typeof f.expires&&(f.expires=new Date(1*new Date+864e5*f.expires)),f.expires=f.expires?f.expires.toUTCString():"";try{var g=JSON.stringify(c);/^[\{\[]/.test(g)&&(c=g)}catch(j){}c=d.write?d.write(c,b):encodeURIComponent(c+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(b+"").replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var h="";for(var i in f)f[i]&&(h+="; "+i,!0!==f[i]&&(h+="="+f[i].split(";")[0]));return document.cookie=b+"="+c+h}}function g(a,c){if("undefined"!=typeof document){for(var e={},f=document.cookie?document.cookie.split("; "):[],g=0;g<f.length;g++){var h=f[g].split("="),i=h.slice(1).join("=");c||'"'!==i.charAt(0)||(i=i.slice(1,-1));try{var j=b(h[0]);if(i=(d.read||d)(i,j)||b(i),c)try{i=JSON.parse(i)}catch(k){}if(e[j]=i,a===j)break}catch(k){}}return a?e[a]:e}}return e.set=f,e.get=function(a){return g(a,!1)},e.getJSON=function(a){return g(a,!0)},e.remove=function(b,c){f(b,"",a(c,{expires:-1}))},e.defaults={},e.withConverter=c,e}return c(function(){})});
;(function(){var a,b,c,d,e,f,g,h,i,j,k,l;$(function(){return $("body").on("click",".checklist:not([readonly]) li:not([readonly])",function(){return"true"===$(this).attr("aria-checked")||"true"===$(this).attr("data-checked")||"checked"===$(this).attr("checked")||$(this).hasClass("checked")||$(this).hasClass("completed")?$(this).attr("aria-checked","false"):$(this).attr("aria-checked","true"),$(this).removeClass("checked completed").removeAttr("data-checked").removeAttr("checked")})}),$(function(){return $("body").on("click",".dismissible",function(){var a=this;return $(this).addClass("dismiss animated"),setTimeout(function(){return $(a).hide(250,function(){return $(this).remove()})},1e3)})}),$(window).on("load resize",function(){return h()}),h=function(){return $(".row.equalize").each(function(){var a,b,c;return a=$(this),c=0,b=!1,a.children().each(function(){var d;d=$(this),d.css("minHeight","1px"),b=d.outerWidth()===a.outerWidth(),b||(d.hasClass("equal")||d.addClass("equal"),d.outerHeight()>c&&(c=d.outerHeight()))}),b?void 0:a.children().css("min-height",c)})},$(function(){var a;a=$("body"),a.on("click",[".error input",".error textarea",".invalid input",".invalid textarea","input.error","textarea.error ","input.invalid","textarea.invalid "].join(","),function(){return $(this).focus().select()}),$(".select select").each(function(){var a;a=$(this),""===a.children("option").first().val()&&a.children("option").first().attr("selected")?a.addClass("unselected"):a.removeClass("unselected")}),a.on("change",".select select",function(){var a;a=$(this),""===a.children("option").first().val()&&a.children("option").first().attr("selected")?a.addClass("unselected"):a.removeClass("unselected")})}),$(function(){var a;return a=$("body"),$(".dropdown").each(function(){return"true"!==$(this).attr("aria-pressed")?($(this).attr("aria-pressed","false"),$(this).children("ul").attr({"aria-expanded":"false","aria-hidden":"true",role:"menu"})):void 0}),a.on("dropdown",function(a){var b;return b=$(a.target),$(".dropdown").not(b).attr("aria-pressed","false"),$(".dropdown").children("ul").attr({"aria-expanded":"false","aria-hidden":"true"}),b.attr("aria-pressed","true"===b.attr("aria-pressed")?"false":"true"),b.children("ul").attr({"aria-expanded":"true"===b.attr("aria-pressed")?"true":"false","aria-hidden":"true"===b.attr("aria-pressed")?"false":"true"})}),a.on("click",".dropdown",function(a){var b;return b=$(a.currentTarget),b.is("a")||b.is("button")||a.stopPropagation(),b.hasClass("focused")?b.removeClass("focused"):b.trigger("dropdown")}),a.on("click",function(){var a;return a=$('.dropdown[aria-pressed="true"]'),a.length?a.attr("aria-pressed","false"):void 0}),a.on("focusout",".dropdown li:last-child a, .dropdown li:last-child button",function(){return $('.dropdown[aria-pressed="true"]').attr("aria-pressed","false")})}),i=0,window.delayMenuClose="",window.delayNavigationClose="",a=function(){function a(a){this.index=i++,this.el=$(a),this.init()}return a.prototype.init=function(){return this.defaultLabel(),this.setupMarkers(),this.hamburgerHelper()},a.prototype.defaultLabel=function(){return void 0===this.el.attr("title")?this.el.attr("title","Menu"):void 0},a.prototype.setupMarkers=function(){return this.el.find("li").each(function(){return $(this).find("ul").length?$(this).attr("role","menu"):void 0})},a.prototype.hamburgerHelper=function(){return this.el.prepend('<button class="hamburger"></button>')},a}(),$(function(){var b,c,d;return b=function(){return $("body").on("mouseenter",'.nav li[role="menu"]',function(a){return $(this).parents(".nav").find("button.hamburger").is(":visible")?void 0:(clearTimeout(window.delayMenuClose),$(this).siblings().find('ul[aria-expanded="true"]').attr("aria-expanded","false"),$(a.target).parents('li[role="menu"]').children("ul").attr("aria-expanded","true"))}),$("body").on("mouseleave",'.nav li[role="menu"]',function(){var a=this;return $(this).parents(".nav").find("button.hamburger").is(":visible")?void 0:window.delayMenuClose=setTimeout(function(){return $(a).find('ul[aria-expanded="true"]').attr("aria-expanded","false")},500)})},d=function(){return $("body").on("click",'.nav li[role="menu"] > a, .nav li[role="menu"] > button',function(a){var b,c;return b=$(this).siblings("ul"),c=$(this).parent('[role="menu"]'),"true"!==b.attr("aria-expanded")?b.attr("aria-expanded","true"):(b.attr("aria-expanded","false"),b.find('[aria-expanded="true"]').attr("aria-expanded","false")),"true"!==c.attr("aria-pressed")?c.attr("aria-pressed","true"):(c.attr("aria-pressed","false"),c.find('[aria-pressed="true"]').attr("aria-pressed","false"),c.find('[aria-expanded="true"]').attr("aria-expanded","false")),a.preventDefault()}),$("body").on("click",".nav button.hamburger",function(a){var b;return b=$(this).siblings("ul"),"true"!==b.attr("aria-expanded")?b.attr("aria-expanded","true"):(b.attr("aria-expanded","false"),b.find('[aria-pressed="true"]').attr("aria-pressed","false"),b.find('[aria-expanded="true"]').attr("aria-expanded","false")),a.preventDefault()})},c=[],$(".nav").each(function(){return c.push(new a(this))}),d(),Modernizr.touch?void 0:b()}),$(function(){var a,b,c,d;return $(".tabs").each(function(){var a,b;return a=$(this).children("ul").children("li.active"),a.length?(b=a.parents(".tabs"),b.find(a.attr("aria-controls")).addClass("active")):($(this).children("ul").children("li").first().addClass("active"),$(this).children("div").first().addClass("active"))}),$("body").on("click",".tabs > ul li",function(a){var b,c;return b=$(this).addClass("active"),c=b.parents(".tabs"),b.siblings("li").removeClass("active"),c.find("> div, > ul > div").hide(),c.find(b.attr("aria-controls")).show(),a.preventDefault()}),d=function(){var a;return a=$(window).width(),480>=a?(c(".tabs.accordion.mobile"),b(".tabs:not(.accordion):not(.mobile)")):768>a?(c(".tabs.accordion.mobile, .tabs.accordion.small-tablet"),b(".tabs:not(.accordion):not(.mobile):not(.small-tablet)")):1024>=a?(c(".tabs.accordion.mobile, .tabs.accordion.small-tablet, .tabs.accordion.ipad"),b(".tabs:not(.accordion):not(.mobile):not(.small-tablet):not(.ipad)")):a>1024?c(".tabs.accordion"):void 0},b=function(a){return a=$(a),a.each(function(){var a;return a=$(this),a.addClass("accordion"),a.find("> div").each(function(){var b;return b=$(this).clone(),a.find('li[aria-controls="#'+b.attr("id")+'"]').after(b),$(this).remove()})})},c=function(b){return $(b).each(function(){var b;return b=$(this),b.removeClass("accordion"),b.hasClass("vertical")&&a(b),b.children("ul").children("div").each(function(){var a;return a=$(this).clone(),b.append(a),$(this).remove()})})},a=function(a){return a=$(a),a.length||(a=$(".tabs.vertical")),a.each(function(){return $(this).hasClass("vertical")&&($(this).children("ul").css({"min-height":"0px"}),!$(this).hasClass("accordion"))?($(this).children('[role="tabpanel"]').css({"padding-left":$(this).children("ul").width()+10+"px"}),$(this).children("ul").css({"min-height":$(this).height()+"px"})):void 0})},$(window).resize(function(){return clearTimeout(window.delayedAdjustTabs),window.delayedAdjustTabs=setTimeout(function(){return d(),a()},50)}),$(window).load(function(){return d(),a()})}),function(a){return a.fn.placeholderText=function(b){var c,d,e;return a.fn.placeholderText.defaults={type:"paragraphs",amount:"1",html:!0,punctuation:!0},d=a.extend({},a.fn.placeholderText.defaults,b),e=new Array(10),e[0]="Nam quis nulla. Integer malesuada. In in enim a arcu imperdiet malesuada. Sed vel lectus. Donec odio urna, tempus molestie, porttitor ut, iaculis quis, sem. Phasellus rhoncus. Aenean id metus id velit ullamcorper pulvinar. Vestibulum fermentum tortor id mi. Pellentesque ipsum. Nulla non arcu lacinia neque faucibus fringilla. Nulla non lectus sed nisl molestie malesuada. Proin in tellus sit amet nibh dignissim sagittis. Vivamus luctus egestas leo. Maecenas sollicitudin. Nullam rhoncus aliquam metus. Etiam egestas wisi a erat.",e[1]="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Aliquam erat volutpat. Nunc auctor. Mauris pretium quam et urna. Fusce nibh. Duis risus. Curabitur sagittis hendrerit ante. Aliquam erat volutpat. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Duis condimentum augue id magna semper rutrum. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Proin pede metus, vulputate nec, fermentum fringilla, vehicula vitae, justo. Fusce consectetuer risus a nunc. Aliquam ornare wisi eu metus. Integer pellentesque quam vel velit. Duis pulvinar.",e[2]="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi gravida libero nec velit. Morbi scelerisque luctus velit. Etiam dui sem, fermentum vitae, sagittis id, malesuada in, quam. Proin mattis lacinia justo. Vestibulum facilisis auctor urna. Aliquam in lorem sit amet leo accumsan lacinia. Integer rutrum, orci vestibulum ullamcorper ultricies, lacus quam ultricies odio, vitae placerat pede sem sit amet enim. Phasellus et lorem id felis nonummy placerat. Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu, orci. Aenean vel massa quis mauris vehicula lacinia. Quisque tincidunt scelerisque libero. Maecenas libero. Etiam dictum tincidunt diam. Donec ipsum massa, ullamcorper in, auctor et, scelerisque sed, est. Suspendisse nisl. Sed convallis magna eu sem. Cras pede libero, dapibus nec, pretium sit amet, tempor quis, urna.",e[3]="Etiam posuere quam ac quam. Maecenas aliquet accumsan leo. Nullam dapibus fermentum ipsum. Etiam quis quam. Integer lacinia. Nulla est. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Integer vulputate sem a nibh rutrum consequat. Maecenas lorem. Pellentesque pretium lectus id turpis. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Fusce wisi. Phasellus faucibus molestie nisl. Fusce eget urna. Curabitur vitae diam non enim vestibulum interdum. Nulla quis diam. Ut tempus purus at lorem.",e[4]="In sem justo, commodo ut, suscipit at, pharetra vitae, orci. Duis sapien nunc, commodo et, interdum suscipit, sollicitudin et, dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam id dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris dictum facilisis augue. Fusce tellus. Pellentesque arcu. Maecenas fermentum, sem in pharetra pellentesque, velit turpis volutpat ante, in pharetra metus odio a lectus. Sed elit dui, pellentesque a, faucibus vel, interdum nec, diam. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Etiam ligula pede, sagittis quis, interdum ultricies, scelerisque eu, urna. Nullam at arcu a est sollicitudin euismod. Praesent dapibus. Duis bibendum, lectus ut viverra rhoncus, dolor nunc faucibus libero, eget facilisis enim ipsum id lacus. Nam sed tellus id magna elementum tincidunt.",e[5]="Morbi a metus. Phasellus enim erat, vestibulum vel, aliquam a, posuere eu, velit. Nullam sapien sem, ornare ac, nonummy non, lobortis a, enim. Nunc tincidunt ante vitae massa. Duis ante orci, molestie vitae, vehicula venenatis, tincidunt ac, pede. Nulla accumsan, elit sit amet varius semper, nulla mauris mollis quam, tempor suscipit diam nulla vel leo. Etiam commodo dui eget wisi. Donec iaculis gravida nulla. Donec quis nibh at felis congue commodo. Etiam bibendum elit eget erat.",e[6]="Praesent in mauris eu tortor porttitor accumsan. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Aenean fermentum risus id tortor. Integer imperdiet lectus quis justo. Integer tempor. Vivamus ac urna vel leo pretium faucibus. Mauris elementum mauris vitae tortor. In dapibus augue non sapien. Aliquam ante. Curabitur bibendum justo non orci.",e[7]="Morbi leo mi, nonummy eget, tristique non, rhoncus non, leo. Nullam faucibus mi quis velit. Integer in sapien. Fusce tellus odio, dapibus id, fermentum quis, suscipit id, erat. Fusce aliquam vestibulum ipsum. Aliquam erat volutpat. Pellentesque sapien. Cras elementum. Nulla pulvinar eleifend sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque porta. Vivamus porttitor turpis ac leo.",e[8]="Maecenas ipsum velit, consectetuer eu, lobortis ut, dictum at, dui. In rutrum. Sed ac dolor sit amet purus malesuada congue. In laoreet, magna id viverra tincidunt, sem odio bibendum justo, vel imperdiet sapien wisi sed libero. Suspendisse sagittis ultrices augue. Mauris metus. Nunc dapibus tortor vel mi dapibus sollicitudin. Etiam posuere lacus quis dolor. Praesent id justo in neque elementum ultrices. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. In convallis. Fusce suscipit libero eget elit. Praesent vitae arcu tempor neque lacinia pretium. Morbi imperdiet, mauris ac auctor dictum, nisl ligula egestas nulla, et sollicitudin sem purus in lacus.",e[9]="Aenean placerat. In vulputate urna eu arcu. Aliquam erat volutpat. Suspendisse potenti. Morbi mattis felis at nunc. Duis viverra diam non justo. In nisl. Nullam sit amet magna in magna gravida vehicula. Mauris tincidunt sem sed arcu. Nunc posuere. Nullam lectus justo, vulputate eget, mollis sed, tempor sed, magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam neque. Curabitur ligula sapien, pulvinar a, vestibulum quis, facilisis vel, sapien. Nullam eget nisl. Donec vitae arcu.",c=function(c){var f,g,h,i,j,k,l,m,n,o,p,q;for(b={type:"undefined"!==a(c).data("placeholderType")?a(c).data("placeholderType"):void 0,amount:"undefined"!==a(c).data("placeholderAmount")?a(c).data("placeholderAmount"):void 0,html:"undefined"!==a(c).data("placeholderHtml")?a(c).data("placeholderHtml"):void 0,punctuation:"undefined"!==a(c).data("placeholderPunctuation")?a(c).data("placeholderPunctuation"):void 0},d=a.extend({},a.fn.placeholderText.defaults,b),f=d.amount,n="",g=0;f>g;)o=Math.floor(10*Math.random()),d.html&&(n+="<p>"),n+=e[o],d.html&&(n+="</p>"),n+="\n\n",g++;switch(d.type){case"words":for(l=d.amount,l=parseInt(l),j=new Array,q=new Array,q=n.split(" "),h=0,i=0;j.length<l;)i>q.length&&(i=0,h++,h+1>e.length&&(h=0),q=e[h].split(" "),q[0]="\n\n"+q[0]),j.push(q[i]),i++;n=j.join(" ");break;case"characters":for(m="",k=d.amount,k=parseInt(k),p=e.join("\n\n");m.length<k;)m+=p;n=m.substring(0,k);break;case"paragraphs":}return d.punctuation||(n=n.replace(",","").replace(".","")),n},this.each(function(){var b,d;return b=a(this),d=c(this),b.html(d)})}}(jQuery),$(function(){return $(".placeholderText").placeholderText()}),e=[],j=0,b=function(){function a(a){this.index=j++,this.el=a,this.compression=$(this.el).data("compression")||5,this.minFontSize=$(this.el).data("min")||10,this.maxFontSize=$(this.el).data("max")||Number.POSITIVE_INFINITY,this.width=$(this.el).data("width")||"100%",this.height=$(this.el).data("height")||"auto",this.adjustParents=$(this.el).data("adjust-parents")||!0,this.styled=$(this.el).data("styled")||!0,this.columns=$("tbody tr",$(this.el)).first().find("th, td").length,this.rows=$("tbody tr",$(this.el)).length,this.init()}return a.prototype.init=function(){return this.setupTable(),this.adjustOnLoad(),this.adjustOnResize()},a.prototype.fontSize=function(){var a;return a="auto"===this.height?$("tbody td",$(this.el)).first().width()/this.compression:$(this.el).height()/this.rows/this.compression,Math.min(this.maxFontSize,Math.max(a,this.minFontSize))},a.prototype.setupTable=function(){return $(this.el).css("width",this.width),"auto"!==this.height&&$(this.el).css("height",this.height),$("th, td",$(this.el)).css("width",100/this.columns+"%"),this.styled&&$(this.el).addClass("responsiveTable"),"auto"!==this.height&&($("th, td",$(this.el)).css("height",100/this.rows+"%"),this.adjustParents&&$(this.el).parents().each(function(){return $(this).css("height","100%")})),$(this.el).css("font-size",this.fontSize())},a.prototype.resizeTable=function(){return $(this.el).css("font-size",this.minFontSize).css("font-size",this.fontSize())},a.prototype.adjustOnLoad=function(){var a=this;return $(window).on("load",function(){return a.resizeTable()})},a.prototype.adjustOnResize=function(){var a=this;return $(window).on("resize",function(){return clearTimeout(e[a.index]),e[a.index]=setTimeout(function(){return a.resizeTable()},20)})},a}(),function(a){var c;return c=[],a.fn.responsiveTables=function(){return this.each(function(){return c.push(new b(this))})}}(jQuery),$(document).ready(function(){return $("table.responsive").responsiveTables()}),f=[],k=0,c=function(){function a(a){this.index=k++,this.el=a,this.compression=$(this.el).data("compression")||10,this.minFontSize=$(this.el).data("min")||Number.NEGATIVE_INFINITY,this.maxFontSize=$(this.el).data("max")||Number.POSITIVE_INFINITY,this.scrollable=$(this.el).data("scrollable")||!1,this.scrollSpeed=$(this.el).data("scrollspeed")||650,this.scrollReset=$(this.el).data("scrollreset")||200,this.init()}return a.prototype.init=function(){return $(this.el).wrapInner('<span class="responsiveText-wrapper" />'),this.adjustOnLoad(),this.adjustOnResize(),this.scrollable?this.scrollOnHover():void 0},a.prototype.resizeText=function(){return $(this.el).css("font-size",Math.floor(Math.max(Math.min($(this.el).width()/this.compression,this.maxFontSize),this.minFontSize)))},a.prototype.adjustOnLoad=function(){var a=this;return $(window).on("load",function(){return a.resizeText()})},a.prototype.adjustOnResize=function(){var a=this;return $(window).on("resize",function(){return clearTimeout(f[a.index]),f[a.index]=setTimeout(function(){return a.resizeText()},20)})},a.prototype.scrollOnHover=function(){var a=this;return $(this.el).css({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),$(this.el).hover(function(){return a.difference=a.el.scrollWidth-$(a.el).width(),a.difference>a.scrollSpeed&&(a.scrollSpeed=a.difference),a.difference>0?($(a.el).css("cursor","e-resize"),$(a.el).stop().animate({"text-indent":-a.difference},a.scrollSpeed,function(){return $(a.el).css("cursor","text")})):void 0},function(){return $(a.el).stop().animate({"text-indent":0},a.scrollReset)})},a}(),function(a){var b;return b=[],a.fn.responsiveText=function(){return this.each(function(){return b.push(new c(this))})}}(jQuery),$(document).ready(function(){return $(".responsive").not("table").responsiveText()}),g=[],l=0,d=function(){function a(a){this.el=a,this.index=l++,this.text=$(this.el).text(),$(this.el).attr("data-text",this.text),this.words=this.text.trim().split(" "),this.lines=parseInt($(this.el).attr("data-truncate")),this.truncate(),this.adjustOnResize()}return a.prototype.truncate=function(){return this.measure(),this.setContent()},a.prototype.reset=function(){return $(this.el).text(this.text).css("max-height","none").attr("data-truncated","false")},a.prototype.measure=function(){var a;for(this.reset(),$(this.el).html("."),this.singleLineHeight=$(this.el).outerHeight(),a=1;a++<this.lines;)$(this.el).append("<br>.");return this.maxLinesHeight=$(this.el).outerHeight()},a.prototype.empty=function(){return $(this.el).html("")},a.prototype.setContent=function(){var a;return this.reset(),a=!1,this.addWords(this.words.length),this.tooBig()?(this.addNumberWordsThatFit(),$(this.el).css("max-height",this.maxLinesHeight+"px"),$(this.el).attr("data-truncated",!0)):void 0},a.prototype.addNumberWordsThatFit=function(){var a,b,c;for(b=this.words.length,a=0,c=Math.floor(this.words.length/2);a+1!==b;)this.addWords(a+c),this.tooBig()?b=a+c:a+=c,c=Math.floor(c/2)||1;return this.addWords(a),$(this.el).html(this.trimTrailingPunctuation($(this.el).html()))},a.prototype.addWords=function(a){return $(this.el).html(this.words.slice(0,a).join(" "))},a.prototype.tooBig=function(){return $(this.el).outerHeight()>this.maxLinesHeight},a.prototype.adjustOnResize=function(){var a=this;return $(window).on("resize",function(){return clearTimeout(g[a.index]),g[a.index]=setTimeout(function(){return a.truncate()},20)})},a.prototype.trimTrailingPunctuation=function(a){return a.replace(/(,$)|(\.$)|(\:$)|(\;$)|(\?$)|(\!$)/g,"")},a}(),function(a){var b,c;return b=!1,c=[],a.fn.truncateLines=function(){return b||a("head").append('<style type="text/css"> [data-truncated="true"] { overflow: hidden; } [data-truncated="true"]:after { content: "..."; position: absolute; } </style>'),this.each(function(){return c.push(new d(this))})}}(jQuery),$(window).load(function(){})}).call(this);
;/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};

;function nPolterPopUp(strona,image,width,height)
{if(height>650)
{height=650;width=parseInt(width)+20;scrollbar='yes';}else scrollbar='no';var left=(screen.width-parseInt(width))/2;left=parseInt(left);if(navigator.appName!='Opera')
var top=(screen.height-parseInt(height))/2;else
var top=(document.body.clientHeight-parseInt(height))/2;top=parseInt(top);window.open(strona+image+",gfx.html","nPolterBigPic","toolbar=no,menubar=no,personalbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrollbar+",resizable=no,fullscreen=no,channelmode=no,width="+width+",height="+height+",top="+top+",left="+left);}
function karta_mtg(nazwakarty){window.open("http://gatherer.wizards.com/Pages/Search/Default.aspx?name="+nazwakarty.replace('_','%5D+%5B'),"Podglad_karty","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width=800,height=500,left=100,top=100");}
function karta_wow(nazwakarty){window.open("http://www.wowtcgvault.com/ViewCard_Popup.aspx?CardName="+nazwakarty,"Podglad_karty","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width=675,height=500,left=100,top=100");}
function nPlink(id)
{window.location=$(id).href;}
var Cookie={set:function(name,value,daysToExpire){var path=';  path=/';var expire='';if(daysToExpire!=undefined){var d=new Date();d.setTime(d.getTime()+(86400000*parseFloat(daysToExpire)));expire='; expires='+d.toGMTString();}
return(document.cookie=escape(name)+'='+escape(value||'')+expire+path);},get:function(name){var cookie=document.cookie.match(new RegExp('(^|;)\\s*'+escape(name)+'=([^;\\s]*)'));return(cookie?unescape(cookie[2]):null);},erase:function(name){var cookie=Cookie.get(name)||true;Cookie.set(name,'',-1);return cookie;},accept:function(){if(typeof navigator.cookieEnabled=='boolean'){return navigator.cookieEnabled;}
Cookie.set('_test','1');return(Cookie.erase('_test')==='1');}};function dodajLista(typ,nota_id)
{let noty_text;$.post('/lista/create.html',{'Lista[typ]':typ,'Lista[nota_id]':nota_id,YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},function(data){if(data=='OK')
{$('#lista_'+typ+'_ico').attr('src','https://static.polter.pl/tplimg/icons/lista_usun.png');noty_text="Pozycja dodana do listy";ga('send','event','Noty','Dodanie noty do listy');}
else if(data=='UNDO')
{$('#lista_'+typ+'_ico').attr('src','https://static.polter.pl/tplimg/icons/lista_dodaj.png');noty_text="Pozycja usunięta z listy";ga('send','event','Noty','Usunięcie noty z listy');}
noty({"text":noty_text,"layout":"top","type":"alert","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});});return false;}
function polecNotke(id)
{$.post('/polecenie/create.html',{'Polecenie[typ]':'blog','Polecenie[item_id]':id,YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},function(data){if(data=='SELF')
noty({"text":"Nie możesz polecać własnej notki!","layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});else
{$('#polecenia').html(data);ga('send','event','Blogi','Polecenie notki blogowej');}});return false;}
function polecArtykul(id)
{$.post('/polecenie/create.html',{'Polecenie[typ]':'art','Polecenie[item_id]':id,YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},function(data){if(data=='SELF')
noty({"text":"Nie możesz polecać własnego artykułu!","layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});else
{$('#polecenia').html(data);ga('send','event','Artykuły','Polecenie artykułu');}});return false;}
function dodawanieZdjec(nota_id){new Ajax_upload('#dodajGaleria',{action:'/galeriaZdjecie/create.html',name:'plik',data:{'GaleriaZdjecie[nota_id]':nota_id,YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},onSubmit:function(file,ext){if(ext&&/^(jpg|png|jpeg|gif)$/.test(ext)){noty({"text":"Wgrywanie "+file,"layout":"top","type":"alert","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});}else{noty({"text":"Dozwolone są wyłącznie pliki graficzne","layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});return false;}},onComplete:function(file,response){if(response=='OK')
{noty({"text":"Wgrano "+file,"layout":"top","type":"alert","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});}
else
noty({"text":"Wystąpił błąd podczas wgrywania pliku."+response,"layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});}});}
function usunKomentarz(id)
{if(confirm('Czy na pewno usunąć ten komentarz?'))
{$.post('/komentarz/delete/ajax/true/id/'+id+'.html',{YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},function(){$('#komentarz'+id).hide();});}
return false;}
function polecKomentarz(id)
{$.get('/komentarz/polec.html',{id:id,},function(data){if(data=='SELF')
alert('Nie możesz polecać własnego komentarza.');else
{$('#koment_'+id+'_ocena').html('+'+data);ga('send','event','Komentarze','Polecenie komentarza');}});return false;}
function ocenaNotyHover(i)
{$('#twoja_ocena').html(i);if(i==0)$('#twoja_ocena').html('-');for(var n=1;n<=20;n++)
{if(n<=i*2)$('#ocena_el'+n).addClass('ocena_el_hover');else $('#ocena_el'+n).removeClass('ocena_el_hover');}}
function ocenNote(id,o)
{$.post('/nota/ocen.html',{'NotaOcena[nota_id]':id,'NotaOcena[ocena]':o,YII_CSRF_TOKEN:document.getElementsByName('YII_CSRF_TOKEN')[0].value},function(data){if(data=='LOGIN')
{noty({"text":"Musisz się zalogować!","layout":"top","type":"alert","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});}
else
{data=data.split(';');$('#ocena_srednia').html(data[0]);$('#ocena_liczba').html(data[1]);noty({"text":"Ocena została zapisana.","layout":"top","type":"alert","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":"5000","closable":true,"closeOnSelfClick":true});window.ocena=o;ocenaNotyHover(o);ga('send','event','Noty','Dodanie oceny');}});}
function trollKomentarz(id)
{var odp=confirm("Funkcja ta służy do oznaczania komentarzy będących przykładem trollowania - obraźliwych, mających na celu wywołanie sporu lub w inny sposób łamiących regulamin. Zabronione jest używanie tej funkcji w stosunku do komentarzy nie spełniających tych warunków.\n\nPo użyciu tej funkcji Twój login będzie publicznie widoczny na liście osób, które oznaczyły komentarz jako przykład trollowania.");if(odp)
{$.get('/komentarz/troll.html',{id:id,},function(data){if(data=='SELF')
alert('Nie możesz zgłosić własnego komentarza.');else if(data=='UNDO')
{$('#koment_'+id+'_tresc').slideDown();$('#koment_'+id+'_pokaz').hide();$('#koment_'+id+'_kto_ukryl').html('');ga('send','event','Komentarze','Usunięcie oznaczenia jako troll');}
else
{$('#koment_'+id+'_tresc').slideUp();$('#koment_'+id+'_pokaz').show();ga('send','event','Komentarze','Oznaczenie jako troll');}});}
return false;}
function ktoPolecaKomentarz(id)
{$.get('/komentarz/ktoPoleca.html',{id:id,},function(data){$('#koment_'+id+'_kto_poleca').html(data);});return false;}
function ktoUkrylKomentarz(id)
{$.get('/komentarz/ktoUkryl.html',{id:id,},function(data){$('#koment_'+id+'_kto_ukryl').html(data);});return false;}
var cur_promo=1;var promo_lock=0;function toggle_promo(id)
{if(cur_promo!=id)
{for(i=1;i<=5;i++)
{$('#promobox_img'+i).hide();}
$('#promobox_img'+cur_promo).fadeOut();$('#promobox_img'+id).fadeIn();$('#promobox_sidebar'+cur_promo).removeClass('promoitem_act');$('#promobox_sidebar'+id).addClass('promoitem_act');cur_promo=id;}
return false;}
function auto_toggle_promo()
{if(promo_lock==0)
{if(cur_promo<5)toggle_promo(cur_promo+1);else toggle_promo(1);}}
var Cookie={set:function(name,value,daysToExpire){var path=';  path=/;domain=polter.pl';var expire='';if(daysToExpire!=undefined){var d=new Date();d.setTime(d.getTime()+(86400000*parseFloat(daysToExpire)));expire='; expires='+d.toGMTString();}
return(document.cookie=escape(name)+'='+escape(value||'')+expire+path);},get:function(name){var cookie=document.cookie.match(new RegExp('(^|;)\\s*'+escape(name)+'=([^;\\s]*)'));return(cookie?unescape(cookie[2]):null);},erase:function(name){var cookie=Cookie.get(name)||true;Cookie.set(name,'',-1);return cookie;},accept:function(){if(typeof navigator.cookieEnabled=='boolean'){return navigator.cookieEnabled;}
Cookie.set('_test','1');return(Cookie.erase('_test')==='1');}};function switchtpl(tpl)
{$('#tplcss').attr('href','https://static.polter.pl/css/'+tpl+'.css');Cookie.set('tplcss',tpl,365);return false;}
function hideCookieInfo()
{Cookie.set('cookieInfo','hidden',356);$('#cookieInfo').hide();return false;};(function($){$.fn.unveil=function(threshold){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded,inview,source;this.one("unveil",function(){source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source)this.setAttribute("src",source);});function unveil(){inview=images.filter(function(){var $e=$(this),wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("unveil");images=images.not(loaded);}$w.scroll(unveil);$w.resize(unveil);unveil();return this;};})(jQuery);$(document).ready(function(){$("img").unveil();$('.imageWrapper[data-src] .imgPlaceholder > div').replaceWith(function(){var p=this.parentElement.parentElement;return'<img src="'+p.getAttribute('data-src')+'" width="'+p.getAttribute('data-width')+'" height="'+p.getAttribute('data-height')+'"'+(p.hasAttribute('alt')?' alt="'+p.getAttribute('alt')+'"':'')+'/>';});});function mcnCallback(){$('.mcn-guest-wrapper .mcn-guest-help').addClass('hidden');};(function($){$.noty=function(options){var base=this;base.init=function(){base.options=$.extend({},$.noty.defaultOptions,options);if(base.options.layout!='topLeft'&&base.options.layout!='topRight'){if(base.options.force){$.noty.queue.unshift({options:base.options});}else{$.noty.queue.push({options:base.options});}
base.render();$.noty.available=false;}else{$.noty.available=true;base.render({options:base.options});}};base.render=function(noty){if($.noty.available){var notification=(jQuery.type(noty)==='object')?noty:$.noty.queue.shift();if(jQuery.type(notification)==='object'){if(notification.options.layout=="topLeft"||notification.options.layout=="topRight"){if($("ul.noty_container."+notification.options.layout).length>0){base.$noty_container=$("ul.noty_container."+notification.options.layout);}else{base.$noty_container=$('<ul/>').addClass('noty_container').addClass(notification.options.layout);$("body").prepend(base.$noty_container);}
base.$notyContainer=$('<li/>');base.$noty_container.prepend(base.$notyContainer);}else{base.$notyContainer=$("body");}
base.$bar=$('<div/>').addClass('noty_bar');base.$message=$('<div/>').addClass('noty_message');base.$text=$('<div/>').addClass('noty_text');base.$close=$('<div/>').addClass('noty_close');base.$message.append(base.$text).append(base.$close);base.$bar.append(base.$message);var $noty=base.$bar;$noty.data('noty_options',notification.options);$noty.addClass(notification.options.layout).addClass(notification.options.type).addClass(notification.options.theme);$noty.find('.noty_text').html(notification.options.text).css({textAlign:notification.options.textAlign});(notification.options.closable)?$noty.find('.noty_close').show():$noty.find('.noty_close').remove();$noty.find('.noty_close').bind('click',function(){$noty.trigger('noty.close');});if(notification.options.closeOnSelfClick){$noty.find('.noty_message').bind('click',function(){$noty.trigger('noty.close');}).css('cursor','pointer');}
if(notification.options.modal){$('<div />').addClass('noty_modal').prependTo($('body')).css(notification.options.modalCss).fadeIn('fast');}
base.$notyContainer.prepend($noty);$noty.one('noty.close',function(event,callback){var options=$noty.data('noty_options');if(options.modal){$('.noty_modal').fadeOut('fast',function(){$(this).remove();});}
$noty.stop().animate($noty.data('noty_options').animateClose,$noty.data('noty_options').speed,$noty.data('noty_options').easing,$noty.data('noty_options').onClose).promise().done(function(){if(options.layout=='topLeft'||options.layout=='topRight'){$noty.parent().remove();}else{$noty.remove();}
if($.isFunction(callback)){callback.apply();}
if(options.layout!='topLeft'&&options.layout!='topRight'){$.noty.available=true;base.render();}});});if(notification.options.buttons){$buttons=$('<div/>').addClass('noty_buttons');$noty.find('.noty_text').append($buttons);$.each(notification.options.buttons,function(i,button){bclass=(button.type)?button.type:'gray';$('<button/>').addClass(bclass).html(button.text).appendTo($noty.find('.noty_buttons')).one("click",function(){$noty.trigger('noty.close',button.click);});});}
$noty.animate(notification.options.animateOpen,notification.options.speed,notification.options.easing,notification.options.onShow);if(notification.options.timeout){$noty.delay(notification.options.timeout).promise().done(function(){$noty.trigger('noty.close');});}}}};base.init();};$.noty.queue=[];$.noty.clearQueue=function(){$.noty.queue=[];};$.noty.close=function(){$('.noty_bar:first').trigger('noty.close');};$.noty.closeAll=function(){$.noty.clearQueue();$('.noty_bar').trigger('noty.close');};$.noty.available=true;$.noty.defaultOptions={layout:"top",theme:"default",animateOpen:{height:'toggle'},animateClose:{height:'toggle'},easing:'swing',text:"null",textAlign:"center",type:"alert",speed:500,timeout:5000,closable:true,closeOnSelfClick:true,force:false,onShow:false,onClose:false,buttons:false,modal:false,modalCss:{'opacity':0.6}};$.fn.noty=function(options){return new $.noty(options);};})(jQuery);function noty(options){jQuery.fn.noty(options);}