1 | <img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage" usemap="#map{$current.selected_derivative->get_type()}" |
---|
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.unique_derivatives)>1} |
---|
6 | {footer_script}{literal} |
---|
7 | function changeImgSrc(url,typeSave,typeMap,typeDisplay) |
---|
8 | { |
---|
9 | var theImg = document.getElementById("theMainImage"); |
---|
10 | if (theImg) |
---|
11 | { |
---|
12 | theImg.removeAttribute("width");theImg.removeAttribute("height"); |
---|
13 | theImg.src = url; |
---|
14 | var elt = document.getElementById("derivativeSwitchLink"); |
---|
15 | if (elt) elt.innerHTML = typeDisplay; |
---|
16 | theImg.useMap = "#map"+typeMap; |
---|
17 | } |
---|
18 | document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}'; |
---|
19 | } |
---|
20 | |
---|
21 | function toggleDerivativeSwitchBox() |
---|
22 | { |
---|
23 | var elt = document.getElementById("derivativeSwitchBox"), |
---|
24 | ePos = document.getElementById("derivativeSwitchLink"); |
---|
25 | if (elt.style.display==="none") |
---|
26 | { |
---|
27 | elt.style.position = "absolute"; |
---|
28 | elt.style.left = (ePos.offsetLeft+10)+"px"; |
---|
29 | elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px"; |
---|
30 | elt.style.display=""; |
---|
31 | } |
---|
32 | else |
---|
33 | elt.style.display="none"; |
---|
34 | } |
---|
35 | {/literal}{/footer_script} |
---|
36 | <a id="derivativeSwitchLink" href="javascript:toggleDerivativeSwitchBox()">{$current.selected_derivative->get_type()|@translate}</a> |
---|
37 | <div id="derivativeSwitchBox" onclick="toggleDerivativeSwitchBox()" style="display:none"> |
---|
38 | {foreach from=$current.unique_derivatives item=derivative key=derivative_type} |
---|
39 | <a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}','{$derivative->get_type()|@translate|@escape:javascript}')">{$derivative->get_type()|@translate} ({$derivative->get_size_hr()})</a><br> |
---|
40 | {/foreach} |
---|
41 | {if isset($U_ORIGINAL)} |
---|
42 | <a href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" rel="nofollow">{'Original'|@translate}</a> |
---|
43 | {/if} |
---|
44 | </div> |
---|
45 | {/if} |
---|
46 | |
---|
47 | {foreach from=$current.unique_derivatives item=derivative key=derivative_type}{strip} |
---|
48 | <map name="map{$derivative->get_type()}" id="map{$derivative->get_type()}"> |
---|
49 | {assign var='size' value=$derivative->get_size()} |
---|
50 | {if isset($previous)} |
---|
51 | <area shape=rect coords="0,0,{$size[0]/4|@intval},{$size[1]}" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" alt="{$previous.TITLE}"> |
---|
52 | {/if} |
---|
53 | <area shape=rect coords="{$size[0]/4|@intval},0,{$size[0]/1.34|@intval},{$size[1]/4|@intval}" href="{$U_UP}" title="{'Thumbnails'|@translate}" alt="{'Thumbnails'|@translate}"> |
---|
54 | {if isset($next)} |
---|
55 | <area shape=rect coords="{$size[0]/1.33|@intval},0,{$size[0]},{$size[1]}" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" alt="{$next.TITLE}"> |
---|
56 | {/if} |
---|
57 | </map> |
---|
58 | {/strip}{/foreach} |
---|