[12796] | 1 | <img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage" |
---|
| 2 | {if isset($COMMENT_IMG)} |
---|
| 3 | title="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}" |
---|
| 4 | {/if}> |
---|
| 5 | {if count($current.available_derivative_types)>1} |
---|
| 6 | {footer_script}{literal} |
---|
[12797] | 7 | function changeImgSrc(url,type,display) |
---|
[12796] | 8 | { |
---|
| 9 | var theImg = document.getElementById("theMainImage"); |
---|
| 10 | if (theImg) |
---|
| 11 | { |
---|
| 12 | theImg.removeAttribute("width");theImg.removeAttribute("height"); |
---|
| 13 | theImg.src = url; |
---|
[12797] | 14 | var elt = document.getElementById("derivativeSwitchLink"); |
---|
| 15 | if (elt) elt.innerHTML = display; |
---|
[12796] | 16 | } |
---|
| 17 | document.cookie = 'picture_deriv=' + type; |
---|
| 18 | } |
---|
[12797] | 19 | |
---|
| 20 | function toggleDerivativeSwitchBox() |
---|
| 21 | { |
---|
| 22 | var elt = document.getElementById("derivativeSwitchBox"), |
---|
| 23 | ePos = document.getElementById("derivativeSwitchLink"); |
---|
| 24 | if (elt.style.display==="none") |
---|
| 25 | { |
---|
| 26 | elt.style.position = "absolute"; |
---|
| 27 | elt.style.left = (ePos.offsetLeft + 10) + "px"; |
---|
| 28 | elt.style.top = (ePos.offsetTop + ePos.offsetHeight) + "px"; |
---|
| 29 | elt.style.display=""; |
---|
| 30 | } |
---|
| 31 | else |
---|
| 32 | elt.style.display="none"; |
---|
| 33 | } |
---|
[12796] | 34 | {/literal}{/footer_script} |
---|
[12797] | 35 | <a id="derivativeSwitchLink" onclick="toggleDerivativeSwitchBox()" style="cursor:pointer">{$current.selected_derivative->get_type()|@translate}</a> |
---|
| 36 | <div id="derivativeSwitchBox" onclick="toggleDerivativeSwitchBox()" style="display:none"> |
---|
[12796] | 37 | {foreach from=$current.available_derivative_types item=derivative_type} |
---|
[12797] | 38 | <a onclick="changeImgSrc('{$current.derivatives[$derivative_type]->get_url()|@escape:javascript}', '{$derivative_type}', '{$derivative_type|@translate|@escape:javascript}')" style="cursor:pointer">{$derivative_type|@translate} ({$current.derivatives[$derivative_type]->get_size_hr()})</a><br> |
---|
[12796] | 39 | {/foreach} |
---|
[12797] | 40 | </div> |
---|
[12796] | 41 | {/if} |
---|