function ToggleInlineLRBox(Type)
{
	if (Type=="Login")
	{
		document.getElementById("InlineLRBoxRegister").style.display="none";
		document.getElementById("InlineLRBoxLogin").style.display="";
	}
	if (Type=="Register")
	{
		document.getElementById("InlineLRBoxLogin").style.display="none";
		document.getElementById("InlineLRBoxRegister").style.display="";
	}
}


function CommentFocus()
{
	if (document.getElementById("Comment").value == "Enter Your Comment...")
	{
		document.getElementById("Comment").value = "";
	}
}


function CommentBlur()
{
	if (document.getElementById("Comment").value == "")
	{
		document.getElementById("Comment").value = "Enter Your Comment...";
	}
}


function ValidateInlineCLRForm()
{
	if (document.getElementById("Comment").value == "Enter Your Comment..." || document.getElementById("Comment").value.length < 2)
	{alert('Please enter your comment');document.getElementById("Comment").focus();return false;}
	
	// Check Login/Register Radio Button
	for (var i=0; i < document.InlineCommentForm.Action.length; i++)
	{
		if (document.InlineCommentForm.Action[i].checked)
		{
			var ActionValue = document.InlineCommentForm.Action[i].value;
		}
	}
	
	// Check LOGIN Form
	if (ActionValue == "Login")
	{	
		if (document.getElementById("Username").value.length < 4)
		{alert('Please enter a valid Username to Login (4+ Characters).');document.getElementById("Username").focus();return false;}
	
		if (document.getElementById("Password").value.length < 4)
		{alert('Please enter a valid Password to Login (4+ Characters).');document.getElementById("Password").focus();return false;}
	}
	
	// Check REGISTER Form
	if (ActionValue == "Register")
	{
		if (document.getElementById("R_Username").value.length < 4)
		{alert('Usernames must be at least 4 characters.');document.getElementById("R_Username").focus();return false;}
	
		if (document.getElementById("R_Email").value.indexOf("@",0) == -1 || 
		document.getElementById("R_Email").value.indexOf(".",0) == -1 || 
		document.getElementById("R_Email").value.indexOf(" ",0) != -1)
		{alert("Email address appears to be invalid.");document.getElementById("R_Email").focus();return false;}
	
		if (document.getElementById("R_Email").value != document.getElementById("R_Email2").value)
		{alert('Confirmation Email does not match.');document.getElementById("R_Email2").focus();return false;}
	
		if (document.getElementById("R_Password").value.length < 4)
		{alert('Passwords must be at least 4 characters.');document.getElementById("R_Password").focus();return false;}
	
		if (document.getElementById("R_Password").value != document.getElementById("R_Password2").value)
		{alert('Confirmation Password does not match.');document.getElementById("R_Password2").focus();return false;}
	}
	
	return true;
}

