var beingopened;

window.addEvent('domready', function() {
var myAccordion = new Accordion($('menu'), 'h2.menuheader', 'div.menucontent', {
opacity:true,
show: -1,
duration: 300,
alwaysHide: true,

		onActive: function(menuheader, menucontent){
			menuheader.setStyle('font-weight', 'bold');
			menucontent.setStyle('display', 'block');
		},
		onBackground: function(menuheader, menucontent){
			menuheader.setStyle('font-weight', 'bold');
			menucontent.setStyle('display', 'block');
		}
});
});

window.addEvent('domready', function() {
var myAccordion = new Accordion($('maincol'), 'h2.contentheader', 'div.content', {
opacity:true,
show: -1,
duration: 300,
alwaysHide: true,

		onActive: function(contentheader, content){
			contentheader.setStyle('font-weight', 'bold');
			content.setStyle('display', 'block');
			beingopened = contentheader;
		},
		onBackground: function(contentheader, content){
			contentheader.setStyle('font-weight', 'bold');
			content.setStyle('display', 'block');
		},
		onComplete: function(contentheader){
			window.setTimeout(function(){
				var obj = beingopened;
				var curleft = curtop = 0;
				if (obj.offsetParent) {
					do {
						curleft += obj.offsetLeft;
						curtop += obj.offsetTop;
					} while (obj = obj.offsetParent);
				}
				window.scrollTo(curleft,curtop);}, 200);
		}
});
});


