function closeBranch( bid )
{
	var d = document.getElementById(bid).style;
	if ( d.display == 'block' ) d.display = 'none';
	else d.display = 'block';
}

function getCaptchaForm(imageid){
	var img = '<img width="300" height="100" onload="$(\'.captcha_refresh\').attr(\'disabled\', false);" class="captcha_verifyimg" src="/icom_cgi/freud/getimg.pcgi?csid='+imageid+'"/>';
	var str = "<div>Please enter the phrase in this image into the textbox below.</div>";
	str += "<div>"+img+"</div>";
	str += "<div><input type='text' name='passphrase' size='7' /><input type='hidden' name='csid' value='"+imageid+"' /><img src='/images/repeat.png' class='captcha_image' onclick='reloadCaptcha(this);' style='cursor: pointer;' /></div>";
	str += "<div style='width: 99%; text-align: left;'>In deciphering this image, you are verifying your identity as an actual site user (a human being--not a bot!). <br/> Thanks for helping us protect our system.</div>";
	str += "<div></div>";
	return str;
}


function reloadCaptcha(ob){
	$.post("/icom_cgi/freud/getcsid.cgi", {}, function (resp){
		$(ob.parentNode.parentNode).html(getCaptchaForm(resp));
	});
}


