$(document).ready(function() {

    // CUFON
    Cufon.replace('#logo', {fontFamily: 'Marketing Script',hover: true});
    Cufon.replace('#menuprincipal', {fontFamily: 'Marketing Script',hover: true, textShadow:'#177987 1px 1px,#177987 1px 1px'});
    Cufon.replace('.titrepostfeatured a', {fontFamily: 'Yanone Kaffeesatz',hover: true});
    Cufon.replace('.titrepost a', {fontFamily: 'Yanone Kaffeesatz',hover: true});
    Cufon.replace('.widget-title', {fontFamily: 'Marketing Script',hover: true, textShadow:'#177987 1px 1px,#177987 1px 1px'});
    Cufon.replace('.photosvrac', {fontFamily: 'Yanone Kaffeesatz'});
    Cufon.replace('.white h2', {fontFamily: 'Yanone Kaffeesatz'});
    Cufon.replace('.outsidetitle', {fontFamily: 'Yanone Kaffeesatz', textShadow:'#00cfee 1px 1px,#00cfee 1px 1px'});
    Cufon.replace('#comments-title', {fontFamily: 'Yanone Kaffeesatz', textShadow:'#00cfee 1px 1px,#00cfee 1px 1px'});
    Cufon.replace('.commentateur', {fontFamily: 'Marketing Script', textShadow:'#d9fafb 1px 1px,#d9fafb 1px 1px'});
    Cufon.replace('.commentateurparent', {fontFamily: 'Marketing Script', textShadow:'#d9fafb 1px 1px,#d9fafb 1px 1px'});
    Cufon.replace('.emm-paginate', {fontFamily: 'Marketing Script',hover: true});
    Cufon.replace('.page-title-tag', {fontFamily: 'Marketing Script'});
    Cufon.replace('.page-title-category', {fontFamily: 'Marketing Script'});
    Cufon.replace('.page-title-search', {fontFamily: 'Marketing Script'});
    Cufon.replace('.entry-title', {fontFamily: 'Marketing Script'});
    Cufon.replace('#sidebarcontactrss p', {fontFamily: 'Marketing Script'});
    Cufon.replace('#linkcontribution', {fontFamily: 'Marketing Script',hover: true,textShadow:'#177987 1px 1px,#177987 1px 1px'});
    Cufon.replace('#contributionhiddentxt1', {fontFamily: 'Yanone Kaffeesatz'});
    Cufon.replace('#contributionhiddentxt2', {fontFamily: 'Marketing Script'});
    Cufon.replace('.tdomf_form legend', {fontFamily: 'Marketing Script'});
    Cufon.replace('#copyright', {fontFamily: 'Marketing Script'});

    //if ($.browser.msie && !$.browser.version.substr(0,1)<7) {
    //    Cufon.replace('.titrepost a', {fontFamily: 'Yanone Kaffeesatz',hover: true});
    //}

    // si pas IE6
    //if (!$.browser.msie && !$.browser.version.substr(0,1)<7) {

    //}else if($.browser.msie && $.browser.version.substr(0,1)>6 && $.browser.version.substr(0,1)<8){

    //}else{
       
    //}

    //SHADOW IMAGE
    $(".bigimages").prepend("<span class='shadowbig'></span>");
    $(".littleimages").prepend("<span class='shadowlittle'></span>");



    //MENU PRINCIPAL
    //$('ul.menu .menu-item a').each(function(){
    //        var newvalue = '<span>' + $(this).html() + '</span>';
    //        $(this).html(newvalue);

    //});

    // LIGHTBOX Prendre les liens avec un attribut REL du post
    postClass= $("#postidjquery").html();
    $(".entry-content").find('a [rel]').each(function () {
            var relation = $(this).attr("rel");
            var newsrc = relation + ' lightbox['+postClass+']';
            $(this).attr("rel",newsrc);
    });

    //FORM POSTCARD
    $('input[type="text"], textarea').each(function(){

            this.value = $(this).attr('title');
            $(this).addClass('text-label');

            $(this).focus(function(){
                    $(this).addClass("txthover");
                    if(this.value == $(this).attr('title')) {
                            this.value = '';
                            $(this).removeClass('text-label');
                    }
            });

            $(this).blur(function(){
                    $(this).removeClass("txthover");
                    if(this.value == '') {
                            this.value = $(this).attr('title');
                            $(this).addClass('text-label');
                    }
            });
    });

    //FORM SEARCH
    $('.searchbox').focus(function(){
        $(this).addClass("txthover");
        if(this.value == $(this).attr('title')) {
                this.value = '';
                $(this).removeClass('text-label');
        }
    });

    $('.searchbox').blur(function(){
        $(this).removeClass("txthover");
        if(this.value == '') {
                this.value = $(this).attr('title');
                $(this).addClass('text-label');
        }
    });

    // BT SUBMIT
    $('#submit').hover(
        function(){ // Change the input image's source when we "roll on"
            $(this).addClass('buttonhover');
        },
        function(){ // Change the input image's source back to the default on "roll off"
            $(this).removeClass('buttonhover');
        }
    );


    //rounded corners pour les commentaires
    if (!$.browser.msie && !$.browser.version.substr(0,1)<9) {
        $.jcorners(".comment-body",{radius:10});
    }

    // CONTACT ET RSS
    $("#buble-rss").css('opacity', 0);
    $("#sidebarcontactrss-rss").hover(function() {
        $("#buble-rss").stop().css('display','block').animate({'top':'-40','opacity':'1','easing':"easeOutBounce"},200);
    },function(){
        $("#buble-rss").stop().animate({'top':'-60','opacity':'0','easing':"easeOutBounce"},200).css('display','none');
    })
    $("#buble-contact").css('opacity', 0);
    $("#sidebarcontactrss-contact").hover(function() {
        $("#buble-contact").stop().css('display','block').animate({'top':'-40','opacity':'1','easing':"easeOutBounce"},200);
    },function(){
        $("#buble-contact").stop().animate({'top':'-60','opacity':'0','easing':"easeOutBounce"},200).css('display','none');
    })

    $("#contributionhidden").css('opacity', 0);
    $("#linkcontribution").hover(function() {
        $("#contributionhidden").stop().css('display','block').animate({'opacity':'1','easing':"easeOutBounce"},100);
    },function(){
        $("#contributionhidden").stop().animate({'opacity':'0','easing':"easeOutBounce"},200).css('display','none');
    })

    //MAP
    $("#big-japon").css('opacity', 0);
    $("#big-japon").css('display', 'block');
    $("#little-japon").hover(function() {
        $("#big-japon").stop().animate({'opacity':'1','easing':"easeOutBounce"},400);
        $("#little-japon").stop().animate({'opacity':'0','easing':"easeOutBounce"},400);
    },function(){
        $("#big-japon").stop().animate({'opacity':'0','easing':"easeOutBounce"},400);
        $("#little-japon").stop().animate({'opacity':'1','easing':"easeOutBounce"},400);
    })
    //MAP
    $("#big-thailande").css('opacity', 0);
    $("#big-thailande").css('display', 'block');
    $("#little-thailande").hover(function() {
        $("#big-thailande").stop().animate({'opacity':'1','easing':"easeOutBounce"},400);
        $("#little-thailande").stop().animate({'opacity':'0','easing':"easeOutBounce"},400);
        $("#little-japon").css('z-index','0');
    },function(){
        $("#big-thailande").stop().animate({'opacity':'0','easing':"easeOutBounce"},400);
        $("#little-thailande").stop().animate({'opacity':'1','easing':"easeOutBounce"},400);
        $("#little-japon").css('z-index','999');
    })


    
    // IE6 SUPPORT
    //if ($.browser.msie && $.browser.version.substr(0,1)<7) {
    //    $('#menu-top li').mouseover( function() {
    //        $(this).find('ul').show();
    //        $('.gmap').css('z-index','-99');
    //    });
    //    $('#menu-top li').mouseleave( function() {
    //        $(this).find('ul').hide();
    //        $('.gmap').css('z-index','0');
    //   });
    //    $('#menu-top li ul').mouseleave( function() {
    //        $(this).hide();
    //    });
    //}

    //menu continent

    // middle shadow
    
    
        

    // top shadow
    //$('ul#menu-continent li.current-post-ancestor').append('<span class="menu-continent-left-top" />').prepend('<span class="menu-continent-top" />').each();


    

});
