//TellFriend ///////////////////////////////////////////////////

jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);  
};

$(document).ready(function() {
    $('#tellfriend').hide();
    $('li a.email, #tellfriend a.close').click(function() {
    $("#tellfriend").fadeToggle('slow');
  });
});


//Modal ///////////////////////////////////////////////////

$(document).ready(function(){
				
	$("a.modal").colorbox();
			
	}); 
	
	
//Tabs! ///////////////////////////////
$(document).ready(function() {
    $('.tabs').tabs();
  });
  
//Cluetip ///////////////////////////////////////////////////

$(document).ready(function() {

$('a.jt').cluetip({
  cluetipClass: 'jtip',  
  dropShadow: false,
  hoverIntent: true,
  sticky: true,
  mouseOutClose: true,
  positionBy: 'fixed', leftOffset: -235, topOffset: -210
  
  
  });  

});




$(document).ready(function() {

$('a.jt-home').cluetip({
  cluetipClass: 'jtip',  
  dropShadow: false,
  hoverIntent: true,
  sticky: true,
  mouseOutClose: true,
  positionBy: 'fixed', leftOffset: -267, topOffset: -120
  
  
  });  

});



$(document).ready(function() {

$('a.jt-list').cluetip({
  cluetipClass: 'jtip',  
  dropShadow: false,
  hoverIntent: true,
  sticky: true,
  mouseOutClose: true,
  positionBy: 'fixed', leftOffset: -235, topOffset: -265
  
  
  });  

});


$(document).ready(function() {

$('a.jt-modal').cluetip({
  cluetipClass: 'jtip',  
  dropShadow: false,
  hoverIntent: true,
  sticky: true,
  mouseOutClose: true,
  positionBy: 'fixed', leftOffset: -10, topOffset: -10
  
  
  });  

});



 
//AutoComplete ///////////////////////////////////////////////////

$().ready(function() {

	function findValueCallback(event, data, formatted) {
		$("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result");
	}
	
	function formatItem(row) {
		return row[0] + " (<strong>id: " + row[1] + "</strong>)";
	}
	function formatResult(row) {
		return row[0].replace(/(<.+?>)/gi, '');
	}
	
	$("input.artist-ac").autocomplete(artist);
	
	$("input.artist-website-ac").autocomplete(website);
	
	$("input.album-title").autocomplete(album_title);
  });


 