﻿/// <reference path='jquery-1.6.1-vsdoc.js' />

$(document).ready(function() {
    EqualizeContentColumns();

    // Fix goose in callouts for webkit
    if ($.browser.webkit) {
        $('#goose').addClass('webkit');
    }
});

function EqualizeContentColumns() {
    $left = $('div.interior-content-left-column').first();
    $right = $('div.interior-content-right-column').first();

    if ($left != undefined && $right != undefined) {
        lHeight = $left.height();
        rHeight = $right.height();

        if (lHeight > rHeight) {
            //$right.height(lHeight);
            $right.css({ 'min-height': lHeight });
        }
//        else {
//            //$left.height(rHeight);
//            $left.css({ 'min-height': rHeight });
//        }
    }
}

function ScrollAndFocus(errorCtrl, fieldName) {
    // Set focus to the proper field
    $('#' + fieldName).focus();

    // Smoothly scroll to the proper field
    var anchorId = $(errorCtrl).attr('href');
    $('html, body').animate({ scrollTop: $(anchorId).offset().top - 10 });

    // Prevent the default behavior
    return false;
}
