function init(){

	$("footer").style.position = "absolute";//for those with js!
//	$("footer").style.z-index = "absolute";//for those with js!
	
	window.onresize = positionFooter;	
	positionFooter();
}

function positionFooter(){

	//for submenu (make sure they all fit)
	if($("contentMenu")){
		var submenuH = $("contentMenu").offsetHeight;
		var subcontentH = $("contentSub").offsetHeight;
		
		if(submenuH > subcontentH){
			//alert(submenuH);
			$("contentSub").style.height = (submenuH -20)+ "px";
		}
	}
	
 	var H =  window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
	
	var contentH = $("container").offsetHeight + $("header").offsetHeight;
	var gotoY = H - 20;//80
	
	if(gotoY < contentH) gotoY = contentH;
	
	$("footer").style.top = gotoY + "px";
	//$("footer").y = gotoY;
	//new Effect.Move("footer", {y:gotoY, duration:1, mode: 'absolute' })
}

function getAnswer($id, $menuObj){
	
	//deselect old menu
	$$(".answer a").each(function(elmt) { elmt.removeClassName("selected") });
	 
	//select new menu
	$($menuObj).addClassName('selected');
	
	new Ajax.Updater('answer', 'getAnswer.php?id=' + $id, { 
		method: 'post',
		onComplete:function(){
			new Effect.BlindDown('answer', { duration: 0.8,  afterFinish: positionFooter});
			positionFooter();
		}}
	);
}
