
window.addEvent('domready', function() {
	new Calendar( {classes: ['dashboard']} );
	
	new ExternalLinks();
	
	new HelpBox(
	            { toggleselector: '.infotooltip', 
	              helpclass: 'helpbox', 
	              leftoffset: 280,
	              contenttop: '<div class="top"><strong style="margin-left: 25px; line-height: 1.7em;">Additional Information</strong></div><div class="content">',
	              contentbottom: '</div><div class="bottom"> </div>'
	            });
	            
    $$('.volatile').each(function (e) {
        if (e.value.length == 0)
            e.value = e.title;
            
        e.addEvent('focus', function () {
            if (e.value == e.title)
                e.value = '';
        });
        
        e.addEvent('blur', function () {
            if (e.value == '')
                e.value = e.title;
        });
    });
	
	$$('.dropmenu').each(function (e) {
		var ul = e.getElement('ul');
		var lnk = e.getElement('a');
		
		if (ul != null) {
		
			e.addEvent('mouseenter', function() {
				var pos = lnk.getPosition();
				var size = lnk.getSize();
				
			
				ul.setStyle('left', pos.x);
				ul.setStyle('top', pos.y + size.y);
				
				ul.setStyle('width', size.x);
				ul.getElements('li').each(function(lie) { lie.getElements('a').each(function(ae) { ae.setStyle('width', size.x - 8); }); });
				
				
				ul.setStyle('display', 'block');
			});
		
			e.addEvent('mouseleave', function() {
				ul.style.display = 'none';
			});
		}
	});
});

function goProduct(basePath) {
    var lst = document.getElementById('lstProductSelection');



    location.href = basePath + lst.options[lst.selectedIndex].value;
}