﻿$(document).ready(function () {
    var Youtube = $('#Header .Stage .YoutubeIcon');
    var ZennBlog = $('#Header .Stage .ZennBlogIcon');
    var Twitter = $('#Header .Stage .Twitter');
    var LinkedIn = $('#Header .Stage .LinkedInIcon');
    var Facebook = $('#Header .Stage .Facebook');
    var Shadow = $('#Header .Stage .Shadow');            

    $(Twitter).mouseenter(function () {
        $(this).animate({ "left": "-=51px" }, 480);
        $(this).find('.Follow').fadeIn(400);
        $(this).unbind('mouseenter');
        return false;
    });

    $(Facebook).mouseenter(function () {
        $(this).animate({ "right": "+=41px" }, 480);
        $(this).find('.Like').fadeIn(400);
        $(this).unbind('mouseenter');
        return false;
    });


    //check ie
    if ($.browser.msie) {
        if ($.browser.version > 8.0) $(Shadow).delay(600).fadeIn(600);
        else $(Shadow).show();
    } else $(Shadow).delay(600).fadeIn(600); //not IE

    //check first load
    if (FirstLoad) {
        $(Youtube).delay(500).animate({ "top": "-47px" }, 480);
        $(ZennBlog).delay(500).animate({ "top": "-12px" }, 450);
        $(Twitter).delay(500).animate({ "top": "-39px" }, 400);
        $(LinkedIn).delay(500).animate({ "top": "-47px" }, 550);
        $(Facebook).delay(500).animate({ "top": "-12px" }, 350);
    }
    else {
        $(Youtube).css('top', '-47px').fadeIn();
        $(ZennBlog).css('top', '-12px').fadeIn();
        $(Twitter).css('top', '-39px').fadeIn();
        $(LinkedIn).css('top', '-47px').fadeIn();
        $(Facebook).css('top', '-12px').fadeIn();
    }


    $('a.amail').each(function(i) {
        $(this).attr('href', $(this).attr('href').replace("[AT]", "@"));
        $(this).html($(this).html().replace("[AT]", "@"));
    });     
});
