execOnLoad = function()
{
    // updateContentForNav();
    an_StartList();
    // an_SetNavAndCrumbs();
    // preloadImages();
    // initPopups();
    // Back/Forward remedy for javascript-controlled tabs. Only works for VI3 pages for now.
    // if(window.location.href.match('/products/vi')) return pollHash();
}

//execNow = function() {
// updateContentForNav();
//}

window.onload = execOnLoad;

// ------------------------------------------------------------------------- \\

function updateContentForNav()
{
    if (document.getElementById("secondary_navigation"))
    {
        var cw = document.getElementById("content-wrapper");
        if (cw && cw.style)
        {
            cw.style.marginRight = "200px";
            if (!cw.attributes["id"].value)
            {
                cw.style.width = "100%";
            } /* IE 5.5 needs this also */
        }
        ;
    }
}

function an_StartList()
{
    if (document.all && document.getElementById && !window.opera)
    {
        navRoot = document.getElementById("primary-navigation");
        if (navRoot)
        {
            for (i = 0; i < navRoot.childNodes.length; i++)
            {
                node1 = navRoot.childNodes[i];
                if (node1.nodeName == "UL")
                {
                    for (j = 0; j < node1.childNodes.length; j++)
                    {
                        node2 = node1.childNodes[j];
                        if (node2.nodeName == "LI")
                        {
                            node2.onmouseover = function()
                            {
                                this.className += " over";
                            }
                            node2.onmouseout = function()
                            {
                                this.className = this.className.replace(" over", "");
                            }
                        }
                    }
                }
            }
        }
        navRoot = document.getElementById("sites");
        if (navRoot)
        {
            for (i = 0; i < navRoot.childNodes.length; i++)
            {
                node = navRoot.childNodes[i];
                if (node.attributes["class"].value)
                {
                    cls = node.attributes["class"].value;
                } /* IE 6 */
                else
                {
                    cls = node.attributes["class"] + "";
                    /* IE 5.5 */
                }
                if (cls.indexOf("expand") >= 0)
                {
                    if (node.nodeName == "LI")
                    {
                        node.onmouseover = function()
                        {
                            this.className += " over";
                        }
                        node.onmouseout = function()
                        {
                            this.className = this.className.replace(" over", "");
                        }
                    }
                }
            }
        }
        cls = "";
        navRoot = document.getElementById("site-tools");
        if (navRoot)
        {
            for (i = 0; i < navRoot.childNodes.length; i++)
            {
                node1 = navRoot.childNodes[i];
                if (node1.nodeName == "UL")
                {
                    for (j = 0; j < node1.childNodes.length; j++)
                    {
                        node2 = node1.childNodes[j];
                        if (node2.attributes["class"].value)
                        {
                            cls = node2.attributes["class"].value;
                            /* IE 6 */
                        }
                        else
                        {
                            cls = node2.attributes["class"] + "";
                            /* IE 5.5 */
                        }
                        if (cls.indexOf("expand") >= 0)
                        {
                            if (node2.nodeName == "LI")
                            {
                                node2.onmouseover = function()
                                {
                                    this.className += " over";
                                }
                                node2.onmouseout = function()
                                {
                                    this.className = this.className.replace(" over", "");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}


function an_IE_GetAttribute(tag, attribute, removeOnlyIfTwo)
{
    attribute = attribute.toLowerCase();
    // Find the first instance of the attribute.
    var startOfClass = tag.toLowerCase().indexOf(attribute);
    if (startOfClass == -1)
    {
        return tag;
        /* probably need some kind of timeout event or something because IE sucks */
    }
    // Make sure there is another class assigned
    if (startOfClass != tag.toLowerCase().lastIndexOf(attribute) || !removeOnlyIfTwo)
    {
        // Find the first space after the first class
        var lengthOfClass = tag.substring(startOfClass).indexOf(" ");
        // The string to remove is from 'class' up to the next space
        var classString = tag.substr(startOfClass, lengthOfClass) + " ";
        tag = an_StringReplace(tag, classString, "");
    }
    return tag;
}

var promotion_index = 0;
function an_Promotions(step)
{
    var promotions = document.getElementById("promotions-content");
    if (promotions && promotions.childNodes)
    {

        var len = 0;
        // number of LI child nodes -- Opera, Mozilla consider blank space as a text node
        for (var i = 0; i < promotions.childNodes.length; i++)
        {
            if (promotions.childNodes[i].nodeName == "LI") len++;
        }
        if (len == 1) return;

        var new_index = promotion_index + step;
        if (new_index < 0) new_index = len - 1;
        if (new_index >= len) new_index = 0;

        var c = 0;
        for (i = 0; i < promotions.childNodes.length; i++)
        {
            if (promotions.childNodes[i].nodeName == "LI")
            {
                if (promotion_index == c)
                {
                    promotions.childNodes[i].style.display = "none";
                }
                if (new_index == c)
                {
                    promotions.childNodes[i].style.display = "block";
                }
                c++;
            }
        }
        promotion_index = new_index;
    }
}

function an_StringReplace(str, match, replace)
{
    // This function takes a three string arguments.
    //  str - the string to work on
    //  match - a sub string of str to replace with:
    //  replace - text to replace 'match' with
    str = str + "";
    // This was needed to make sure str is considered a string.
    var a = str.indexOf(match);
    if (a >= 0)
    {
        str = str.substring(0, a) + replace + str.substring(a + match.length);
    }
    return str;
}

// -----------------------------------------------------------------------------
// The following function cycles through the main nav HTML and highlights the
// appropriate top-level section.
// It also assembles and generates the page breadcrumbs based on values in the
// main nav.
function an_SetNavAndCrumbs()
{
    var crumb = document.getElementById("breadcrumbs");
    if (crumb)
    {
        // If there are no list-item descendants, continue...
        if (crumb.getElementsByTagName('li').length == 0)
        {

            var breadcrumbs = ["Home", "/"];

            var loc = document.location + "";

            loc = loc.replace("://", "");
            loc = loc.substring(loc.indexOf("/"));

            var navroot = document.getElementById("primary-navigation");
            if (navroot) var c = an_GetChildrenOfType(navroot, "ul");

            if (c.defined)
            {
                c = an_GetChildrenOfType(c[0], "li");
                for (var i = 0; i < c.length; i++)
                {
                    // For every <li> child, we must test it's the href value of it's <a> child:
                    var li = c[i];
                    var a = an_GetChildrenOfType(li, "a")[0];
                    // first anchor child of current LI

                    // NOTE: 'href' Refers to the href values taken from the primary nav, while 'loc' refers to the document location.
                    var href = (a + "").replace("//", "");
                    href = href.substring(href.indexOf("/"));

                    if (loc.indexOf(href) == 0)
                    {
                        // At this point, we've found the top-level section this page belongs to
                        // Store the breadcrumb information:
                        breadcrumbs[breadcrumbs.length] = a.firstChild.data;
                        breadcrumbs[breadcrumbs.length] = href;

                        // Set the proper section active:
                        an_SetAttribute(li, "class", "active");

                        // Now, we prepare to visit the second-level elements:
                        var d = an_GetChildrenOfType(li, "div")[0];
                        var ul = an_GetChildrenOfType(d, "ul")[0];
                        c = an_GetChildrenOfType(ul, "li");


                        for (var j = 0; j < c.length; j++)
                        {
                            var li = c[j];
                            var a = an_GetChildrenOfType(li, "a")[0];
                            var href = (a + "").replace("///", "").replace("//", "");

                            href = href.substring(href.indexOf("/"));

                            if (
                                    (loc.indexOf(href) >= 0) && // If href (URL from nav) matches document location
                                    (href != breadcrumbs[breadcrumbs.length - 1]) && // and href does not match previously breadcrumb URL
                                    !(                                                         // BUT NOT
                                            (loc == href) || // if href and document location match
                                            (loc.indexOf(href + 'index.') >= 0) || // or location refers to and href+index file
                                                                                               ((loc.lastIndexOf("/") == loc.length - 1) && (loc == href)) // or href refers to a directory and loc == href (excludes subdirectories)
                                            )
                                    )
                            {
                                // At this point, we've found the next level element
                                // Store the breadcrumb information:
                                breadcrumbs[breadcrumbs.length] = a.firstChild.data;
                                breadcrumbs[breadcrumbs.length] = href;
                                break;
                            }
                        }
                        break;
                    }
                }
            }

            //	  Remove any default breadcrumbs
            //	  crumb.innerHTML = "";

            // Loop through our breadcrumbs array
            for (var i = 0; i < breadcrumbs.length; i += 2)
            {
                // Create our text node
                var text = document.createTextNode(breadcrumbs[i]);

                // Create the anchor tag
                var a = document.createElement('a');
                an_SetAttribute(a, "href", breadcrumbs[i + 1]);

                // Create the LI tag
                var li = document.createElement('li');

                // Finally, assemble everything and add it to the page.
                a.appendChild(text);
                li.appendChild(a);
                crumb.appendChild(li);
            }

            // If loc does not match the previously stored breadcrumb URL
            if (loc != breadcrumbs[breadcrumbs.length - 1])
            {
                // Set breadcrumb overrides for specific sections, and any exceptions
                // The format is an array of overides.
                // The overides consist of either:
                //  - a single directory sting, or
                //  - an array consisting a directory string and any exceptions within that directory.
                // Exceptions consist of either:
                //  - a string or regular expression pattern
                //  - an array of strings or regular expressions.

                // var breadcrumbOverride = new Array(
                //	new Array("/news/press/", "/index.html"),
                //	new Array("/news/releases/", new Array("/index.html", /\/\d\d\d\d\.html/i))
                // );
                // This will override using the <title> tag breadcrumb for files in /news/press/ with the exception of the index.html
                // It will also override using the <title> tag breadcrumb for files in /news/releases/ except index.html and files matching ####.html (for example: 2004.html, 2005.html)
                var breadcrumbOverride = new Array(
                        new Array("/news/press/", new Array("/index.html", /\/\d\d\d\d\.html/i)),
                        new Array("/news/releases/", new Array("/index.html", /\/\d\d\d\d\.html/i))
                        );

                // Assign 'Type' properties to Array and String objects
                Array.prototype.Type = "Array";
                String.prototype.Type = "String";


                var proceed = true;
                for (var i = 0; i < breadcrumbOverride.length; i++)
                {
                    // In case of a non-array element, we convert it to a 1-dimensional array
                    if (breadcrumbOverride[i].Type != "Array")
                    {
                        breadcrumbOverride[i] = new Array(breadcrumbOverride[i]);
                    }

                    if (loc.match(breadcrumbOverride[i][0]))
                    {
                        // We're in an override section, so we set 'proceed' to false.
                        proceed = false;

                        // However, it is now necessary to check for exceptions to the override
                        if (breadcrumbOverride[i][1])
                        {
                            for (var j = 0; j < breadcrumbOverride[i][1].length; j++)
                            {
                                // In case of a non-array element, we convert it to a 1-dimensional array
                                if (breadcrumbOverride[i][1].Type != "Array")
                                {
                                    breadcrumbOverride[i][1] = new Array(breadcrumbOverride[i][1]);
                                }

                                // In the case of an index file, we also add a condition to match on an ending slash, not just 'index.html'
                                if ((breadcrumbOverride[i][1][j] + "").match(/index\./))
                                {
                                    breadcrumbOverride[i][1][breadcrumbOverride[i][1].length] = /\/$/;
                                }

                                // Check for an exception case and update 'proceed' if found
                                if (loc.match(breadcrumbOverride[i][1][j]))
                                {
                                    proceed = true;
                                    break;
                                }
                            }
                        }
                    }
                }


                if (proceed)
                {
                    // For the final crumb, we get the value from the <title> tag.
                    var text_content = document.getElementsByTagName('title')[0].innerHTML;
                    // Create the final LI node, and add it to the document.
                    var text = document.createTextNode(text_content);
                    var li = document.createElement('li');
                    li.appendChild(text);
                    crumb.appendChild(li);
                }
            }
        }
    }
}

function an_GetChildrenOfType(n, t)
{
    // This function returns an array of child nodes of type 't'
    var a = [];
    var c = 0;
    // Cycle through all child nodes:
    for (var i = 0; i < n.childNodes.length; i++)
    {
        if (n.childNodes[i].nodeName.toLowerCase() == t.toLowerCase())
        {
            a[c] = n.childNodes[i];
            c++;
        }
    }
    a.length = c;
    a.defined = true;
    return a;
}

function an_SetAttribute(node, att, val)
{
    var current = "";
    if (node.attributes[att])
    {
        current = node.attributes[att].nodeValue;
        val = current ? current + " " + val : val;
        node.attributes[att].nodeValue = val;
    }
    else
    {
        node.setAttribute(att, val);
    }

}

//-----------------------------------------------------------------------------
// toggleRegion
//  This function cycles through a series of HTML tags (img, div, etc) and sets
//  all the visibility of all but one to hidden. The other is made visible.
//  It takes two or more arguments:
//   1  - The tag number to make visible.
//   2+ - The tag ID, minus it's sequence number: 'image' in the case of
//       'image0', 'image1', 'image2', etc...
//  By convention, 0 is the default ID. Initial states of the tags must
//   be defined elsewhere.
function toggleRegion(which, region)
{
    // Cycle through arguments, and apply the appropriate rollover status
    for (var a = 1; a < arguments.length; a++)
    {
        var i = 1;
        var x = document.getElementById(arguments[a] + i);

        // Cycle through all rollover tag (starting at 1, ending at the first sequentially non-existant element)
        while (x)
        {
            // Set all images hidden, except 'which'
            if (which != i)
            {
                x.style.visibility = "hidden";
            }
            x = document.getElementById(arguments[a] + (++i));
        }

        // Make the selected tag visible
        x = document.getElementById(arguments[a] + which);
        if (x)
        {
            x.style.visibility = "visible";
        }
        else
        {
            x = document.getElementById(arguments[a] + 0);
            if (x) x.style.visibility = "visible";
        }
    }
}
//------------------------------------------------------------------------------


function newImage(arg)
{
    if (document.images)
    {
        rslt = new Image();
        rslt.src = arg;
        return rslt;
    }
}

function changeImages()
{
    if (document.images && (preloadFlag == true))
    {
        for (var i = 0; i < changeImages.arguments.length; i += 2)
        {
            document[changeImages.arguments[i]].src = changeImages.arguments[i + 1];
        }
    }
}

var preloadFlag = false;
function preloadImages()
{
    if (document.images)
    {
        button1_over = newImage("../img/home_solutions_button1-over.gif");
        button2_over = newImage("../img/home_solutions_button2-over.gif");
        button3_over = newImage("../img/home_solutions_button3-over.gif");
        preloadFlag = true;
    }
}

var productTarget = "_top";
function productThere()
{
    if (!document.productForm.productMenu.selectedIndex == "")
    {
        window.open(document.productForm.productMenu.options[document.productForm.productMenu.selectedIndex].value, productTarget, "");
    }
}

var demoTarget = "_blank";
function demoThere()
{
    if (!document.demoForm.demoMenu.selectedIndex == "")
    {
        window.open(document.demoForm.demoMenu.options[document.demoForm.demoMenu.selectedIndex].value, demoTarget, "");
    }
}

// ----------------------------------------------------------------------------
// Sets onclick events for anchors having the class 'popupLink'
//  Assigns a ?referer to popupLinks with a target value of "wForm"
initPopups = function()
{
    var x = new Array()
    x[0] = document.getElementById('toolbox');

    var list = new Array();
    var c = 0;
    // Collect all <a/> tags within the areas defined in 'x'
    for (var i = 0; i < x.length; i++)
    {
        if (x[i])
        {
            var y = x[i].getElementsByTagName('a');
            for (var j = 0; j < y.length; j++)
            {
                list[c] = y[j];
                c++;
            }
        }
    }

    // Set default values
    var width = 800;
    var height = 600;
    var scroll = 1;
    var resize = 1;
    var status = 1;
    if (list.length > 0)
    {
        for (var i = 0; i < list.length; i++)
        {
            if (list[i].className == "popupLink")
            {
                if (!list[i].onclick)
                { // Make sure not to overwrite an existing onclick event
                    list[i].onclick = function()
                    {
                        var wHref = this.href;
                        var wName = this.target;
                        if (wName == "_blank" || wName == "")
                        {
                            wName = "default";
                        }
                        if (wName == "wForm")
                        {
                            wHref += "?referer=" + window.location;
                            width = 640;
                            height = 480;
                            scroll = 0;
                            status = 0;
                        }
                        popup(wHref, wName, width, height, scroll, resize, status);
                        return false;
                    }
                }
            }
        }
    }
}

// General popup window function
function popup(URL, name, w, h, scroll, resize, status, buttons)
{
    var featureStr = "";
    if (scroll)
    {
        scroll = 'yes';
    }
    else
    {
        scroll = 'no';
    }
    if (resize)
    {
        resize = 'yes';
    }
    else
    {
        resize = 'no';
    }
    if (status)
    {
        status = 'yes';
    }
    else
    {
        status = 'no';
    }
    if (!buttons)
    {
        buttons = 'no';
    }
    else
    {
        buttons = 'yes';
    }
    // This includes location bar, menubar and toolbar
    featureStr = "width=" + w + ",height=" + h + ",directories=no,location=" + buttons + ",menubar=" + buttons + ",resizable=" + resize + ",scrollbars=" + scroll + ",status=" + status + ",toolbar=" + buttons
    var newWin = window.open(URL, name, featureStr);
    newWin.focus();
    // Bring window to focus (in case of updating an existing window)
}

// hompage product flip
var delay = 5;
//delay in seconds
var promotion_index = 0;
//var timerID = setTimeout("flipPromotions()",delay*1000);

function flipPromotions()
{
    an_Promotions(1);
    //clearTimeout(timerID);
    //timerID = setTimeout("flipPromotions()",delay*1000);
}

function flipPromotionsBack()
{
    an_Promotions(-1);
    //clearTimeout(timerID);
    //timerID = setTimeout("flipPromotions()",delay*1000);

    //after going back one, resume flipping
    //forward after next timeout
}

// Year Script
function printYear()
{
    var time = new Date();
    var year = time.getYear();
    if (year < 2000)
        year = year + 1900;
    document.write(year);
}

// Spam-proof email by deanq.com
function vmemail(who, subject, domain, body)
{
    if (!domain) var domain = "vmware.com";
    if (!subject) var subject = " ";
    if (!body) var body = " ";
    eval("location.href='mailto:" + who + "@" + domain + "?subject=" + subject + "&body=" + body + "'");
}

/////////////////////////////////////////////
// Dynamic Tabs controller used in VI3 pages
//

function showLayer(lyr)
{
    //   makeHistory(lyr);
    document.getElementById(currentLayer).className = 'hide';
    document.getElementById(lyr).className = 'show';
    currentLayer = lyr;
    //   showTab(lyr.replace("tab","t_"));
}

function showTab(lyr)
{
    document.getElementById(currentTab).className = 'taboff';
    document.getElementById(lyr).className = 'tabon';
    currentTab = lyr;
}

//function makeHistory(newHash) {
//  window.location.hash = "_" + newHash;
//  expectedHash = window.location.hash;
//  return true;
//}

//function handleHistory() {
//  if ( window.location.hash != expectedHash ) {
//    expectedHash = window.location.hash;
//    if (expectedHash.match('tab')) showLayer(expectedHash.substring(2));
//  }
//  return true;
//}

//function pollHash() {
//  handleHistory();
//  window.setInterval("handleHistory()", 200);
//  return true;
//}
////////// END Dynamic Tabs /////////

// HBX tracking
var _hbEC = 0,_hbE = new Array;
function _hbEvent(a, b)
{
    b = _hbE[_hbEC++] = new Object();
    b._N = a;
    b._C = 0;
    return b;
}
var hbx = _hbEvent("pv");
hbx.vpc = "HBX0200u";
hbx.gn = "ehg-vmware.hitbox.com";
hbx.acct = "DM550929D5BC96EN3";
//Rollup
hbx.pn = "PUT+PAGE+NAME+HERE";
hbx.mlc = "CONTENT+CATEGORY";
hbx.pndef = "index.html";
hbx.lc = "y";
hbx.ctdef = "full";
hbx.fv = "";
hbx.lt = "auto";
hbx.dlf = ".exe,.zip,.rpm,.gz,.iso,.tgz,.flp,.dmg,.pdf,.xls,.doc!.do,.lic";
hbx.dft = "n";
hbx.elf = "";
hbx.seg = "";
hbx.fnl = "";

// 404 - File Not Found tracking
if ((document.location.href.indexOf("404.html")) > -1)
{
    var _sv = 10;
    _sv = 11
    function _A(v)
    {
        return escape(v)
    }
    function _D(v)
    {
        return(typeof eval("window._" + v) != _hud)?eval("window._" + v):""
    }
    function _II(a, b, c)
    {
        return a.indexOf(b, c?c:0)
    }
    function _E(a)
    {
        var b = "",d = a.split(",");
        for (var c = 0; c < d.length; c++)b += "&" + d[c] + "=" + _A(_D(d[c]));
        return b
    }

    var _hud = "undefined",_ss = "na",_sc = "na",_cy = "u",_hp = "u",_vpc = hbx.vpc,_rf = document.location + "";
    var __r = ".referrer";
    _er = eval("document" + __r) + "";
    if ((_er == _hud) || (_er == ""))_er = "bookmark";
    if (_II(document.cookie, "CP=") != -1)
    {
        _ce = "y"
    }
    else
    {
        document.cookie = "CP=nul" + "l*; path=/; expires=Wed, 1 Jan 2020 00:00:00 GMT";
        _ce = (_II(document.cookie, "CP=") != -1)?"y":"n"
    }
    ;
    var _bnI = _II(navigator.appName, "Microsoft") > -1;
    var _hM = _II(navigator.userAgent, "Mac") > -1;
    var _I5 = false;
    if (_bnI)
    {
        var _nua = navigator.userAgent,_is = _II(_nua, "MSIE"),_if = _II(_nua, ".", _is);
        if (_if > _is)_I5 = _nua.substring(_is + 5, _if) >= 5
    }
    if (window.screen)
    {
        _sv = 12;
        _ss = screen.width + "*" + screen.height;
        _sc = _bnI?screen.colorDepth:screen.pixelDepth;
        if (_sc == _hud)_sc = "na"
    }
    var _ra = new Array();
    if (_ra.toSource || (_bnI && _ra.shift))_sv = 13;
    if (_I5 && !_hM)
    {
        if (_II("" + navigator.appMinorVersion, "Privacy") > -1)_ce = "p";
        if (document.body && document.body.addBehavior)
        {
            document.body.addBehavior("#default#homePage");
            _hp = document.body.isHomePage(location.href)?"y":"n";
            document.body.addBehavior("#default#clientCaps");
            _cy = document.body.connectionType
        }
    }
    var _arg = (location.protocol == 'https:'?'https://':'http://') + hbx.gn + "/HG?hc=&hb=" + hbx.acct + "&cd=1&l=e" + "&ja=" + (navigator.javaEnabled()?"y":"n") +
               _E("rf,er,ce,vpc,sv,ss,sc,cy,hp");
    if (typeof eval("hbx.mlc") != _hud && _II(hbx.mlc, "CONTENT+CATEGORY") < 0)_arg += "&vcon=" + _A(hbx.mlc);
    var _hbi = new Image();
    _hbi.src = _arg + "&hid=" + Math.random();
    if (_sv < 11)
    {
        document.write("<img src='" + _arg + "' border='0' height='1' width='1'>")
    }
}

// TAP Catalog tracking
if (document.location.href.match("tapcatalog"))
{
    hbx.pndef = "title";
}

// KB tracking
if ((document.location.href.indexOf("externalId")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('externalId=', 2);
    var finalURL = splitURL[1].split('&', 2);
    hbx.pn = "externalid=" + finalURL[0];
}

// Discussion Forum tracking
if ((document.location.href.indexOf("threadID")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('threadID=', 2);
    var finalURL = splitURL[1].split('&', 2);
    hbx.pn = "threadid=" + finalURL[0];
}
if ((document.location.href.indexOf("forumID")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('forumID=', 2);
    hbx.pn = "forumid=" + splitURL[1];
}
if ((document.location.href.indexOf("categoryID")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('categoryID=', 2);
    hbx.pn = "categoryid=" + splitURL[1];
}
if ((document.location.href.indexOf("messageID")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('messageID=', 2);
    hbx.pn = "messageid= " + splitURL[1];
}

// Download tracking in VMware Store
// if url contains "download.do" BUT DOES NOT CONTAIN "downloadGroup"
if ((document.location.href.indexOf("download.do")) > -1 && (document.location.href.indexOf("downloadGroup=")) == -1)
{
    hbx.pn = "session expired";
}

// if url contains "download.do" AND ALSO CONTAINS "downloadGroup"
if ((document.location.href.indexOf("download.do")) > -1 && (document.location.href.indexOf("downloadGroup=")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('downloadGroup=', 2);
    hbx.pn = "eula for " + splitURL[1];
}

if ((document.location.href.indexOf("login.do")) > -1)
{
    var fullURL = document.referrer;
    var splitURL = fullURL.split('downloadGroup=', 2);
    hbx.pn = "login for " + splitURL[1];
    _hbCookie('download_session', document.referrer);
}

// already logged in
if ((document.location.href.indexOf("eula.do")) > -1 && (document.referrer.indexOf("downloadGroup=")) > -1)
{
    var fullURL = document.referrer;
    var splitURL = fullURL.split('downloadGroup=', 2);
    hbx.pn = "binaries for " + splitURL[1];
}

// first time logged in with no referrer
if ((document.location.href.indexOf("eula.do")) > -1 && (document.referrer.indexOf("downloadGroup=")) == -1)
{
    var newReferrer = _RCV('temp');
    var fullURL = newReferrer;
    var splitURL = fullURL.split('downloadGroup=', 2);
    hbx.pn = "binaries for " + splitURL[1];
}

// VMware Store Product Group tracking
if ((document.location.href.indexOf("ProductGroupCode=")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('ProductGroupCode=', 2);
    var finalURL = splitURL[1].split('&', 2);
    hbx.pn = "vmwarestore/newstore/category.jsp?product=" + finalURL[0];
}

if ((document.location.href.indexOf("ProductGroupCodes=")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('ProductGroupCodes=', 2);
    var finalURL = splitURL[1].split('&', 2);
    hbx.pn = "vmwarestore/newstore/category.jsp?product=" + finalURL[0];
}

// Tracking download2 files
if ((document.location.href.indexOf("file=")) > -1)
{
    var fullURL = document.location.href;
    var splitURL = fullURL.split('file=', 2);
    var finalURL = splitURL[1].split('&', 2);
    hbx.dlf = finalURL[0];
}