$(document).ready(function () {
    $('#footer a:not(.info), .accetto a').colorbox({ width: "600px", height: "500px", iframe: true });
    $('a.yt').colorbox({ width: "853px", height: "510px", iframe: true });
    $('.info').colorbox({ width: "500px", height: "350px", iframe: true });
    $('a.lb').colorbox();
    $("a.blank").click(function () { $(this).attr("target", "_blank") });
    //    $("a[rel='gal1']").colorbox({ title: true });
    //    $("a[rel='gal2']").colorbox({ title: true });
    //    $("a[rel='gal3']").colorbox({ title: true });

    /*pulsanti forms*/
    $("#top .invia").click(function () {
        $(this).closest("div").find("input[type=submit]").click();
        return false;
    });
    $("#top input[type='text']").focus(function () {
        var txt = $(this).closest("div").is("#cerca") ? "cerca..." :
				$(this).closest("div").is("#newsletter") ? "Inserisci email" : "";
        $(this).attr("value") == txt ? $(this).attr("value", "") : ""
    });
    $("#top input[type='text']").blur(function () {
        var txt = $(this).closest("div").is("#cerca") ? "cerca..." :
				$(this).closest("div").is("#newsletter") ? "Inserisci email" : "";
        $(this).attr("value") == "" ? $(this).attr("value", txt) : ""
    });


    /* social links */
    $("#social .fb, #social .tw").click(function () {
        var u = location.href;
        $(this).hasClass("fb") ? window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&src=sp', '', '') :
		$(this).hasClass("tw") ? window.open('http://twitter.com/home?status=Currently%20reading%20' + encodeURIComponent(u), '', '') : "";
        return false;
    });

});



