{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Base.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Async.js')}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Iter.js")}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DOM.js")}

{capture assign=sLocation}action=checkout_final&fDocumentId={$context->oDocument->getId()}&reason={$reason|escape:'url'}{/capture}

{capture assign=sJavascript}
function doCheckout () {ldelim}
	document.location.href = "{$sLocation|addQSSelf}";
{rdelim}
function scheduleCheckout () {ldelim}
	callLater(2, doCheckout);
{rdelim}
addLoadEvent(scheduleCheckout);
{/capture}
{$context->oPage->requireJSStandalone($sJavascript)}

<h2><img src="{if $config->get("ui/morphEnabled") == '1'}{$rootUrl}/skins/kts_{$config->get("ui/morphTo")}/title_bullet.png{else}{$rootUrl}/resources/graphics/title_bullet.png{/if}"/>{i18n}Checkout Document{/i18n}:<br />{$context->oDocument->getName()|sanitize}</h2>

{capture assign=link}{$sLocation|addQSSelf}{/capture}
<p class="descriptiveText">{i18n arg_link=$link}The document you wish to
check out will begin to download soon.  If it does not automatically
start to download, you can use <a href="#link#">this link</a> to start
it yourself.{/i18n}</p>

{assign var=iDocumentId value=$context->oDocument->getId()}
{capture assign=link}
{"viewDocument"|generateControllerUrl:"fDocumentId=$iDocumentId"}
{/capture}
<p class="descriptiveText">{i18n arg_link=$link}Once the document has
been downloaded, you should <a href="#link#">return to the document
view</a>.{/i18n}</p>
