(function(){var Y=Object.prototype,E=function(){return null},A=apture;var $=A.$,arrayCopy=A.arrayCopy,Base=A.Base,BaseTitleBar=A.BaseTitleBar,Class=A.Class,concat=A.concat,contains=A.contains,Div=A.Div,Element=A.Element,Event=A.Event,extend=A.extend,Img=A.Img,Anchor=A.Anchor,MessageBox=A.MessageBox,Mixin=A.Mixin,MultiAnimation=A.MultiAnimation,NeedFlash=A.NeedFlash,Rect=A.Rect,remove=A.remove,Script=A.Script,slice=A.slice,sub=A.sub,stub=A.stub,SWFObject=A.SWFObject,textNode=A.textNode,TitleBar=A.TitleBar,Transitions=A.Transitions,trim=A.trim,Link=A.Link,PhraseLink=A.PhraseLink,EndPassageLink=A.EndPassageLink,PageLink=A.PageLink,IFrame=A.IFrame,HiddenIFrame=A.HiddenIFrame,Draggable=A.Draggable,ScrollingPanel=A.ScrollingPanel,RelatedScrollingPanel=A.RelatedScrollingPanel,PlaceholderInput=A.PlaceholderInput;var Popup=A.Popup,PopupButton=A.PopupButton,PreviewPopup=A.PreviewPopup,FirstTimePopup=A.FirstTimePopup,RelatedLinkPanel=A.RelatedLinkPanel,RelatedMediaOverlay=A.RelatedMediaOverlay,CenterLayout=A.CenterLayout,NearbyElemLayout=A.NearbyElemLayout,AdjacentToElemLayout=A.AdjacentToElemLayout,GoodLayout=A.GoodLayout,FixedLayout=A.FixedLayout,LinkThumbnail=A.LinkThumbnail,InlineMediaLink=A.InlineMediaLink,InlineMediaContainer=A.InlineMediaContainer,RelatedLink=A.RelatedLink,OverlayLinkInserter=A.OverlayLinkInserter,StretchRowBackground=A.StretchRowBackground;var MediaItem=A.MediaItem,Embed=A.Embed,Video=A.Video,WikiArticle=A.WikiArticle,MediaImage=A.MediaImage,WebClip=A.WebClip,IFrameItem=A.IFrameItem,ImageSlideshow=A.ImageSlideshow,Viewer=A.Viewer,AptureArticle=A.AptureArticle,License=A.License,ItemThumbnail=A.ItemThumbnail,RelatedScrollingPanel=A.RelatedScrollingPanel,RelatedMediaOverlay=A.RelatedMediaOverlay;var _dA=sub(Base,{init:function($0,$1,$2){this.name=$2;this._dB=$0;this._dC={};this._dD={};this._dE={};this._dF={};this._dG={};this._dH=$1;this._dI=true;this._dJ={};this._dK={};this._dL={};this._dM=null},_dN:function($3,$4){var $5=$3[$4];if($5){clearTimeout($5);delete $3[$4]}},setContainerElem:E,sendEncodedMessage:function($6,$7,$8,$9){if(!$9){$9=1}var $4=Math.floor(Math.random()*1000000);if($9==1){this._dF[$4]=$7;this._dG[$4]=$8;this._dD[$4]=setTimeout(this.bind(this._dO,[$4]),4000)}var $a=this._dC[$4]=this._dP($9,$6,$4);this._dQ($a)},sendMessage:function($b,$7,$8,$9){this.sendEncodedMessage(A.jsonSerialize($b,true),$7,$8,$9)},handle_2:function($c){this._dN(this._dD,$c);this._dN(this._dE,$c);if(this._dC[$c]){delete this._dC[$c]}var $d=this._dF[$c];if($d){$d($c);delete this._dF[$c]}},handle_3:function($e){var $f=$e[0];this._dN(this._dD,$f);this._dN(this._dE,$f);var $g=[],$h=this._dC[$f];for(var $i=1;$i<$e.length;$i++){$g.push($h[$e[$i]])}this._dR($g);this._dE[$f]=setTimeout(this.bind(this._dS,[$f]),3000)},_dO:function($4){var $a=this._dC[$4];this._dR(this._dC[$4]);delete this._dD[$4];this._dE[$4]=setTimeout(this.bind(this._dS,[$4]),3000)},setAckEnabled:function($j){this._dI=$j},_dS:function($4){delete this._dE[$4];var $8=this._dG[$4];if($8){$8();delete this._dG[$4]}},_dP:function($9,$6,$4){var $k=8192,$l=Math.ceil(1.0*$6.length/$k),$a=[];for(var $i=0;$i<$l;$i++){$a.push(A.jsonSerialize([$9,$4,$i,$l,$6.substr($i*$k,$k)]))}return $a},handle_1:function($m){var $d=this._dT;if($d){$d($m)}},registerCommHandler:function($n){this._dT=$n},_dU:function($4){var $o=this._dK[$4],$p=$o.length,$e=[$4];for(var $i=0;$i<$p;$i++){if($o[$i]==null){$e.push($i)}}this.sendMessage($e,null,null,3)},receiveChunk:function($q){var p=A.safeEval($q);var $r=p[0],$s=p[1],$t=p[2],$l=p[3],$u=p[4];var $v=this._dJ,$w=this._dK;if(!$v[$s]){var $o=$w[$s];if(!$o){$o=$w[$s]={};$o.length=$l}$o[$t]=$u;var $x=true;var $b='';for(var i=0;i<$l;i++){if($o[i]==null){$x=false;break}$b+=$o[i]}this._dN(this._dL,$s);if($x){$v[$s]=1;delete $w[$s];var $d=this['handle_'+$r];if($d){$d.call(this,A.safeEval($b))}}else{this._dL[$s]=setTimeout(this.bind(this._dU,[$s]),1500)}}if($r==1&&this._dI&&$v[$s]){this.sendMessage($s,null,null,2)}},setTargetWindow:E,initReceiverInElem:E});var _dV=sub(_dA,{initReceiverInElem:function(){_dV.initReceiver()},setTargetWindow:function($y){this._dW=$y},_dQ:function($a){var $z=this._dW;if($z){var $0=this._dB;setTimeout(function(){for(var I=0;I<($a||'').length;I++){var $A=$a[I];$z.postMessage([$0,$A].join(","),'*')}},10)}},_dR:function($a){}});_dV.initReceiver=function(){if(!this.validReceiver){A._dX();this.validReceiver=true}};var _dY=sub(_dA,{setContainerElem:function($B){this._dM=$B},initReceiverInElem:function($B){var $C=this._dH.split(".");$B._.innerHTML=A._dZ($C[1]).getHTML()},_e0:function($D){var $E=A._e1();$E.addVariable("connectionName",this._dB);$E.addVariable("payload",$D);return $E},_e2:function($a){var $F='';for(var I=0;I<($a||'').length;I++){var $A=$a[I];var $E=this._e0($A);$F+=$E.getHTML()}return $F},_dQ:function($a){var $G=this._dM,$F=this._e2($a);setTimeout(function(){$G._.innerHTML=$F},100)},_dR:function($a){this._dM._.innerHTML=this._e2($a)}});_dY.initReceiver=function(){if(!this.validReceiver){var $H=A._dZ();if($H.isValidVersion()){var $I=document.createElement('div');$I.style.position='absolute';$I.innerHTML=$H.getHTML();A.appendToBody($I);this.validReceiver=true}}};A.extend({_e3:{},makePairedConnection:function($J,$K){var $0=$J,$1=$J+'r';$K=$K||A._e4;return A._e3[$1]||(A._e3[$1]=new $K($0,$1,$J))},_e4:(window.postMessage?_dV:_dY),_e5:function($L){var $M="0123456789abcdefghiklmnopqstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",$N=[];for(var $i=0;$i<$L;$i++){$N.push($M.charAt(Math.floor(Math.random()*$M.length)))}return $N.join("")},_e6:1,_e7:function(){if(!A._e8){A._e8=A._e5(9)}return A._e8},makeFrameConnection:function($K){var $J=(A._e6++)+"."+A._e7(),$0=$J+'r',$1=$J;$K=$K||A._e4;$K.initReceiver();return A._e3[$1]=new $K($0,$1,$J)},_e1:function(){var $O=A.getNewDomId('apture_endpoint');return new SWFObject("http://cdn.apture.com/media/client.swf?v=ba",$O,1,1,"8.0.0","#ffffff")},_dZ:function($P){var $E=A._e1();$E.addParam('AllowScriptAccess','always');$E.addVariable("baseConnectionName",$P||A._e7());return $E},initReceiver:function(){A._e4.initReceiver()},_dX:function(e){$(window).addEvent("message",function(e){var $Q=e.data.indexOf(',');if($Q!=-1){var $J=e.data.substring(0,$Q);var $D=e.data.substring($Q+1);A.signalPage($J,$D)}})},signalPage:function($J,$q){var $R=A._e3[$J];if($R){$R.receiveChunk($q)}}});A.crossTabConnectionType=(0?_dY:A._e4);var LeafIterator=sub(Base,{init:function($S,$T,$U,$V){$S=$S._||$S;$T=($T&&$T._)||$T||$S;this._gS=$V;this.begin=$S;this.end=_gT($T,true,$V);this._gU=!$U},getLeaves:function($W){return _gV(this.begin,this.end,$W,this._gS,null,null,this._gU)},walk:function($W){var $X=this._gW=this._gW||this.getLeaves();for(var $Y,i=0;$Y=$X[i];++i){$W($Y)}},walkSoftly:function($W){if(this._gW){this.walk($W)}else{this.getLeaves($W)}}},'LeafIterator');var TextNodeIterator=sub(LeafIterator,{walk:function($W){var $Z,$10=[];this.parent(function($Y){if($Y.nodeType==3){$Y.nodeValue==''?$10.push($Y):$W($Y)}});while($10.length){$Z=$10.shift();$Z.parentNode.removeChild($Z)}},length:function(){var $11=0;this.walkSoftly(function(tn){$11+=tn.nodeValue.length});return $11},collect:function($12){var $13=[];this.walkSoftly(function(tn){$13.push($12&&$12(tn)||tn.nodeValue)});return $13.join('')}},'TextNodeIterator');TextNodeIterator.prototype.walkSoftly=TextNodeIterator.prototype.walk;Element.implement({lastTextNode:function($V){var $Y=_gT(this._,true,$V);var $14=/[^\s]/;while($Y){if($Y.nodeType==3&&$Y.nodeValue.match($14)&&!A.isAptureElem($Y.parentNode)){break}$Y=_gX($Y,true,$V)}return $Y}});function _gY($15,$V,$16){var $17=[],$18=[],$19,$1a=document.body;if($V){$15=_aL($15)}if($15){if(($15._aK||$15)==$1a){$17.push($15);$18.push($16?-2:0)}else{while(true){var $1b=$15.parentNode;if(!$1b||($15._aK||$15)==$1a)break;$19=$1b.childNodes;if($V){$1b=_aL($1b);var $1c=_gZ($1b._aK||$1b),$19=($1c&&$1c._aI)||$19}for(var i=0;i<$19.length;i++){if($19[i]==$15){$18.unshift(i);$17.unshift($1b);$15=$1b;break}}if(i==$19.length){throw"couldn't find start position"}}}}return[$17,$18]}function _gT($1d,$1e,$V){var $1f=_gV($1d,null,null,$V,$1e,1);var $Y=($1f.length>0)?$1f[0]:null;return $Y}function _gX($1d,$1e,$V){var $1f=_gV($1d,null,null,$V,$1e,2);var $1g=($1f.length>1)?$1f[1]:null;return $1g}function _gV($1h,$T,$1i,$V,$16,$1j,$1k){var $1l=_gY($1h,$V,$16),$17=$1l[0],$18=$1l[1],$1m=$17.length-1,$15,$X=[],$1n,$1o=A.ignore,$1p=$16?-1:1,i;for(var i=0;i<$18.length-1;i++){$18[i]+=$1p}if($1m>=0){while(true){$15=$17[$1m],i=$18[$1m];$18[$1m]+=$1p;var $1q=$15._aK||$15;$19=$1q.childNodes;if($V){$15=_aL($15);var $1c=_gZ($1q),$19=($1c&&$1c._aI)||$19}if(i==-2){i=$19.length-1;$18[$1m]=i+$1p}if(!$1k&&$15==$T)break;if(i>=$19.length||i<0){$17.pop();$18.pop();if(--$1m<0)break}else{var $1r=$19[i];if($1r.parentNode==$1q){if($1r.nodeType==3){if(!$1k&&$1r==$T)break;$1i?$1i($1r):$X.push($1r);if($1k&&$1r==$T)break;if($1j&&$X.length>=$1j)break}else if($1r.nodeType==1){var $1s=$1r._aK||$1r;if($1s.nodeName=="SCRIPT"||$1s.nodeName=="STYLE"||$1s.aptureDynamicText||($1o&&$1o($1s))){continue}$1m++;$17.push($1r);$18.push($16?-2:0)}}}if($1k&&$15==$T)break}}return!$1i&&$X}var _gZ=A.getProxy;function _aL($1d){if($1d._aK||$1d.nodeType!=1){return $1d}else{var $1c=_gZ($1d);return($1c&&$1c._aL)||$1d}}function fix($1t,$1u,$V){if(!$V&&$1t.node._aK){$1t.node=$1t.node._aK}var $N={node:$1u||_h0($1t.node),offset:$1t.offset};var $1v=_h1($1t.node,$N.node,$V);$N.offset+=$1v;return $N}function unfix($1t,$1w,$V){var $1u=$1t.node||document.body,$1x=$1t.offset;function _h2(tn){var $L=tn.nodeValue.length;if(($1w&&$1x<=$L)||$1x<$L){throw tn}$1x-=$L}try{new TextNodeIterator($1u,null,false,$V).walkSoftly(_h2)}catch($1d){if($1d.nodeType==3){return{node:$1d,offset:$1x}}else{throw $1d}}return null}function mapPosition($1y,$1z){var $1A=_h0($1y.node);if($1z&&$1y.node._aK){return $1y}var $1B=fix($1y,$1A,!$1z);var $1f=unfix($1B,false,$1z);return $1f}function _h0($1d){var $1C=null;while($1d){if($1d.nodeType!=3&&!$1C){$1C=$1d}if($1d.apture){$1C=null}$1d=$1d.parentNode}return $1C}function _h1($1d,$1D,$V){var $1E=_gT($1d,false,$V);return new TextNodeIterator($1D||document.body,$1E,true,$V).length()}A.extend({eraseLink:function($1F){A._h3($1F);$1F.erase();$1F.del()},_h4:function($1F){if($1F.parentLinkToken){var $1G=A._h5({token:$1F.parentLinkToken});if($1G){$1G.rawLink.childLinks.push($1F)}}else{A.page.links.push($1F)}},_h3:function($1F){var $1G=A._h5($1F);if($1G){$1G.parent.splice($1G.childIndex,1)}},_h5:function($1F){return A._h6($1F,A.page.links)},_h6:function($1F,$1H){for(var i=0;i<($1H||'').length;i++){var $1r=$1H[i];if(($1F.id&&$1r.id==$1F.id)||($1F.token&&$1r.token==$1F.token)){return{parent:$1H,childIndex:i,rawLink:$1r}}var $1f=this._h6($1F,$1r.childLinks);if($1f){return $1f}}return null},_h7:function($1I,$1J){var $1K=new Date().getTime();for(var I=0;I<($1J||'').length;I++){var $1F=$1J[I];if(!$1F.id){if(!$1F._h8){$1F._h8=$1K}if($1K<$1F._h8+20000){$1I.push($1F)}}A._h7($1I,$1F.childLinks)}},_f1:function(){var $1L=[];A._h7($1L,A._9i);if(A._h9){A._h9.cancel();A._h9=null}A._ha=$1L;if($1L.length){var $1M=[];for(var I=0;I<($1L||'').length;I++){var $1F=$1L[I];$1M.push($1F.token)}A._h9=new Script("/mediahub/resolveLinkTokens/",{token:$1M,siteToken:A.siteToken});A._h9.request(A._hb)}},_hb:function($1f){var N=A._ha;for(var I=0;I<(N||'').length;I++){var $1N=N[I];var $1O=$1f[$1N.token];var $1G=A._h5($1N);if($1O==-1){A.eraseLink($1N)}else if($1O){if($1G){$1G.rawLink.id=$1O}$1N.id=$1O;$1N.notify(1)}}setTimeout(A._f1,1500)},getUserContext:function(){var $1P=A.getDashboard();return $1P&&$1P.getUserContext()},handleSelection:function($1Q){var $1R=A.getUserContext();if(!$1R||!$1R.canEditPage()){return}var $1S=A.getSelection();if(!$1S.isEmpty()){if(!$1Q.alt){$1S=$1S.round();$1S.select()}var $1b=$($1S.getParentElem());var $1T;if(!A.inContentArea($1b)){if(A._hc($1b)){if(confirm("Apture: The region you selected appears after the Apture script tag in the page's HTML code. Apture currently only supports adding links to text that appears before the Apture script tag in the HTML. Do you want to see instructions for moving the Apture script tag? (Site administrators only)")){window.open(A.makeUrl("/site/"+A.siteToken+"/setup/"),'setup')}}else{new MessageBox(3,'The region you selected is outside of the linkable content area.').timedOpen($1Q)}}else if(!A.warnIfTooManyLinks($1Q)){var $1U=$1S.getExistingLink();if($1U){var $1V=$($1U);if($1V.normal){$($1U.parentNode).open()}else{$1S.selectNode($1U);$1S.select();var $1W=$1V.lastTextNode(true);var $1X=A.clean($1W.nodeValue);var $1Y=A.getOccurrence($1W,$1W.nodeValue.length-1,$1X,true)-1;if(A._hd($1X,$1Y,$1Q)){$1T={linkText:$1X,oI:$1Y,href:$1U.href}}}}else if($1S.isSingleTextNode()){var $1Z=$1S.toOccurRepr(A._9f);var $20=$1Z[0],$21=$1Z[1];if(A._hd($20,$21,$1Q)){$1T={linkText:$20,oI:$21}}}else{new MessageBox(3,"Apture cannot link the selected text because it overlaps tags in the source code of the web page.").timedOpen($1Q)}}if($1T){$1T.linkType=0;A.getMediaHubPopup().fastOpen($1T)}}},warnIfTooManyLinks:function($1Q){if(A._91()){new MessageBox(3,"For performance reasons, a maximum of "+A.maxPageLinks+" Apture links can be added to a single page (not including related media links). To add another Apture link to this page, you can either add it as a related media item on an existing link, split the content across multiple pages, or remove an existing Apture link.").timedOpen($1Q);return true}return false},_hd:function($20,$22,$1Q){if($22==-1){new MessageBox(3,"Could not determine position of selection on the page. Try refreshing the page.").timedOpen($1Q);return false}if(!$20){new MessageBox(3,"No text selected.").timedOpen($1Q);return false}if($20.length>=127){new MessageBox(3,'The text you selected to link is too long.  The maximum length of links is 127 characters.').timedOpen($1Q);return false}return true},_hc:function($B){var $23=A._8J;return $23&&$23.compareOrder($B)<0},inContentArea:function($B){if((A._9f&&A._9f.compareOrder($B)>0)||(A._9g&&A._9g.compareOrder($B)<0))return false;if(A._hc($B))return false;var $1o=A.ignore;if($1o){var $24=$B._;while($24){if($1o($24))return false;$24=$24.parentNode}}return true},makeSelection:function(text,n){var $25=A.findByOccurrence(text,n);if($25){A._dl(window,$25.node,$25.offset,$25.length)}else{A.getSelection().deselect()}return null},findByOccurrence:function($20,$22){var $25=A._he($20,$22);if($25){var $26=mapPosition($25,false);if($26){$26.length=$25.length;return $26}else{}}return null},_he:function($20,$22){var $27=-1;var $28=A._9f||document.body;var $29=A._9g||document.body;var $2a=A.getRegexForText($20);try{new TextNodeIterator($28,$29,false,true).walkSoftly(function($2b){var $2c;while($2c=$2a.exec($2b.nodeValue)){$27++;if($27==$22){throw{node:$2b,offset:$2c.index,length:$2c[0].length}}$2a.lastIndex=$2c.index+1}})}catch(pos){if(pos.node){return pos}else{throw pos}}return null},getOccurrence:function($B,$2d,$20,$2e){if($B.nodeType!=3){return-1}var $25={node:$B,offset:$2d};var $26=mapPosition($25,true);if($26){$B=$26.node;$2d=$26.offset}else{return-1}var $2a=A.getRegexForText($20),$27=0,$28=A._9f||document.body,$2f={};try{new TextNodeIterator($28,$B,false,true).walkSoftly(function($2b){var $2g=$2b.nodeValue;var $2c;while($2c=$2a.exec($2g)){if(!$2e&&$2b==$B&&$2c.index>=$2d){throw $2f}$27++;$2a.lastIndex=$2c.index+1}})}catch(ex){if(ex!=$2f){throw ex}}return $27}});var ProfileLoader=sub(Base,{init:function(){this._eg=false;this._eh=A.userContext},getUserContext:function(){return this._eh},isLoggedIn:function(){return this._eh&&this._eh.loggedIn},getError:function(){return this._ei},login:function($2h,$2i,$2j){$2h=$2h||"/login/live/k/";$2i=$2i||530;$2j=$2j||266;if(!this._ej){var $2k=new ServerWindow($2h,"aptureLoginWindow","status=1,toolbar=0,menubar=0,directories=0,location=1,resizable=1,scrollbars=1,dialog=1,width="+$2i+",height="+$2j+",top=50,left=50");$2k._ed.setAckEnabled(false);$2k.setCommDelegate(this);A.appendToBody(this._ej=$2k)}else{this._ej.open()}},closeLogin:function(){this._ej&&this._ej.close()},logout:function(){new Script("/logout/js/").request(this.bind(this.loadProfile))},windowSuccess:function(){if(this._ej){this._ej.close()}this.notify('login_complete');this.loadProfile(true)},loadProfile:function($2l,$2m){return this._ek($2l,'/user/context/',{pageId:A.page&&A.page.id||0,siteToken:A.siteToken,url:window.location.href,t:Math.random(),openedDashboard:$2m})},_ek:function($2l,$2n,$2o){if(this._eg)return;this._eh=null;this._eg=true;this._el=$2l;(new Script($2n,$2o)).request(this.bind(this._em),this.bind(this._en))},_em:function($1R){this._eg=false;this._eh=$1R;if(this._eo($1R)){this._ep()}else if($1R.loggedIn){this._eq()}else{this._er()}},_eq:function(){this.notify('login_successful')},_eo:function($1R){return!$1R.loggedIn&&this._el},_er:function(){this.notify('logged_out')},_ep:function(){this._en({code:-10,msg:'Error retrieving login information.  Please ensure your browser accepts third-party cookies from www.apture.com.'})},_en:function(err){this._eg=false;this._ei=err;this.notify('error')}},'ProfileLoader');var ProfileLoaderUsingServerPanel=sub(ProfileLoader,{init:function(){this.parent();var $2p=this._es||(this._es=new ServerPanel({className:'apture'}));$2p.iframe._.scrolling="no";$2p.iframe._.className='apture';$2p._ed.setAckEnabled(false);$2p.setCommDelegate(this)},login:function($2h,$2q,$2r){var $2p=this._es;$2p.iframe.setHeight($2q||200);$2p.iframe.setWidth($2r||400);$2p.setLocation($2h)},closeLogin:E,panelSuccess:function(){this.notify('login_complete');this.loadProfile(true)},getLoginPanel:function(){return this._es}},'ProfileLoaderUsingServerPanel');A.loadCSRFToken=function($2s){var $2t=new HiddenIFrame({src:"/csrfToken/"});var $2u=null;var $2v=function(){if($2u){clearInterval($2u)}var $2w=$2t.getDocument();var $2x=$2w.getElementById('csrfmiddlewaretoken');$2s($2x.value)};$2t._.onload=$2v;A.appendToBody($2t)};var _f3=sub(Element,{init:function(){this.parent('div',this._f4=new Div({style:{position:'absolute'}}));this._ed=A.makeFrameConnection(this._e4);this._ed.setContainerElem(this._f4);this._ed.registerCommHandler(this.bind(this._dT))},setCommDelegate:function($2y){this._f5=$2y},_dT:function($2z){var $2A=this._f5;if($2A){var $2B=$2z[0];$2z.splice(0,1);var $n=$2A[$2B];if($n){setTimeout(function(){$n.apply($2A,$2z)},1)}}},_f6:function($2h){return A.makeUrl($2h,{cn:this._ed.name,r:Math.random()})}});var ServerPanel=sub(_f3,{init:function(){this.parent();this.iframe=new IFrame(arguments);this._f7=false},_f8:function(){if(!this._f7){this.appendChild(this.iframe)}this._f7=true},setLocation:function(url){this.iframe._.src=this._f6(url);this._f8()}},'ServerPanel');var MediaHubServerPanel=sub(ServerPanel,{init:function($2C){this.parent();this._f9=$2C;this.setStyle('background-color','#fff');this.setStyle('position','absolute');this._fa=false;this.iframe._.scrolling="no";this.appendChild(this._y=new Div({className:'aptureLinkerLoadingContainer'},this._4d=new Div({className:'aptureLinkerLoadingText'})));this._y.hide()},_fb:function(){A.logError(3);this._4d.setText("Could not load panel. (This might be because you have other browser windows open with Apture. Try closing other browser windows and refreshing the page, or restarting your browser.)")},_fc:function(){this._y.hide()},initIframeSrc:function($2D){if(!this._fa){$2D.url=window.location.href;var $2E=A.makeUrl(this._f9,$2D,true);this.setLocation($2E);this._ed.setTargetWindow(this.iframe._.contentWindow);this._fa=true}else{this._4d.setText("Loading...");this._y.show();this.sendMessage($2D,this.bind(this._fc),this.bind(this._fb))}},setWidth:function($2F){this.iframe.setWidth($2F);this._y.setWidth($2F)},setHeight:function($2G){this.iframe.setHeight($2G);this._y.setHeight($2G)},sendMessage:function($b,$2s,$8){this._ed.sendMessage($b,$2s,$8)}},'MediaHubServerPanel');var ServerWindow=sub(_f3,{init:function(){this.parent();this._fd=arguments;this.open()},_e4:A.crossTabConnectionType,open:function(){var $2H=this.window=window.open(this._f6(this._fd[0]),this._fd[1],this._fd[2]);this._ed.setTargetWindow($2H);setTimeout(function(){try{$2H.focus()}catch(_){}},250)},close:function(){try{this.window.close()}catch(e){}},remove:function(){this.parent()}},'ServerWindow');var BezierRect=sub(Rect,{init:function($2I,$2J,$2K,$2L,$2M){this.parent($2I,$2J,$2K,$2L);this._fe=$2M},_ff:function($2M,$2N){var $2O=$2M.length,$2P=[],$2Q=[];for(var I=0;I<($2M||'').length;I++){var $2R=$2M[I];$2P.push($2R.x);$2Q.push($2R.y)}for(var $2S=1;$2S<$2O;++$2S){for(var $i=0;$i<$2O-$2S;++$i){$2P[$i]=(1-$2N)*$2P[$i]+$2N*$2P[$i+1];$2Q[$i]=(1-$2N)*$2Q[$i]+$2N*$2Q[$i+1]}}return{x:$2P[0],y:$2Q[0]}},interpolate:function($2T,$2U){var $2M=[{x:this.x+this.width*0.5,y:this.y+this.height*0.5}];var N=this._fe;for(var I=0;I<(N||'').length;I++){var $2R=N[I];$2M.push($2R)}$2M.push({x:$2T.x+$2T.width*0.5,y:$2T.y+$2T.height*0.5});var $2V=this._ff($2M,$2U),$2K=this.width+($2T.width-this.width)*$2U,$2L=this.height+($2T.height-this.height)*$2U;return new Rect($2V.x-$2K/2,$2V.y-$2L/2,$2K,$2L)}},'BezierRect');A.runLinkAnim=function($2W,$2X,$2Y,$2Z,$30){if($30){A._fg($2X,$2Z)}else{A._fh($2W,$2X,$2Y,function(){A._fg($2X,$2Z)})}};A._fh=function($2W,$2X,$2Y,$2s){var $31=$2W.center(),$32=$2X.center(),$33=[{x:$32.x-($32.x-$31.x)*0.2,y:$32.y-($32.y-$31.y)*0.2-180}];var $34=new Img({src:$2Y});$34.setStyle('position','absolute');$34.setStyle('z-index','75000');$34.setRect($2W);A.appendToBody($34);var $35=$34.getAnimation({duration:600,transition:Transitions.apple});$35.onComplete=function(){$34.remove();$2s()};$35.start({rect:[new BezierRect($2W.x,$2W.y,$2W.width,$2W.height,$33),$2X],opacity:[1,0.15]})};A._fg=function($2X,$2Z){var $36=function(t,b,c,d){var $2N=t/d;if($2N<=0.5){return Transitions.easeOutQuad((2*$2N)*d,b,c,d)}else{return Transitions.easeOutQuad(Math.max(0.05,((1.0-(2*($2N-0.5)))*d)),b,c,d)}};var makeCountBubble=function($2O){var $37=new Img({src:'/media/imgs/_countBubble'+$2O+'.png'});$37.setStyles({position:'absolute','z-index':'75000'});return $37};var $37=makeCountBubble($2Z);A.appendToBody($37);var $38=$37.getAnimation({duration:600,transition:$36});$38.onComplete=function(){$37.remove()};var $39=(new Rect(0,0,20,20)).centerIn($2X);$39.y+=-8;var $3a=(new Rect(0,0,25,25)).centerIn($2X);$3a.y+=-30;$38.start({rect:[$39,$3a],opacity:[1.0,1.0]})};if(A.init){Link.implement({_et:function(){if(!this._7d){if(this.parentLinkId){this._7d=A.getLinkById(this.parentLinkId)}if(this.parentLinkToken){this._7d=A.getLinkByToken(this.parentLinkToken)}}return this._7d},updateLinkIcon:E,updateThumbnail:E,_7A:function(){new DeleteLinkDialog(this).open()}});PhraseLink.implement({updateLinkIcon:function(){this._7o=this.mediaItem.getLinkIconY()}});RelatedLink.implement({updateThumbnail:function(){var $3b=this._aQ;if($3b){this._aQ=null;if($3b._.parentNode){$3b.replaceWith(this.getThumbnail())}}}});var ChildLink=sub(Mixin,{insert:function(){var $3c=this.before;var $1b=this._et();if($1b){var $3d=false;if($3c){var N=$1b.childLinks;for(var i=0;i<(N||'').length;i++){var $3e=N[i];if($3e.id==$3c){$1b.childLinks.splice(i,0,this);$3d=true;break}}}if(!$3d){$1b.childLinks.push(this)}$1b.notify(11)}},erase:function(){var $1b=this._et();if($1b){remove($1b.childLinks,this);$1b.notify(11)}this.notify(13)}},'ChildLink');ChildLink.implementIn(RelatedLink);ChildLink.implementIn(InlineMediaLink);PageLink.implement({erase:function(){A.removeRootLink(this);this.spliceOut();this.notify(13)}});InlineMediaLink.implement({_eu:function(){this._ev.setStyle("background-position","-100px -15px");this._ew.setStyle("color","#c00");this._ew.setText("Delete")},_ex:function(){this._ev.setStyle("background-position","-100px top");this._ew.setText("")},_ey:function(){this._ev.setStyle("background-position","-100px -30px")},_ez:function(){this._eA.setStyle("background-position","-80px -15px");this._ew.setStyle("color","#00c");this._ew.setText("Edit")},_eB:function(){this._eA.setStyle("background-position","-80px top");this._ew.setText("")},_eC:function(){this._eA.setStyle("background-position","-80px -30px")},_eD:function($1Q){new DeleteLinkDialog(this).open();this.setEnabled(false);$1Q.stop()},_eE:function(){this._eF.setStyle('background-position','5px -80px')},_eG:function(){this._eF.setStyle('background-position','5px -60px')},_eH:function(){this._b1.setText(this.caption);this.setEnabled(true)},_eI:function($1Q){new EditCaptionDialog(this,this.bind(this._eH)).open();this.setEnabled(false);$1Q.stop()},_eJ:function(){return new Rect(0,0,this._1L.getWidth(),this._1L.getHeight())},_eK:function($3f){this._1L.resize($3f.width,$3f.height);var $3g=$3f.width;var $3h=$3f.height;if(this._cL){this._cL.setWidth($3g)}this.resizeLayout($3g,$3h);if(this._b3){this._b3.updateView()}},_eL:function(){if(!this._eM){this._eM=new Div({style:{width:'100%',height:'100%',position:'absolute',zIndex:'11213',backgroundColor:'white'},opacity:0.5})}this._b2.appendChild(this._eM);this.setStyle('border','2px dashed #ccc')},_eN:function(){this._eM.remove();var $2F=this._1L.getWidth();var $2G=this._1L.getHeight();this.setStyle('border','1px solid #BCBCBC');var $3i=this.suggestedSize();if($2F!=$3i.width||$2G!=$3i.height){var $3j=new ModalServerPopup('Change Embed Size',{width:420,height:110},A.makeUrl("/link/edit/size/",{siteToken:A.siteToken,linkId:this.id,width:$2F,height:$2G}));$3j.setMaximizable(false);$3j.onComplete=this.bind(function($1f){this.width=$1f.width;this.height=$1f.height;this.setEnabled(true)});$3j.onError=function($3k){alert('Cannot change embed size: '+$3k.msg)};$3j.onCancel=this.bind(function(){this._eK(this.suggestedSize());this.setEnabled(true)});$3j.open()}this.setEnabled(false)},_eO:function($3l){$3l.setFixedRatio(this.mediaItem.hasFixedAspectRatio());$3l.addListener(73,{obj:this,fn:this._eN});$3l.addListener(71,{obj:this,fn:this._eL});this._b2.appendChild($3l)},_aW:function(){var $3m=A.mode==2&&this.id;this._bb=$3m;this.resizeLayout(this._1L.getWidth(),this._1L.getHeight());if($3m){if(!this._eP){A.addStyles(A.styles.editor,this._b0);this._eP=true}if(!this._ev&&this.creationMode==1){this._b4.appendChildren(this._ev=new Div({className:'aptureDeleteInlineLink',title:'Remove this embed',onmouseover:this.bind(this._eu),onmouseout:this.bind(this._ex),onmousedown:this.bind(this._ey),onmouseup:this.bind(this._ex),onclick:this.bindWithEvent(this._eD)}),this._eA=new Div({className:'aptureEditInlineLink',title:'Edit link properties',onclick:this.bindWithEvent(this._eQ),onmouseover:this.bind(this._ez),onmouseout:this.bind(this._eB),onmousedown:this.bind(this._eC),onmouseup:this.bind(this._eB)}),this._ew=new Element('div',{className:'aptureActionText',style:{cursor:'pointer'}}));if(this.mediaItem.allowsResizing()){this._eO(this._eR=new ResizeControl(5,100,100,this.bind(this._eJ),this.bind(this._eK)));this._eO(this._eS=new ResizeControl(6,100,100,this.bind(this._eJ),this.bind(this._eK)))}var $O=A.getNewDomId("aptureR");A.addStyles(A.styles.reset+A.styles.editor,$O);this._eT=new Element('span',{id:$O},this._eF=new Element('a',{className:'aptureEditCaption',onmouseover:this.bind(this._eE),onmouseout:this.bind(this._eG),onclick:this.bindWithEvent(this._eI),innerHTML:"&nbsp;"}))}}if(this._ev){this._ev.setVisible($3m);this._eA.setVisible($3m);this._eT.setVisible($3m)}this._eU($3m)},_eU:function($3m){if(this._eS){this._eS.setVisible($3m);this._eR.setVisible($3m)}},_eQ:function(){var $3n=A.getMediaHubPopup();$3n.fastOpen({creationMode:this.creationMode,linkType:this.linkType,token:this.token,pageText:this.pageText,parentLinkToken:this._et().token,oI:this.oI})}});var UserContext=sub(Base,{canEdit:function(){return(this.rights&14)!=0},canEditPage:function(){return A.overlay&&(this.rights&2)!=0}},'UserContext');var ServerPopup=sub(Popup,{init:function($3o,$3i,$2C){this._e9();this.parent();this.appendChild(this._ea);this._8a.setTitle($3o);this._eb=$3i;if($2C){this._ea.setLocation($2C)}},_e9:function(){var $3p=this._ea=new ServerPanel({className:'apture'});$3p.iframe.setPos(12,30);$3p.setCommDelegate(this)},getIFrame:function(){return this._ea.iframe},_bZ:function(){return this._eb||this.parent()},panelBack:function(){A.dismissPopup(this)},panelSuccess:function($m){if(this.onComplete){this.onComplete($m)}A.dismissPopup(this)},panelFailure:function($3k){if($3k.code!=-1){if(this.onError){this.onError($3k)}else{alert($3k.msg)}}else{this._ec()}this.dismiss()},resize:function($2F,$2G){this.parent($2F,$2G);this._ea.iframe.resize($2F-24,$2G-64)}},'ServerPopup');var ModalServerPopup=sub(ServerPopup,{open:function(){A.appendToBody(this);this.animation.stop();A.setPopupsAndEmbedsEnabled(false);this._ea._ed.setAckEnabled(false);var $3f=new Rect(0,0,this._eb.width,this._eb.height);this.setRect($3f.centerIn($(window).getViewportRect()));this.makeKey();A.dimWindow(0.5,this.bind(this._ee),10009);this.setOpacity(1)},_7R:function(){this.parent();this._ec()},_ec:function(){if(this.onCancel){this.onCancel()}},_ee:function(){this.dismiss();this._ec()},dismiss:function($3q){A.setPopupsAndEmbedsEnabled(true);A.undimWindow();this.parent($3q)},_ef:function(){this.setStyle('z-index',"10010")},makeKey:function(){this.parent();this._ef()},deactivate:function(){this.parent();this._ef()}},'ModalServerPopup');var DeleteLinkDialog=sub(ModalServerPopup,{init:function($1F){this._55=$1F;var $3r=$1F.mediaItem&&$1F.mediaItem.normal;this.parent($3r?"Visit or Delete Link":"Confirm Delete",$3r?{width:420,height:190}:{width:200,height:130},A.makeUrl("/link/delete/",{siteToken:A.siteToken,linkId:$1F.id,normal:$3r,href:$1F.mediaItem&&$1F.mediaItem.getSourceUrl()}));this.setMaximizable(false)},onComplete:function(){A.eraseLink(this._55)},onError:function($3k){alert('Cannot delete link: '+$3k.msg)}},'DeleteLinkDialog');var EditCaptionDialog=sub(ModalServerPopup,{init:function($1F,$2s){this.parent('Enter a new caption for this link:',{width:410,height:210},A.makeUrl("/link/edit/caption/",{siteToken:A.siteToken,linkId:$1F.id}));this.setMaximizable(false);this._ar=$2s;this._55=$1F},onComplete:function($1f){this._55.caption=$1f.caption;this._ar(this._55)},onError:function($3k){alert("Cannot change caption: "+$3k.msg)}},'EditCaptionDialog');var PrefsDialog=sub(ModalServerPopup,{init:function(){this.parent('Apture',{width:540,height:328},A.makeUrl("/prefs/"));this.setMaximizable(false)},onComplete:function($3s){if(A.getDashboard()&&((A.prefs.enable==false&&$3s.enable!=false)||(A.prefs.enable!=false&&$3s.enable==false))){window.location.href=window.location.href}else{for(var $3t in $3s){var $3u=$3s[$3t];if($3s[$3t]!==Y[$3t]){A.prefs[$3t]=$3u}}if($3s.enable==false){A.removeLinks()}}}},'PrefsDialog');var FeedbackDialog=sub(ModalServerPopup,{init:function($1F){this.parent(A.feedbackTitle||"Send Feedback",{width:440,height:525},A.makeUrl("/feedback/",{linkId:$1F&&$1F.id,url:window.location.href,siteToken:A.siteToken}));this.setMaximizable(false)}},'FeedbackDialog');var MediaHubPopup=sub(ServerPopup,{init:function(){this.parent("Apture Media Hub",{width:704,height:479});this._eV=false;this.setMaximizable(false);this.updateLayout()},useFixedShim:false,_eW:function(){return"/mediahub/"},_bs:function(){return new A.PopupShadow('dark')},_bv:function($3v,$3w){return new PopupButton($3v,$3w,'apturePopupButtonDark')},_bu:function(){return new TitleBar({className:'apturePopupTitle aptureTitleBarDark'})},_e9:function(){this._ea=new MediaHubServerPanel(this._eW());this._ea.setPos(12+1,30);this._ea.setCommDelegate(this);this._ea.iframe._.className='apture'},_7R:function(){if(this._eV){if(confirm("Are you sure you want to close the Apture Media Hub?\n\nYou have unsaved changes.\n\nPress OK to close, or Cancel to keep the media hub open.")){this._eV=false;A.dismissPopup(this)}}else{A.dismissPopup(this)}},_eX:function($2D){if($2D.linkType==2){if($2D.token){return"Edit Apture Embed"}else{return"Add Apture Embed"}}else{if($2D.token){return"Edit Apture Link"}else{return"Add Apture Link"}}},fastOpen:function($2D,$3x){A.setPopupsAndEmbedsEnabled(false);if($2D.linkType==null){alert("Apture internal error: Unknown link type.");return}this._8a.setTitle(this._eX($2D));A.ignoreLayoutElem(this);var $3y=this._bT($3x||new CenterLayout());this.setLocalTop($3y.y);this._ea.initIframeSrc($2D);if($2D.creationMode==1&&$2D.token){this._eY($3y)}else{this._bX(250,$3y,this.bind(this._eY,[$3y]))}},_eY:function($3y){this._bV($3y);this.setOpacity(1);this.setRect($3y);this.show();this.makeKey();this._bW()},setDirty:function($3u){this._eV=$3u},hide:function(){this.setLocalLeft(-1600);this._eZ=false;A.ignoreLayoutElem(this)},show:function(){A.registerLayoutElem(this);this._eZ=true},isVisible:function(){return this._eZ},isLoading:function(){return this._ea._y.isVisible()},clickToDismiss:false,dismiss:function($3q,$3z){this.hide();this.notify(33);if(!$3z){this._ea.sendMessage({closing:1})}A.setPopupsAndEmbedsEnabled(true)},_f0:function($3A){var $3B=$3A.mediaItem||$3A.childLinks[0].mediaItem;var $2W=new Rect(0,0,240,160).centerIn(this.getRect()),$2X=new Rect(0,0,0,0).centerIn($3A.getRect()),$2Y=$3B._7()||$3B._85(),$2Z=1+$3A.childLinks.length;if(!$3A.mediaItem){$2Z--;$2X.y-=160}A.runLinkAnim($2W,$2X,$2Y,$2Z,true)},resetAndDismiss:function(){this.resizeFrame(679,416);this.dismiss(true,true)},_f1:function(){A._f1&&A._f1()},resizeFrame:function($2F,$2G){this._eb={width:$2F+25,height:$2G+63};this.resize(this._eb.width,this._eb.height);this.getRect().scrollIntoViewport()},onError:function($3k){alert("Could not create link: "+$3k.msg)},resize:function($2F,$2G){this.parent($2F,$2G);var $3C=$2F-25,$3D=$2G-63;this._ea.resize($3C,$3D)}},'MediaHubPopup');A.extend({getMediaHubPopup:function(){if(!A._f2){A._f2=new A.mediaHubPopupType();A._f2.hide();A.appendToBody(A._f2)}return A._f2},resetMediaHubPopup:function(){if(A._f2){A._f2.remove();A._f2.del();A._f2=null}}});var OverlayMediaHubPopup=sub(MediaHubPopup,{dismiss:function($3q,$3z){try{A.getSelection().deselect()}catch(ex){}this.parent($3q,$3z)},addLink:function($3E){A._h4($3E);if($3E.parentLinkToken){A.createLink($3E).insert()}else{var $3F=this;A._aa(function(){var $3A=A.getLinkByToken($3E.token);if($3A&&$3A._){$3F._f0($3A)}})}this._f1();this.resetAndDismiss()},deleteLink:function($2D){var $3G=A.getLinkByToken($2D.token);A.eraseLink($3G);this.resetAndDismiss()},updateLink:function($3E,$2D){var $3G=A.getLinkByToken($2D.token);$3E.oI=$2D.oI;$3E.pageText=$2D.pageText;var $3H=$3G.getContent();A._h4($3E);var $3A=A.createLink($3E,$3H);if($3E.parentLinkToken){A.eraseLink($3G);$3A.insert();$3A.afterDomAttach()}else{A._h3($3G);$3G.replaceWith($3A);$3A.afterDomAttach();A.removeRootLink($3G);A.addRootLink($3A);$3G.del()}this._f1();this._f0($3A);this.notify(42,$3A);this.resetAndDismiss()}},'OverlayMediaHubPopup');A.mediaHubPopupType=OverlayMediaHubPopup;A.extend({_hf:function($1Q){if(A.mode==2){if(!A._hg)return;var $3I=new Date().getTime();if(!A._hh||$3I-A._hh>1000){A._hi();A._hh=$3I}var N=A._hj;for(var I=0;I<(N||'').length;I++){var $3J=N[I];if($3J.rect.containsPoint($1Q.page)){clearTimeout(A._hk);A._hl($3J);return}}clearTimeout(A._hk);A._hk=setTimeout(A._hm,400)}},_hm:function(){A._hl(null)},_hl:function($3J){A._hn.attachToAnchor($3J)},_ho:function(){A._hg=A._hp();A._hq=A._hr();A._hn=new _hs();$(document).addEvent('mousemove',A.bindWithEvent(A._hf))},_hp:function(){var $3K=document.getElementsByTagName('p');var $3L=[];for(var $i=0;$i<$3K.length&&$i<25;$i++){var $3M=$($3K[$i]);if(!!$3M._.firstChild&&!A.isAptureElem($3M)&&A.inContentArea($3M)){$3L.push($3M)}}return $3L},_hr:function(){var $3N=document.getElementsByTagName('br');var $3O=[];for(var i=0;i<$3N.length&&i<25;i++){var $3P=$($3N[i]);if(!A.isAptureElem($3P)&&A.inContentArea($3P)){var $3Q=$3P._.nextSibling;var $3R=$3P._.previousSibling;if($3R&&$3R.nodeName!='BR'){if($3R.nodeName=='DIV'||($3Q&&$3Q.nodeName=='BR')){$3O.push($3P)}}}}return $3O},_d9:function($3f,$3S){for(var I=0;I<($3S||'').length;I++){var $3T=$3S[I];if($3T.intersectsWith($3f)){return true}}return false},_hi:function(){var $3U=A._hg,$3V=A._hj=[],$3W;if(!$3U)return;var $1a=document.body;var $3X=[];var N=A._9i;for(var I=0;I<(N||'').length;I++){var $1F=N[I];var $3Y=null;if($1F._&&$1F._.parentNode&&$1F.id){if($1F instanceof InlineMediaContainer){var O=$1F.childLinks;for(var J=0;J<(O||'').length;J++){var $3Z=O[J];if($3Z.id){$3Y=$3Z.getRect($1a,true);$3V.push(new _ht(new Rect($3Y.x,$3Y.y-15,$3Y.width,20),$3Z))}}if($3Y){var $40=new Rect($3Y.x,$3Y.y+$3Y.height-10,$3Y.width,20);$3V.push(new _hu($40,$1F));$3X.push($40)}}}}if($3U.length){$3W=$3U[0].getRect($1a,true)}for(var i=1;i<$3U.length;i++){var $3Y=$3U[i].getRect($1a,true);var $41=$3W.getBottom();var $42=$3Y.y;var $43=new Rect($3Y.x,$41-8,$3Y.width,$42-$41+16);if($43.height>30){$43.height=30}if(!A._d9($43,$3X)){$3V.push(new _hv($43,$3U[i-1]))}$3W=$3Y}var $44=A._hq;for(var i=0;i<$44.length;i++){var $3P=$44[i];var $45=$3P._.nextSibling;if($45){var $46=($45.nodeName=='BR')?$45:$3P;var $47=$($46).getRect($1a,true);var $48=$($3P._.parentNode).getWidth();$47.width=$48;$47.y-=$47.height/2;$47.height*=2;if(!A._d9($47,$3X)){$3V.push(new _hw($47,$3P))}}}var N=A._hx;for(var I=0;I<(N||'').length;I++){var $49=N[I];$49.remove()}A._hx=[]},_9p:function(){if(A._hn){A._hn.dismiss()}}});var _hy=sub(Base,{init:function($3f){this.rect=$3f},equals:function($4a){return this==$4a},getLinkParams:function(){return{}},insertPlaceholder:function($4b){}});function _hz($B){var $1W=$B.lastTextNode(true);if($1W){var $4c=A.clean($1W.nodeValue);if($4c&&$4c.length>=8){var $1X=$4c.length>30?$4c.substring($4c.length-30):$4c;var $1Y=A.getOccurrence($1W,$1W.nodeValue.length-1,$1X,true)-1;if($1Y>=0){return{pageText:$1X,oI:$1Y}}else{new MessageBox(3,"Error calculating link position. Try refreshing the page and placing the link again.").timedOpen()}}}return null}var _hw=sub(_hy,{init:function($3f,$3P){this.parent($3f);this._hA=$3P},equals:function($4a){return this._hA==$4a._hA},getLinkParams:function(){return _hz(this._hA)},insertPlaceholder:function($4b){$(this._hA._.parentNode).insertBefore($4b,this._hA)}});var _hv=sub(_hy,{init:function($3f,$B){this.parent($3f);this._52=$B},equals:function($4a){return this._52==$4a._52},getLinkParams:function(){return _hz(this._52)},insertPlaceholder:function($4b){this._52.appendChild($4b)}});var _hu=sub(_hy,{init:function($3f,$4d){this.parent($3f);this._hB=$4d},equals:function($4a){return this._hB==$4a._hB},getLinkParams:function(){return{parentLinkToken:this._hB.token}},insertPlaceholder:function($4b){this._hB.appendChild($4b)}});var _ht=sub(_hy,{init:function($3f,$3Z){this.parent($3f);this._hC=$3Z},equals:function($4a){return this._hC==$4a._hC},getLinkParams:function(){return{parentLinkToken:this._hC._et().token,before:this._hC.id}},insertPlaceholder:function($4b){$(this._hC._.parentNode).insertBefore($4b,this._hC)}});var _hs=sub(Element,{init:function(){var $O=A.getNewDomId('aptureIL');this.parent('span',{id:$O,className:'aptureBetweenPassageControl',style:{display:'inline'},apture:true});A.addStyles(A.styles.reset,$O);this.addEvent('click',this.bind(this._hD));A.addListener(1,{obj:this,fn:this._aV});this.appendChildren(this._hE=new Element('div',{className:'aptureEmbedMarkerM'}),new Element('div',{className:'aptureEmbedMarkerL'}),new Element('div',{className:'aptureEmbedMarkerR'}),this._fB=new Element('div',{className:'aptureEmbedButton'}));this.addEvent('mouseover',this.bind(this._bg));this.addEvent('mouseout',this.bind(this._hF));this._hG=this.getAnimation();this._hH=new Div({apture:true,style:{border:'2px dashed #ccc',margin:'0 auto',font:'bold 24px Helvetica',color:'gray',backgroundColor:'white',textAlign:'center',width:'250px',overflow:'hidden'}},new Div({style:{padding:'80px 10px'}},"Embed Media"));this._hI=this._hH.getAnimation();this._hI.onComplete=this.bind(this._hJ)},_hK:function(){var $4e=this._hL;if($4e&&!A.warnIfTooManyLinks()){var $4f=$4e.getLinkParams();if($4f!=null){$4f.linkType=2}return $4f}return null},_hM:function($3n){this._hN=false;this.attachToAnchor(null);$3n.removeListener({obj:this})},dismiss:function(){this._hN=false},attachToAnchor:function($4e){if(this._hN){return}if((!!this._hL!=!!$4e)||(this._hL&&!this._hL.equals($4e))){this.remove();if($4e){this._hO($4e.rect)}this._hL=$4e}this.show()},_bg:function(){if(this._hP){clearTimeout(this._hP)}this._hP=setTimeout(this.bind(this._hQ),500)},_hQ:function(){this._hG.stop();this._fB.show();this._hG.start({opacity:1,width:this._hR})},_hF:function(){if(this._hP){clearTimeout(this._hP)}this._hP=setTimeout(this.bind(this._hS),500)},_hS:function(){this._hG.stop();this._fB.hide();this._hG.start({opacity:0.5,width:92})},remove:function(){this.parent();this._hH.remove()},_hD:function($1Q){var $4g=this._hK();if(!$4g){new MessageBox(3,"Sorry, Apture is currently unable to embed multimedia at that point in the document.").timedOpen($1Q)}if($4g&&!this._hN){this._hN=true;this._5T=$4g;this._hH.setHeight(30);this._hL.insertPlaceholder(this._hH);this._hI.start({height:[30,200]});this.hide()}},_hJ:function(){var $3n=A.getMediaHubPopup();$3n.removeListener({obj:this});var $4h={obj:this,fn:this._hM};$3n.addListener(33,$4h);$3n.fastOpen(this._5T)},_aV:function(){if(A.mode!=2){this._hN=false;this.attachToAnchor(null)}},setWidth:function($2F){this.parent($2F);var $4i=Math.floor($2F/2);if(this._hT){this.setLocalLeft(this._hT-$4i)}this._hE.setWidth($2F-4);this._fB.setLocalLeft($4i-46)},_hO:function($3f){this._hG.stop();this._hR=Math.min($3f.width,1190);this._hT=Math.floor($3f.x+$3f.width/2);this._fB.hide();this.setOpacity(0.5);this.setWidth(92);var $2G=Math.min($3f.height-18,20);this.setLocalTop($3f.y+$2G/2);A.appendToBody(this);this._hH.remove();this.show()}});var Dashboard=sub(Popup,{init:function(){this.parent();this._hU=115;this._8a.setTitle("Apture Dashboard");this.setMaximizable(false);var $4j=this._gf=new ProfileLoader();this._hV=new ServerPanel({className:'aptureLogoutPanel'});this._hV.setCommDelegate(this);this._hV._ed.setAckEnabled(false);this._hV.iframe._.scrolling='no';this._hW=new Div({style:{margin:'0px 5px'}},this._31=new Div({className:'aptureEditorStatus'},"Loading..."),this._hX=new Div({className:'aptureEditorStatus aptureEditorIcon',style:{paddingBottom:'3px',borderTop:'0px',backgroundPosition:'left -115px'}},new Anchor({className:'aptureEditorLink',onclick:function(){$4j.login()}},'Sign In')," Logged out"),this._hV,this._hY=new Div({className:'aptureEditorStatus aptureEditorIcon',style:{backgroundPosition:'left 5px'}},new Anchor({className:"aptureEditorLink",onclick:this.bind(this._hZ)},'Enable'),' Editing Off '),this._i0=new Div({className:'aptureEditorStatus aptureEditorIcon',style:{backgroundPosition:'left -55px'}},new Anchor({className:"aptureEditorLink",onclick:this.bind(this._i1)},'Disable'),' Editing On ',this._i2=new Div({className:'aptureEditorInstructions'})),new Div({className:'aptureEditorStatus aptureEditorIcon',style:{backgroundPosition:'left -155px'}}," Help Topics",new Div({className:'aptureHelp'},new Anchor({onclick:this.bindWithEvent(this._i3)},'Watch Video Tutorial'))),this._i4=new Div({className:'aptureEditorStatus'},"You do not have access to edit this page."));this._31.hide();this._hX.hide();this._hY.hide();this._i0.hide();this._i4.hide();this._i5(false);this.appendChild(this._i6=new Div({style:{position:'absolute',top:'30px',left:'13px',font:"10pt \'Helvetica\'"}},this._hW));this.setStyle('overflow','hidden');var $2h=window.location.href;if(!A._e4.validReceiver){this._i7(new NeedFlash())}else if($2h&&$2h.toString().match(new RegExp("http://www\.((typepad\.com/services/widgets/preview)|(blogger\.com/display))"))){this._i7(textNode("This is a preview of the Apture Dashboard."),130)}else if(window.opera){this._i7(textNode('At this time, editing links using Apture is not compatible with the Opera web browser.  If you wish to edit this page using Apture, please try in another web browser.'))}else if(A.prefs&&A.prefs.enable==false){this._i7(new Div('It appears that you have disabled Apture links. If you wish to edit this page, ',new Element('a',{href:"javascript:void(0)",onclick:this.bindWithEvent(this._i8)},'click here'),' to enable Apture links again.'))}else{this._i9=true;$4j.addListener('logged_out',{obj:this,fn:this._ia});$4j.addListener('login_complete',{obj:this,fn:this._ib});$4j.addListener('login_successful',{obj:this,fn:this._ic});$4j.addListener('error',{obj:this,fn:this._id})}},useFixedShim:false,panelSuccess:function(){this._gf.loadProfile()},_7R:function($1Q){this._ie(false);this.parent($1Q)},_i8:function($1Q){if($1Q){$1Q.stop()}new PrefsDialog().open()},_i7:function($B,$2G){this._31.setChildren($B);this._31.show();this._hV.hide();this._if($2G||180);this._i9=false},_ig:function($1Q){if(this._ih&&this._ih.isInDom()){A.dismissPopup(this._ih);this._ih=null}else{this._ih=A.openMediaPreview(new AptureArticle({title:'Getting Started'}))}if($1Q){$1Q.stop()}},_i3:function($1Q){if(this._ii&&this._ii.isInDom()){A.dismissPopup(this._ii);this._ii=null}else{this._ii=A.openMediaPreview(A.tutorialVideo())}},clickToDismiss:false,_ib:function(){this._ij=2;A.setPref('editing',1);A.resetMediaHubPopup()},_c1:function(){this._i6.hide();var $4k=A.editorKey;if($4k){var $4l=this.getRect();$4l.y+=$(window).getScrollTop();$4l.width=220;this._ik=new MessageBox(1,[new Element('span',{className:'aptureMessageKey'},$4k),"Press the '"+$4k+"' key to reopen the Dashboard."],"To Reopen the Apture Dashboard");this._ik.timedOpen($4l)}this.parent()},resize:function($2F,$2G){this.parent($2F,$2G);this._i6.setWidth($2F-26)},_ie:function($4m){A.setPref('editor',$4m?1:2)},_il:(window.location.href.indexOf(".blogspot.com")!=-1?29:0),open:function(){this._if(this._hU);this.animation.stop();this.show();this._i6.show();this.setOpacity(1);this.setStyle('right','0px');if(this._ik){this._ik.close()}this.setStyle('position','fixed');this.setStyle('top',this._il+'px');this.setStyle('left','');if(this._.parentNode!=document.body){A.appendToBody(this)}if(this._ij==null&&A.prefs.editing!=0)this._ij=2;if(this._i9){this._ek(true)}},dismiss:function($3q){this.parent($3q);A.showBadElems()},_id:function(){var err=this._gf.getError();this._im(err)},_im:function(err){this._in();if(err.code==-4){var $2h=A.makeUrl("/site/"+A.siteToken+"/settings/",{newUrl:window.location.href});this._31._.innerHTML=err.msg+" <a href='"+A.escapeHTML($2h)+"'>Fix this</a>"}else{this._31.setText(err.msg)}this._31.show();if(err.code!=-10){this._hX.hide();this._if((err.code==-8)?160:140)}else{this._if(160)}},_io:function(){this._if(150);this._im(A.page.error);this._ip=false},_if:function($2G){this._hU=$2G;this.resize(265,$2G)},_ek:function($4n){this._31.show();if(A.page.id>0){this._gf.loadProfile(false,$4n);this._if(140)}else{if(A.page.error){setTimeout(this.bind(this._io),50)}else{this._if(115)}A.addListener(6,{obj:this,fn:this._io});A.addListener(5,{obj:this,fn:this.bind(this._ek,[true])})}},_ia:function(){this._in();A.resetMediaHubPopup()},getUserContext:function(){return this._gf.getUserContext()},_ic:function(){var $1R=this._gf.getUserContext();this._hV.setLocation(A.makeUrl("/user/dashboard/",{},true));this._31.hide();this._hX.hide();this._i5(true);if(!$1R.canEdit()){this._if(140+10);this._i4.show()}else if(!$1R.canEditPage()&&!A._9i.length){this._if(140+10);this._i4.show();this._i4.setText("This page does not have editable links.")}else{this._ie(true);this._i4.hide();if(this._ij==2){this._iq()}else{this._ir()}}},_i5:function($3u){this._hV.setHeight($3u?37:0);this._hV.iframe.setHeight($3u?37:0)},_in:function(){this._ir();this._if(115);this._31.hide();this._hX.show();this._hY.hide();this._i0.hide();this._i4.hide();this._i5(false)},_i1:function(){A.setPref('editing',0);this._ij=1;this._ir()},_hZ:function(){A.setPref('editing',1);this._iq()},toggleEditing:function(){var $1R=this.getUserContext();if(!$1R||!$1R.loggedIn||!$1R.canEdit())return;if(A.mode==2)this._i1();else
this._hZ()},_ir:function(){A.mode=1;this.notify(1);this._if(150);this._hY.show();this._i0.hide();A.showBadElems()},_iq:function(){A.mode=2;this.notify(1);A.hideBadElems("hidden while Apture editing is enabled. To switch out of editing mode, type the '"+A.editorKey+"' key or use the Apture Dashboard.");this._if(175);this._i0.show();if(this.getUserContext().canEditPage()){this._i2.setText("Highlight text to link, or click between paragraphs to embed media.")}else{this._i2.setText("Open an existing Apture link and click the Add Related Media button.")}this._hY.hide()}},'Dashboard');A.extend({_9e:function(){if(!A.overlay&&!(A.capabilities&4)){A._8U();A.overlay=1}var $23=this._8J;var $4o=$23&&$23._.parentNode;if($4o&&$4o.nodeName=='HEAD'){alert("Error: Apture script tag found in the <head>. The Apture script tag should be placed near the end of the <body> tag, after the content.");return}if(!document.getElementsByTagName('head').item(0)){alert("Error: HTML page does not have a <head> element. In order to add Apture links, please add <head></head> before the <body> tag in your HTML template.");return}if(!this._is){this._is=new Dashboard()}this._is.open()},getDashboard:function(){return this._is}});PreviewPopup.implement({_aW:function(){var $4p=this._cj&&this._cj.id&&(A.mode==2);var $4q=this._8p;if($4p||$4q){this._cK();this._cn.show();if($4q){this._cL.setText($4q)}else if($4p){this._it()}if($4p){this._iu()}}else if(this._cn){this._cn.hide()}if($4p&&!this._iv&&this._cj.creationMode!=4&&this._cj.linkType!=3){this._iw()}if(this._iv){this._iv.setVisible($4p)}this._cg&&this._cg.setVisible(this._cj&&!$4p);if(this._ce){this._ce.setVisible(!$4p)}if(this._b3){this._b3.updateView()}},_cJ:function(){new PrefsDialog().open()},_cH:function(){new FeedbackDialog(this._cj).open()},_ck:function(){this._ix()},_iw:function(){this._ca.appendChild(this._iv=new Div({className:'aptureActionBarControls'},this._iy=new Div({className:'aptureDeleteLink',onmouseover:this.bind(this._eu),onmouseout:this.bind(this._ex),onmousedown:this.bind(this._ey),onmouseup:this.bind(this._ex),onclick:this.bindWithEvent(this._eD)}),this._iz=new Div({className:'aptureEditLink',onmouseover:this.bind(this._iA),onmouseout:this.bind(this._iB),onmousedown:this.bind(this._iC),onmouseup:this.bind(this._iB),onclick:this.bindWithEvent(this._iD)}),this._ew=new Element('div',{className:'aptureActionText',style:{cursor:'pointer'},onmouseover:this.bind(this._eu),onmouseout:this.bind(this._ex),onmousedown:this.bind(this._ey),onmouseup:this.bind(this._ex),onclick:this.bindWithEvent(this._eD)})));if(A.geckoMac){this._ew.setStyle('padding-top','1px')}this._iy.setStyles({font:"bold 12px helvetica",color:"red"})},_iA:function(){this._iz.setStyle('background-position','-80px -15px');this._ew.setStyle("color","#00c");this._ew.setText("Edit")},_iC:function(){this._iz.setStyle('background-position','-80px -30px')},_iB:function(){this._iz.setStyle('background-position','-80px top');this._ew.setText("")},_eu:function(){this._iy.setStyle("background-position","-100px -15px");this._ew.setStyle("color","#c00");this._ew.setText("Delete")},_ey:function(){this._iy.setStyle("background-position","-100px -30px")},_ex:function(){this._iy.setStyle("background-position","-100px top");this._ew.setStyle("color","#6d6d6d");this._ew.setText("")},_it:function(){this._cL.setChildren(new Element('ins',{style:{fontStyle:'italic',cursor:'pointer'},onmouseover:this.bind(this._eE),onmouseout:this.bind(this._eG),onclick:this.bindWithEvent(this._eI),innerHTML:"Add a Caption"}))},_iu:function(){this._cL.appendChild(this._eF=this._eF||new Element('a',{className:'aptureEditCaption',onmouseover:this.bind(this._eE),onmouseout:this.bind(this._eG),onclick:this.bindWithEvent(this._eI),innerHTML:"&nbsp;"}))},_eE:function(){this._cL.setStyle('backgroundColor','#ffffcc');this._eF.setStyle('background-position','5px -80px')},_eG:function(){this._cL.setStyle('backgroundColor','#F0F6FC');this._eF.setStyle('background-position','5px -60px')},_iE:function($1F){this._8p=$1F.caption;this._aV()},_eI:function($1Q){var $1F=this._cj;if($1F){new EditCaptionDialog($1F,this.bind(this._iE)).open();$1Q.stop()}},resizeSuggested:function(){var $4r=this._bZ();this.resize($4r.width,$4r.height)},_iF:function(){if(this._iG){this.setEnabled(true);this.show();this._ix();this._iG=false}},_iH:function($3A){if(this._iG){this.setLink($3A);this.setEnabled(true);this.show();this._1L.afterDomAttach();$3A.setOpenState(2);var $4s=this._bZ();this.resize($4s.width,$4s.height);this._ix();this._iG=false}},_ix:function(){if(A._f2){A.getMediaHubPopup().removeListener({obj:this})}},_iD:function($1Q){var $1F=this._cj;if($1F&&!this._iG){this._iG=true;var $3n=A.getMediaHubPopup();$3n.addListener(33,{obj:this,fn:this._iF});$3n.addListener(42,{obj:this,fn:this._iH});var $25=this.getRelPos();var $4t=$(window).getViewportRect();var $4u=$4t.width+$4t.x-704-10;$25.x=Math.max(0,Math.min($25.x,$4u));this.setEnabled(false);this.hide();var $1b=$1F._et();$3n.fastOpen({creationMode:$1F.creationMode,linkType:$1F.linkType,token:$1F.token,parentLinkToken:$1b&&$1b.token,pageText:$1F.pageText,oI:$1F.oI},new FixedLayout($25));$1Q.stop()}},_eD:function($1Q){new DeleteLinkDialog(this._cj).open();$1Q.stop()}});var ResizeControl=sub(Div,{init:function($4v,$4w,$4x,$4y,$4z){this.parent({className:"aptureResizeControl"+$4v});this._iI=$4w||0;this._iJ=$4x||0;this._iK=$4y;this._iL=$4z;this._iM=$4v;this.addListener(71,{obj:this,fn:this._eL});this.addListener(72,{obj:this,fn:this._iN})},_eL:function(){var $4A=this._iO=this._iK();this._iP=($4A.width?$4A.height/$4A.width:1)||1},_iN:function(){var $4B=this._7O;var $4C=this._7P;var $4D=this._iO;var $4E=$4D.copy();var $4v=this._iM;var $4F=$4v&2;var $4G=$4v&8;if($4v&3)$4E.width+=$4B*($4F?-1:1);if($4v&12)$4E.height+=$4C*($4G?-1:1);if($4E.width<this._iI)$4E.width=this._iI;if($4E.height<this._iJ)$4E.height=this._iJ;if(this._iQ){if($4v&3){$4E.height=$4E.width*this._iP}else{$4E.width=$4E.height/this._iP}}if($4G){$4E.y+=$4D.height-$4E.height}if($4F){$4E.x+=$4D.width-$4E.width}this._iL($4E)},setFixedRatio:function($4H){this._iQ=$4H}},'ResizeControl');Draggable.implementIn(ResizeControl);A.initReceiver()}A.styles.editor="a.$EditorLink{font:bold 12px \"Helvetica\"!;float:right!; text-decoration:none!;color:black!}a.$EditorLink:hover{color:#444!}a.$EditorLink:active{color:black!}## .$EditorStatus{font:bold 12px \"Helvetica\"!;padding:4px 0px 2px 0px;border-top:1px solid #eee;color:#333}## .$EditorStatus *,## .$EditorStatus a:hover,## .$EditorStatus a:link{font:bold 12px \"Helvetica\"}## .$EditorIcon{padding-left:17px;background-image:url(~/editor_icons.gif?v3);background-repeat:no-repeat}.$EditorInstructions{font:8pt \"Helvetica\",sans-serif!;color:#666666!}.$Help,.$Help *{font:11px \"Helvetica\",sans-serif!;color:#666!}.$Help a{text-decoration:none!;color:#06c!}.$Help a:hover{text-decoration:underline!;color:#04a!}iframe.$LogoutPanel{width:231px;margin-bottom:0px}.$InlineLinkerInsertSpace{border:1px solid gray!;text-align:center;font-family:\"lucida grande\",tahoma,verdana,arial,sans-serif!;font-size:24px!;color:#999999!;z-index:10001!;overflow:hidden;display:none;height:0px}.$InlineLinkerParagraphEndMarker{ border:1px solid black;line-height:normal;margin:0px;padding:0px;top:0px;left:0px;z-index:10002;vertical-align:baseline}## .$BetweenPassageControl{display:block;position:absolute;z-index:9999;height:21px}## .$BetweenPassageControl div{cursor:pointer}.$EndPassageControl,.$EndPassageControl *{display:inline;font:bold 12px \"Helvetica\"!;cursor:pointer!}.$EndPassageControl{padding-left:2px}.$EndPassageControl .$LinkIcon{padding-left:11px!;background:url(~/editor_icons.gif?v3) no-repeat left -199px!}.$InlineLinkerControlText{font:11px \"Lucida Grande\";display:inline}.$Highlighted{background-color:#222;color:#eee}## .$ResizeControl5{width:12px;height:12px;cursor:url(~/cursor_resize.gif),se-resize;background:url(~/resize.gif?v2) no-repeat right -12px;position:absolute;overflow:hidden;right:-5px;bottom:-7px}## .$ResizeControl6{width:12px;height:12px;cursor:url(~/cursor_resize_sw.gif),sw-resize;background:url(~/resize.gif?v2) no-repeat left -12px;position:absolute;overflow:hidden;left:-5px;bottom:-7px}## a.$EditCaption,## a.$EditCaption:hover,## a.$EditCaption:link{cursor:pointer;background:url(~/add_edit_delete.gif?v2) no-repeat 5px -60px;padding-left:18px;font-size:12px;text-decoration:none!}## .$DeleteLink,## .$EditLink{float:right;width:16px;height:13px;cursor:pointer;overflow:hidden;background:url(~/footer_icons.gif) no-repeat -100px top}## .$EditLink{background-position:-80px top;margin-right:6px}## .$DeleteInlineLink{margin-top:0px;margin-right:7px;float:right;width:16px;height:13px;cursor:pointer;overflow:hidden;background:url(~/footer_icons.gif) no-repeat -100px top}## .$EditInlineLink{margin-top:0px;margin-right:3px;float:right;width:16px;height:13px;cursor:pointer;overflow:hidden;background:url(~/footer_icons.gif) no-repeat -80px top}## .$EmbedMarkerL{position:absolute;height:9px;width:10px;left:0px;top:6px;background:url(~/embedline.gif) no-repeat left top}## .$EmbedMarkerM{position:absolute;left:2px;top:6px;height:9px;width:100%;background:url(~/embedline.gif) no-repeat -10px top}## .$EmbedMarkerR{position:absolute;right:0px;top:6px;height:9px;width:10px;background:url(~/embedline.gif) no-repeat right top}## .$EmbedButton{position:absolute;top:0px;width:92px;height:21px;background:url(~/embedbutton.gif) no-repeat left top}## .$ActionBarControls{position:absolute;right:5px;top:0px;width:150px;text-align:right;font:12px \"Helvetica\";z-index:10}iframe.${background-color:white;border:none; position:absolute} ## .$LinkerLoadingContainer{position:absolute;top:0px;left:0px;background-color:white;z-index:10}## .$LinkerLoadingText{padding-top:40px;text-align:center;font:bold 18px Helvetica,Arial,sans-serif;color:#6d6d6d}::-moz-selection{background:#444;color:#eee}::selection{background:#444;color:#eee}".replace(/~/g,apture.imgDir).replace(/\$/g,'apture').replace(/\!/g,'!important');A.addStyles(A.styles.editor);if(A.isApp){A._ho()}A.setLoaded('editor')})();