Event.observe( window, "load", function() {

    // Activate the pop-up Online Services navigation
    Event.observe( "online-services-go-to", "change", function() {
        var url = $F("online-services-go-to");
        if ( url.substring( 0, 4 ) == "http" ) {
            window.location = url;
        }
     } );
     
    

    // Remove sample text when user clicks in search field
    var originalSearchFieldText = $F("q");
    Event.observe( "q", "focus", function() {
        if ( $F("q") == originalSearchFieldText ) $('q').value = "";
     } );

    // Intercept People Searches/Site Searches before form is submitted
    Event.observe( "txst-banner-toolssearch", "submit", function( event ) {
        if ($F("txst-banner-toolsearch-searchtype") == "people") {
            Event.stop( event );
            window.location = "http://peoplesearch.txstate.edu/peoplesearch2.pl?srchmode=search&query=" + $F("q");
        } else if ($F("txst-banner-toolsearch-searchtype") == "site") {
            $('sitesearch').value = site.slice(0,-1).replace( /\/+$/g, "" );  
        } else if ($F("txst-banner-toolsearch-searchtype") == "web") {
            $('sitesearch').value = "";  
        }
    } );
    
});
