// Javscript functions for the UT home page

$(document).ready(function(){

    // Tab behavior for the Know content block
    $("li.knowTabButton").click(function (event) {
        event.preventDefault();
        $(".knowTab").removeClass("active");
        $(".knowTabButton").removeClass("activeButton");
        $(this).addClass("activeButton");
        var tabId=$(this).attr("id") + "Tab";
        $("#" + tabId).addClass("active");
    });

    // Mouseover behavior for the "News" heading
    $("div#titleholder")
        .mouseover(function() {
            $('#newstitle').hide();
            $('#newstitleover').show();
        })
        .mouseout(function() {
            $('#newstitle').show();
            $('#newstitleover').hide();
        });

    // Mouseover behavior for the four images
    // at the bottom of the Know content block
    $("div.bottomContainer")
        .mouseover(function() {
            $(this).children('.overtext').show();
        })
        .mouseout(function() {
            $(this).children('.overtext').hide();
        });

    var jsEnabledSearchForm = '				<!-- Begin JavaScript-enabled Google CSE Search Form  -->';
    jsEnabledSearchForm += '			<form name="cse_searchbox" action="/wc/common/searchRedirect.php" method="get" id="cse_searchbox">';
    jsEnabledSearchForm += '				<div>';
    jsEnabledSearchForm += '					<label for="cseq" class="search"><a href="/search/">Search</a></label>';
    jsEnabledSearchForm += '					<input type="hidden" name="cx" value="006470498568929423894:etsxpcor8wm" />';
    jsEnabledSearchForm += '					<input type="hidden" name="cof" value="FORID:10" />';
    jsEnabledSearchForm += '					<input type="hidden" name="js" value="js" />';       
    jsEnabledSearchForm += '					<input class="inputbox" type="text" name="q" id="cseq" />';
    jsEnabledSearchForm += '					<label for="scope" style="display: none;">search in</label>';
    jsEnabledSearchForm += '					<select class="selectbox" name="menu" id="scope">';
    jsEnabledSearchForm += '						<option>UT Web</option>';
    jsEnabledSearchForm += '						<option>UT Directory</option>';
    jsEnabledSearchForm += '					</select>';
    jsEnabledSearchForm += '					<input type="image" name="sa" class="go" src="/wc/first_level/graphics/go.jpg" alt="go for search" /> ';  
    jsEnabledSearchForm += '				</div>';    
    jsEnabledSearchForm += '			</form>';

    $("#search_form").html(jsEnabledSearchForm);

});
