/*
###########################################################################

                        JavaScript Document for
                          tx_exolightbox_pi1
                          
   Programmierung bstenfeldt bstenfeldt(at)exotec.de -  www.exotec.de

			                FEEL SO FREE AND CONTACT US

###########################################################################

This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2006 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at http://typo3.com/ and http://typo3.org/
*/ 
function Pageloaded() 
{ 
    var buttons = document.getElementsByClassName("button" ,"exolightbox");  
    buttons.each(function(value, index){
          Element.toggle(value);
    }); 
    var buttonjs = document.getElementsByClassName("buttonjs" ,"exolightbox");  
    buttonjs.each(function(value, index){
          Element.toggle(value);
    });    
    ObserveEvents();
}

function startEffects()
{
  if($("disableEffects").checked==false)
  {
    if(enableSlide==1)
      new Effect.BlindUp('inner_exolightbox', { duration: slideDuration });	
    if(enableFade==1)  
     new Effect.Fade('inner_exolightbox', { duration: fadeDuration });	
  }
}

function gt()
{
  if(showPage==maxBrowserPages)return;
  showPage += 1;
  startEffects();
  getData();
}

function lt()
{
  if (showPage==1)return;
  showPage -= 1;
  startEffects();
  getData();
}

function getData()
{
  var parameter = {
      showPage       : showPage,
      mode           : "ajax",
      imagesPeerPage : $("imagesPeerPage").value,
      no_cache       : 1,
  };
      
  var param = $H(parameter);
  var url = "index.php?id="+pageID;
  var myAjax = new Ajax.Request(
  url,
  {
    method: "get",
    parameters: param.toQueryString(),
    onComplete: showResponse
  });
}

function showResponse(parameter)
{
  var response = parameter.responseText.split("<!--***RESPONSE_MARKER***-->");
  Element.update("exolightbox", response[1]); 
  if((enableSlide==0)&&(enableFade==0)) 
  {
    Element.show("inner_exolightbox");
  }
  else if($("disableEffects").checked==false)
  {
    effectAktivated = 0;
    if(enableSlide==1)
     new Effect.BlindDown('inner_exolightbox', { duration: slideDuration });
    if(enableFade==1)  
     new Effect.Appear('inner_exolightbox', { duration: fadeDuration });	
  }
  else
  {
    Element.show("inner_exolightbox");
  }

  Pageloaded();
  initLightbox(); 
  
}


