$(document).ready(function() {
  if($("#content .slides .slide").length > 0) {
    $("#content .slides").cycle({
      fx:       'fade',
      speed:    2000,
      timeout:  3000,
      cleartype: true,
      cleartypeNoBg: true
    });
  }
});

/*
$(document).ready(function() {
	SetYoutubeVideos();
  
  $(".lightbox").fancybox({
    'padding'        : 0,
    'titleShow'      : false,
    'autoScale'      : false,
    'transitionIn'  : 'none',
    'transitionOut'  : 'none'
  });
});

function SetYoutubeVideos() {
  
  if($(".youtubeblock").length > 0) {
    $(".youtubeblock .youtube").each( function() {
      var VideoId   = GetYoutubeVideoId($(this).attr("href"));
      $(this).html("<img style=\"width: 159px;\" src=\"http://img.youtube.com/vi/"+ VideoId +"/0.jpg\" alt=\"youtube\" />"); 
    });
  }
  
  $(".youtubeblock .overlay").click(function() { $('.youtube', $(this).parent()).trigger('click'); });                             
  $(".youtube").click(function() {
    var VideoId   = GetYoutubeVideoId($(this).attr("href"));
    $.fancybox({
        'padding'        : 0,
        'autoScale'      : false,
        'transitionIn'  : 'none',
        'transitionOut'  : 'none',
        'title'          : this.title,
        'titleShow'      : false,
        'width'          : 854,
        'height'        : 480,
        'href'          : "http://www.youtube.com/v/" + VideoId + "&autoplay=1",
        'type'          : 'swf',
        'swf'            : {
          'wmode'            : 'transparent',
          'allowfullscreen'  : 'true'
        }
      });

    return false;
  });
  
  return ;
}

function GetYoutubeVideoId (URL) {
  if(URL === null){ 
    return ""; 
  }
  
  var VideoId;
  var Results;
  Results = URL.match("[\\?&]v=([^&#]*)");
  
  if(Results == null){
    Results = URL.split("/")  
    VideoId = ( Results === null ) ? URL : Results[3];  
  } else {
    VideoId = Results[1]
  }

  return VideoId;
}
*/
