var bioPaneActive ="portraitwrapperlisting";
// preload
iml = new Image();
iml.src = CCM_REL + "/images/loadingAnimation.gif";

loadBioPage = function(cID, index) {
	
	// synchronize select menus
	$("bio1").selectedIndex = index;
	$("bio2").selectedIndex = index;
	
	if (cID) {
		//oh = $(bioPaneActive).offsetHeight;
		//$("portraitwrapper").style.height = oh + "px";
		$("portraitwrapper").innerHTML = '<div style="text-align: center; padding: 30px 0px 0px 0px"><img src="' + CCM_REL + '/images/loadingAnimation.gif" /></div>';
		$("biolisting").style.display = "none";
		$("bio").style.display = "block";
		
		bioPaneActive = "portraitwrapper";
		
		setTimeout(function() {
			au = new Ajax.Updater("portraitwrapper", CCM_REL + "/tools/ajax_bio_content.php", {
				parameters: "cID=" + cID,
				onComplete: function() {
					$("portraitwrapper").style.height = "auto";
				}
			});
		}, 500);
		
	} else {
		bioPaneActive = "portraitwrapperlisting";
		$("bio").style.display = "none";
		$("biolisting").style.display = "block";
	}
}