$(document).ready(function()
{


    $('#bCerca > a > img').click(
		function()
		{
		    loadInnerContentCerca($('#iCerca').val())
		}
	);


    $('#fCerca').submit(
		function()
		{
		    loadInnerContentCerca($('#iCerca').val());
		    void (0);
		    return false;
		}
	);

    // <Icona RSS ToolTip> 


    var mybrowser;
    var myheight;

    if (jQuery.browser.msie)
    {
        mybrowser = "msie"
        myheight = 230;
    }
    else if (jQuery.browser.mozilla)
    {
        mybrowser = "mozilla"
        myheight = 190;
    }
    else if (jQuery.browser.safari)
    {
        mybrowser = "safari"
        myheight = 200;
    }
    else
    {
        mybrowser = ""
        myheight = 100;
    }


    $.fn.tooltip = function()
    {
        return this.each(function()
        {
            $this = $(this);
            var div = $(this).next().next();
			div.css({ "top": "+" + Math.round($(this).offset().top +  20) + "px", "left": "+" + Math.round($(this).offset().left +  20) + "px", "position": "absolute", "height": myheight + "px" });
				
            $this.hover(function(e)
            {				
                div.fadeIn(500);
            },
            function()
            {
                div.fadeOut(500);
            });
        });
    }

    $.get('/bom/includes/fFrontEndAJAX.asp?act=rssToolTip&browser=' + mybrowser, function(data)
    {
        $(".RssTooltip").html(data); 
        $('#aRSS').tooltip();
    });
    
    // </Icona RSS ToolTip> 

    var hasFlash = true;
    if ($.hasFlashPlayer)
    {
        if ($.flashPlayerVersion[0] < 10)
        {
            hasFlash = false;
        }
    } else
    {
        hasFlash = false;
    }
    if (!hasFlash)
    {
        $("#video").html('<a href="http://get.adobe.com/it/flashplayer/" target="_blank"><img src="/images/img_flash_player_955.jpg" border="0"></a>')
    }

    //inizializzazione js player
    pageInit();

});


function searchSpettacoli()
{
    $(this).scrollTo(537, 1500);
    var tipo = $("#tipoSpettacoli").val();
    var citta = $("#cittaSpettacoli").val();
    $('#main_left').fadeTo(200, 0, function()
    {
        $.get('/funcAjax.asp?f=fFESpettacoli("' + tipo + '","' + citta + '")', function(data)
        {
            $("#main_left").html(data);
            $("#main_left").fadeTo(200, 1);
        });
    });
}












