if (!Seasons) {
var Seasons = {};
}
Modernizr.addTest("boxsizing", function() {
return Modernizr.testAllProps("boxSizing") && (document.documentMode === undefined || document.documentMode > 7);
});
(function ($) {
Seasons.showAdvancedForm = function () {
var advancedForm = $('#advanced-form');
var searchTextbox = $('#search-form input[type=text]');
var searchSubmit = $('#search-form button');
if (advancedForm.length > 0) {
advancedForm.css("display", "none");
$('#search-form').addClass("with-advanced");
$('#query').after('Advanced Search');
advancedForm.click(function (event) {
event.stopPropagation();
});
$("#advanced-search").click(function (event) {
event.preventDefault();
event.stopPropagation();
advancedForm.fadeToggle();
$(document).click(function (event) {
if (event.target.id == 'query') {
return;
}
advancedForm.fadeOut();
$(this).unbind(event);
});
});
} else {
$('#search-form input[type=submit]').addClass("blue button");
}
};
Seasons.mobileSelectNav = function () {
// Create the dropdown base
$("").appendTo("nav.top");
// Create default option "Go to..."
$("", {
"selected": "selected",
"value" : "",
"text" : "MENU"
}).appendTo("nav select");
// Populate dropdown with menu items
$("nav.top a").each(function() {
var el = $(this);
if (el.parents('ul ul').length) {
var parentCount = el.parents("ul").length;
var dashes = new Array(parentCount).join('- ');
$("", {
"value": el.attr("href"),
"text": dashes + el.text()
}).appendTo("nav select");
} else {
$("", {
"value": el.attr("href"),
"text": el.text()
}).appendTo("nav.top select");
}
$("nav.top select").change(function() {
window.location = $(this).find("option:selected").val();
});
});
}
if( !($('html').hasClass('boxsizing')) ){
$('.boxSized, .boxSized *').each(function(){
var fullW = $(this).outerWidth(),
actualW = $(this).width(),
wDiff = fullW - actualW,
newW = actualW - wDiff;
$(this).css('width',newW);
});
}
})(jQuery);