﻿var Agent = {
	currentLink: null,
	currentBio: null,
	show: function(link, id){
		var bio = $(id);
		
		if(this.currentBio)
			this.currentBio.hide();
		if(this.currentLink)
			Element.removeClassName(this.currentLink.parentNode, 'hover');
			
		if(bio){
			var offset = Element.cumulativeOffset(link);
			var left = offset[0] + link.offsetWidth + 45;
			var top = offset[1] - 69;
			if(Prototype.Browser.IE) ++top;
			//alert(left + ' - ' + top);
			bio.style.top = top + 'px';
			bio.style.left = left + 'px';
			bio.show();
			Element.addClassName(link.parentNode, 'hover');
			this.currentLink = link;
			this.currentBio = bio;
		}
	}
};

document.observe('dom:loaded', function(){
  $$('#nav-sales a').each(function(item){ 
    if(item.href == location.href) item.addClassName('selected'); 
  });
});
