$(function(){
    //target blank automatique
    $("a[href^='http://']").click(function(){
             try {
                var pageTracker=_gat._getTracker('UA-17093156-1');
                var act = this.href.match(/:\/\/(.[^/]+)/)[1];
                var cl = $(this).attr("class");
                var txt ="";
                switch(cl){
                    case "agency":
                        txt = 'Liens sortants - agences';
                        break;
                    case "offer":
                        txt = 'Liens sortants - annonces';
                        break;
                    case "chamber":
                        txt = 'Liens sortants - chambres';
                        break;
                    default:
                        txt = 'Outbound Links';
                        break;
                }
                pageTracker._trackEvent(txt, act);
                setTimeout('window.open("'+this.href+'")', 100)
              }catch(err){}
              return false;
    });


    //permet d'ajouter _hover au image pour le changement au survol
    $(".hovered").mouseover(function(){
        var style = $(this).css("background-image");
        var re = new RegExp("(.+)\\.(gif|png|jpg)", "g");
        style= style.replace(re, "$1_hover.$2");
        $(this).css("background-image",style);
    });

    $(".hovered").mouseout(function(){
        var style = $(this).css("background-image");
        var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
        style=style.replace(re, "$1.$2");
        $(this).css("background-image",style);
    });

    $('form').jqTransform({
        imgPath:'/images/img/'
    });
});


//Compatibilité BB....
function survole(id,type) {
    document.getElementById(id).style.backgroundImage = "url(/images/"+id+"_hover."+type+")";
}

function sortie(id,type) {
    document.getElementById(id).style.backgroundImage = "url(/images/"+id+"."+type+")";
}



