function fmt(format,data){data=arguments.length==2&&typeof data==="object"?data:[].slice.call(arguments,1);return format.replace(/\{\{/g,String.fromCharCode(0)).replace(/\}\}/g,String.fromCharCode(1)).replace(/\{([^{}]*)\}/g,function(match,key_name){return key_name in data?String(data[key_name]):match;}).replace(/\x00/g,"{").replace(/\x01/g,"}");}
jQuery.extend(jQuery.i18n,{fmt:function(format){var data=[].slice.call(arguments,1);return format.replace(/\{\{/g,String.fromCharCode(0)).replace(/\}\}/g,String.fromCharCode(1)).replace(/\{([^{}]*)\}/g,function(match,key){var idx=parseInt(key);return isNaN(idx)?jQuery.i18n.prop(key):data[idx];}).replace(/\x00/g,"{").replace(/\x01/g,"}");},list:function(items){if(items.length>1){return items.slice(0,-1).join(", ")+" "+$.i18n.prop("portfolio.main.filter.and")+" "+items.slice(-1)[0];}
else if(items.length==1){return items[0];}
else{return"";}}});function portfolioOpener(){var href="http://"+location.host+"/portfolio/main.html";window.open(href);self.close();return false;}
(function($){$.fn.batch=function(method,args){var func=$.fn[method],results=[];this.each(function(){results.push(func.apply($(this),args));});return results;};var funcs="attr css=styles prop html text val offset width height".split(" ");$.each(funcs,function(i,v){var names=v.indexOf("=")==-1?[v,v+"s"]:v.split("="),cur_method=names[0],batch_method=names[1];if($.fn[cur_method]&&!$.fn[batch_method]){$.fn[batch_method]=function(){return this.batch(cur_method,arguments);}}});})(jQuery);jQuery.fn.extend({slideFadeToggle:function(easing,callback){return this.animate({opacity:'toggle',height:'toggle'},'fast',easing,callback);},center:function(){return this.css({position:"absolute",top:"210px",left:($(window).width()-this.width())/2+$(window).scrollLeft()+"px"});},processing:function(code){code=code||"portfolio.shared.processing";return this.append($.i18n.fmt("<div id='popup_processing' class='popup_processing'>{"+code+"}</div>"));}});function enableExpandables(){jQuery(".expandable dd").hide();jQuery(".expandable dt").addClass("collapsed").each(function(){setExpandableStyleClass(this);}).click(function(e){clickedThing(e,"dt").next("dd").toggle();setExpandableStyleClass(this);});}
function clickedThing(e,type){var el=jQuery(e.target);if(!el.is(type)){el=el.parents(type).first();}
return el;}
function setExpandableStyleClass(expandableElement){var $el=jQuery(expandableElement),isHidden=$el.next("dd").is(":hidden");if(isHidden){$el.addClass("collapsed").removeClass("expanded");}
else{$el.addClass("expanded").removeClass("collapsed");}}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}
else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}
else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}
else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}
else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}
else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}
else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function do_close(){$('.messagepop').slideFadeToggle().remove();$('#overlay').fadeOut().remove();}
function _closePopUp(callback){callback=callback||do_close;$('.close').live('click',function(ev){callback(ev);});$(document).keypress(function(ev){if(ev.keyCode==27){callback(ev);}});}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments);},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m);})(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');function createGATrackingObject()
{var locHref=location.href;var bmjIdProperties='portfolio.ga.web.property.id.live';var urlRegex=locHref.match(/staging.*.dpipe.bmjgroup.com/gi);if(locHref.indexOf('internal.bmjgroup.com')>-1||locHref.indexOf('external.bmjgroup.com')>-1||urlRegex)
{bmjIdProperties='portfolio.ga.web.property.id.test';}
var gaBMJId=jQuery.i18n.prop(bmjIdProperties);var gaBMJSetting=jQuery.i18n.prop('portfolio.ga.setting');try
{__gaTracker('create',gaBMJId,gaBMJSetting);}
catch(err)
{}}