execOnLoad = function() {
 updateContentForNav();
 an_StartList();
 an_SetNavAndCrumbs();
 //preloadImages();
 initPopups();
}

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%"; } 
	};
  }
}

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; }
		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; }
			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();
  
  var startOfClass = tag.toLowerCase().indexOf(attribute);
  if (startOfClass == -1) { return tag; /*  */ }
 
  if (startOfClass != tag.toLowerCase().lastIndexOf(attribute) || !removeOnlyIfTwo) {
   
    var lengthOfClass = tag.substring(startOfClass).indexOf(" ");
  
    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; 
  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) {
  
  str=str+""; 
  var a=str.indexOf(match);
  if (a >= 0) { str = str.substring(0,a) + replace + str.substring(a+match.length); }
  return str;
}

// -----------------------------------------------------------------------------

function an_SetNavAndCrumbs() {
  var crumb = document.getElementById("breadcrumbs");
  if (crumb) {
	
	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++) {
			
			var li = c[i];
			var a = an_GetChildrenOfType(li,"a")[0]; 

			
			var href = (a+"").replace("//","");
			href = href.substring(href.indexOf("/"));

			if (loc.indexOf(href) == 0) {
				
				breadcrumbs[breadcrumbs.length] = a.firstChild.data;
				breadcrumbs[breadcrumbs.length] = href;

				
				an_SetAttribute(li, "class", "active");

				
				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) &&                                
					  (href != breadcrumbs[breadcrumbs.length-1]) &&            
					  
					  !(                                                         
					   (loc == href) ||                                          
					   (loc.indexOf(href+'index.') >= 0) ||                      
					   ((loc.lastIndexOf("/") == loc.length-1) && (loc == href)) 
					  )
					) {
						
						breadcrumbs[breadcrumbs.length] = a.firstChild.data;
						breadcrumbs[breadcrumbs.length] = href;
						break;
					}
				}
				break;
			}
		  }
		}


  	  for (var i = 0; i < breadcrumbs.length; i+=2) {
		
		var text = document.createTextNode(breadcrumbs[i]);

		
		var a = document.createElement('a');
		an_SetAttribute(a, "href", breadcrumbs[i+1]);

		
		var li = document.createElement('li');

		
		a.appendChild(text);
		li.appendChild(a);
		crumb.appendChild(li);
	  }

	 
	  if (loc != breadcrumbs[breadcrumbs.length-1]) {
	   
		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))
		);

		
		Array.prototype.Type="Array";
		String.prototype.Type="String";


		var proceed = true;
		for (var i = 0; i < breadcrumbOverride.length; i++) {
		
			if (breadcrumbOverride[i].Type != "Array") { breadcrumbOverride[i] = new Array(breadcrumbOverride[i]); }

			if (loc.match(breadcrumbOverride[i][0])) {
				
				proceed = false;

				
				if (breadcrumbOverride[i][1]) {
					for (var j = 0; j < breadcrumbOverride[i][1].length; j++) {
					
						if (breadcrumbOverride[i][1].Type != "Array") { breadcrumbOverride[i][1] = new Array(breadcrumbOverride[i][1]); }

						
						if ((breadcrumbOverride[i][1][j]+"").match(/index\./)) { breadcrumbOverride[i][1][breadcrumbOverride[i][1].length] = /\/$/; }

						
						if (loc.match(breadcrumbOverride[i][1][j])) { proceed = true; break; }
					}
				}
			}
		}


	  	if (proceed) {
			
			var text_content = document.getElementsByTagName('title')[0].innerHTML;
			
			var text = document.createTextNode(text_content);
			var li = document.createElement('li');
			li.appendChild(text);
			crumb.appendChild(li);
		}
	  }
	}
  }
}

function an_GetChildrenOfType(n,t) {
	
	var a = [];
	var c = 0;
	
	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);
	}
		
}


function toggleRegion(which, region) {
	
	for (var a = 1; a < arguments.length; a++) {
		var i = 1;
		var x = document.getElementById(arguments[a]+i);

		
		while (x) {
			
			if (which != i) { x.style.visibility="hidden"; }
			x = document.getElementById(arguments[a]+(++i));
		}

		
		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,"");
	}
}

// ----------------------------------------------------------------------------

initPopups = function() {
  var x = new Array()
  x[0] = document.getElementById('toolbox');

  var list = new Array();
  var c = 0;
 
  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++;
 }
   } 
  }

  
  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) {
       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;
} } }   }  }   }


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'; }
  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(); 
}


var delay = 5; 
setTimeout("flipPromotions()",delay*1000);
function flipPromotions() {
  an_Promotions(1);
  setTimeout("flipPromotions()",delay*1000);
}



function printYear() {
  var time=new Date();
  var year=time.getYear();
  if (year < 2000)
    year = year + 1900; 
    document.write(year);
}


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="HBX0100u";hbx.gn="ehg-vmware.hitbox.com";

hbx.acct="DM550929D5BC96EN3";
hbx.pn="PUT+PAGE+NAME+HERE";
hbx.mlc="CONTENT+CATEGORY";
hbx.pndef="title";
hbx.ctdef="full";

hbx.fv="";
hbx.lt="auto";
hbx.dlf=".exe,.zip,.rpm,.gz,.iso,.tgz,.flp,.diff,.rss,.wrf";
hbx.dft="n";
hbx.elf="n";

hbx.seg="";
hbx.fnl="";

hbx.cmp="";
hbx.cmpn="";
hbx.dcmp="";
hbx.dcmpn="";
hbx.dcmpe="";
hbx.dcmpre="";
hbx.hra="";
hbx.hqsr="";
hbx.hqsp="";
hbx.hlt="";
hbx.hla="";
hbx.gp="";
hbx.gpn="";
hbx.hcn="";
hbx.hcv="";
hbx.cp="null";
hbx.cpd="";

hbx.ci="";
hbx.hc1="";
hbx.hc2="";
hbx.hc3="";
hbx.hc4="";
hbx.hrf="";
hbx.pec="";
