/* :asset_packager_compatibility, 'config/asset_packages.yml' @ 1305154354 */


/* :files, 'public/javascripts/shared', ... @ (none) */


/* :files, 'app/views', ... @ 1305154352 */
/* app/views/documents/fourgen/_ads.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
if(!Scribd.Ads){Scribd.Ads=new Object();}
Scribd.Ads.PREFIX='between_page_ads_';Scribd.Ads.adContainers={};Scribd.Ads.loadCallbacks=[function(){for(var pageNum in docManager.pages){if(pageNum>1&&pageNum%2==1&&docManager.pages.hasOwnProperty(pageNum)){var adContainer=$(Scribd.Ads.PREFIX+pageNum);if(adContainer){var adSlot=Math.round((pageNum-3)/2)%5;if((Scribd.Ads.betweenPageAd[adSlot].height+'px')!=adContainer.style.height){adContainer.style.height=Scribd.Ads.betweenPageAd[adSlot].height+'px';}}}}},function(){if(docManager.pages.hasOwnProperty(1)){Scribd.Ads.showAds(docManager.pages[1]);}},function(){docManager.addEvent('expectedFirstPageChanged',Scribd.Ads.expectedFirstPageChanged);docManager.addEvent('exitedFullscreen',Scribd.Ads.exitedFullscreen);docManager.addEvent('enteredFullscreen',Scribd.Ads.enteredFullscreen);docManager.addEvent('viewmodeChanged',Scribd.Ads.viewmodeChanged);docManager.addEvent('zoomed',Scribd.Ads.zoomed);}];Scribd.Ads.expectedFirstPageChanged=function(pageNum){for(var i=pageNum;i<pageNum+3;i++){if(docManager.pages.hasOwnProperty(i)){Scribd.Ads.showAds(docManager.pages[i]);}}};Scribd.Ads.fetchAdHtml=function(pageNum){var adSlot=Math.round((pageNum-3)/2)%5;if(Scribd.Ads.betweenPageAd[adSlot].url&&Scribd.Ads.betweenPageAd[adSlot].url!=''){return'<iframe scrolling="no" height="'+Scribd.Ads.betweenPageAd[adSlot].height+'" frameborder="0" width="728" marginheight="0" marginwidth="0" src="'+Scribd.Ads.betweenPageAd[adSlot].url+'#'+adSlot+'"></iframe>';}
return'';};Scribd.Ads.insertAds=function(page){if(page.pageNum==1){Scribd.Ads.adContainers[page.pageNum]=$(Scribd.Ads.PREFIX+page.pageNum);}else if(page.pageNum%2==1){var adHtml=Scribd.Ads.fetchAdHtml(page.pageNum);var adContainer=$(Scribd.Ads.PREFIX+page.pageNum);adContainer.update(adHtml);Scribd.Ads.adContainers[page.pageNum]=adContainer;}};Scribd.Ads.showAds=function(page){var mode=docManager.viewMode()||'scroll';if(mode=='scroll'){if(!Scribd.Ads.adContainers.hasOwnProperty(page.pageNum)&&page.pageNum%2==1){Scribd.Ads.insertAds(page);}}};Scribd.Ads.enteredFullscreen=function(){var adContainer=$(Scribd.Ads.PREFIX+'1');if(adContainer){adContainer.style.display='none';}};Scribd.Ads.exitedFullscreen=function(){var adContainer=$(Scribd.Ads.PREFIX+'1');if(adContainer){adContainer.style.display='block';}};Scribd.Ads.viewmodeChanged=function(newMode,oldMode){if(oldMode=='scroll'){for(var pageId in docManager.pages){if(docManager.pages.hasOwnProperty(pageId)){var page=docManager.pages[pageId];Scribd.Ads.registerAds(page);}}}else if(newMode=='scroll'){for(var pageId in docManager.pages){if(docManager.pages.hasOwnProperty(pageId)){var page=docManager.pages[pageId];Scribd.Ads.unregisterAds(page);}}}};Scribd.Ads.zoomed=function(multiplier){var page=docManager.pages[docManager.currentPageNum()];var adContainer=$(Scribd.Ads.PREFIX+'1');if(adContainer){adContainer.style.top=(page.boundingRect.bottom-60)+'px';}};Scribd.Ads.registerAds=function(page){if(page.pageNum==1){if(!Scribd.Ads.adContainers.hasOwnProperty(1)){Scribd.Ads.insertAds(page);}
var adContainer=$(Scribd.Ads.PREFIX+'1');if(adContainer){adContainer.style.display='block';adContainer.style.position='absolute';adContainer.style.left='0px';adContainer.style.top=(page.boundingRect.bottom-60)+'px';}}else{var adContainer=$(Scribd.Ads.PREFIX+page.pageNum);if(adContainer){adContainer.style.display='none';}}};Scribd.Ads.unregisterAds=function(page){var adContainer=$(Scribd.Ads.PREFIX+page.pageNum);if(adContainer){adContainer.style.display='block';adContainer.style.position='';adContainer.style.left='';adContainer.style.top='';}};document.observe('dom:loaded',function(){if(Scribd.Ads.betweenPageAd){for(var i=0;i<Scribd.Ads.loadCallbacks.length;i++){Scribd.Ads.loadCallbacks[i]();}}else{for(var pageNum in docManager.pages){if(pageNum%2==1){var adContainer=$(Scribd.Ads.PREFIX+pageNum);if(adContainer){adContainer.style.display='none';}}}}});


/* :class_inlines, 'app/views', ... @ 1305154352 */
/* app/views/documents/fourgen/_comments.js @ 1305154352 */

document.observe("dom:loaded",function(){$A(['document_comment','document_comment_form']).each(function(dom_id){var form=$(dom_id);if(form){form.insert('<input name="context" type="hidden" value="4gen" />');}});});


/* app/views/documents/fourgen/_toc.js @ 1305154352 */

Scribd.TOC=(function(){var selector=function(x){return"#sectionlist "+x;};var toc_click_callbacks=[];var cur_page=1;var initialized=false;var num_pages;var next_btn,prev_btn,hide_btn,show_btn,prev_next_span;var initialize=function(){if(initialized){return};initialized=true;var sectionlist=$('sectionlist');num_pages=sectionlist.down('ul').getAttribute('data-page-count');next_btn=sectionlist.down('.toc_next');prev_btn=sectionlist.down('.toc_prev');hide_btn=sectionlist.down('.toc_collapse');show_btn=sectionlist.down('.toc_show_all');prev_next_span=sectionlist.down('.toc_prev_next');attachClickListeners();};var attachClickListeners=function(){$$('#sectionlist ul').first().observe('click',function(e){var sectionlink=e.findElement().up();if(sectionlink.hasAttribute('data-section')){var section=sectionlink.getAttribute('data-section');var first_page=sectionlink.getAttribute('data-first-page');document.location.hash="#page="+first_page;docManager.gotoPage(first_page);trackEvent('FourGen','Sectionized','TOC_NavClick');toc_click_callbacks.each(function(callback){callback(section);});e.stop();e.preventDefault();}});next_btn.observe('click',function(e){e.stop();e.preventDefault();gotoPage(cur_page+1);});prev_btn.observe('click',function(e){e.stop();e.preventDefault();gotoPage(cur_page-1);});hide_btn.observe('click',function(e){e.stop();e.preventDefault();collapse();});show_btn.observe('click',function(e){e.stop();e.preventDefault();show_all();});}
var show=function(section){$$('.toc_section_'+section).each(Element.show);};var hide=function(section){$$('.toc_section_'+section).each(Element.hide);};var gotoPage=function(p){if(p>0&&p<=num_pages){hide(cur_page);cur_page=p;show(cur_page);if(cur_page===1){prev_btn.addClassName('grey');}else{prev_btn.removeClassName('grey');}
if(cur_page==num_pages){next_btn.addClassName('grey');}else{next_btn.removeClassName('grey');}}}
var show_all=function(){$R(1,num_pages).map(function(x){show(x);});[show_btn,prev_next_span].each(Element.hide);hide_btn.show();}
var collapse=function(){$R(1,num_pages).map(function(x){hide(x);});[show_btn,prev_next_span].each(Element.show);gotoPage(cur_page);hide_btn.hide();}
var register_nav_callback=function(fx){toc_click_callbacks[toc_click_callbacks.size()]=fx;};return{initialize:initialize,register_nav_callback:register_nav_callback,num_pages:num_pages,cur_page:cur_page,next:function(){gotoPage(cur_page+1);},prev:function(){gotoPage(cur_page-1);},show_all:show_all,collapse:collapse};}());


/* app/views/documents/fourgen/_search.js @ 1305154352 */

Scribd.init('Scribd','Annotation');Scribd.init('Scribd','Fourgen');Scribd.init('Scribd','DOM');Scribd.Fourgen.DocSearcher=Class.create({initialize:function(options){var doc_id=options.doc_id,upload_id=options.upload_id,secret_password=options.secret_password;var that=this;this.cache=new Scribd.Fourgen.DocSearcher.Cache(function(query,dataHandler){var cache=this;Scribd.Fourgen.DocSearcher.remote_search({'query':query,'doc_id':doc_id,'upload_id':upload_id,'secret_password':secret_password,success:function(data){if(data){cache.set(query,data);dataHandler(data);that.trackEvent('result.success',data.length);}else{cache.set(query,null);that.trackEvent('result.null');}},failure:function(error){cache.set(query,false);dataHandler(false);that.trackEvent('result.failed');}});});this.queryHistory=[];this.queryHistoryIndex=0;},search:function(query,resultHandler){this.queryHistory.push(query);this.queryHistoryIndex=this.queryHistory.length-1;this.trackEvent('submit');this.cache.fetch(query,resultHandler);},trackEvent:function(eventName,extra){if(this.currentQuery()){var eventData=[this.queryHistoryIndex,this.currentQuery()];if(extra!==undefined){eventData.push(extra);}
$rat('fourgen.toolbar.search.'+eventName,eventData);}},currentResults:function(){return this.cache.get(this.currentQuery());},currentQuery:function(){return this.queryHistory[this.queryHistoryIndex];},setCurrentQueryTo:function(position){if(position>=0&&position<this.queryHistory.length){this.queryHistoryIndex=position;}},pastQueries:function(n){var historyLength=this.queryHistory.length,queries=[];n=Math.min(n||10,historyLength);for(var i=1;i<=n;i++){var position=historyLength-i;queries.push({'position':position,'query':this.queryHistory[position]});}
return queries;}});Scribd.Fourgen.DocSearcher.BASE_URL="/search-4gen";Scribd.Fourgen.DocSearcher.remote_search=function(options){var params={'query':options.query,'wordUploadId':options.upload_id,'wordDocumentId':options.doc_id};if(options.secret_password)
params.secretPassword=options.secret_password;new Ajax.Request(Scribd.Fourgen.DocSearcher.BASE_URL,{parameters:params,method:'get',onSuccess:options.success&&function(resp){options.success(resp.responseJSON);},onFailure:options.failure});};Scribd.Fourgen.DocSearcher.UI=Class.create({initialize:function(containerSelector,searcher){this.searcher=searcher;this.templates=Scribd.Fourgen.DocSearcher.UI.Templates;/*<sl:translate>*/
this.queryPlaceholder='Search within document...';/*</sl:translate>*/
this.query=null;this.selectedResult=null;this.currentHightedText=null;this.loadedPages={};this.highlightedPages={};this.resultsCount=0;this.resultsPosition=0;this.highlightingSelectedPage={};this.container=$$(containerSelector).first();this.popupContainer=$('search_results_popup');this.form=this.container.down('form');this.queryInput=this.form.down('.query');this.clearButton=this.form.down('.clear_query');this.searchButton=this.form.down('.search_submit');this.results=this.container.down('.results');this.summary=this.container.down('.header .search_summary');this.queryHistory=this.container.down('.query_history');this.resultSelectionContainers=this.container.select('.results_selection')
this.resultSelectionInfo=this.container.down('.header .result_selection_info')
this.attachBehaviors();},attachBehaviors:function(){this.handleSearchForm();this.handleCloseButton();this.handleClearButton();this.handleSearchButton();this.handleResultsSelectionControls();this.handleResultClick();this.handleHistoryClick();docManager.addEvent('pageLoaded',this.handlePageLoaded.bind(this));docManager.addEvent('expectedFirstPageChanged',this.handlePageChanged.bind(this));},handleSearchForm:function(){var that=this;this.form.observe('submit',function(e){e.stop();that.fireSearch();});this.queryInput.setValue(this.queryPlaceholder);this.queryInput.observe('focus',function(){if(that.queryInput.getValue()===that.queryPlaceholder){that.queryInput.setValue('');}});this.queryInput.observe('keyup',function(e){var newquery=that.queryInput.getValue();if(e.keyCode===27){that.hide();}
if(newquery&&newquery!==''&&newquery!=that.queryPlaceholder){that.clearButton.addClassName('clear_query_on');that.form.addClassName('querying');}else{that.clearButton.removeClassName('clear_query_on');that.form.removeClassName('querying');}});this.form.enable();},handleCloseButton:function(){var that=this;this.container.down('.header .close_button').observe('click',function(e){e.stop();that.hide();});},handleClearButton:function(){var that=this;this.clearButton.observe('click',function(e){e.stop();that.resetAndClearQuery();});},handleSearchButton:function(){var that=this;this.searchButton.observe('click',function(e){e.stop();that.fireSearch();});},handlePageLoaded:function(container){var pageNum=/^outer_page_(\d+)$/.exec(container.id)[1];if(this.query&&!this.isHighlightingSelectedPage(pageNum)){this.setLoadedPage(pageNum);this.highlightOnPage(pageNum,this.query);}},handlePageChanged:function(pageNum){if(this.query&&!this.hasHighlightedPage(pageNum)&&!this.isHighlightingSelectedPage(pageNum))
this.highlightOnPage(pageNum,this.query);},handleResultsSelectionControls:function(){var that=this;this.resultSelectionContainers.invoke('observe','click',function(e){e.stop();var clicker=e.findElement();if(clicker.hasClassName('next')){that.gotoNextSelected();}else if(clicker.hasClassName('previous')){that.gotoPreviousSelected();}});},handleResultClick:function(){var that=this;this.results.observe('click',function(e){var result=e.findElement().up();if(result.hasClassName('result')){e.stop();that.gotoSelectedPage(result);}});},handleHistoryClick:function(){var that=this;if(this.queryHistory){this.queryHistory.observe('click',function(e){e.stop();var clicked=e.findElement();if(!clicked.hasClassName('selected')&&clicked.readAttribute('data-position')){var position=parseInt(clicked.readAttribute('data-position'));that.queryHistory.select('a.selected').invoke('removeClassName','selected')
clicked.addClassName('selected')
that.searcher.setCurrentQueryTo(position);that.queryInput.setValue(that.searcher.currentQuery());that.query=that.searcher.currentQuery();that.renderResults(that.searcher.currentResults());that.renderResultSelectionInfo()}});}},fireSearch:function(){var that=this;if(this.query!==this.queryInput.getValue()){this.reset();this.query=this.queryInput.getValue();if(this.query&&this.query!==''&&this.query!==this.queryPlaceholder){this.renderSearching();this.show();this.searcher.search(this.query,function(data){that.renderResults(data);that.gotoNextSelected();});this.renderQueryHistory();}else{this.resetAndClearQuery();}}else{if(this.query&&this.query!==''&&this.query!==this.queryPlaceholder){this.toggle();}}},gotoNextSelected:function(){if(this.resultsCount<=0)return;if(this.selectedResult&&this.selectedResult.next('.result')){this.setSelectedResult(this.selectedResult.next('.result'));}else{this.setSelectedResult(this.results.down('.result'));}
this.gotoSelected();},gotoPreviousSelected:function(){if(this.resultsCount<=0)return;if(this.selectedResult&&this.selectedResult.previous('.result')){this.setSelectedResult(this.selectedResult.previous('.result'));}else{this.setSelectedResult(this.results.down('.result',this.resultsCount-1));}
this.gotoSelected();},gotoSelected:function(){if(this.selectedResult){var position=parseInt(this.selectedResult.readAttribute('data-position'));if(position<this.resultsPosition){this.resultsPosition=position;}else if(position>this.resultsPosition+3){this.resultsPosition=Math.max(0,position-3);}
this.results.scrollTop=this.selectedResult.getHeight()*this.resultsPosition;this.gotoSelectedPage(this.selectedResult);}},gotoSelectedPage:function(result){var that=this;this.setSelectedResult(result);this.renderResultSelectionInfo();var pageNum=result.readAttribute('data-pagenum'),position=result.readAttribute('data-position');if(pageNum!=docManager.currentPageNum()){this.setHighlightingSelectedPage(pageNum);docManager.gotoPage(pageNum);}
this.highlightOnPage(pageNum,that.query,function(){var highlightedIndex=0,snippets=that.results.select('.pagefound'+pageNum);for(var i=0;i<snippets.length;i++){if(position==snippets[i].getAttribute('data-position')){highlightedIndex=i;break;}}
var expectedHighlightsOnPage=snippets.length,highlighted=$$('#outer_page_'+pageNum+' .fourgen_highlight'),currentHighlighted=highlighted[highlightedIndex];if(currentHighlighted){if(that.currentHighlightedText)that.currentHighlightedText.removeClassName('fourgen_highlight_selected')
that.currentHighlightedText=currentHighlighted;currentHighlighted.addClassName('fourgen_highlight_selected');var offset=Scribd.DOM.scaledCumulativeOffset(currentHighlighted);if(offset!==0){window.scrollTo(offset.left,offset.top-10);}}
that.unsetHighlightingSelectedPage(pageNum);});},highlightOnPage:function(pageNum,query,callback){var that=this;var snippets=this.results.select('.pagefound'+pageNum);var expectedHighlightsOnPage=snippets.length;if(expectedHighlightsOnPage>0){var page_container_id='outer_page_'+pageNum;if(that.hasLoadedPage(pageNum)){Scribd.Annotation.highlightText($(page_container_id),query,'fourgen_highlight');that.setHighlightedPage(pageNum);callback&&callback($$('#outer_page_'+pageNum+' .fourgen_highlight'));}else{var _highlight=function(attempt,retries){window.setTimeout(function(){var found=Scribd.Annotation.highlightText($(page_container_id),query,'fourgen_highlight');if(attempt<retries&&found<expectedHighlightsOnPage){return _highlight(attempt+1,retries);}
that.setHighlightedPage(pageNum);callback&&callback($$('#outer_page_'+pageNum+' .fourgen_highlight'));},500);}
_highlight(0,8);}}},renderResults:function(data){if(this.query){if(data&&data.length>0){this.resultsCount=data.length;var results=[];var matchPattern=new RegExp('('+RegExp.escape(this.query)+')','i');this.form.addClassName('found');this.renderResultsSelectionControls();this.summary.update(this.templates.summary.evaluate({count:data.length,query:this.query.escapeHTML()}));for(var i=0;i<data.length;i++){var d=data[i];var snippet=d.snippet.escapeHTML().sub(matchPattern,function(match){return('<span class="found">'+match[1]+'</span>');});results[i]=this.templates.result.evaluate({position:i,pageNum:d.pageNum,'snippet':snippet});}
this.results.update(results.join(''));}else{this.resultsCount=0;this.form.removeClassName('found');this.summary.update(this.templates.summary.evaluate({count:0,query:this.query.escapeHTML()}));this.results.update('No search result is found');}
this.show();}},renderSearching:function(){this.renderResultsSelectionControls();this.form.addClassName('querying');this.summary.update(this.templates.searching.evaluate({query:this.query.escapeHTML()}));this.results.update(this.templates.spinner.evaluate());},renderResultsSelectionControls:function(){this.resultsCount===0?this.resultSelectionContainers.invoke('hide'):this.resultSelectionContainers.invoke('show');},renderResultSelectionInfo:function(){if(this.resultSelectionInfo&&this.selectedResult&&this.resultsCount!==0){var position=parseInt(this.selectedResult.readAttribute('data-position'));this.resultSelectionInfo.update('Result '+(position+1)+' of '+this.resultsCount);}else{this.resultSelectionInfo.update('');}},renderQueryHistory:function(){if(this.queryHistory){var queries=this.searcher.pastQueries(6);if(queries.length>1){this.queryHistory.update('<span class="label">Search history: </span>'+
$A(queries).map(function(q){return Scribd.Fourgen.DocSearcher.UI.Templates.queryHistory.evaluate({position:q.position,query:q.query.truncate('25').escapeHTML()});}).join('<span class="sep"> » </span>'));this.queryHistory.down('a').addClassName('selected');this.queryHistory.show();}}},show:function(){if(!this.popupContainer.visible())
Scribd.Toolbar.handlePopup(this.popupContainer.id);Scribd.Toolbar.viewmode_popup.hide();},hide:function(){if(this.popupContainer.visible())
Scribd.Toolbar.handlePopup(this.popupContainer.id);},toggle:function(){Scribd.Toolbar.handlePopup(this.popupContainer.id);Scribd.Toolbar.viewmode_popup.hide();},reset:function(){this.query=null,this.resultsCount=0;this.highlightedPages={},this.highlightingSelectedPage={};Scribd.Annotation.removeHighlight();this.resetSelectedResult();this.form.removeClassName('found');this.resultSelectionContainers.invoke('hide');},resetAndClearQuery:function(){this.reset();this.queryInput.setValue(this.queryPlaceholder);this.clearButton.removeClassName('clear_query_on');this.form.removeClassName('querying');this.hide();},setSelectedResult:function(result){if(!result)return;if(this.selectedResult){this.selectedResult.removeClassName('selected');}
result.addClassName('selected');this.selectedResult=result;},resetSelectedResult:function(){if(this.selectedResult){this.selectedResult.removeClassName('selected');this.selectedResult=null;}},isHighlightingSelectedPage:function(pageNum){return this.highlightingSelectedPage['p'+pageNum]===true;},setHighlightingSelectedPage:function(pageNum){this.highlightingSelectedPage['p'+pageNum]=true;},unsetHighlightingSelectedPage:function(pageNum){this.highlightingSelectedPage['p'+pageNum]=false;},hasLoadedPage:function(pageNum){return this.loadedPages['p'+pageNum]===true;},setLoadedPage:function(pageNum){this.loadedPages['p'+pageNum]=true;},hasHighlightedPage:function(pageNum){return this.highlightedPages['p'+pageNum]===true;},setHighlightedPage:function(pageNum){this.highlightedPages['p'+pageNum]=true;}});Scribd.Fourgen.DocSearcher.UI.Templates={summary:new Template('<span class="count">#{count}</span> results for: <span class="found">#{query}</span>'),result:new Template('\
    <a class="result pagefound#{pageNum}" data-position="#{position}" data-pagenum="#{pageNum}">\
    <span class="snippet">...#{snippet}...</span>\
    <span class="page">p. #{pageNum}</span>\
    </a>'),searching:new Template('Searching for: <span class="found">#{query}</span>'),spinner:new Template('<img src="/images/4gen/spinner_24x24.gif" class="spinner"/>'),queryHistory:new Template('<a data-position="#{position}">#{query}</a>')};Scribd.Fourgen.DocSearcher.Cache=Class.create({initialize:function(missHandler){this.cache={};this.missHandler=missHandler.bind(this);},fetch:function(key,dataHandler){var data=this.get(key);if(data===undefined){this.missHandler(key,dataHandler);}else{dataHandler(data);}},get:function(key){return this.cache[this._normalizedKey(key)];},set:function(key,data){this.cache[this._normalizedKey(key)]=data;},_normalizedKey:function(key){if(key)
return key.toUpperCase();return key;}});Scribd.Annotation.highlightText=function(node,text,highlightClass){var highlightClass=highlightClass||'fourgen_highlight';var highlighted=0;var highlight=function(node){var skip=0;if(node.nodeType==3){var pos=node.data.toUpperCase().indexOf(text.toUpperCase());if(pos>=0){var span_node=document.createElement('span');span_node.className=highlightClass;var found=node.splitText(pos);found.splitText(text.length);var found_clone=found.cloneNode(true);span_node.appendChild(found_clone);found.parentNode.replaceChild(span_node,found);skip=1;highlighted++;}}else if(node.nodeType==1&&node.childNodes&&!/(script|style)/i.test(node.tagName)){if(node.className?node.className.indexOf(highlightClass)<0:true){for(var i=0;i<node.childNodes.length;++i)
i+=highlight(node.childNodes[i]);}else{highlighted++;}}
return skip;};highlight(node);return highlighted;};Scribd.Annotation.removeHighlight=function(highlightSelector){var highlightSelector=highlightSelector||'.fourgen_highlight'
$$(highlightSelector).each(function(e){var parent=e.parentNode;parent.replaceChild(e.firstChild,e);parent.normalize();});};Scribd.DOM.scaledCumulativeOffset=function(element){if(Prototype.Browser.IE){Scribd.DOM.scaledCumulativeOffset=function(elem){var top=0,left=0;do{var scale=parseFloat(elem.getStyle('zoom'))/100;if(scale){top*=scale;left*=scale;}
top+=elem.offsetTop;left+=elem.offsetLeft;elem=elem.offsetParent;}while(elem);return Element._returnOffset(left,top);}}else if(Prototype.Browser.WebKit||Prototype.Browser.Gecko){var transformStyle=Prototype.Browser.WebKit?'-webkit-transform':'-moz-transform';Scribd.DOM.scaledCumulativeOffset=function(elem){var top=0,left=0,transformParser=new RegExp("scale\\(([0-9\\.]+)\\)|matrix\\(([0-9\\.]+,)");do{var matchedScale=transformParser.exec(Element.getStyle(elem,transformStyle));if(matchedScale&&matchedScale.length>1){var scale=parseFloat(matchedScale[1]||matchedScale[2]);top*=scale;left*=scale;}
top+=elem.offsetTop;left+=elem.offsetLeft;elem=elem.offsetParent;}while(elem);return Element._returnOffset(left,top);}}else{Scribd.DOM.scaledCumulativeOffset=Element.cumulativeOffset;}
return Scribd.DOM.scaledCumulativeOffset(element);};


/* app/views/documents/fourgen/layout/_web.js @ 1305154352 */

if(!window.Scribd)var Scribd=new Object();Scribd.prepareViewMode=function(newMode,oldMode){var viewMain;switch(oldMode){case'book':break;case'scroll':$(document).stopObserving('keydown',Scribd.scrollKeyboardHandler);break;case'slideshow':$(document).stopObserving('keydown',Scribd.slideshowKeyboardHandler);$('viewer_document').style.position='';break;}
switch(newMode){case'book':new Effect.ScrollTo($('template_main_content'),{duration:0.3});break;case'scroll':$(document).observe('keydown',Scribd.scrollKeyboardHandler);break;case'slideshow':$(document).observe('keydown',Scribd.slideshowKeyboardHandler);$('viewer_document').style.position='relative';new Effect.ScrollTo($('template_main_content'),{duration:0.3});break;}
if(oldMode==='book'&&oldMode!==newMode){$$('#view_main, #viewer_document').each(function(container){container.style.height='';container.style.width='';});}};document.observe('dom:loaded',function(){docManager.addEvent('viewmodeChanged',Scribd.prepareViewMode);});Scribd.preparePageFlip=function(pageFlip){var afterDisplay=function(){var height=pageFlip.oldPage?pageFlip.oldPage.boundingRect.height:pageFlip.page.boundingRect.height;var width=pageFlip.width();var viewMain=$('view_main');viewMain.style.height=height+'px';viewMain.style.width=width+'px';var viewerDoc=$('viewer_document');viewerDoc.style.height=height+'px';viewerDoc.style.width=width+'px';};var beforeAnimation=function(animType){pageFlip.oldPage.containerElem.style.position='absolute';pageFlip.oldPage.containerElem.style.top='0';if(animType=='css'){$('viewer_document').style.WebkitPerspective=3500;}};var afterAnimation=function(animType){pageFlip.oldPage.containerElem.style.position='';pageFlip.oldPage.containerElem.style.top='';if(animType=='css'){$('viewer_document').style.WebkitPerspective='';}};pageFlip.addEvent('afterDisplay',afterDisplay);pageFlip.addEvent('beforeAnimation',beforeAnimation);pageFlip.addEvent('afterAnimation',afterAnimation);};document.observe('dom:loaded',function(){docManager.addEvent('preparePageFlip',Scribd.preparePageFlip);});document.observe('dom:loaded',function(){docManager.addEvent('hideExtras',function(){$('view_bar').hide();});docManager.addEvent('showExtras',function(){$('view_bar').show();});});Scribd.keyPressValid=function(e){var el=e.findElement(),selectors=["input[type=text]","input[type=password]","textarea"];var matched=selectors.any(function(selector){return el.match(selector);});if(matched){return false;}
return true;};Scribd.scrollKeyboardHandler=function(event){if(!Scribd.keyPressValid(event)){return;}
switch(event.keyCode||event.which){case'j':case's':docManager.gotoNextPage();break;case'k':case'w':docManager.gotoPreviousPage();break;default:return;}
event.stop();};Scribd.slideshowKeyboardHandler=function(event){if(!Scribd.keyPressValid(event)){return;}
switch(event.keyCode||event.which){case 39:docManager.gotoNextPage();break;case 37:docManager.gotoPreviousPage();break;case 32:docManager.gotoNextPage();break;default:return;}
event.stop();};Scribd.sessionLengthSec=0;Scribd.updateSessionLength=function(){Scribd.sessionLengthSec+=10;window.setTimeout(Scribd.updateSessionLength,10000);};document.observe('dom:loaded',function(){window.setTimeout(Scribd.updateSessionLength,10000);});Event.observe(window,'unload',function(){trackEvent('FourGen','Metrics','SessionLengthSec',Scribd.sessionLengthSec);});


/* app/views/documents/fourgen/_scrubber.js @ 1305154352 */

if(!window.Scribd)var Scribd=new Object();if(!Scribd.Scrubber)Scribd.Scrubber=new Object();Scribd.Scrubber.id='scrubber';Scribd.Scrubber.skip_slider_set=false;Scribd.Scrubber.scrubber_autohide_timer=null;Scribd.Scrubber.num_pages=0;Scribd.Scrubber.loadCallbacks=[function(){Scribd.Scrubber.element=$(Scribd.Scrubber.id);Scribd.Scrubber.current_page_element=$('current_page');},function(){var scrubber=Scribd.Scrubber.element;if(scrubber){var controls=$$('#toolbar .controls .ctl_button');controls.invoke('observe','mouseover',function(){Scribd.Toolbar.viewmode_popup.hide();});scrubber.observe('mouseover',function(){scrubber.addClassName('hovered');});scrubber.observe('mouseout',function(){scrubber.removeClassName('hovered');});document.observe('scroll',function(e){});}},function(){var slider_range=$R(1,Scribd.Scrubber.num_pages);var slider=new Control.Slider('handle','track',{range:slider_range,onSlide:function(page){$$('.lightbox').each(function(lb){Scribd.Lightbox.close(lb.id);});var origPage=page;page=Math.round(page);var page_num_tooltip=$('page_num');page_num_tooltip.show();Scribd.Scrubber.element.addClassName('sliding');if(page==1){page_num_tooltip.addClassName('first_page');Scribd.Scrubber.element.addClassName('first_page');}else{page_num_tooltip.removeClassName('first_page');Scribd.Scrubber.element.removeClassName('first_page');}
if(page==Scribd.Scrubber.num_pages){page_num_tooltip.addClassName('last_page');Scribd.Scrubber.element.addClassName('last_page');}else{page_num_tooltip.removeClassName('last_page');Scribd.Scrubber.element.removeClassName('last_page');}
page_num_tooltip.update(page);slider.syncLeftTrackToHandle(origPage);},onChange:function(page){$$('.lightbox').each(function(lb){Scribd.Lightbox.close(lb.id);});var origPage=page;page=Math.round(page);Scribd.Scrubber.element.removeClassName('first_page');Scribd.Scrubber.element.removeClassName('last_page');$('page_num').hide();Scribd.Scrubber.page_num_tooltip=true;slider.syncLeftTrackToHandle(origPage);if(!slider.active){Scribd.Scrubber.skip_slider_set=true;docManager.gotoPage(page);slider.transitionSnap(page);Scribd.Scrubber.skip_slider_set=false;}else{slider.dragging=true;}}});slider.setValueWithoutCallback=function(value){value=value||0;this.transitionSnap(value);}.bind(slider);slider.syncLeftTrackToHandle=function(value){$('left_track').style.width=this.translateToPx(value);}.bind(slider);slider.transitionSnap=function(value){var lt=$('left_track');var handle=$('handle');if(Scribd.Scrubber.currentEffect){Scribd.Scrubber.currentEffect.cancel();Scribd.Scrubber.currentEffect=null;}
if(Scribd.Scrubber.currentTimeout){window.clearTimeout(Scribd.Scrubber.currentTimeout);Scribd.Scrubber.currentTimeout=null;}
var width=this.translateToPx(value&&value>0?value:1);Scribd.Scrubber.currentEffect=new Effect.Parallel([new Effect.Morph(handle,{sync:true,style:{'left':width}}),new Effect.Morph(lt,{sync:true,style:{'width':width}})],{duration:0.1,fps:100,afterFinish:function(){Scribd.Scrubber.currentEffect=null;Scribd.Scrubber.currentTimeout=window.setTimeout(function(){Scribd.Scrubber.element.removeClassName('sliding');Scribd.Scrubber.currentTimeout=null;},100);}});}.bind(slider);slider.setValueWithoutCallback(1);var track=$('track');docManager.addEvent('expectedFirstPageChanged',function(page){if(Scribd.Toolbar&&Scribd.Toolbar.viewmode_popup)
Scribd.Toolbar.viewmode_popup.hide();if(!Scribd.Scrubber.skip_slider_set){slider.setValueWithoutCallback(page);}
Scribd.Scrubber.skip_slider_set=false;});Scribd.Scrubber.slider=slider;}];document.observe('dom:loaded',function(){if($(Scribd.Scrubber.id)){for(var i=0;i<Scribd.Scrubber.loadCallbacks.length;i++)
Scribd.Scrubber.loadCallbacks[i]();}});


/* app/views/documents/fourgen/mobile/_dialogs.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
Scribd.MobileDialog=function(){var visible=null;var container_ready=false;function initContainer(){container_ready=true;$('mobile_dialog_container').setStyle({display:'block',top:$('mobile_toolbar').cumulativeOffset().top-550+"px"});Scribd.MobileDialog.Comments.init();}
function show(dialog){dialog.style.webkitTransform="translate(0, -"+dialog.getHeight()+"px)";}
function hide(dialog,hideContainer){if(hideContainer){dialog.observe('webkitTransitionEnd',function(){dialog.stopObserving('webkitTransitionEnd');$('mobile_dialog_container').style.display="none";})}
dialog.style.webkitTransform="translate(0, "+dialog.getHeight()+"px)";}
return{toggle:function(name){if(!container_ready){initContainer();}
var dialog=$(name);if(dialog){if(!visible){$('mobile_dialog_container').style.display="block";show(dialog);visible=name;}
else if(name==visible){hide(dialog,true);visible=null;}
else{hide($(visible));show(dialog);visible=name;}}}};}();Scribd.MobileDialog.Comments=function(){var document_activity=null;var container,dialog;return{init:function(){container=$('activity_container');dialog=$('comments');document_activity=new iScroll('document_activity');if($$('#document_activity .document_event_container').length===0){container.style.padding="0px";}
var h=$('document_activity').getHeight();container.style.height=((h>300)?300:h)+"px";},Manager:Class.create(Scribd.commentManager,{initialize:function($super,opts){$super(opts);this.input_selector='#comment_input';},displayComment:function(comment){if(container.style.padding=="0px")
container.style.padding="5px";if(comment&&!comment.visible()){document_activity.setPosition(0,0);var comment_height=comment.getHeight();var container_height=container.getHeight();if(comment_height+container_height<=300){container.style.height=(container_height+comment_height)+"px";dialog.style.webkitTransform="translate(0,-"+dialog.getHeight()+"px)";}
comment.setOpacity(0);new Effect.Appear(comment);}},showReplyForm:function($super,url,event_id){$super(url,event_id);}})};}();


/* app/views/documents/fourgen/_sections.js @ 1305154352 */

Scribd.init('Scribd','Toolbar');Scribd.Toolbar.SectionPopup=(function(){var cur_section,popup,sectionlist,sections,section_count,pageNumbers,prev,next,section_display,close;var initialize=function(){cur_section=0;popup=$('sectionlist_popup');sectionlist=popup.down('ul');section_count=parseInt(sectionlist.getAttribute('data-section_count'));prev=popup.down('.previous');next=popup.down('.next');close=popup.down('.close_button');section_display=$('popup_section_number');attachClickListeners();register_callbacks();};var get_section=function(section){return popup.down('#popup_section_link_'+section);};var scroll_doc_and_change_hash=function(section){var page=parseInt(get_section(section).down('span.page').getAttribute('data-page'));docManager.gotoPage(page);document.location.hash="#page="+page;};var togglePopup=function(){Scribd.Toolbar.handlePopup("sectionlist_popup");};var attachClickListeners=function(){next.observe('click',doNext);prev.observe('click',doPrev);close.observe('click',togglePopup);popup.down('ul').observe('click',function(e){var sectionlink=e.findElement().up();if(sectionlink.hasAttribute('data-section')){var section=parseInt(sectionlink.getAttribute('data-section'));scroll_doc_and_change_hash(section);highlight_section(section);trackEvent('FourGen','Sectionized','Section_NavClick');e.stop();e.preventDefault();}});};var highlight_section=function(num){if(num<1||num>section_count){return;}
if(cur_section>0){get_section(cur_section).removeClassName('current');}
cur_section=num;section_display.update(num);var current_li=get_section(cur_section);current_li.addClassName('current');popup.down('span.section_title').update('Section:');popup.down('span.section_info').update(current_li.down('.name').innerHTML);};var show_popup_and_for_section=function(section){if(num<1||num>section_count){return;}
var num=[1,section-1].max();var scroll=20*(num-1);var scrollFxn=function(){sectionlist.scrollTop=scroll;};if(!popup.visible()){Scribd.Toolbar.showPopup(popup,scrollFxn);}else{scrollFxn();}};var register_callbacks=function(){document.observe("dom:loaded",function(){Scribd.TOC.register_nav_callback(function(section){section=parseInt(section);show_popup_and_for_section(section);highlight_section(section);});});};var navigateToSection=function(section){scroll_doc_and_change_hash(section);show_popup_and_for_section(section);highlight_section(section);};var doNext=function(){if(cur_section<section_count){navigateToSection(cur_section+1);}};var doPrev=function(){if(cur_section>1){navigateToSection(cur_section-1);}};return{callback:function(section){initialize();show_popup_and_for_section(section);highlight_section(section);},initialize:initialize,navigateToSection:navigateToSection};}());


/* app/views/documents/fourgen/mobile/_readcast.js @ 1305154352 */

if(!Scribd.Readcast)Scribd.Readcast={};Scribd.Readcast.Mobile=function(){return{}}();document.observe('dom:loaded',function(){});


/* app/views/documents/fourgen/layout/_mobile.js @ 1305154352 */

function iScroll(el,options){this.element=typeof el=='object'?el:document.getElementById(el);this.wrapper=this.element.parentNode;this.wrapper.style.overflow='hidden';this.wrapper.style.position='relative';this.element.style.webkitTransitionProperty='-webkit-transform';this.element.style.webkitTransitionTimingFunction='cubic-bezier(0,0,0.25,1)';this.element.style.webkitTransitionDuration='0';this.element.style.webkitTransform='translate3d(0,0,0)';this.options={bounce:true,hScrollBar:true,vScrollBar:true};if(typeof options=='object'){for(var i in options){this.options[i]=options[i];}}
this.refresh();this.element.addEventListener('touchstart',this);this.element.addEventListener('touchmove',this);this.element.addEventListener('touchend',this);this.element.addEventListener('DOMSubtreeModified',this);window.addEventListener('orientationchange',this);}
iScroll.prototype={_x:0,_y:0,handleEvent:function(e){switch(e.type){case'touchstart':this.onTouchStart(e);break;case'touchmove':this.onTouchMove(e);break;case'touchend':this.onTouchEnd(e);break;case'webkitTransitionEnd':this.onTransitionEnd(e);break;case'orientationchange':this.refresh();break;case'DOMSubtreeModified':this.refresh();break;}},refresh:function(){this.element.style.webkitTransitionDuration='0';this.scrollWidth=this.wrapper.clientWidth;this.scrollHeight=this.wrapper.clientHeight;this.maxScrollX=this.scrollWidth-this.element.offsetWidth;this.maxScrollY=this.scrollHeight-this.element.offsetHeight;var resetX=this._x,resetY=this._y;if(this.scrollX&&this._x<this.maxScrollX){resetX=this.maxScrollX;}
if(this.scrollY&&this._y<this.maxScrollY){resetY=this.maxScrollY;}
this.scrollTo(resetX,resetY,'0');this.scrollX=this.element.offsetWidth>this.scrollWidth?true:false;this.scrollY=this.element.offsetHeight>this.scrollHeight?true:false;if(this.options.hScrollBar&&this.scrollX){this.scrollBarX=new scrollbar('horizontal',this.wrapper);this.scrollBarX.init(this.scrollWidth,this.element.offsetWidth);}else if(this.scrollBarX){this.scrollBarX=this.scrollBarX.remove();}
if(this.options.vScrollBar&&this.scrollY){this.scrollBarY=new scrollbar('vertical',this.wrapper);this.scrollBarY.init(this.scrollHeight,this.element.offsetHeight);}else if(this.scrollBarY){this.scrollBarY=this.scrollBarY.remove();}},setPosition:function(x,y){this._x=x!==null?x:this._x;this._y=y!==null?y:this._y;this.element.style.webkitTransform='translate3d('+this._x+'px,'+this._y+'px,0)';if(this.scrollBarX){this.scrollBarX.setPosition(this.scrollBarX.maxScroll/this.maxScrollX*this._x);}
if(this.scrollBarY){this.scrollBarY.setPosition(this.scrollBarY.maxScroll/this.maxScrollY*this._y);}},onTouchStart:function(e){if(e.targetTouches.length!=1){return false;}
e.preventDefault();e.stopPropagation();this.element.style.webkitTransitionDuration='0';if(this.scrollBarX){this.scrollBarX.bar.style.webkitTransitionDuration='0, 250ms';}
if(this.scrollBarY){this.scrollBarY.bar.style.webkitTransitionDuration='0, 250ms';}
var theTransform=new WebKitCSSMatrix(window.getComputedStyle(this.element).webkitTransform);if(theTransform.m41!=this._x||theTransform.m42!=this._y){this.setPosition(theTransform.m41,theTransform.m42);}
this.touchStartX=e.touches[0].pageX;this.scrollStartX=this._x;this.touchStartY=e.touches[0].pageY;this.scrollStartY=this._y;this.scrollStartTime=e.timeStamp;this.moved=false;},onTouchMove:function(e){if(e.targetTouches.length!=1){return false;}
var leftDelta=this.scrollX===true?e.touches[0].pageX-this.touchStartX:0;var topDelta=this.scrollY===true?e.touches[0].pageY-this.touchStartY:0;if(this._x>0||this._x<this.maxScrollX){leftDelta=Math.round(leftDelta/4);}
if(this._y>0||this._y<this.maxScrollY){topDelta=Math.round(topDelta/4);}
if(this.scrollBarX&&!this.scrollBarX.visible){this.scrollBarX.show();}
if(this.scrollBarY&&!this.scrollBarY.visible){this.scrollBarY.show();}
this.setPosition(this._x+leftDelta,this._y+topDelta);this.touchStartX=e.touches[0].pageX;this.touchStartY=e.touches[0].pageY;this.moved=true;if(e.timeStamp-this.scrollStartTime>250){this.scrollStartX=this._x;this.scrollStartY=this._y;this.scrollStartTime=e.timeStamp;}},onTouchEnd:function(e){if(e.targetTouches.length>0){return false;}
if(!this.moved){var theEvent=document.createEvent('MouseEvents');theEvent.initMouseEvent("click",true,true,document.defaultView,0,0,0,0,0,0,0,0,0,0,0,null);e.changedTouches[0].target.dispatchEvent(theEvent);return false;}
var time=e.timeStamp-this.scrollStartTime;var momentumX=this.scrollX===true?this.momentum(this._x-this.scrollStartX,time,-this._x+50,this._x+this.element.offsetWidth-this.scrollWidth+50):{dist:0,time:0};var momentumY=this.scrollY===true?this.momentum(this._y-this.scrollStartY,time,-this._y+50,this._y+this.element.offsetHeight-this.scrollHeight+50):{dist:0,time:0};if(!momentumX.dist&&!momentumY.dist){this.onTransitionEnd();return false;}
var newDuration=Math.max(momentumX.time,momentumY.time);var newPositionX=this._x+momentumX.dist;var newPositionY=this._y+momentumY.dist;this.element.addEventListener('webkitTransitionEnd',this);this.scrollTo(newPositionX,newPositionY,newDuration+'ms');if(this.scrollBarX){this.scrollBarX.scrollTo(this.scrollBarX.maxScroll/this.maxScrollX*newPositionX,newDuration+'ms');}
if(this.scrollBarY){this.scrollBarY.scrollTo(this.scrollBarY.maxScroll/this.maxScrollY*newPositionY,newDuration+'ms');}},onTransitionEnd:function(){this.element.removeEventListener('webkitTransitionEnd',this);this.resetPosition();if(this.scrollBarX){this.scrollBarX.hide();}
if(this.scrollBarY){this.scrollBarY.hide();}},resetPosition:function(){var resetX=resetY=null;if(this._x>0||this._x<this.maxScrollX){resetX=this._x>=0?0:this.maxScrollX;}
if(this._y>0||this._y<this.maxScrollY){resetY=this._y>=0?0:this.maxScrollY;}
if(resetX!==null||resetY!==null){this.scrollTo(resetX,resetY,'500ms');if(this.scrollBarX){this.scrollBarX.scrollTo(this.scrollBarX.maxScroll/this.maxScrollX*(resetX||this._x),'500ms');}
if(this.scrollBarY){this.scrollBarY.scrollTo(this.scrollBarY.maxScroll/this.maxScrollY*(resetY||this._y),'500ms');}}},scrollTo:function(destX,destY,runtime){this.element.style.webkitTransitionDuration=runtime||'400ms';this.setPosition(destX,destY);},momentum:function(dist,time,maxDist1,maxDist2){friction=0.1;deceleration=1.5;var speed=Math.abs(dist)/time*1000;var newDist=speed*speed/(20*friction)/1000;if(dist>0&&maxDist1!==undefined&&newDist>maxDist1){speed=speed*maxDist1/newDist;newDist=maxDist1;}
if(dist<0&&maxDist2!==undefined&&newDist>maxDist2){speed=speed*maxDist2/newDist;newDist=maxDist2;}
newDist=newDist*(dist<0?-1:1);var newTime=-speed/-deceleration;if(newTime<1){newTime=1;}
return{dist:Math.round(newDist),time:Math.round(newTime)};}};var scrollbar=function(dir,wrapper){this.dir=dir;this.bar=document.createElement('div');this.bar.className='scrollbar '+dir;this.bar.style.webkitTransitionTimingFunction='cubic-bezier(0,0,0.25,1)';this.bar.style.webkitTransform='translate3d(0,0,0)';this.bar.style.webkitTransitionProperty='-webkit-transform,opacity';this.bar.style.webkitTransitionDuration='0,250ms';this.bar.style.pointerEvents='none';this.bar.style.opacity='0';wrapper.appendChild(this.bar);}
scrollbar.prototype={size:0,maxSize:0,maxScroll:0,visible:false,init:function(scroll,size){var offset=this.dir=='horizontal'?this.bar.offsetWidth-this.bar.clientWidth:this.bar.offsetHeight-this.bar.clientHeight;this.maxSize=scroll-8;this.size=Math.round(this.maxSize*this.maxSize/size)+offset;this.maxScroll=this.maxSize-this.size;this.bar.style[this.dir=='horizontal'?'width':'height']=(this.size-offset)+'px';},setPosition:function(pos){if(pos<0){pos=0;}else if(pos>this.maxScroll){pos=this.maxScroll;}
pos=this.dir=='horizontal'?'translate3d('+Math.round(pos)+'px,0,0)':'translate3d(0,'+Math.round(pos)+'px,0)';this.bar.style.webkitTransform=pos;},scrollTo:function(pos,runtime){this.bar.style.webkitTransitionDuration=(runtime||'400ms')+',250ms';this.setPosition(pos);},show:function(){this.visible=true;this.bar.style.opacity='1';},hide:function(){this.visible=false;this.bar.style.opacity='0';},remove:function(){this.bar.parentNode.removeChild(this.bar);return null;}};


/* app/views/documents/fourgen/mobile/_scrubber.js @ 1305154352 */

var TouchSlider=function(options){this.handle=options.handle;this.track=options.track;this.scroll=(options.scroll||'X').toUpperCase();this.previousStep=parseInt(options.currentStep||0);if(this.scroll==='X'){this.handleSize=parseFloat(options.handleSize||this.handle.offsetWidth);this.trackSize=parseFloat(options.trackSize||this.track.offsetWidth);this.handleMovement='left';}else{this.handleSize=parseFloat(options.handleSize||this.handle.offsetHeight);this.trackSize=parseFloat(options.trackSize||this.track.offsetHeight);this.handleMovement='top';}
this.totalSteps=parseInt(options.totalSteps||this.trackSize);this.handleOffset=this.handleSize/2.0;this.pixelsPerStep=this.trackSize/this.totalSteps;this.stepOffset=this.pixelsPerStep/2.0-this.handleOffset;this.touchStarted=options.touchStarted||function(){};this.touchMoved=options.touchMoved||function(){};this.touchEnded=options.touchEnded||function(){};this.handleMoved=options.handleMoved||function(){};this.moveHandleToStep(this.previousStep);this.track.addEventListener('touchstart',this,false);this.track.addEventListener('touchmove',this,false);this.track.addEventListener('touchend',this,false);};TouchSlider.prototype={handleEvent:function(event){var eventHandler=this[event.type];if(eventHandler){eventHandler.call(this,event);}},touchstart:function(e){e.preventDefault();if(e.targetTouches.length===1){this.touchStarted(e);}},touchmove:function(e){e.preventDefault();if(e.targetTouches.length===1){this.moveHandleToPosition(this.touchPosition(e.targetTouches[0]));this.touchMoved(e);}},touchend:function(e){e.preventDefault();this.moveHandleToStep(this.currentStep());this.touchEnded(e);},currentStep:function(){return this.positionStep(this.handlePosition);},moveHandleToStep:function(step){return this.moveHandleToPosition(this.stepPosition(step));},touchPosition:function(touch){return touch['client'+this.scroll]-this.handleOffset;},moveHandleToPosition:function(position){position-=this.handleOffset;position=this.validPosition(position)
this.handlePosition=position;this.handle.style.webkitTransform='translate'+this.scroll+'('+position+'px)';this.handleMoved(position);},positionStep:function(position){return Math.round((position+this.handleSize+this.stepOffset)/this.pixelsPerStep)-1;},stepPosition:function(step){return(this.pixelsPerStep*step)+this.handleOffset+this.stepOffset;},validPosition:function(position){return Math.max(this.stepOffset,Math.min(this.trackSize-(this.stepOffset+this.handleSize),position));}}


/* app/views/documents/fourgen/mobile/_toolbar.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
if(!Scribd.MobileToolbar){Scribd.MobileToolbar={};}
Scribd.MobileToolbar.actions={};Scribd.MobileToolbar.actions.to_top=function(event){event.stop();docManager.gotoPage(1);trackEvent('FourGen','MobileToolbar','TopPage');}
Scribd.MobileToolbar.CurrentPageTracker=function(pageNum){if(pageNum||pageNum===0){Scribd.MobileToolbar.current_page_element.value=pageNum;}};Scribd.MobileToolbar.toolbarParams=function(){return{id:docManager.documentId,show_container:true};};Scribd.MobileToolbar.dialogAction=function(name,callback){return function(event){event.stop();var element=event.findElement('a');if(!element.hasClassName('active')){var active=$$('#toolbar_right_side .active');if(active&&active.length>0)
active[0].removeClassName('active');element.addClassName('active');}
else{element.removeClassName('active');}
Scribd.MobileDialog.toggle(name);trackEvent('FourGen','MobileToolbar',name);if(callback&&typeof(callback)=="function")
callback();}};Scribd.MobileToolbar.actions.comments=Scribd.MobileToolbar.dialogAction('comments');Scribd.MobileToolbar.actions.information=Scribd.MobileToolbar.dialogAction('information');Scribd.MobileToolbar.actions.readcast=Scribd.MobileToolbar.dialogAction('readcast');Scribd.MobileToolbar.login=function(event){event.stop();Scribd.login.open({});};Scribd.MobileToolbar.documentActivity=null;document.observe('dom:loaded',function(){Scribd.MobileToolbar.element=$('mobile_toolbar');if(Scribd.MobileToolbar.element){Scribd.MobileToolbar.current_page_element=$('current_page');Scribd.MobileToolbar.current_page_element.value=docManager.currentPageNum()||1;docManager.addEvent('expectedFirstPageChanged',Scribd.MobileToolbar.CurrentPageTracker);for(var action in Scribd.MobileToolbar.actions){var button=Scribd.MobileToolbar.element.down('a.'+action);if(button){if(!Scribd.logged_in&&button.hasClassName('login_required')){button.observe('click',Scribd.MobileToolbar.login);}else{button.observe('click',Scribd.MobileToolbar.actions[action]);}}}
Scribd.MobileToolbar.element.down('.current_page').observe('change',function(event){var page=parseInt(event.element().value);if(page<1){page=1;event.element().value=page;}else if(page>numPages){page=numPages;event.element().value=page;}
docManager.gotoPage(page);});}});


/* app/views/documents/fourgen/layout/_web_pro.js @ 1305154352 */

Scribd.init('Scribd','ProLayout');Scribd.ProLayout.zoomed=function(multiplier){var currentZoomedLevel=docManager._currentViewManager._currentZoomMultiplier;var viewMidSection=$('view_mid_section');var viewMain=$('view_main');var viewer=$('viewer');var viewBar=$('view_bar');if(currentZoomedLevel>1.0){var viewportWidth=document.viewport.getDimensions().width;var leftMargin=Math.max((viewportWidth-996)/2,0);viewMidSection.setStyle({width:'auto'});viewMain.setStyle({width:'auto','margin-left':leftMargin+'px'});if(viewer.getWidth()+viewBar.getWidth()+300>viewportWidth){viewBar.hide();}else{viewBar.show();}}else{viewMidSection.setStyle({width:'996px'});viewMain.setStyle({width:'656px','margin-left':'auto'});viewBar.show();}};


/* app/views/documents/fourgen/mobile/_hot_spots.js @ 1305154352 */

if(!window.Scribd)var Scribd=new Object();Scribd.TouchHotSpot={initialize:function(page_count){var HS=Scribd.TouchHotSpot;document.observe('dom:loaded',function(){HS.page_count=page_count;HS.container=$('viewer_document');HS.left_hotspot=$('mobile_left_hotspot');HS.right_hotspot=$('mobile_right_hotspot');HS.left_arrow=HS.left_hotspot.down('.left_indicator');HS.right_arrow=HS.right_hotspot.down('.right_indicator');HS.page_indicator=$('overlay_pagenum');HS.current_page_indicator=HS.page_indicator.down('.current_page');HS.page_indicator.down('.page_count').update(page_count);registerPageIndicators();registerSwipes();registerHotSpotClicks();registerHotSpotPresses();});function registerPageIndicators(){var prev_page=0;docManager.addEvent('expectedFirstPageChanged',function(current_page){HS.current_page_indicator.update(current_page);if(prev_page!==current_page&&prev_page!==0){if(prev_page>current_page){forceOpacity(HS.right_arrow,'touched',0);flashElement(HS.left_arrow,'touched',1);}
if(prev_page<current_page){forceOpacity(HS.left_arrow,'touched',0);flashElement(HS.right_arrow,'touched',1);}}
if(prev_page!==0){repositionYOffset(HS.page_indicator,80,7,5);flashElement(HS.page_indicator,'touched',0.75);}
prev_page=current_page;});}
function registerSwipes(){var container=HS.container;new Scribd.TouchGestures.Swipe('left',container,{orientation:'x',direction:-1,callback:function(){docManager.gotoNextPage();}});new Scribd.TouchGestures.Swipe('right',container,{orientation:'x',direction:1,callback:function(){docManager.gotoPreviousPage();}});}
function registerHotSpotClicks(){Scribd.TouchGestures.clickWithNoDelay(HS.left_hotspot,function(){if(HS.left_timer===null&&HS.right_timer===null){docManager.gotoPreviousPage();}});Scribd.TouchGestures.clickWithNoDelay(HS.right_hotspot,function(){if(HS.left_timer===null&&HS.right_timer===null){docManager.gotoNextPage();}});}
function registerHotSpotPresses(){new Scribd.TouchGestures.Press(HS.left_hotspot,{delay:700});new Scribd.TouchGestures.Press(HS.right_hotspot,{delay:700});registerPageJumpPress('left',-1);registerPageJumpPress('right',1);}
function registerPageJumpPress(direction,page_delta){var counter_direction=(direction==='left'?'right':'left');var hotspot=direction+'_hotspot';var timer=direction+'_timer',counter_timer=counter_direction+'_timer';var arrow=direction+'_arrow',counter_arrow=counter_direction+'_arrow';HS[hotspot].observe('scribd:touch:pressstart',function(){if(HS[counter_timer]===null){window.clearInterval(HS[timer]);repositionYOffset(HS.page_indicator,80,7,5);forceOpacity(HS[arrow],'touched',1);forceOpacity(HS[counter_arrow],'touched',0);forceOpacity(HS.page_indicator,'touched',0.75);var current_page=parseInt(HS.current_page_indicator.innerHTML)||1;HS[timer]=window.setInterval(function(){current_page+=page_delta;if(direction==='left'){var reset_conditions=current_page<=1;var reset_value=1;}else{var reset_conditions=current_page>=HS.page_count;var reset_value=HS.page_count;}
if(reset_conditions){window.clearInterval(HS[timer]);HS[timer]=null;HS.current_page_indicator.update(reset_value);}else{HS.current_page_indicator.update(current_page);}},200);}});HS[hotspot].observe('scribd:touch:pressend',function(){window.clearInterval(HS[timer]);HS[timer]=null;window.clearInterval(HS[counter_timer]);HS[counter_timer]=null;repositionYOffset(HS.page_indicator,80,7,5);var current_page=parseInt(HS.current_page_indicator.innerHTML)||1;HS.current_page_indicator.update(current_page)
flashElement(HS.page_indicator,'touched',0.75);flashElement(HS[arrow],'touched',1);docManager.gotoPage(current_page);});}
function repositionYOffset(element,initial_y_offset,top,margin){var realative_y_offset=window.pageYOffset-initial_y_offset;if(realative_y_offset>0){element.style.top=realative_y_offset+top+margin+'px';}else{element.style.top=top+'px';}};function flashElement(element,animation_class,initial_opacity){forceOpacity(element,animation_class,initial_opacity);window.setTimeout(function(){element.addClassName(animation_class);element.style.opacity=0;},0);};function forceOpacity(element,animation_class,initial_opacity){element.removeClassName(animation_class);element.style.opacity=initial_opacity;}},page_count:null,container:null,left_hotspot:null,right_hotspot:null,left_arrow:null,right_arrow:null,left_timer:null,right_timer:null};Scribd.TouchGestures={};Scribd.TouchGestures.clickWithNoDelay=function(element,callback){element=$(element);if(window.Touch){element.addEventListener('touchstart',function(e){var moved=false;e.preventDefault();var touchmove=function(e){moved=true;};var touchend=function(e){element.removeEventListener('touchmove',touchmove,false);element.removeEventListener('touchend',touchend,false);!moved&&callback(e);};element.addEventListener('touchmove',touchmove,false);element.addEventListener('touchend',touchend,false);});}else{$(element).observe('click',callback);}}
Scribd.TouchGestures.Press=Class.create({initialize:function(element,options){options=Object.extend({delay:1000,touches:1},options);this.element=$(element);this.delay=options.delay;this.touches=options.touches;this.timer=null;this.pressed=false;this.element.observe('touchstart',this.touchstart.bind(this));this.element.observe('touchend',this.touchend.bind(this));},touchstart:function(e){window.clearTimeout(this.timer);if(e.touches.length===this.touches){this.timer=window.setTimeout(function(){this.pressed=true;this.element.fire('scribd:touch:pressstart');}.bind(this),this.delay);}else{this.pressed=false;}},touchend:function(e){if(this.pressed===true){this.pressed=false;this.element.fire('scribd:touch:pressend');}
window.clearTimeout(this.timer);}});Scribd.TouchGestures.Swipe=Class.create({initialize:function(name,element,options){this.element=$(element);this.name=name;this.minLength=options.minLength||200;this.tolerance=options.tolerance||100;this.callback=options.callback||function(){};if(options.orientation==='X'||options.orientation==='x'){this.moveOrientation='X',this.toleranceOrientation='Y';}else{this.moveOrientation='Y',this.toleranceOrientation='X';}
this.direction=options.direction||1;this.tracking=false;this.originX=null,this.originY=null;this.element.observe('touchstart',this.touchstart.bind(this));this.element.observe('touchmove',this.touchmove.bind(this));this.element.observe('touchend',this.touchend.bind(this));},touchstart:function(e){if(e.touches.length===1){this.originX=e.touches[0].clientX;this.originY=e.touches[0].clientY;this.tracking=true;}},touchmove:function(e){if(!this.tracking){return;}
if(!(e.touches.length===1&&this.validMovingTouch(e.touches[0]))){this.reset();}},touchend:function(e){if(!this.tracking){return;}
if(e.touches.length===0&&e.changedTouches.length===1&&this.validEndingTouch(e.changedTouches[0])){this.callback();}
this.reset();},reset:function(){if(this.tracking){this.tracking=false;}},validEndingTouch:function(touch){return this.validMovingTouch(touch)&&this.validMinLength(touch);},validMovingTouch:function(touch){return this.tracking&&this.validDirection(touch)&&this.validTolerance(touch);},validDirection:function(touch){var originPosition=this['origin'+this.moveOrientation];var clientPosition=touch['client'+this.moveOrientation];if(this.direction===1){return clientPosition>=originPosition;}
return clientPosition<=originPosition;},validTolerance:function(touch){var originPosition=this['origin'+this.toleranceOrientation];var clientPosition=touch['client'+this.toleranceOrientation];if(Math.abs(originPosition-clientPosition)<this.tolerance){return true;}
return false;},validMinLength:function(touch){var originPosition=this['origin'+this.moveOrientation];var clientPosition=touch['client'+this.moveOrientation];if(this.direction===1){return Math.abs(clientPosition-originPosition)>this.minLength;}
return Math.abs(originPosition-clientPosition)>this.minLength;}});


/* app/views/documents/fourgen/_metadata.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
if(!Scribd.Metadata){Scribd.Metadata={};}
Scribd.Metadata.id='doc_metadata';Scribd.Metadata.onLoad=function(){Scribd.Metadata.element=$(Scribd.Metadata.id);if(Scribd.Metadata.element){for(var action in Scribd.Metadata.actions){var button=Scribd.Metadata.element.down('a.'+action);if(button){if(!Scribd.logged_in&&button.hasClassName('login_required')){button.observe('click',Scribd.Metadata._login_or_action(action));}else{button.observe('click',Scribd.Metadata.actions[action]);}}}}};Scribd.Metadata._login_or_action=function(action){var a=action;return function(e){if(Scribd.Facebook.isSessionTransitioned()){Scribd.Metadata.actions[a](e);}else{Scribd.Metadata.login(e);}}}
Scribd.Metadata.actions={};Scribd.Metadata.download={};Scribd.Metadata.download.open=function(){var post_params=Scribd.Metadata.toolbarParams();if(Scribd.FourGen.doc.secret_password){post_params.secret_password=Scribd.FourGen.doc.secret_password;}
Scribd.Lightbox.remoteOpen('toolbar_download_lightbox','/word/toolbar_download',post_params);}
Scribd.Metadata.download.login=function(){Scribd.login.open({document_id:Scribd.FourGen.doc.id,context:'download',callback:"Scribd.logged_in = true; Scribd.Metadata.download.open()"});}
Scribd.Metadata.actions.download=function(event){event.stop();if(!Scribd.logged_in){Scribd.Metadata.download.login();}else{Scribd.Metadata.download.open();}
$rat('fourgen.viewbar.actions.download');};Scribd.Metadata.actions.mobile=function(event){event.stop();Scribd.Lightbox.remoteOpen('toolbar_mobile_lightbox','/device/choose_device',Scribd.Toolbar.toolbarParams());$rat('fourgen.viewbar.actions.mobile');};Scribd.Metadata.actions.print=function(event){event.stop();Scribd.Lightbox.open('lightbox_print');$rat('fourgen.viewbar.actions.print');};Scribd.Metadata.actions.collections=function(event){event.stop();Scribd.DocumentCollectionsManager.addToCollectionsEventHandler(Scribd.Metadata.toolbarParams().id,event);$rat('fourgen.viewbar.actions.collections');}
Scribd.Metadata.actions.report=function(event){}
Scribd.Metadata.login=function(event){event.stop();Scribd.login.open({});};Scribd.Metadata.toolbarParams=function(){var params={id:docManager.documentId,show_container:true};if(Scribd.FourGen.doc.secret_password){params.secret_password=Scribd.FourGen.doc.secret_password;}
return params;};document.observe('dom:loaded',Scribd.Metadata.onLoad);


/* app/views/documents/fourgen/_hot_spots.js @ 1305154352 */

if(!window.Scribd)var Scribd=new Object();Scribd.HotSpot=new Object();Scribd.HotSpot.slideshowRight=function(){docManager.gotoNextPage();};Scribd.HotSpot.slideshowLeft=function(){docManager.gotoPreviousPage();};Scribd.HotSpot.initialize=function(){var left_hot_spot=$('slideshow_left_hotspot');var right_hot_spot=$('slideshow_right_hotspot');if(left_hot_spot&&right_hot_spot&&docManager){docManager.addEvent('viewmodeChanged',function(newMode,oldMode){if(newMode=='slideshow'){left_hot_spot.show();left_hot_spot.observe('click',Scribd.HotSpot.slideshowLeft);right_hot_spot.show();right_hot_spot.observe('click',Scribd.HotSpot.slideshowRight);}else if(oldMode=='slideshow'){left_hot_spot.hide();left_hot_spot.stopObserving('click',Scribd.HotSpot.slideshowLeft);right_hot_spot.hide();right_hot_spot.stopObserving('click',Scribd.HotSpot.slideshowRight);}});}};


/* app/views/documents/fourgen/_toolbar.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
if(!Scribd.Toolbar){Scribd.Toolbar={};}
Scribd.Toolbar.id='toolbar';Scribd.Toolbar._login_or_action=function(action){var a=action;return function(e){if(Scribd.Facebook.isSessionTransitioned()){Scribd.Toolbar.actions[a](e);}else{Scribd.Toolbar.login(e);}}};Scribd.Toolbar.loadCallbacks=[function(){Scribd.Toolbar.element=$(Scribd.Toolbar.id);Scribd.Toolbar.viewmode_popup=$('viewmode_popup');Scribd.Toolbar.current_page_element=$('current_page');Scribd.Toolbar.current_page_element.value=docManager.currentPageNum()||1;docManager.addEvent('expectedFirstPageChanged',Scribd.Toolbar.CurrentPageTracker);},function(){Scribd.StickyElement('toolbar',function(toolbar){toolbar.setStyle({position:'fixed',bottom:'0px',top:'auto'});Scribd.Toolbar.autohider.tryStartAutohide();},function(toolbar){var footerOffset=$('footer').cumulativeOffset()[1];toolbar.setStyle({position:'absolute',top:(footerOffset-45)+'px',bottom:'auto'});Scribd.Toolbar.autohider.visible=true;},function(){var height=document.viewport.getHeight();var footerOffset=($('footer').viewportOffset()||[0,0])[1];return(footerOffset+12)>height;},function(toolbar){});},function(){Scribd.StickyElement('exit_fs_button',function(exit_button){exit_button.setStyle({position:'fixed',top:'0px',bottum:'auto'});},function(exit_button){var pageOffset=$$('.outer_page:first').first().cumulativeOffset()[1];exit_button.setStyle({position:'absolute',top:(pageOffset-55)+'px',bottum:'auto'});},function(){var pageOffset=($$('.outer_page:first').first().viewportOffset()||[0,0])[1];return pageOffset<0;},function(exit_button){});},function(){for(var action in Scribd.Toolbar.actions){var button=Scribd.Toolbar.element.down('a.'+action);if(button){if(!Scribd.logged_in&&button.hasClassName('login_required')){Scribd.Toolbar._login_or_action(action);}else{button.observe('click',Scribd.Toolbar.actions[action]);}}}
Scribd.Toolbar.element.down('input.current_page').observe('keydown',Scribd.Toolbar.actions.current_page);Scribd.Toolbar.viewmode_popup.select('a.option').invoke('observe','click',Scribd.Toolbar.actions.view_mode);$('button_exit_fullscreen').observe('click',Scribd.Toolbar.actions.exit_fullscreen);},function(){if($('readcast_popup_outer'))
$('readcast_popup_outer').show();docManager.addEvent('exitedFullscreen',function(){Scribd.Toolbar.element.down('a.exit_fullscreen').hide();Scribd.Toolbar.element.down('a.fullscreen').show();$('exit_fs_button').hide();if(docManager.viewMode()=='slideshow'){Scribd.Toolbar.element.down('div.zoom_in_disabled').hide();Scribd.Toolbar.element.down('div.zoom_out_disabled').hide();Scribd.Toolbar.element.down('a.zoom_in').show();Scribd.Toolbar.element.down('a.zoom_out').show();}});docManager.addEvent('enteredFullscreen',function(){Scribd.Toolbar.element.down('a.fullscreen').hide();Scribd.Toolbar.element.down('a.exit_fullscreen').show();Scribd.Toolbar.Tooltips.get('toolbar_exit_fullscreen').position();$('exit_fs_button').show();Scribd.Toolbar.Tooltips.get('button_exit_fullscreen').position();if(docManager.viewMode()=='slideshow'){Scribd.Toolbar.element.down('a.zoom_in').hide();Scribd.Toolbar.element.down('a.zoom_out').hide();Scribd.Toolbar.element.down('div.zoom_in_disabled').show();Scribd.Toolbar.element.down('div.zoom_out_disabled').show();}});},function(){Scribd.Toolbar.autohider.setupEvents();}];Scribd.Toolbar.switchToLoggedInAction=function(action){var button=Scribd.Toolbar.element.down('a.'+action);if(button&&button.hasClassName('login_required')){button.stopObserving('click',Scribd.Toolbar.login);button.observe('click',Scribd.Toolbar.actions[action]);}}
Scribd.Konami=function(){this.buffer=[];};Scribd.Konami.code=[38,38,40,40,37,39,37,39,66,65,13];Scribd.Konami.prototype.record=function(keyCode){this.buffer.push(keyCode);if(this.buffer.length>Scribd.Konami.code.length)
this.buffer.shift();};Scribd.Konami.prototype.checkCode=function(){if(this.buffer.length!=Scribd.Konami.code.length)
return false;for(var i=0;i<Scribd.Konami.code.length;i++)
if(this.buffer[i]!=Scribd.Konami.code[i])
return false;Scribd.Lightbox.remoteOpen('credits_lightbox','/documents/credits');Scribd.Toolbar.current_page_element.value=docManager.currentPageNum()||1;return true;};Scribd.konami=new Scribd.Konami();Scribd.Toolbar.actions={};Scribd.Toolbar.download={};Scribd.Toolbar.actions.current_page=function(event){try{Scribd.konami.record(event.keyCode||event.which);}catch(x){}
if((event.keyCode||event.which)!=13)return;try{if(Scribd.konami.checkCode())return;}catch(x){}
var page=parseInt(event.element().value);if(page<1){page=1;event.element().value=page;}else if(page>docManager.maximumPageNumber()){page=docManager.maximumPageNumber();event.element().value=page;}
docManager.gotoPage(page);};Scribd.Toolbar.actions.page_up=function(event){try{docManager.viewportManager.disable();event.stop();docManager.gotoPreviousPage();$rat('fourgen.toolbar.actions.page.up');}finally{docManager.viewportManager.enable();}
trackEvent('FourGen','Toolbar','PreviousPage');};Scribd.Toolbar.actions.page_down=function(event){try{docManager.viewportManager.disable();event.stop();docManager.gotoNextPage();$rat('fourgen.toolbar.actions.page.down');}finally{docManager.viewportManager.enable();}
trackEvent('FourGen','Toolbar','NextPage');};Scribd.Toolbar.actions.to_top=function(event){try{docManager.viewportManager.disable();event.stop();if(docManager.viewMode()=="scroll")
new Effect.ScrollTo($('template_main_content'),{duration:0.6});else
docManager.gotoPage(1);$rat('fourgen.toolbar.actions.page.top');}finally{docManager.viewportManager.enable();}
trackEvent('FourGen','Toolbar','TopPage');}
Scribd.Toolbar.actions.toggle_viewmode_popup=function(event){event.stop();Scribd.Toolbar.viewmode_popup.toggle();Scribd.fourgenDocSearchUI&&Scribd.fourgenDocSearchUI.hide();$rat('fourgen.toolbar.actions.toggle_viewmode_popup');}
document.observe('dom:loaded',function(){if($(Scribd.Toolbar.id)){for(var i=0;i<Scribd.Toolbar.loadCallbacks.length;i++){Scribd.Toolbar.loadCallbacks[i].apply(this,arguments);}}
Scribd.Toolbar.autoHideSwitch.initialize();});Scribd.Toolbar.resizeInProgress=false;Scribd.Toolbar.CurrentPageTracker=function(pageNum){if(pageNum||pageNum===0){Scribd.Toolbar.current_page_element.value=pageNum;}};Scribd.Toolbar.openPopups=[];Scribd.Toolbar.defaultDuration=0.4;Scribd.Toolbar.alteringPopup=function(name){return Effect.Queues.get(name+"Blind").length>0;};Scribd.Toolbar.hidePopup=function(el,finish){var name=el.id;if(this.alteringPopup(name))return;this.openPopups=this.openPopups.without(el);if(typeof finish!=='function'){finish=function(){};}
Effect.BlindUp(el,{duration:this.defaultDuration,queue:{scope:name+"Blind",limit:1},afterFinish:finish});Effect.Fade(el,{duration:this.defaultDuration,queue:{scope:name+"Fade",limit:1},afterFinish:function(){el.hide();}});};Scribd.Toolbar.showPopup=function(el,finish){var name=el.id;if(this.alteringPopup(name))return;this.openPopups.push(el);if(typeof finish!=='function'){finish=function(){};}
Effect.BlindDown(el,{duration:this.defaultDuration,queue:{scope:name+"Blind",limit:1},afterFinish:finish});Effect.Appear(el,{duration:this.defaultDuration,queue:{scope:name+"Fade",limit:1},afterFinish:function(){el.show();}});};Scribd.Toolbar.handlePopup=function(name,cb){if(this.inTransition)return;this.inTransition=true;var that=this;var popup=$(name);function finish(){if(typeof cb==='function'){cb.apply(this,arguments);}
that.inTransition=false;Scribd.Toolbar.autohider.tryStartAutohide();}
if(that.openPopups.include(popup)){that.hidePopup(popup,finish);}else{that.openPopups.each(function(el){that.hidePopup(el);});that.showPopup(popup,finish);}};Scribd.Toolbar.actions.zoom_in=function(event){event.stop();docManager.zoom(1.25);trackEvent('FourGen','Toolbar','ZoomIn');$rat('fourgen.toolbar.actions.zoom.in');};Scribd.Toolbar.actions.zoom_out=function(event){event.stop();docManager.zoom(0.8);trackEvent('FourGen','Toolbar','ZoomOut');$rat('fourgen.toolbar.actions.zoom.out');};Scribd.Toolbar.actions.fullscreen=function(event){event.stop();docManager.enterFullscreen();trackEvent('FourGen','Toolbar','Fullscreen');$rat('fourgen.toolbar.actions.fullscreen.enter');};Scribd.Toolbar.actions.exit_fullscreen=function(event){event.stop();docManager.exitFullscreen();trackEvent('FourGen','Toolbar','ExitFullscreen');$rat('fourgen.toolbar.actions.fullscreen.exit');};Scribd.Toolbar.actions.readcast=function(event){if(event){event.stop();var readcast_button=$('toolbar_readcast');if(readcast_button&&readcast_button.hasClassName('disabled')){return;}}
Scribd.Toolbar.handlePopup('social_readcast_popup',Scribd.Readcast.Control.showControls);trackEvent('FourGen','Toolbar','Readcast');$rat('fourgen.toolbar.actions.popup.readcast');};Scribd.Toolbar.actions.comment=function(event){event.stop();var comment_button=$('toolbar_comment');if(comment_button&&comment_button.hasClassName('disabled')){return;}
Scribd.Toolbar.handlePopup('comment_popup');trackEvent('FourGen','Toolbar','Comment');$rat('fourgen.toolbar.actions.popup.comment');};Scribd.Toolbar.actions.section_list=function(event){event.stop();Scribd.Toolbar.handlePopup('sectionlist_popup');trackEvent('FourGen','Toolbar','Sectionlist');$rat('fourgen.toolbar.actions.popup.sectionlist');}
Scribd.Toolbar.actions.embed=function(event){event.stop();Scribd.Toolbar.handlePopup('embed_popup');trackEvent('FourGen','Toolbar','Embed');$rat('fourgen.toolbar.actions.popup.embed');};Scribd.Toolbar.toolbarParams=function(){var params={id:docManager.documentId,show_container:true};if(Scribd.FourGen.doc.secret_password){params.secret_password=Scribd.FourGen.doc.secret_password;}
return params;};Scribd.Toolbar.login=function(event){event.stop();Scribd.login.open({});};Scribd.Toolbar.download.open=function(){Scribd.Lightbox.remoteOpen('toolbar_download_lightbox','/word/toolbar_download',Scribd.Toolbar.toolbarParams());}
Scribd.Toolbar.download.login=function(){Scribd.login.open({document_id:Scribd.FourGen.doc.id,context:'download',callback:"Scribd.logged_in = true; Scribd.Toolbar.download.open()"});}
Scribd.Toolbar.actions.download=function(event){event.stop();if(!Scribd.logged_in){Scribd.Toolbar.download.login();}else{Scribd.Toolbar.download.open();}
trackEvent('FourGen','Toolbar','Download');$rat('fourgen.toolbar.actions.modal.download');};Scribd.Toolbar.actions.mobile=function(event){event.stop();Scribd.Lightbox.remoteOpen('toolbar_mobile_lightbox','/device/choose_device',Scribd.Toolbar.toolbarParams());trackEvent('FourGen','Toolbar','Mobile');$rat('fourgen.toolbar.actions.modal.mobile');};Scribd.Toolbar.actions.print=function(event){event.stop();Scribd.Lightbox.open('lightbox_print');trackEvent('FourGen','Toolbar','Print');$rat('fourgen.toolbar.actions.modal.print');};Scribd.Toolbar.actions.collections=function(event){event.stop();Scribd.DocumentCollectionsManager.addToCollectionsEventHandler(Scribd.Toolbar.toolbarParams().id,event);trackEvent('FourGen','Toolbar','Collections');$rat('fourgen.toolbar.actions.collections');};Scribd.Toolbar.actions.view_mode=function(event){var currentViewMode=docManager.viewMode();var newViewMode=event.element().id;if(currentViewMode!=newViewMode){docManager.setViewManager(newViewMode);if(Scribd.Toolbar.element){var togglePopupButton=Scribd.Toolbar.element.down('a.toggle_viewmode_popup');var pagingControls=Scribd.Toolbar.element.down('div.paging_controls');pagingControls.removeClassName(currentViewMode);togglePopupButton.removeClassName(currentViewMode);togglePopupButton.addClassName(newViewMode);pagingControls.addClassName(newViewMode);}}
Scribd.Toolbar.viewmode_popup.hide();trackEvent('FourGen','Toolbar','ChangeViewMode');};Scribd.Toolbar.autohider={};Scribd.Toolbar.autohider.stick=false;Scribd.Toolbar.autohider.waitTime=3000;Scribd.Toolbar.autohider.mouseIsOver=false;Scribd.Toolbar.autohider.autohideTimeoutId=null;Scribd.Toolbar.autohider.currentEffect=null;Scribd.Toolbar.autohider.visible=true;Scribd.Toolbar.autohider.setupEvents=function(){Scribd.Toolbar.element.observe('mouseover',function(){Scribd.Toolbar.autohider.mouseIsOver=true;Scribd.Toolbar.autohider.tryCancelAutohide();});Scribd.Toolbar.element.observe('mousemove',function(){Scribd.Toolbar.autohider.mouseIsOver=true;Scribd.Toolbar.autohider.tryCancelAutohide();});Scribd.Toolbar.element.observe('mouseout',function(){Scribd.Toolbar.autohider.mouseIsOver=false;Scribd.Toolbar.autohider.tryStartAutohide();});document.observe('mousemove',function(){Scribd.Toolbar.autohider.tryCancelAutohide();});Scribd.Toolbar.autohider.tryStartAutohide();};Scribd.Toolbar.Cookies=new CookieJar({path:'/',expires:(60*60*24*360*10)});Scribd.Toolbar.autoHideSwitch={initialize:function(){this.element=$('hide_switch');if(this.element){this.element.observe('click',this.toggleHiding.bind(this));}
this.setting=true;var self=this;var cookieVal=Scribd.Toolbar.Cookies.get('autoHide');if(cookieVal==='false'){this.setting=false;}else if(cookieVal==='true'){this.setting=true}
if(!this.setting){this.element.addClassName('on');Scribd.Toolbar.autohider.stick=true;var tooltip=Scribd.Toolbar.Tooltips.get('hide_switch');if(tooltip){tooltip.setText('Auto-hide: off');}else{this.element.writeAttribute('title','Auto-hide: off')}}},saveSetting:function(val){this.setting=val;Scribd.Toolbar.Cookies.put('autoHide',val);},toggleHiding:function(e){e.stop();if(Scribd.Toolbar.autohider.stick){this.element.removeClassName('on');Scribd.Toolbar.autohider.stick=false;Scribd.Toolbar.autoHideSwitch.saveSetting(true);Scribd.Toolbar.Tooltips.get('hide_switch').setText('Auto-hide: on');}else{this.element.addClassName('on');Scribd.Toolbar.autohider.stick=true;Scribd.Toolbar.autoHideSwitch.saveSetting(false);Scribd.Toolbar.Tooltips.get('hide_switch').setText('Auto-hide: off');}}};Scribd.Toolbar.autohider.canHideToolbar=function(){if(Scribd.Toolbar.autohider.stick){return false;}
if(Scribd.Toolbar.openPopups.length>0){return false;}
if(Scribd.Toolbar.autohider.mouseIsOver){return false;}
return true;};Scribd.Toolbar.autohider.tryCancelAutohide=function(){if(Scribd.Toolbar.autohider.autohideTimeoutId){window.clearTimeout(Scribd.Toolbar.autohider.autohideTimeoutId);Scribd.Toolbar.autohider.autohideTimeoutId=null;}
Scribd.Toolbar.autohider.show();Scribd.Toolbar.autohider.tryStartAutohide();};Scribd.Toolbar.autohider.tryStartAutohide=function(){if(Scribd.Toolbar.autohider.canHideToolbar()){if(!Scribd.Toolbar.autohider.autohideTimeoutId){Scribd.Toolbar.autohider.autohideTimeoutId=window.setTimeout(function(){if(Scribd.Toolbar.autohider.canHideToolbar()){Scribd.Toolbar.autohider.hide();}},Scribd.Toolbar.autohider.waitTime);}}};Scribd.Toolbar.autohider.hide=function(){if(Scribd.Toolbar.autohider.visible){Scribd.Toolbar.autohider.visible=false;if(Scribd.Toolbar.autohider.currentEffect){Scribd.Toolbar.autohider.currentEffect.cancel();}
Scribd.Toolbar.autohider.currentEffect=new Effect.Morph(Scribd.Toolbar.element,{afterFinish:function(){Scribd.Toolbar.autohider.currentEffect=null;},duration:0.3,style:{bottom:'-35px'}})}};Scribd.Toolbar.autohider.show=function(){if(!Scribd.Toolbar.autohider.visible){Scribd.Toolbar.autohider.visible=true;if(Scribd.Toolbar.autohider.currentEffect){Scribd.Toolbar.autohider.currentEffect.cancel();}
Scribd.Toolbar.autohider.currentEffect=new Effect.Morph(Scribd.Toolbar.element,{afterFinish:function(){Scribd.Toolbar.autohider.currentEffect=null;},duration:0.3,style:{bottom:'0px'}})}};Scribd.processHash=(function(){var paramProcessors=$H({mode:function(name,value){var modes=["slideshow","scroll"];value=value.toLowerCase();if(modes.indexOf(value)<0){return;}
if(docManager.viewMode()!=value){docManager.setViewManager(value);}},full:function(name,value){docManager.enterFullscreen();},page:function(name,value){var num=Math.min(docManager.pageCount(),Math.max(parseInt(value),1));docManager.gotoPage(num);}});function processParam(name,value){paramProcessors.get(name).call(this,name,value);}
function parseParam(str){var kv=str.split("="),name=kv[0].toLowerCase(),value=kv[1]||true,idx=paramProcessors.keys().indexOf(name);if(idx>=0){return{'priority':idx,'name':name,'value':value};}
return false;}
return(function(){if(window.location.hash&&window.location.hash.length>1){var hashValue=window.location.hash.substring(1);hashValue.split("&").collect(function(p){var parsed=parseParam(p);if(parsed){return parsed;}}).compact().sortBy(function(hsh){return hsh['priority'];}).each(function(hsh){processParam(hsh['name'],hsh['value']);});}});})();


/* app/views/documents/fourgen/_tooltip.js @ 1305154352 */

if(!window.Scribd){var Scribd={};}
if(!Scribd.Toolbar){Scribd.Toolbar={};}
Scribd.Toolbar.Tooltips={Tooltip:Class.create({initialize:function(control_id){this.control_id=control_id;this.control=$(control_id);this.tooltip=$(control_id+"_tooltip");this.textElement=this.tooltip.down('nobr');var tail=this.tooltip.down('.tooltip_tail');var title=this.control.readAttribute('title');this.control.writeAttribute('title',null);this.setText(title);tail.setStyle({width:this.tooltip.getWidth()});this.position();this.bindings();Scribd.Toolbar.Tooltips.set(control_id,this);},blockers:function(){return Scribd.Toolbar.Tooltips.blockers[this.control_id]||[];},blocking:function(){return this.blockers().any(function(fn){return fn.apply();});},setText:function(text){this.textElement.update(text);},bindings:function(){var opts={duration:0.2};var that=this;that.control.observe('mouseover',function(){if(that.blocking()){return;}
that.tooltip.appear(opts);});that.control.observe('mouseout',function(){that.tooltip.fade(opts);});},position:function(){this.tooltip.clonePosition(this.control,{setWidth:false,setHeight:false,offsetTop:-1*(this.control.getHeight()-2),offsetLeft:(this.tooltip.getWidth()-this.control.getWidth())/-2});}}),blockers:{},registerBlocker:function(id,fn){if(typeof this.blockers[id]!=='object'){this.blockers[id]=[];}
this.blockers[id].push(fn);},collection:{},get:function(control_id){return this.collection[control_id];},set:function(control_id,tooltip){this.collection[control_id]=tooltip;}};Scribd.Toolbar.Tooltips.registerBlocker('viewmode_selector',function(){return Scribd.Toolbar.viewmode_popup.visible();});Scribd.Toolbar.Tooltips.registerBlocker('toolbar_readcast',function(){return $('social_readcast_popup').visible();});Scribd.Toolbar.Tooltips.registerBlocker('toolbar_comment',function(){return $('comment_popup').visible();});Scribd.Toolbar.Tooltips.registerBlocker('toolbar_embed',function(){return $('embed_popup').visible();});
