// alert('javascript is enabled');
// start
if (typeof(jQuery) == 'function')
{
    var IE = (IE == undefined)
     ? (jQuery.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent) )
     : IE
    ;
jQuery.noConflict();
jQuery(document).ready(function($) 
{
    // result: the main container is fully stretched
    var fixL = {}; // layout fix
    fixL.docHeight = screen.height + 'px';
    if (IE) 
    {
        $("#page").css('height', fixL.docHeight);
    }
    else
    {
        $("#page").css('min-height', fixL.docHeight);
    }
    $("#bottom").css({display: 'block', top: $("#page").height() + 'px'});
    $("#doc > .inG > .col").pjpColFix();
    
    // add a click state to main nav
    var navBtn = { 
          bgPosX:       undefined
        , bgPosY:       '-320px'
    }
    $("#navMain a").click(function(e, done) 
    {
        if ( ! done) {
            $this = $(this);
            navBtn.bgPosX = $this.css('backgroundPosition').toString().split(' ')[0];
            // console.log(navBtn.bgPosX);
            $this.addClass('hover').css({
                  backgroundPosition: navBtn.bgPosX + ' ' + navBtn.bgPosY
            }).end().trigger('click', [true]);
            return;
        }
    });
    
    // fix IE6 hover for complex layouts
    if (IE) 
    {
        $('#bd .image > a').hover(
              function() { $(this).addClass('hover'); }
            , function() { $(this).removeClass('hover'); }
        );
    }
});
}