$j = $.noConflict();

$j(document).ready(function () {
    replaceFonts();
	$j('.innerContentEqual').each(function (index) {
        setEqualHeight($j(".gridItem > .itemContent", this));
    });
	$j('.customSelectBox').sSelect({ ddMaxHeight: '300px' }).removeClass('customSelectBox');
	$j( ".dateField" ).datepicker();
    $j('input[type="checkbox"]').ezMark({ checkboxCls: 'ez-checkbox', checkedCls: 'ez-checked' });
    $j('input[type="radio"]').ezMark();
});
function replaceFonts() {
    Cufon.replace('.txtLnk, .quote', {
        fontFamily: 'Avenir55Roman'
    });
    Cufon.replace('h3.itemTitle, h6', {
        fontFamily: 'Avenir45Book'
    });
    Cufon.replace('.focus', {
        fontFamily: 'FuturaLTBold'
    });
    Cufon.replace('.mainMenu, .autoBttn span, .autoBttn2 span', {
        fontFamily: 'Avenir65Medium'
    });
    Cufon.replace('.subFooter h3, .blueBox h3, .subFooter h4, .persistFooter h3, .persistFooter h4', {
        fontFamily: 'Avenir65MediumOblique'
    });
    Cufon.replace('h1', {
        color: '-linear-gradient(#0e2c5a, 0.9=#285377)', fontFamily: 'Avenir85Heavy'
    });
    Cufon.replace('h2', {
        color: '-linear-gradient(#0e2c5a, 0.9=#285377)', fontFamily: 'Avenir85Heavy'
    });
    Cufon.replace('.innerContainerSection h4, h5', {
        fontFamily: 'Avenir65MediumOblique'
    });
}


function setEqualHeight(items) {
    var tallestItem = 0;
    items.each(
       function () {
           currentHeight = $j(this).height();
           if (currentHeight > tallestItem) {
               tallestItem = currentHeight;
           }
       }
    );
    items.height(tallestItem);
}

