function Ensure()
	{
	if (location.href==top.location.href) 
		{top.location.replace("http://www.legalhistory.com/ForumFrame.php?Choice=Forum");}
	return true;
	}

function RightPage()
	{
	HrefRight=parent.right.location.href;
	TabLoc=HrefRight.lastIndexOf("#");
	if (TabLoc>0)
		{HrefRight=HrefRight.substring(0,TabLoc);}
	parent.right.location.href=HrefRight+"#Top";
	}

function ViewChoice(Switch)
	{
	var RAL=Switch.RL.value;
	var Choice=Switch.View.value;

	if (Choice=="Subjects")
		{
		Left=parent.left.location.href;
			LeftQuest=Left.lastIndexOf("?");
			if (LeftQuest>0)
				{Left=Left.substring(0,LeftQuest);}
			parent.left.location.href=Left+"?SubIn=0&ch=ML";
		Right=parent.right.location.href;
			RightQuest=Right.lastIndexOf("?");
			if (RightQuest>0)
				{Right=Right.substring(0,RightQuest);}
			parent.right.location.href=Right+"?SubIn=0&ch=ML&RL="+RAL;
		}
	if (Choice=="Topics")
		{
		Left=parent.left.location.href;
			LeftQuest=Left.lastIndexOf("?");
			if (LeftQuest>0)
				{Left=Left.substring(0,LeftQuest);}
			parent.left.location.href=Left+"?SubIn=0&ch=VA";
		Right=parent.right.location.href;
			RightQuest=Right.lastIndexOf("?");
			if (RightQuest>0)
				{Right=Right.substring(0,RightQuest);}
			parent.right.location.href=Right+"?SubIn=0&ch=VA&RL="+RAL;	
		}
	}

function ManualValid(manual,TotalPages)
	{
	err="Please enter an integer between 1 and "+TotalPages+".";
	Page=manual.Page.value;
	PInt=parseInt(Page);
	if (Page<1 || Page>TotalPages || Page!=PInt)
		{
		alert(err); 
		return false;
		}
	}

function EntryValid(NewEntry,EntryType)
	{
	errOne="Please enter a topic title.";
	errThree="Please enter a message.";
	if (EntryType=="T")
		{
		TN=NewEntry.TopicName.value;
		if (TN=="")
			{
			alert(errOne);
			return false;
			}
		}
	MTxt=NewEntry.MsgText.value;
	if (MTxt=="")
		{
		alert(errTwo);
		return false;
		}
	return true;
	}

function ExtraChars()
	{
	Char=new Array(1);
	var MasterList="";
	var delimiter="|";
	var Count=0;
	var x=0;

	MasterList="&Aacute;|&aacute;|&Agrave;|&agrave;|&Acirc;|&acirc;|&Auml;|&auml;|&Aring;|&aring;|&Atilde;|&atilde;|&AElig;|&aelig;|&Ccedil;|&ccedil;|&Eacute;|&eacute;|&Egrave;|&egrave;|&Ecirc;|&ecirc;|&Euml;|&euml;|&Iacute;|&iacute;|&Igrave;|&igrave;|&Icirc;|&icirc;|&Iuml;|&iuml;|&Ntilde;|&ntilde;|&Oacute;|&oacute;|&Ograve;|&ograve;|&Ocirc;|&ocirc;|&Ouml;|&ouml;|&Oslash;|&oslash;|&Otilde;|&otilde;|&Uacute;|&uacute;|&Ugrave;|&ugrave;|&Ucirc;|&ucirc;|&Uuml;|&uuml;|&Yacute;|&yacute;|&yuml;|&szlig;|&ETH;|&eth;|&THORN;|&thorn;|&ndash;|&mdash;|&iquest;|&iexcl;|&laquo;|&raquo;|&sect;|&para;|&#36;|&pound;|&#8364;|&yen;|";

	while (MasterList.indexOf(delimiter)>0) 
		{
	    Char[Count]=MasterList.substr(0,MasterList.indexOf(delimiter));
			NewStart=MasterList.indexOf(delimiter)+1;
			NewLength=MasterList.length-NewStart;
			MasterList=MasterList.substr(NewStart,NewLength);
		Count=Count+1;
		}

	document.write ('<option value="">Special</option>');
	
	for (x=0;x<Count;x++)
		{document.write ('<option value="'+Char[x]+'">'+Char[x]+'</option>');}

	return true; 
	}

function Txt(Type)
	{
	if (Type=="Bold")
		{
		var bold=new Image;
		var bsrc=document.bold.src.substring(document.bold.src.lastIndexOf("/")+1);
		if (bsrc=="BoldOn.gif")
			{
			TypeValue="<b>";
			document.bold.src="Images/BoldOff.gif";
			}
			if (bsrc=="BoldOff.gif")
			{
			TypeValue="</b>";
			document.bold.src="Images/BoldOn.gif";
			}
		}
	if (Type=="Italics")
		{
		var italics=new Image;
		var isrc=document.italics.src.substring(document.italics.src.lastIndexOf("/")+1);
		if (isrc=="ItalicsOn.gif")
			{
			TypeValue="<i>";
			document.italics.src="Images/ItalicsOff.gif";
			}
		if (isrc=="ItalicsOff.gif")
			{
			TypeValue="</i>";
			document.italics.src="Images/ItalicsOn.gif";
			}
		}
	if (Type=="Underline")
		{
		var underline=new Image;
		var usrc=document.underline.src.substring(document.underline.src.lastIndexOf("/")+1);
		if (usrc=="UnderlineOn.gif")
			{
			TypeValue="<u>";
			document.underline.src="Images/UnderlineOff.gif";
			}
		if (usrc=="UnderlineOff.gif")
			{
			TypeValue="</u>";
			document.underline.src="Images/UnderlineOn.gif";
			}
		}
	if (Type=="Indent")
		{
		var indent=new Image;
		var isrc=document.indent.src.substring(document.indent.src.lastIndexOf("/")+1);
		if (isrc=="IndentOn.gif")
			{
			TypeValue="<indent>";
			document.indent.src="Images/IndentOff.gif";
			}
		if (isrc=="IndentOff.gif")
			{
			TypeValue="<end indent>";
			document.indent.src="Images/IndentOn.gif";
			}
		}
	if (Type=="Extra")
		{
		var opt=document.forms["NewEntry"].extra;
		TypeValue=opt.options[opt.selectedIndex].value;
		}
	if (Type=="Link")
		{
		TypeValue="<url=Address>Name of Link</url>";
		}
	if (Type=="Mail")
		{
		TypeValue="<mail=Address>Recipient</mail>";
		}

	var ExistInput=document.forms["NewEntry"].elements["MsgText"];
	ExistInput.value=ExistInput.value+TypeValue;

	document.forms["NewEntry"].elements["MsgText"].scrollTop=document.forms["NewEntry"].elements["MsgText"].scrollHeight;
	document.forms["NewEntry"].elements["MsgText"].focus();
	}

function EM(name,domain,type,subject,display)
	{document.write('<a href=mailto:'+name+'@'+domain+'.'+type+'?subject='+subject+'>'+display+'</a>');} 

function CancelFor()
	{top.location="http://www.legalhistory.com";}


