function showdebug() 
{
	var args=1;
	var sFeatures="dialogHeight: 400px; dialogWidth: 500px; resizable: yes";
	window.showModalDialog("debug.aspx", args, sFeatures) ;
}
function refreshframe(framename)
{
	top.frames[framename].location.href=top.frames[framename].location.href;
}
function go()
{
	if (document.readyState=="complete")
	{
		var action=document.forms[0].elements.GetElementByID("action");
		var actionarg=document.forms[0].elements.GetElementByID("actionarg");
		switch (action)
		{
			case "refresh":
				refreshframe(actionarg);
				break;
			case "logout":
				top.location.href="default.htm";
				break;
		}
	}
}
function setfocuson(controlname)
{	
	var control=document.getElementById(controlname);
	if (control!=null)
	{
	document.getElementById(controlname).focus();
	}
}
function reveal(controlname, show)
{
	var thing=document.getElementById(controlname);
	if (show)
		{thing.style.visibility='visible';}
	else
		{thing.style.visibility='hidden';};
	editing();
}
function showname()
{
var titlectrl=document.getElementById("ddlTitles");
var prefixctrl=document.getElementById("ddlPrefix");
var suffixctrl=document.getElementById("ddlSuffix");
var namectrl=document.getElementById("txtname");
var dmctrl=document.getElementById("chkDM");
var title, name, prefix, suffix, dm;
try {title=titlectrl.options[titlectrl.selectedIndex].childNodes[0].nodeValue;}
catch (errorthing) {title="";}
if (title=='(none)') {title='';};
try {prefix=prefixctrl.options[prefixctrl.selectedIndex].childNodes[0].nodeValue;}
catch (errorthing) {prefix="";}
if (prefix=='(none)') {prefix='';};
var name=namectrl.value;
try {suffix=suffixctrl.options[suffixctrl.selectedIndex].childNodes[0].nodeValue;}
catch (errorthing) {suffix="";}
if (suffix=='(none)') {suffix='';};
if (dmctrl.checked) {dm=', DM';} else {dm='';}
var temp=title + ' ';
if (prefix!='')
{
	if (prefix.indexOf('^')==-1)
	{
		temp=temp + prefix + ' ' + name;
	}
	else
	{
		temp=temp + name + ' ' + prefix.replace(/\^/,'');
	}
}
else
{
	temp=temp + name;
}
if (suffix!='')
{
	temp=temp + ' of ' + suffix;
}
temp=temp + dm;
document.getElementById("lblCatName").innerHTML=temp;
editing();
return;
}
function editing()
{
	document.getElementById("imgEditing").style.visibility='visible';
	try {document.getElementById("btnSave").disabled=false;}
	catch (e) {}
	try {document.getElementById("ibtnSave").disabled=false;}
	catch (e) {}
}
function showperson()
{
	document.getElementById("lblName").innerHTML=document.getElementById("txtName").value;
	editing();
}
function showprefix()
{
	document.getElementById("lblPrefix").innerHTML=document.getElementById("txtPrefix").value;
	editing();
}
function expand(divname, show, hidecontrol, showcontrol)
{
	var thing=document.getElementById(divname);
	if (show)
		{thing.style.display='block';}
	else
		{thing.style.display='none';};
	hidecontrol.style.display='none';
	document.getElementById(showcontrol).style.display='inline';
}
function menuhi(td)
{
try
	{td.style.backgroundColor='#ffffff';
	 td.style.color='#802020';}
catch (ex)
	{alert(ex.message);}
}
function menulo(td)
{
try
	{td.style.backgroundColor='#802020';
	 td.style.color='#ffffff'}
catch (ex)
	{alert(ex.message);}
}