/*make the main nav contact link a hash so that people can link to it*/
$(document).ready(function(){
   if (location.hash == "#contact")
      showContact();
});

/*show hide contact*/
function showContact()
{
	$("#contact-flash").fadeIn("slow");
}

function hideContact()
{
	$("#contact-flash").fadeOut("slow");
}

/*image replacement for main nav*/
/*$(document).ready(function() {
  if($('#branding img')[0].offsetWidth == 273) {
    $('#return-home, #nav-about, #nav-work, #nav-notebook, #nav-contact').each(function() {
      string = $(this).text();
      filename = string.toLowerCase().replace(/ /g, '-').replace(/([^0-9a-z-])/g,'');
      $(this).html('<img src="images/nav-' + filename + '.png" alt="' + string + '" />');
    });
  }
});

$(document).ready(function() {
});*/

/*nav-main hover effect*/
$(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#nav-main li')
            .removeClass('highlight')
            .find('a.nav-main')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(100, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(500, 0);
                    });
                });
});

/*nav-main hover effect*/
/*Implement later $(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#nav-viewport')
            .removeClass('highlight')
            .find('a.text-replace')
            .prepend('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(100, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(500, 0);
                    });
                });
});*/
    