// Cover Top
$(function() {
    var img = null;
    $.ajax({
        type: "POST",
        url: "/js/get_head.php",
        cache: false,
        success: function(header){
            $("#artiste").fadeTo("slow", 0).css({"backgroundImage" : "url("+header+")"}).fadeTo("slow", 1);
            img = header;
        }
    });
    setInterval(function() {
        $.ajax({
            type: "POST",
            url: "/js/get_head.php",
            data: "lastimg="+img,
            cache: false,
            success: function(header){
                if(html!=1)
                {
                    $("#artiste").fadeTo("slow", 0).css({"backgroundImage" : "url("+header+")"}).fadeTo("slow", 1);
                    img = header;
                }
            }
        });
        return false;
    },10000);
});

/***
// Comming next title
$(function() {
    var poch1 = $("#poch1").attr("src");
    $.ajax({
        type: "GET",
        url: "/js/cache/pochsuiv.html",
        cache: false,
        success: function(poch1rep){
            $("#poch1").fadeTo("slow", 0).attr({"src" : poch1rep}).fadeTo("slow", 1);
            poch1 = poch1rep;
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/pochsuiv.html",
            cache: false,
            success: function(poch1rep){
                if(poch1rep!=poch1)
                {
                    $("#poch1").fadeTo("slow", 0).css({"src" : poch1rep}).fadeTo("slow", 1);
                    poch1 = poch1rep;
                }
            }
        });
        return false;
    },10000);
});

$(function() {
    var titre1 = $("#titre1").html();
    $.ajax({
        type: "GET",
        url: "/js/cache/titrsuiv.html",
        cache: false,
        success: function(titre1txt) {
            $("#titre1").html(titre1txt);
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/titrsuiv.html",
            cache: false,
            success: function(titre1txt) {
                if(titre1txt=!titre1)
                {
                    $("#titre1").html(titre1txt);    
                }
            }
        });
        return false;
    }, 10000);
});

$(function() {
    var titre2 = $("#titre2").html();
    $.ajax({
        type: "GET",
        url: "/js/cache/titractu.html",
        cache: false,
        success: function(titre2txt) {
            $("#titre2").html(titre2txt);
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/titractu.html",
            cache: false,
            success: function(titre2txt) {
                if(titre2txt=!titre2)
                {
                    $("#titre2").html(titre2txt);    
                }
            }
        });
        return false;
    }, 10000);
});

$(function() {
    var titre3 = $("#titre3").html();
    $.ajax({
        type: "GET",
        url: "/js/cache/titrprec.html",
        cache: false,
        success: function(titre3txt) {
            $("#titre3").html(titre3txt);
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/titrprec.html",
            cache: false,
            success: function(titre3txt) {
                if(titre3txt=!titre3)
                {
                    $("#titre3").html(titre3txt);    
                }
            }
        });
        return false;
    }, 10000);
});

// Current title
$(function() {
    var poch2 = $("#poch2").attr("src");
    $.ajax({
        type: "GET",
        url: "/js/cache/pochactu.html",
        cache: false,
        success: function(poch2rep){
            $("#poch2").fadeTo("slow", 0).attr({"src" : poch2rep}).fadeTo("slow", 1);
            poch2 = poch2rep;
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/pochactu.html",
            cache: false,
            success: function(poch2rep){
                if(poch2rep!=poch2)
                {
                    $("#poch2").fadeTo("slow", 0).css({"src" : poch2rep}).fadeTo("slow", 1);
                    poch2 = poch2rep;
                }
            }
        });
        return false;
    },10000);
});

// Previous title
$(function() {
    var poch3 = $("#poch3").attr("src");
    $.ajax({
        type: "GET",
        url: "/js/cache/pochprec.html",
        cache: false,
        success: function(poch3rep){
            $("#poch3").fadeTo("slow", 0).attr({"src" : poch3rep}).fadeTo("slow", 1);
            poch3 = poch3rep;
        }
    });
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: "/js/cache/pochprec.html",
            cache: false,
            success: function(poch3rep){
                if(poch3rep!=poch3)
                {
                    $("#poch3").fadeTo("slow", 0).css({"src" : poch3rep}).fadeTo("slow", 1);
                    poch3 = poch3rep;
                }
            }
        });
        return false;
    },10000);
});
*/

// Change external link into target _blank
$(document).ready(function(){
    $("a[href*=\'http://\']:not([href*=\'"+location.hostname+"\'])").attr("target","_blank");
});
