﻿//  Title:  Base Page Javascript
// Author:  Avala Marketing

function AdjustSizeForBrowser() {
    var theWidth = $('#mainCont').width();
    var theDiff = theWidth % 2;
    if ($.browser.opera || $.browser.webkit) {
        console.log("The Width:  " + theWidth + " and the Diff:  " + theDiff);
        if (theDiff > 0) {
            $('#mainImageCont').css('left', '1px');
            var test = $('#mainImageCont').css('left');
            console.log("Should have added " + test);
        }
        else {
            $('#mainImageCont').css('left', '0px');
            var test = $('#mainImageCont').css('left');
            console.log("Should have subtracted " + test);
        }
    }
}

// JC_12/11/2011:  This is really done to fix a bug on Webkit and Opera browsers where there is a 1px line to the right of the main images.
//                 Using Browser Detection to fix, which I know is bad, but given time contstrains, and nature of issue, think it is okay.
$(document).ready(function () {

    AdjustSizeForBrowser();

    $(window).resize(function () {
        AdjustSizeForBrowser();
    });

});
