/*
@author Antoine Goutenoir <antoine@goutenoir.com>
*/
String.implement({prefixIntegers:function(numberOfDigits){if(this.substr(0,1)=='-')return'-'+this.substr(1).prefixIntegers(numberOfDigits);return(Array(numberOfDigits).join('0')+this).slice(-numberOfDigits);},forceDigits:function(numberOfDigits){return this.prefixIntegers(numberOfDigits);}});
;/*
  
  MooModernizr 1.2
  Compatible with Mootools 1.3.2 without backwards compatibility
  
  @author Arian Stolwijk
  @contributor Antoine Goutenoir <antoine@goutenoir.com>
  @license MIT
  
*/

/*
 * Modernizr JavaScript library 1.1
 * http://modernizr.com/
 *
 * Copyright (c) 2009 Faruk Ates - http://farukat.es/
 * Licensed under the MIT license.
 * http://modernizr.com/license/
 *
 * Featuring major contributions by
 * Paul Irish  - http://paulirish.com
 * Ben Alman   - http://benalman.com/
 *
 * Modernizr is a script that will detect native CSS3 and HTML5 features
 * available in the current UA and provide an object containing all
 * features with a true/false value, depending on whether the UA has
 * native support for it or not.
 * 
 * In addition to that, Modernizr will add classes to the <html>
 * element of the page, one for each cutting-edge feature. If the UA
 * supports it, a class like "cssgradients" will be added. If not,
 * the class name will be "no-cssgradients". This allows for simple
 * if-conditionals in CSS styling, making it easily to have fine
 * control over the look and feel of your website.
 * 
 * @author    Faruk Ates
 * @copyright   (2009) Faruk Ates.
 *
 * @contributor   Paul Irish
 * @contributor   Ben Alman
 *
 */
(function(){var m=new Element('mooModernizr'),f=new Element('input'),checkProps=function(prop){var i=0;for(i in prop){if(getCss(prop[i])!=undefined){return prop[i];}}
return false;},getPropsAll=function(prop,extend){var uc_prop=prop.replace(/./,function(a){return a.toUpperCase();}),props=mooModernizr.prefixes.map(function(e){return e+uc_prop;}).include(prop);if(extend){if(typeOf(extend)!='array')extend=[extend];Object.append(props,extend);}
return props;},setCss=function(str){m.style.cssText=str;},setCssAll=function(str1,str2){str1+=';';return setCss(str1
+mooModernizr.prefixes.map(function(pre){return'-'+pre+'-';}).join(str1)
+(str2||''));},getCss=function(prop){prop=prop?prop:'cssText';return(m.style[prop]!=undefined)?m.style[prop]:null;};this.mooModernizr={inputtype:function(type){f.setAttribute('type',type);return!!(f.type!=='text');},prefixes:'o moz Moz ms webkit'.split(' ')};var features=new Hash({canvas:(function(){return!!new Element('canvas').getContext;})()});Object.append(features,{canvastext:!!(features.canvas&&typeof new Element('canvas').getContext('2d').fillText=='function'),geolocation:!!navigator.geolocation,rgba:(function(){setCss('background-color: rgba(150,255,150, .5)');return getCss('backgroundColor').contains('rgba');})(),hsla:(function(){setCss('background-color: hsla(120,40%,100%, .5)');return getCss('backgroundColor').contains('rgba');})(),multiplebgs:(function(){setCss('background: url(m.png), url(a.png), #f99 url(m.png)');return /(url\s*\(.*?){3}/.test(getCss('background'));})(),opacity:(function(){setCss('opacity: .5');return getCss('opacity').contains('0.5');})(),cssgradients:(function(){var str1='background-image:',str2='gradient(linear,left top,right bottom,from(#9f9),to(white));',str3='linear-gradient(left top,#9f9, white);';setCss(str1+str2
+str1+str3
+mooModernizr.prefixes.map(function(pre){return str1+'-'+pre+'-'+str2
+str1+pre+str3;}));return getCss('backgroundImage').contains('gradient');})()});var checkCSS3=function(value){var arr=typeOf(value)=='array'?value:[value];if((arr[1]!=undefined))setCssAll(arr[1]);if(typeOf(arr[0])!='array')arr[0]=[arr[0]];return checkProps(getPropsAll.apply(null,arr[0]));};Object.append(features,new Hash({borderimage:'borderImage',borderradius:'borderRadius',boxshadow:'boxShadow',textshadow:'textShadow',cssanimations:'animationName',csscolumns:'columnCount',cssreflections:'boxReflect',csstransforms:[['Transform','transformProperty']],csstransforms3d:[['Perspective','perspectiveProperty']],csstransitions:'transitionProperty'}).map(checkCSS3));Object.append(features,{video:(function(){var v=new Element('video');var video=v.canPlayType?new Hash():false;if(video){Object.append(video,{ogg:v.canPlayType('video/ogg; codecs="theora, vorbis"'),h264:v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')});return video;}
return false;})(),audio:(function(){var a=new Element('audio');var audio=a.canPlayType?new Hash():false;if(audio){Object.append(audio,{ogg:a.canPlayType('audio/ogg; codecs="vorbis"'),wav:a.canPlayType('audio/wave'),mp3:a.canPlayType('audio/mpeg3;'),m4a:a.canPlayType('audio/x-m4a;')});return audio;}
return false;})(),localstorage:!!('sessionStorage'in window),sessionstorage:!!('sessionStorage'in window),webworkers:!!window.Worker,applicationcache:!!window.applicationCache,offlinedetection:!!navigator.onLine,postmessage:!!window.postMessage,webdatabase:!!window.openDatabase,query:!!(document.querySelector),json:!!(window.JSON),inputtypes:(function(props){var inputs={},supported=false;props.each(function(type){inputs[type]=mooModernizr.inputtype(type);supported=supported||inputs[type];});return supported?inputs:false;})('search tel url email datetime date month week time datetime-local number range color'.split(' ')),inputattributes:(function(props){var attrs={},supported=false;props.each(function(attr){attrs[attr]=!!(attr in f);supported=supported||attrs[attr];});return supported?attrs:false;})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '))});Object.append(Browser.Features,features);setCss('');})();
;window.addEvent('domready',function()
{$('newsPopin').toPopIn({close:'#newsPopin .content .close a',links:'.sidebarNewsletter li a.archiveLink'});$('creditsPopin').toPopIn({close:'#creditsPopin .content .close a',links:'.credits'});});
;/*
  ToPopIn Object
  @author Simon FREMAUX <simon.fremaux@gmail.com>
  @copyright Diplomatic Cover 2011
*/
var ToPopIn=new Class({Implements:[Options],options:{fnShow:function(e){e.preventDefault().stopPropagation();this.element.setStyle('opacity',0).setStyle('display','block').tween('opacity',0,1);},fnHide:function(e){e.preventDefault().stopPropagation();this.element.get('tween')[0].start('opacity',1,0).chain(function()
{this.setStyle('display','none');}.bind(this.element));},links:[],close:[]},element:[],initialize:function(element,options){this.setOptions(options);this.element=toElements(element);if(this.element!=null)
{var aAction=['close','links'];var oItemAction=null,sKeyAction='';for(var i=0,j=aAction.length;i<j;i++)
{sKeyAction=aAction[i];oItemAction=this.options[sKeyAction];oItemAction=toElements(oItemAction);if(oItemAction!=null)
for(var k=0,l=oItemAction.length;k<l;k++)
{oItemAction[k].addEvent('click',(sKeyAction=='close'?this.options.fnHide:this.options.fnShow).bind(this));}
this.options[sKeyAction]=oItemAction;}}}});function toElements(mSelector)
{var aReturn=[];if(typeOf(mSelector)=='string')
aReturn=$$(mSelector);else
if(typeOf(mSelector)=='element')
aReturn=new Elements(new Array(mSelector));if((typeOf(aReturn)=='array'||typeOf(aReturn)=='element')&&aReturn.length==0)
aReturn=null;return aReturn;}
Element.Properties.toPopIn={set:function(options){var oToPopIn=this.retrieve('toPopIn');if(oToPopIn)oToPopIn.destroy();return this.eliminate('toPopIn').store('toPopIn:options',options);},get:function(){var oToPopIn=this.retrieve('toPopIn');if(!oToPopIn){oToPopIn=new ToPopIn(this,this.retrieve('toPopIn:options'));this.store('toPopIn',oToPopIn);}
return oToPopIn;}};Element.implement({toPopIn:function(options){if(options)this.set('toPopIn',options);this.get('toPopIn');return this;}});
