    // The URL that loaded this page:
    var doc = escape(document.URL);

<!-- 

if(window.SymError) 
 window.onerror=SymError2; 

function SymError2() 
{ 
 document.writeln('Norton Internet Security is currently running on your computer.',
  '  If you\'re seeing this message, this program may have interfered with some of the functionality of this website.',
  '  Here are some <a href="http://wp.brokertix.com/plugin/norton/norton.html">instructions</a> for fixing this problem.'); 
 return true; 
} 

//--> 



    // URL to plugin server:
    pluginPath = "wp1.brokertix.com/plugin";
    if (doc.substr(0, 5) == "https")
        pluginUrl = "https://" + pluginPath ;
    else
	pluginUrl = "http://" + pluginPath ;

    pluginUrl += "/plugin";

    // For future use:
    var template = 0;

    // Verbosity
    var SHOWITEMS = 1;
    var SILENT = 2;
    var verbosity = 0;
    function setVerbosity(value) {
        verbosity = value;
    }

    // The next broker page in the plugin service sequence.
    var next;
    if ((typeof(nextUrl) == "undefined") || (nextUrl == null)) {
        next = brokerUrl;
    }
    else {
        next = nextUrl;
    }

    // Customizable resources:
    if ((typeof(perfsViewTicketsBtn) == "undefined") || (perfsViewTicketsBtn == null)) {
        perfsViewTicketsBtn = "";
    }
    if ((typeof(buyTicketsBtn) == "undefined") || (buyTicketsBtn == null)) {
        buyTicketsBtn = "";
    }
    if ((typeof(buyMyTicketsBtn) == "undefined") || (buyMyTicketsBtn == null)) {
        buyMyTicketsBtn = "";
    }


    // The plugin selectors used in this page. This informes the plugin server
    // of what page_plugin_selector values to return upon special user action.
    var homePlugin = "home";
    var cartPlugin = "cart";

    //
    // Sends debug messages to a separate window.
    //
    var console = null
    function debug(msg) {
        if ((console == null) || (console.closed)) {
            console = window.open("", "console", "width=600, height=300, resizable=yes, scrollbars=yes, menubar=yes, status=yes");
            console.document.open("text/plain");
        }
        console.focus();
        console.document.writeln(msg);
        console.document.close();
    }

    function getSelectorValue() {
        var url = document.URL;
        var idx = url.search(/next_plugin=/i);
        if (idx > -1) {
            var attributePart = url.substr(idx + 12);
            if (attributePart.indexOf("&") > -1) {
                var attributes = attributePart.split("&");
                return attributes[0]; 
            }
            else {
                return attributePart;
            }
        }
        return null;
    }

    //
    // For reloading the broker page using the global session ID and with a specific 
    // plugin selector.
    //
    function reloadPage(selector, value, nvPairs, container) {
        var url;
        if ((typeof(container) == "undefined") || (container == null)) {
            url = document.URL;
            var qm = url.search(/\?/);
            if (qm > -1) {
                url = url.substr(0, qm);
            }
        }
        else {
            url = container;
        }
   
        var params = "?id=" + brokerId + "&next_plugin=" + selector;
        if (value != null) {
            params += "&plugin_param=" + value;
        }
        if (nvPairs != null) {
            params += nvPairs;
        }
        location.reload(url + params);
        return false;
    }

    //
    // Displays output from plugin determined by the selector argument.
    // Param selector: The requested plugin function.
    // Param pluginParam: Value to assign to the plugin_param request parameter.
    // Param qsParams: Any Query String attributes (&name=value) to include in the request.
    //
    function selectPlugin(selector, pluginParam, qsParams) {
        // This is to avoid having to deal with "undefined" in the server code:
        if (pluginParam == null) {
            pluginParam = "";
        }

        if (qsParams == null) {
            qsParams = "";
        }

        //next = brokerUrl;

        // Used to select the plugin when the same broker wrapper is used for displaying
        // different plugins (each representing a separate page).
        var page_selector;

        var plugin;
        var nextPluginSelector;

        // Set the default plugin to be used:
        if ((selector == null) || (selector == "home")) {
            //selector = "events";
            return false;
        }

        //selector = selector.toLowerCase();

        // Determine plugin.  The "plugin" values below are used by the plugin
        // server to determine what output to return.  The "nextPluginSelector" 
        // values are used next time this script is called to determine the
        // plugin request to be made.
        if (selector == "events") {
            // Displays a selection box with event names.
            plugin = "event_box";
            nextPluginSelector = "performances";
        }
        else
        if (selector == "venues") {
            // Displays a selection box with venue names.
            plugin = "venue_box";
            nextPluginSelector = "venue_performances";
        }
        else
        if ((selector == "Events") || (selector == "Event")) {
            // Displays a list of events.
            plugin = "event_list";
            nextPluginSelector = "performances";
        }
        else
        if ((selector == "Venues") || (selector == "Venue")) {
            // Displays a list of venues.
            plugin = "venue_list";
            nextPluginSelector = "venue_performances";
        }
        else
        if ((selector == "Search") || (selector == "date_search")) {
            // Displays list of events for a given date.
            plugin = "date_search";
            nextPluginSelector = "tickets";
        }
        else
        if (selector == "searchbox") {
            // Displays the search input field.
            plugin = "searchbox";
            nextPluginSelector = "TBS";
        }
        else
        if (selector == "pro_basketball") {
            // Displays the search input field.
            plugin = "probasketball";
            nextPluginSelector = "Event";
        }
        else
        if (selector == "pro_football") {
            // Displays the search input field.
            plugin = "profootball";
            nextPluginSelector = "Event";
        }
        else
        if (selector == "pro_baseball") {
            // Displays the search input field.
            plugin = "probaseball";
            nextPluginSelector = "Event";
        }
        else
        if (selector == "pro_hockey") {
            // Displays the search input field.
            plugin = "prohockey";
            nextPluginSelector = "Event";
        }
        else
        if ((selector == "performances") || (selector == "performance_list")) {
            // Displays a list of performances.
            plugin = "performance_list";
            nextPluginSelector = "tickets";
        }
        else
        if ((selector == "venue_performances") || (selector == "venue_performance_list")) {
            // Displays the performances for a given venue.
            plugin = "venue_performance_list";
            nextPluginSelector = "tickets";
        }
        else
        if (selector == "tickets") {
            // Displays the tickets for a given performance.
            plugin = "ticket_list";
            nextPluginSelector = "cart";
        }
        else
        if (selector == "cart") {
            // Displays the shopping cart.
            plugin = "shopping_cart";
            nextPluginSelector = "shipping";

            if ((typeof(billingUrl) != "undefined") && (billingUrl != null)) {
                // The broker has specified a billing URL
                qsParams = qsParams + "&billingurl=" + billingUrl;
            }
        }
        else
        // Note that the "skip_cart" selector may be issued by the plugin server
        // and, therefore, is required.
        if ((selector == "shipping") || (selector == "skip_cart")) {
            // Displays the shipping input form.
            plugin = "shipping_input";
            nextPluginSelector = "billing";
            if ((typeof(billingUrl) != "undefined") && (billingUrl != null)) {
                // The broker has specified a billing URL
                next = billingUrl;
            }
        }
        else
        if (selector == "accept_substitute") {
            // Used for non-shopping cart purchases to instruct the server that the
            // customer accepts the offered substitute tickets.
            plugin = "accept_substitute";
            nextPluginSelector = "billing";
            if ((typeof(billingUrl) != "undefined") && (billingUrl != null)) {
                // The broker has specified a billing URL
                next = billingUrl;
            }
        }
        else
        if (selector == "billing") {
            // Displays the billing input form.
            plugin = "billing_input";
            nextPluginSelector = "confirmation";
            if ((typeof(confirmationUrl) != "undefined") && (confirmationUrl != null)) {
                // The broker has specified a confirmation URL
                next = confirmationUrl;
            }
            else {
                next = brokerUrl;
            }
        }
        else
        if (selector == "confirmation") {
            // Displays the confirmation page.
            plugin = "confirmation";
            nextPluginSelector = "events";
        }
        else
        if (selector == "seller_info") {
            // Loads data into the TicketTrader popup window.
            plugin = "seller_info";
            nextPluginSelector = "TBS";
        }

        // Display the selected plugin:
        if (plugin != null) {
            fullUrl = pluginUrl +
                "?id=" + brokerId +
                "&plugin=" + plugin + 
                "&plugin_param=" + pluginParam + 
                "&next_plugin=" + nextPluginSelector +
                "&home_plugin=" + homePlugin +
                "&cart_plugin=" + cartPlugin +
                "&home=" + brokerUrl + 
                "&template=" + template + 
                "&next=" + next + 
                qsParams +
                "&doc=" + doc;
           //window.open(fullUrl, "plugin", "width=600, height=300, resizable=yes, scrollbars=yes, menubar=yes, status=yes");
		
            pluginOutput = "<script language='javascript' src='" + fullUrl + "'><\/script>";
            document.writeln(pluginOutput);
            document.close();
        }
        else {
            alert("Invalid plugin selector: " + selector);
        }

        return true;
    }

    //
    // Displays output from plugin determined by the selector argument.
    //
    function displayPlugin(selector, pluginParam, qsParams) {
        return selectPlugin(selector, pluginParam, qsParams);
    }

    //
    // Defines the location of the plugin area of the web page.  Called from the location 
    // in the broker page where the shopping sequence should take place.
    // Returns value true, if there is ouput to be displayed from the plugin server,
    // otherwise value false.
    // 
    function pluginService(qsParam) {
        if (qsParam == null) {
            if (verbosity > 0) {
                if (verbosity == SILENT) {
                    pluginService("output=none");
                }
                else
                if (verbosity == SHOWITEMS) {
                    pluginService("output=items");
                }
            }
            else {
                return displayPlugin(getSelectorValue());
            }
        }
        else {
            return displayPlugin(getSelectorValue(), "", "&" + qsParam);
        }
    }

    // This pluginService call returns no output;
    function silentPluginService() {
        pluginService("output=none");
    }

    // This pluginService call displays shopping cart content but creates no
    // input form;
    function showItemsPluginService() {
        pluginService("output=cartitems");
    }

    //
    // Displays a list box of events at the location from which it is called.  If the eventType 
    // parameter is empty (""), all events are returned, otherwise, only events of a type code 
    // matching the parameter string are returned.
    // Depricated; use insertEventListBox.
    //
    function insertEventBox(eventType) {
        if ((eventType == null) || (eventType == "")) {
            displayPlugin("events");
        }
        else {
            displayPlugin("events", eventType);
        }
    }

    //
    // This function is identical to insertEventBox except for the selection box
    // not having a title and an activation button. 
    // Param eventType. Specifies the event type ID for which to list events. If value is null or 
    //      empty (""), all events are listed.
    // Param caption. Name displayed above the listbox. If value is null or empty (""), the name
    //      field is omitted.
    // Param buttonText. Name displayed on the action button. If value is null or empty (""),
    //      the button is omitted and action takes place when a list entry is clicked.
    // Param boxSize. Size of the listbox window in terms of the number of lines displayed. If value is null 
    //      or empty (""), the default value of "1" is used, making the listbox a drop down menu. 
    // Param container: URL to the container page for the response to this call.  If not specified,
    //    the current page will be used.
    //
    function insertEventListBox(eventType, caption, buttonText, boxSize, container) {
        var params = "&boxtype=type2";
        if ((eventType != null) && (eventType != "")) {
            params += "&eventtype=" + eventType;
        }
        if ((caption != null) && (caption != "")) {
            params += "&caption=" + caption;
        }
        if ((buttonText != null) && (buttonText != "")) {
            params += "&buttontext=" + buttonText;
        }
        if ((boxSize != null) && (boxSize != "")) {
            params += "&boxsize=" + boxSize;
        }
        if ((container != null) && (container != "")) {
            params += "&action_container=" + container;
        }
        displayPlugin("events", "", params);
    }

    //
    // Displays a list box of events in the plugin area.  If the eventType parameter is empty (""),
    // all events are returned, otherwise, only events of a type code matching the parameter 
    // string are returned.
    //
    function showEventBox(eventType) {
        if ((eventType == null) || (eventType == "")) {
            reloadPage("events");
        }
        else {
            reloadPage("events", eventType);
        }
    }

    // 
    // Displays event tables for events of certain categories requiring special
    // formatting in the plugin area. Currently supported parameter values are:
    //      "pro_baseball", "pro_basketball", "pro_football", and "pro_hockey".
    // param eventcategory: One of the following strings: "pro_baseball", "pro_basketball", "pro_football", 
    //    and "pro_hockey".
    // param container: URL to the container page for the response to this call.  If not specified,
    //    the current page will be used.
    function showSpecEventCategory(eventCategory, container) {
        reloadPage(eventCategory, "", "", container);
    }

    //
    // Displays a table of events in the plugin area.  If the eventName parameter is 
    // empty (""), all events are returned, otherwise, all events with names matching 
    // the parameter string are returned. If eventName matches only one event, all 
    // performances for that event are returned.
    // param container: URL to the container page for the response to this call.  If not specified,
    //    the current page will be used.
    //
    function showEventTable(eventName, container) {
        if (eventName.indexOf("%") == -1) {
            // Contains no escaped characters.
            eventName = escape(eventName);
        }
        reloadPage("Event", eventName, "", container);
    }

    // 
    // Displays the performances for a given event (name must be exact). The optional date parameter
    // limits the returned performances to a given date.  If dateOrTime can be used to specify a date
    // range or a performance time for the given date.
    // Param eventName: String.
    // Param date: 'mmddyyyy'.
    // Param dateOrTime: 'hhmm' or 'mmddyyyy'.
    // param sellersTicketsOnly: If value is "yes", only tickets owned by the seller are shown.
    // param container: URL to the container page for the response to this call.  If not specified,
    //    the current page will be used.
    // 
    function showVenuePerformanceTable(eventName, venueName, date, dateOrTime, sellersTicketsOnly, container) {
        var atts = "";
        isOk = true;

        if ((venueName != null) && (venueName != "")) {
            if (venueName.indexOf("%") == -1) {
                // Contains no escaped characters.
                venueName = escape(venueName);
            }
            atts += "&venuename=" + venueName;
        }

        if ((date != null) && (date != "")) {
            atts += "&date=" + date;
            if (String(date).length != 8) {
                isOk = false;
                alert("The showPerformanceTable date parameter must be formatted as 'mmddyyyy'.");
            }
        }

        if ((dateOrTime != null) && (dateOrTime != "")) {
            atts += "&dateortime=" + dateOrTime;
            var s = String(dateOrTime);
            if (!((s.length == 4) || (s.length == 8))) {
                isOk = false;
                alert("The showPerformanceTable time or date parameter must be formatted as 'hhmm' or 'mmddyyyy'.");
            }
        }

        if ((sellersTicketsOnly != null) && (sellersTicketsOnly != null)) {
            atts += "&sellersticketsonly=" + sellersTicketsOnly;
        }

        if (isOk) {
            if (eventName.indexOf("%") == -1) {
                // Contains no escaped characters.
                eventName = escape(eventName);
            }
            reloadPage("Event", eventName, atts, container);
        }
    }

    function showPerformanceTable(eventName, date, dateOrTime, sellersTicketsOnly, container) {
        showVenuePerformanceTable(eventName, "", date, dateOrTime, sellersTicketsOnly, container);
    }

    //
    // Displays a list box of venues in the plugin area. 
    // 
    function showVenueBox() {
        reloadPage("venues");
    }

    //
    // Displays a list box of venues at the location from which it is called. 
    // 
    function insertVenueBox() {
        displayPlugin("venues");
    }

    //
    // This function is identical to insertVenueBox except for the selection box
    // not having a title and an activation button. 
    // Param caption. Name displayed above the listbox. If value is null or empty (""), the name
    //      field is omitted.
    // Param buttonText. Name displayed on the action button. If value is null or empty (""),
    //      the button is omitted and action takes place when a list entry is clicked.
    // Param boxSize. Size of the listbox window in terms of the number of lines displayed. If value is null 
    //      or empty (""), the default value of "1" is used, making the listbox a drop down menu. 
    //
    function insertVenueListBox(caption, buttonText, boxSize) {
        var params = "&boxtype=type2";
        if ((caption != null) && (caption != "")) {
            params += "&caption=" + caption;
        }
        if ((buttonText != null) && (buttonText != "")) {
            params += "&buttontext=" + buttonText;
        }
        if ((boxSize != null) && (boxSize != "")) {
            params += "&boxsize=" + boxSize;
        }
        
        displayPlugin("venues", "", params);
    }

    //
    // Displays a table of venues in the plugin area.  If the venueName parameter is 
    // empty (""), all venues are returned, otherwise, all venues with names matching 
    // the parameter string are returned. If venueName matches only one venue, all 
    // performances for that venue are returned.
    // param container: URL to the container page for the response to this call.  If not specified,
    //    the current page will be used.
    //
    function showVenueTable(venueName, container) {
        if (venueName.indexOf("%") == -1) {
            // Contains no escaped characters.
            venueName = escape(venueName);
        }
        reloadPage("Venue", venueName, "", container);
    }

    //
    // Displays the content of the shopping cart in the plugin area.
    // 
    function showCart() {
        reloadPage("cart");
    }

    //
    // Displays the search box at the location from which it is called.
    // param container: URL to the container page for the response to any search request.
    //    If not specified, the current page or the nextWrapper page will be used.  This
    //    can be useful when a general search box input request is made from a special
    //    events page.
    //
    // 
    function insertSearchBox(container) {
        if ((typeof(container) == "undefined") || (container == null)) {
            displayPlugin("searchbox");
        }
        else {
            var params = "&action_container=" + container;
            displayPlugin("searchbox", "", params);
        }
    }

    // Other functions ---------------------------------------------------------

    //
    // Displays venue's seating map.
    //
    function newchartwin(map, name) {
        var str = "http://www.openfield.com/chart.cfm?chart=" + map + "&venue=" + escape(name);
        window.open(str, "myWin", "toolbar=no, height=550, width=640, left=0, top=0, resizable=yes, scrollbar=no");
    }

    //
    // Displays venue seating map icon and specifies the event handler for showing the map.
    //
    function venueSeating(map) {
        var icon;
        if ((typeof(venueSeatingIcon) == "undefined") || (venueSeatingIcon == null)) {
            icon = "http://" + pluginPath + "/images/stadium-3.gif";
        }
        else {
            icon = venueSeatingIcon;
        }

        var str = "<input type='image' src='" + icon + "' align='center' border='0' "
            + "onclick=javascript:newchartwin('" + map + "'); return false;/>";
        return str;
    }

    //
    // Displays the policies page.
    //
    function showPolicies(link) {
        window.open(link, "Policies", "width=550, height=460, resizable=yes, scrollbars=yes, status=yes");
    }

 
