:: ImageMarcro[widget]

<<widget "linkedImage" container>>
    <<set _linkedImageContents = _contents>>
    <div class="linkedImage">
        <<capture _linkedImageContents>>
            <<link ''>>
                _linkedImageContents
            <</link>>
        <</capture>>
        <<image _args[0]>>
    </div>
<</widget>>

<<widget 'image'>>
    <<if _args[0]>>
        <<set _path = setup.mediaPathImage(_args[0])>>

        <<if _args[1] !== undefined>>
            <<set _path = _path.replace('#',rand(_args[1],_args[2]))>>
        <</if>>

        <img @src="_path">

    <<else>>
        <div></div>
    <</if>>
<</widget>>

<<widget 'imageDayNight'>>
    <<if !$time.isNight>>
        <<set _pathDayNight = _args[0].replace('#',_args[1])>>
    <<else>>
        <<set _pathDayNight = _args[0].replace('#',_args[2])>>
    <</if>>
    <<image _pathDayNight>>
<</widget>>

<<widget 'imageWithTooltip' container>>
    <<if !$tooltipCounter>><<set $tooltipCounter = 0>><</if>>
    <<set $tooltipCounter = $tooltipCounter % 1000000>>
    <<set $tooltipCounter += 1>>
    <<set _tooltip_id = 'tooltip_'+$tooltipCounter>>
    <<set _tooltip_id_hidden = 'tooltip_'+$tooltipCounter+'_hidden'>>

    <<set _path = setup.mediaPathImage(_args[0])>>

    <img @id=_tooltip_id title="" @src="_path">
    <a @id=_tooltip_id_hidden style="display:none">
        _contents
    </a>

    <<capture _tooltip_id, _tooltip_id_hidden>>
        <<done>>
            <<run setup.tooltip("#"+_tooltip_id, '#'+_tooltip_id_hidden)>>
        <</done>>
    <</capture>>

<</widget>>
