$(document).ready(function()	{
	$('#markitup').markItUp(mySettings);	

	$('#emoticons img').click(function() 
	{
    emoticon = $(this).attr("alt");
    $.markItUp( { replaceWith:emoticon } );
  });
});

$(function() 
{    
    $('#teampic').after('<div id="nav2" class="content_pic_description">').cycle({
        fx:     'fade', 
        speed:  'fast',
        timeout: 0,
        speed: 750,
        pager:  '#nav2',
        sync: 1,
        // callback fn that creates a thumbnail to use as pager anchor 
        pagerAnchorBuilder: function(idx, slide) 
        { 
          team_image = new Array();
          team_image[0] = "";
          team_image[1] = "Karl Heinz Struggl";
          team_image[2] = "Andreas Hütter";
          team_image[3] = "Philipp Melab";
          team_image[4] = "Martin Daum";
          team_image[5] = "Mario Smrekar";
          
          link = '<a class="white" href="#">' + team_image[idx] + '</a>';
          if(idx >= 1 && idx < 5)
            link += '<font> | </font>';
          
          return link; 
        }
    });    
});

$(function()
{
  $('#reference').after('<div id="nav2" class="reference_thumbs">').cycle({ 
      fx:     'fade', 
      speed:  1300, 
      timeout: 0, 
      pager:  '#nav2', 

      // callback fn that creates a thumbnail to use as pager anchor 
      pagerAnchorBuilder: function(idx, slide) 
      { 
        var str_name = slide.src;
        var name = str_name.replace(/original/, "refthumb");
        return '<a href="#"><img class="thumb" src="' + name + '" width="89" height="30" /></a>'; 
      } 
  });
});
  
$(function()
{
$(window).load(function(event) { fw_checkWindowWidth(); } );
$(window).resize(function(event) { fw_checkWindowWidth(); });
});

function fw_checkWindowWidth()
{
  var winWidth = $(window).width();
  if(winWidth < 1140)
  {
  	$('#flw_pagecurl').css('display', 'none');
  }
  else
  {
    $('#flw_pagecurl').css('display', 'block');
  }
}

$(document).ready(function()
{ 
    $("#search_field").focus(function() 
    {
      $("#search_field").val("");
    });
    
    $("#search_field").blur(function() 
    {
      if($("#search_field").val() == "")
        $("#search_field").val("Suchbegriff eingeben...");
    });     
});

window.onload = function () {
    var container = $('div.sliderGallery');
    var ul = $('ul', container);
    
    var itemsWidth = ul.innerWidth() - container.outerWidth();
    
    $('.slider', container).slider({
        minValue: 0,
        maxValue: itemsWidth + 4,
        handle: '.handle',
        stop: function (event, ui) {
            ul.animate({'left' : ui.value * -1}, 500);
        },
        slide: function (event, ui) {
            ul.css('left', ui.value * -1);
        }
    });
};

