(function($){$.fn.getTwitter=function(options){var o=$.extend({},$.fn.getTwitter.defaults,options);$(this).hide();if(o.showHeading){$(this).append('<h2>'+o.headingText+'</h2>')}$(this).append('<ul id="twitter_update_list"><li></li></ul>');$("ul#twitter_update_list").hide();var pl=$('<p id="'+o.preloaderId+'">'+o.loaderText+'</p>');$(this).append(pl);if(o.showProfileLink){$(this).append('<a id="profileLink" href="http://twitter.com/'+o.userName+'">http://twitter.com/'+o.userName+'</a>')}$(this).show();$.getScript("http://twitter.com/javascripts/blogger.js");$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets,function(){$(pl).remove();if(o.slideIn){$("ul#twitter_update_list").slideDown(1000)}else{$("ul#twitter_update_list").show()}$("ul#twitter_update_list li:first").addClass("firstTweet");$("ul#twitter_update_list li:last").addClass("lastTweet");$("ul#twitter_update_list li a:last").addClass("time")})}})(jQuery);(function($){var style=document.createElement('div').style;var moz=style['MozBorderRadius']!==undefined;var webkit=style['WebkitBorderRadius']!==undefined;var radius=style['borderRadius']!==undefined||style['BorderRadius']!==undefined;var mode=document.documentMode||0;var noBottomFold=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var expr=$.browser.msie&&(function(){var div=document.createElement('div');try{div.style.setExpression('width','0+0');div.style.removeExpression('width')}catch(e){return false}return true})();function sz(el,p){return parseInt($.css(el,p))||0};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s};function gpc(node){while(node){var v=$.css(node,'backgroundColor');if(v&&v!='transparent'&&v!='rgba(0, 0, 0, 0)'){if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2])}return v}if(node.nodeName.toLowerCase()=='html')break;node=node.parentNode}return'#ffffff'};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dogfold':case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevelfold':case'bevel':return i+1}};$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options)})}return this};return this.each(function(index){var $this=$(this);var o=[$this.attr($.fn.corner.defaults.metaAttr)||'',options||''].join(' ').toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;var fx=((o.match(re)||['round'])[0]);var fold=/dogfold|bevelfold/.test(o);var edges={T:0,B:1};var opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)opts={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&fx=='round'&&(radius||moz||webkit)&&!cc&&!sc){if(opts.TL)$this.css(radius?'border-top-left-radius':moz?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',width+'px');if(opts.TR)$this.css(radius?'border-top-right-radius':moz?'-moz-border-radius-topright':'-webkit-border-top-right-radius',width+'px');if(opts.BL)$this.css(radius?'border-bottom-left-radius':moz?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',width+'px');if(opts.BR)$this.css(radius?'border-bottom-right-radius':moz?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',width+'px');return};var strip=document.createElement('div');$(strip).css({overflow:'hidden',height:'1px',minHeight:'1px',fontSize:'1px',backgroundColor:sc||'transparent',borderStyle:'solid'});var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$(this).outerHeight();for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)ds.setExpression('width','this.parentNode.offsetWidth');else ds.width='100%'}else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"')}else ds.width='100%'}else{ds.position='relative';ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'}for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild)}if(fold&&$.support.boxModel){if(bot&&noBottomFold)continue;for(var c in opts){if(!opts[c])continue;if(bot&&(c=='TL'||c=='TR'))continue;if(!bot&&(c=='BL'||c=='BR'))continue;var common={position:'absolute',border:'none',margin:0,padding:0,overflow:'hidden',backgroundColor:strip.style.borderColor};var $horz=$('<div/>').css(common).css({width:width+'px',height:'1px'});switch(c){case'TL':$horz.css({bottom:0,left:0});break;case'TR':$horz.css({bottom:0,right:0});break;case'BL':$horz.css({top:0,left:0});break;case'BR':$horz.css({top:0,right:0});break}d.appendChild($horz[0]);var $vert=$('<div/>').css(common).css({top:0,bottom:0,width:'1px',height:width+'px'});switch(c){case'TL':$vert.css({left:width});break;case'TR':$vert.css({right:width});break;case'BL':$vert.css({left:width});break;case'BR':$vert.css({right:width});break}d.appendChild($vert[0])}}}}})};$.fn.uncorner=function(){if(radius||moz||webkit)this.css(radius?'border-radius':moz?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'}})(jQuery);(function($){$.flightboxIsVideo=false;$.flightboxShow=function($calling){$calling=$($calling);$(".flightbox-current").removeClass("flightbox-current");$calling.addClass("flightbox-current");var $flightbox=$("#flightbox");$("#flightbox-image, #flightbox-meta").remove();$flightbox.prepend("<img id='flightbox-image' src='' />");$image=$("#flightbox-image");$image.unbind("load");$image.load(function(){$("#flightbox-image").after("<div id='flightbox-meta'><div id='flightbox-close'></div><div id='flightbox-title'></div>");$("#flightbox-title").html($calling.attr("title"));$("#flightbox-flickr-link a").attr("href",$calling.parent("a").attr("href"));$("#flightbox-meta").css({width:$image.innerWidth()});$("#flightbox-left, #flightbox-right").css({top:15,width:Math.floor($image.innerWidth()/2),height:$image.innerHeight()});$("#flightbox-close").click(function(){$("#floverlay").remove();$("#flightbox").remove()});$("#flightbox-video").remove();if($calling.hasClass("video")){$.flightboxIsVideo=true;$("#flightbox-right,#flightbox-left").css({height:33,top:$image.innerHeight()+15});$("#flightbox-prev,#flightbox-next").css({top:0,display:"block"});$("#flightbox-meta").css({paddingTop:33});var img_data=$image.attr("src").match(/[^\/]+_[^\/]+.jpg/g)[0].split(".")[0];var photo_id=img_data.split("_")[0];var photo_secret=img_data.split("_")[1];$image.before('<div id="flightbox-video" style="display: none;"><object type="application/x-shockwave-flash" width="'+$image.width()+'" height="'+$image.height()+'" data="http://www.flickr.com/apps/video/stewart.swf?v=67090&photo_id='+photo_id+'&photo_secret='+photo_secret+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=67090&photo_id='+photo_id+'&photo_secret='+photo_secret+'"></param>								<param name="bgcolor" value="#000000"></param>								<param name="allowFullScreen" value="true"></param>								<embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=67090&photo_id='+photo_id+'&photo_secret='+photo_secret+'" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&amp;photo_secret='+photo_secret+'&amp;photo_id='+photo_id+'" width="'+$image.width()+'" height="'+$image.height()+'"></embed></object></div>').hide();$("#flightbox-type").html("video")}else{if($.flightboxIsVideo==true){$("#flightbox-next, #flightbox-prev").hide()}$.flightboxIsVideo=false;$("#flightbox-prev,#flightbox-next").css({top:100});$("#flightbox-meta").css({paddingTop:0});$("#flightbox-type").html("photo")}$("#flightbox").animate({left:(($("body").width()-$image.innerWidth()-30)/2),height:$image.innerHeight()+$("#flightbox-meta").innerHeight(),width:$image.innerWidth()},"normal","swing",function(){$("#flightbox-meta").fadeIn("fast");if(!$calling.hasClass("video")){$image.fadeIn("fast")}else{$("#flightbox-video").show()}});$("#flightbox-left").click(function(){$prev=$calling.parents(".flickr-thumb").prev(".flickr-thumb").find("img");if($prev.length){$.flightboxShow($prev)}else{$("#flightbox").remove();$("#floverlay").remove()}});$("#flightbox-right").click(function(){$next=$calling.parents(".flickr-thumb").next(".flickr-thumb").find("img");if($next.length){$.flightboxShow($next)}else{$("#flightbox").remove();$("#floverlay").remove()}})});$image.attr("src",$calling.attr("src").replace(/_[stm]\./g,"."))};$.fn.flightbox=function(){return this.each(function(){$(this).click(function(){var $calling=$(this);var $document=$(this.ie6?document.body:document);$("body").append('<div id="floverlay"></div>').append('<div id="flightbox"><div id="flightbox-right"><div id="flightbox-next"></div></div><div id="flightbox-left"><div id="flightbox-prev"></div></div></div>');var flightbox_offset;if(self.pageYOffset){flightbox_offset=self.pageYOffset+100}else if(document.documentElement&&document.documentElement.scrollTop){flightbox_offset=document.documentElement.scrollTop+100}else if(document.body){flightbox_offset=document.body.scrollTop+100}$("#floverlay").css({width:$document.width(),height:$document.height()}).click(function(){$(this).remove();$("#flightbox").remove()});$("#flightbox").css({top:flightbox_offset,left:(($("body").width()-130)/2)}).corner("6px");$("#flightbox-left, #flightbox-right").mouseover(function(e){if(e.target.id=="flightbox-left"&&$(".flightbox-current").parents(".flickr-thumb").prev(".flickr-thumb").find("img").length==0){$(e.target).css("cursor","default");return}else if(e.target.id=="flightbox-right"&&$(".flightbox-current").parents(".flickr-thumb").next(".flickr-thumb").find("img").length==0){$(e.target).css("cursor","default");return}else{$(e.target).css("cursor","pointer")}if(!$.flightboxIsVideo)$(this).children().show()});$("#flightbox-left, #flightbox-right").mouseout(function(){if(!$.flightboxIsVideo)$(this).children().hide()});$("#flightbox-prev").corner("right 3px");$("#flightbox-next").corner("left 3px");$.flightboxShow($calling);return false})})}})(jQuery);var $j=jQuery.noConflict();$j(document).ready(function(){$j("#twitterFeed").getTwitter({userName:"polarmax",numTweets:1,loaderText:"Loading latest tweet...",slideIn:false,showHeading:false,headingText:"Latest Tweets",showProfileLink:false});$j("#nw01 a, #twitterFeed, .post .tease").corner("top 6px");$j("#nw05 a, #follow a, .post .meta, .post .share, .athlete .meta").corner("bottom 6px");$j("#rss a, #comments .comment, .presscontact").corner("6px");$j(".media .headBar").corner("3px");$j('#lines dd > a, #logos dd > a, #pdfs dd > a').click(function(){var link=$j(this).attr('href');$j(this).parent().parent().append($j('<div class="terms"><p>I have read and accept the terms to download the file</p><p><a href="'+link+'" class="agree">I agree</a></p><p><a href="#" class="cancel">Cancel</a></p></div>'));return false});$j('.terms a.agree').live('click',function(){$j('.terms').remove()});$j('.terms a.cancel').live('click',function(){$j('.terms').remove();return false})});
