/**
 * JS
 * @author Darío Ruellan <druellan@ecimtech.com>
 * @author Gustavo Salvini <gsalvini@ecimtech.com>
 * @copyright ecimTech 2009
 * @import: jquery/jquery.quicksearch.js
 */

$(function()
{

// Zebra
	$("#program .row:odd").addClass("odd");
	
	// Provisualizacion de imagen
	$("#program .links a.img").tipsy(
	{
		content: '<span class="thumb"></span>',
		fade: true,
		gravity: 's'
	});
	$("#program .links a.img").mouseover(function()
	{
		var id = $(this).attr("rel");
		$.get('?action=peek/getthumb_artist&id='+id, function(thumb)
		{
			$(".tipsy .tipsy-inner span").html('<img src="'+thumb+'" width="100" />'); 
		});
	})
	
	// Botonete de + mas info
	$("#program .row a.moreinfo").click(function()
	{
		$(this).parent().find("p.moreinfo").slideDown();
		$(this).css("opacity", "0.3");
		return false;
	});

	// Quicksearch
	var textarea = $("#textarea");
	$(".row", textarea).quicksearch(
	{
		attached: 'div.searchbox',
		labelText: '&nbsp;',
		inputText: 'Quick search',
		loaderText: ' <span class="spinner"></span>',
		onBefore: function()
		{
			if ($("div.searchbox input.qs_input").val() ) {
				$("#program h3, #program .letters, #program .description").slideUp("fast");
			} else {
				$("#program h3, #program .letters, #program .description").slideDown("fast");
			}
		}
	});
})

