/**
 * @version: 0.01
 * @date   : 26.05.2011 21:28:15
 * @autor  : bernd göbel, strich-komma
 * 
 */
 
var referencesClass = '';
var referencesCount = 0;
var referencesPage  = 0;
var referencesOpen  = false;
  
$(document).ready(function () {
  get_page();
  
  $(".carousel").carousel({
    //effect: "fade",
    animSpeed: "slow",
    nextBtnInsert: "appendTo",
    prevBtnInsert: "appendTo",
    btnsWrapper: '<div id="carouselNavigation"></div>',
    callback: show_curPage
  })
    .hover(
    function () {
      $("h1").addClass("active");
    },
    function () {
      $("h1").removeClass("active");
    }
  );
  $('#carouselNavigation').append('<a href="#" id="openPage" class="carousel-control open carousel-open" role="button"">Open</a>')
  .append('<div class="carousel-info"></div>');
  
  $('.carousel').css('height', 'auto');
  
  show_curPage(referencesCount);
  
  $('#openPage').click(function() {
    open_page( $(this) );
    return false;
  });
  
  $('.carousel ul li p').addClass('text');
    
  tmpLeft =   $('#pageWrapper').offset().left;

  $('#home h1').css( {
    'position': 'fixed',
    'left'    :  ( tmpLeft + 52 ) + 'px'
  });
  
  $('#carouselNavigation').css( {
    position: 'fixed',
    left    : tmpLeft + 'px'
  });
  
  write_href();
});

$(window).load(function() {

});

$(window).resize(function() {
  tmpLeft =   $('#pageWrapper').offset().left;
  $('#home h1').css( {
    'left'    :  ( tmpLeft + 52 ) + 'px'
  });
  $('#carouselNavigation').css( {
    left    : tmpLeft + 'px'
  });
});

$(window).scroll(function () { 

});


