one of the documented procedures in this installation of the ACS
What it does:
Sets a cookie based on the current url to create proper look-and-feel templates, redirecting to the normal guidestar page. If you specify a force_return_url, the cookie is set and the user is returned to that url.
Defined in: /web/philip/tcl/ad-partner-defs.tcl

Source code:

    set current_cookie [ad_partner_from_cookie]
    set url [ad_partner_url_with_query]
    # Remove leading slash if any
    regsub "^/" $url "" url
    # The partner site would be the phrase between the first and second slash
    set stub [lindex [split $url "/"] 0]
    # Try the greedy regsub first
    if {! [regsub "$stub/" $url "" return_url] } {
	regsub "$stub" $url "" return_url
    if { [empty_string_p $return_url] } { 
	set return_url /
    ad_returnredirect "/cookie-chain?cookie_name=[ns_urlencode ad_partner]&cookie_value=[ns_urlencode $stub]&expire_state=s&final_page=[ns_urlencode $return_url]"