<script language="javascript" src="{$jspath}/jgalslide.js" type="text/javascript"></script>

{literal}
<script type="text/javascript">
<!-- //

function mycarousel_itemLoadCallback(carousel, state)
{
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }
	
    jQuery.get('index.php?aj=1&p=gallery&action=ajaxrandom&id={/literal}{$smarty.request.galid}&ascdesc={$smarty.request.ascdesc}&blanc=1&first_id={$smarty.get.first_id}&categ={$smarty.request.categ}{literal}',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};


function mycarousel_itemAddCallback(carousel, first, last, xml)
{
    carousel.size(parseInt(jQuery('total', xml).text()));
	jQuery('image', xml).each(function(i) {
        carousel.add(first + i, mycarousel_getItemHTML(jQuery(this).text()));
    });
};

function mycarousel_getItemHTML(url)
{
    return url;
	//return '<img border="0" src="' + url + '"  alt="" />';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		itemLoadCallback: mycarousel_itemLoadCallback,
		start:{/literal}{$slide_start|default:1}{literal}
		{/literal}{if $browser == 'Firefox' || $browser == 'IE7'},scroll:4,visible:7{/if}{literal}
    });
});


function initImage() {
  imageId = 'gallery_image_thumb';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}

function setOpacity(obj, opacity) {
/*
  opacity = (opacity == 100)?99.999:opacity;
  obj.style.filter = "alpha(opacity:"+opacity+")";
  obj.style.KHTMLOpacity = opacity/100;
  obj.style.MozOpacity = opacity/100;
  obj.style.opacity = opacity/100;
 */
}

function fadeIn(objId,opacity) {
/*
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
  */
}
window.onload = function() {initImage()}
// -->
</script>
{/literal}

<div id="body_blanc">
<div class="box_innerhead">{$pagetitle_html|specialchars}</div>




<div align="center">
<div class="gallery_diashow_toolbox">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td>
    {if permission('gallery_download') && $gs->Download==1}
    <strong><a href="index.php?diashow=1&amp;p=gallery&amp;action=showimage&amp;id={$smarty.request.id}&amp;galid={$smarty.request.galid}&amp;blanc=1&amp;download=1&amp;area={$area}">{#Gallery_Download#}</a></strong> ({#Gallery_FileSize#}: {$data->Image_Width} X {$data->Image_Height})
    {/if}
    </td>
    <td align="right">

{if $data->NextImage}
<button class="gfx_buttons" onclick="location.href='index.php?diashow=1&amp;ascdesc={$smarty.request.ascdesc}&amp;stop=1&amp;p=gallery&amp;action=showimage&amp;id={$smarty.get.id}&amp;galid={$smarty.get.galid}&amp;blanc=1{if $smarty.request.refreshtime!=''}&amp;refreshtime={$smarty.request.refreshtime}{/if}&amp;first_id={$smarty.get.first_id}&amp;categ={$smarty.request.categ}&amp;area={$area}'">{#Gallery_Pause#}</button>
<button class="gfx_buttons" onclick="location.href='{$data->NextImageLink_Blanc}'">{#Gallery_Play#}</button>
{/if}
<button class="gfx_buttons" onclick="location.href='index.php?diashow=1&amp;ascdesc={$smarty.request.ascdesc}&amp;p=gallery&amp;action=showimage&amp;id={$smarty.get.first_id}&amp;galid={$smarty.get.galid}&amp;blanc=1&amp;first_id={$smarty.get.first_id}&amp;categ={$smarty.request.categ}&amp;area={$area}'">{#Gallery_PlayAgain#}</button>
<button class="gfx_buttons" onclick="javascript:window.close();">{#WinClose#}</button>
</td>
  </tr>
  <tr>
    <td>&nbsp;
    
    </td>
<td align="right">
{#Gallery_ImageNextIn#} <h2><span id="numberCountdown">{#Gallery_ImageNextPause#}</span></h2></strong> {#Gallery_ImageNextSeconds#}.
</td>
  </tr>
</table>


<br />
</div>

<div class="gallery_pic_preview_container">
<div class="gallery_pic_diashow">

<div class="gallery_diashowload">
<img id="gallery_image_thumb" onload="nextImg();startCountdown()"  src="{$data->Image}" alt="{$data->ImageName|specialchars}" vspace="0" border="0" />
</div> 

<br />
<h2>{$data->ImageName|specialchars}</h2><br />
{$data->ImageText}

<br /><br />


</div>
</div>

{if $data->NextImage}
    {if $smarty.request.blanc==1 && $smarty.request.stop!=1}
    <script language ="JavaScript">
    <!--
	var ccontinue = true;
	
	
	var g_iCount = new Number();
	var g_iCount = {$Galsettings->Diashow_Zeit} + 1;
	var time = {$Galsettings->Diashow_Zeit}000;
	function startCountdown()
	{ldelim}
		   if((g_iCount - 1) >= 0)
		   {ldelim}
				   g_iCount = g_iCount - 1;
				   document.getElementById('numberCountdown').innerHTML = g_iCount;
				   setTimeout('startCountdown()',1000);
		   {rdelim}
	{rdelim} 
	
	function nextImg(status)
	{ldelim}
		if(status=='stop')
		{ldelim}
			stop();
		{rdelim}
		else
		{ldelim}
			setTimeout ("document.location.href ='{$data->NextImageLink_Blanc|replace:'&amp;':'&'}'",time);
		{rdelim}
	{rdelim}
	
	function gstop()
	{ldelim}
		nextImg('stop');
	{rdelim}
    // -->
    </script>
    {/if}
{/if}

<!-- SLIDER START -->
<div class="jcarousel_div">
<div id="mycarousel" class="jcarousel-slider">
<ul><!-- DUMMY --></ul>
</div>
</div>
<!-- SLIDER ENDE -->

{if $gs->Banner_Code!=''}
<div class="gallery_bannercode">{$gs->Banner_Code}</div>
{/if}


</div>
</div>
