
// remap jQuery to $
(function($){

     $(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#navigation li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(900, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(900, 0);
                    });
                });
                
    });




    $(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#logo li')
            .removeClass('highlight-logo')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(1000, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(1000, 0);
                    });
                });
                
    });




    $(function () {
        if ($.browser.msie && $.browser.version < 7) return;
		
        
        $('#footer-logo li')
            .removeClass('highlight-footer-logo')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(1000, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(1000, 0);
                    });
                });
                
    });




$(function () {
  
  var msie6 = $.browser == 'msie' && $.browser.version < 7;
  
  if (!msie6) {
    var top = $('#right-menu').offset().top - parseFloat($('#right-menu').css('margin-top').replace(/auto/, 0));
    $(window).scroll(function (event) {
      // what the y position of the scroll is
      var y = $(this).scrollTop();
      
      // whether that's below the form
      if (y >= top) {
        // if so, ad the fixed class
        $('#right-menu').addClass('fixed');
      } else {
        // otherwise remove it
        $('#right-menu').removeClass('fixed');
      }
    });
  }  
});


$("ul.thumb li").hover(function() {
	$(this).css({'z-index' : '9999'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
			marginTop: '-40px', /* The next 4 lines will vertically align this image */ 
		/*	marginLeft: '0px',
		/*	top: '50%',
		/*	left: '50%',
		/*	width: '174px', /* Set new width */
		/*	height: '174px', /* Set new height */
			padding: '0px'
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '286px', /* Set width back to default */
			height: '171px', /* Set height back to default */
			padding: '0px'
		}, 400);
});



})(window.jQuery);



// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};



// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);













