$(function() {
	$(".jcarousel-skin-tango .jcarousel-item").hover(
	  function () {
		$(this).addClass("jcarousel-hover");
	  },
	  function () {
		$(this).removeClass("jcarousel-hover");
	  }
	);
	
	$("#sidebar ul li>a").click(function(){
		$(this).toggleClass("active").next().slideToggle("normal");
	});


	$('#slideshow').cycle({ 
		fx:     'fade', 
		timeout: 5000
	});

    $('#mycarousel').jcarousel();
	

$('#gallery').cycle({ 
    fx:     'fade', 
    timeout: 0,
    after: onAfter, 
    pager:  '#mycarousel', 
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#mycarousel li:eq(' + idx + ') a'; 
    } 
});


function onAfter(curr, next, opts, fwd){
        //get the height of the current slide
        var $ht = $(this).height();
        //set the container's height to that of the current slide
        $(this).parent().css("height", $ht);
}

var anchor=window.location.hash.substring(1);  
if(anchor)
{
	$('#gallery').cycle(parseInt(anchor)); 
}  
});

$(document).ready(function() 
{
   // Notice the use of the each() method to acquire access to each elements attributes
   $('.days a[tooltip]').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
         style: 'light' // Give it a crea mstyle to make it stand out
      });
   });
   
 
});

//$(document).ready(function() {
//	
//	$("a[title]:gt(1)").tooltip({
//
//		// use div.tooltip as our tooltip
//		tip: '.tooltip',
//
//		// use the fade effect instead of the default
//		effect: 'fade',
//
//		// make fadeOutSpeed similar to the browser's default
///		fadeOutSpeed: 100,
//
//		// the time before the tooltip is shown
//		predelay: 400,
//
//		// tweak the position
//		position: "bottom right",
//		offset: [-50, -80]
//	});
//}/)/;

