function set_cookies () {
    var pagecount = getCookie("p_galileo")||0;
    setCookie("p_galileo",++pagecount);

    var h = location.hash; var hl = h.length;
    if( hl ) setCookie("h_galileo",h.substr(1,hl-1));

    if( pagecount == 1 && cookiesEnabled("zzz") ) {
        var sid = Math.floor(Math.random()*10000000+1);
        setCookie("i_galileo",sid);
        with( window.location ) {
            if( search ) { href = pathname+search+"&Welcome"; }
            else         { href = pathname+"?Welcome";        }
        }
    }
}

function set_return () {
    with( window.location ) {
        var return_path = pathname;
        // if( search ) return_path += search;
        setCookie("return",return_path);
        var a = pathname.match( /^\/(scholar|library|high-school|teen)\// );
        if( a && a.length ) {
            var view = a[1];  // just the view
            //alert(view);
            setCookie("view",view);
        }
    }
}

function webadminUseridCookie() {
    var u = document.getElementById( "userid" );
    setCookie( "door_galileo_site_userid", u.value );
}

function ultimateUseridCookie() {
    var u = document.getElementById( "userid" );
    setCookie( "door_galileo_userid", u.value );
}

