var Site = {
    Common: {
        init: function(e) {
            $('body').addClass('js');
        },
        hoverClass: function(e) {
            // add a "hover" class while hovered. Used for dropdowns
            $(e).hover(function() {
                $(this).addClass('hover');
                if ($(this).hasClass('dropdown')) {
                    $(this).addClass('dropdown-hover');
                }
            },
      function() {
          $(this).removeClass('hover').removeClass('dropdown-hover');
      });
        },
        /* Table color */
        tableColor: function(e) {
            $(e + ' tr:nth-child(even) td').addClass('odd');
            $(e + ' td:first-child').addClass('first-child');
            $(e + ' td:last-child').addClass('last-child');
            $(e + ' tr:last-child').addClass('last-child');
        },
        /* Last child */
        lastChildSupport: function(e) {
            $(e + ':last-child').addClass('last-child');
        },
        /* Fancybox enabler */
        fancyboxEnabler: function(e) {
            if (typeof $.fn.fancybox != 'undefined') {
                $("a.fancybox").fancybox({
                    'overlayShow': false,
                    'transitionIn': 'elastic',
                    'transitionOut': 'elastic',
                    'titlePosition': 'outside'
                });
            }
        },
        
/*        
        newsTicker: function(e) {
            alert('here1');
            if (typeof $.fn.marquee != 'undefined') {
                $('.marquee-postings marquee').marquee('pointer').mouseover(function() {
                    $(this).trigger('stop');
                }).mouseout(function() {
                    $(this).trigger('start');
                }).mousemove(function(event) {
                    if ($(this).data('drag') == true) {
                        this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
                    }
                }).mousedown(function(event) {
                    $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
                }).mouseup(function() {
                    $(this).data('drag', false);
                });
            }
        },
*/        
        ie6pngFix: function(e) {
            if (typeof DD_belatedPNG != 'undefined') {
                DD_belatedPNG.fix('.header .navigation .main a, .header .navigation .secondary li, .content #newest-bid-requests ul li.odd, body.home .content .employers, body.home .content .employers .badge, body.home .content .employers a.post-project, body.home .content .workers a.bid-project');
            }
        }
    }
};

$(document).ready(function() {

  Site.Common.init();
  Site.Common.hoverClass($('.navigation .secondary li'));
  //Site.Common.fancyboxEnabler();  //Don't seem to be using this...also removed Javascript include
  Site.Common.ie6pngFix();
  //Site.Common.tableColor('.content table.zebra');  //Not using (and very slow)
  Site.Common.lastChildSupport('.content .section .item');

  //note: 2010-10-03: This code works cross browser, but uses client's CPU to do it.
  //Did a test and latest versions of IE, Firefox, Google, Safari and Opera 
  //all support the plain <marquee> tag.  So commenting out.  On pages that requires
  //100% cross browser compatibility for older browsers, you can still invoke this method manually
  //(but will need to include jquery.marquee.js)
  //Site.Common.newsTicker();
  


});
