//  search box "smart" hover: out state only if blank
$(document).ready(function() {
    $("#search-txt").hover(
        function() { $(this).addClass("hover"); }, 
        function() { if(!this.value) $(this).removeClass("hover"); }
    );
	//	text-size-widget
	$("#text-size-widget a").click(function(e) {
		if ($(this).hasClass("sel")) return;
		switchSelectedState(e.target.id);
		setActiveStyleSheet(e.target.id);
	});
	switchSelectedState = function(newID) {
		$("#text-size-widget").children().removeClass("sel");
		$("#text-size-widget a#" + newID).addClass("sel");
	}
	//	moved from styleswitcher.js
	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
	//	custom select state
	if (title == "null") {
		title = "sm";
	}
	switchSelectedState(title);
});
