var SmilieWin;
var YourSmilieWin;

function CommentTypeToggle()
{
var iOnOff;
var iC;
iOnOff = !document.getElementById('CommControl:chkViewCommentTypes:0').checked;
for (iC=0;iC<=4;iC++)
	document.getElementById('CommControl:chkViewCommentTypes:'+iC).checked=iOnOff;
}
function RE(iID)
{
document.getElementById('CommControl_intAbuseItem').value=iID +',' + CurrPageID;
document.Form1.submit();
}
function DE(iID)
{
document.getElementById('CommControl_intDeleteItem').value=iID +',' + CurrPageID;
document.Form1.submit();
}
function SN(iID)
{
var initialmsg;
var initialsubj;
initialmsg="Hi,\n Check this out\n  \<A href='http://sudoku.com.au/" + SendToAFriendID + "#AC_" + iID + "'\>http://sudoku.com.au/" + SendToAFriendID + "#AC_" + iID + "\<\/A\>";
initialsubj="Check it out - sudoku comments";
window.location = "mailto:?body="+initialmsg + "&subject="+initialsubj;
}

function SmilieOpen()
{
if (SmilieWin && !SmilieWin.closed)
	{
	SmilieWin.focus();
	} else
	{
	SmilieWin=window.open('smilies.aspx','Smilies','width=550,height=570');
	}
return false;
}

function YourSmilieOpen()
{
if (YourSmilieWin && !YourSmilieWin.closed)
	{
	YourSmilieWin.focus();
	} else
	{
	YourSmilieWin=window.open('yoursmilies.aspx','YourSmilies','width=550,height=460');
	}
return false;
}

function AbuseSet()
{
var al_elements;
 al_elements = document.getElementsByName("abl");

 for (var i = 0; i < al_elements.length; i++) 
   {
     al_elements[i].innerHTML="Report this comment as abusive";
   } 

 al_elements = document.getElementsByName("snd");

 for (var i = 0; i < al_elements.length; i++) 
   {
     al_elements[i].innerHTML="Send this to a friend";
   } 

 al_elements = document.getElementsByName("del");

 for (var i = 0; i < al_elements.length; i++) 
   {
     al_elements[i].innerHTML="Delete";
   } 
}

function SubmitCheck()
{
	if (document.getElementById('CommControl_CommentType').options[0].selected ==true)
		{
		alert('You must select a Comment Type');
		document.getElementById('CommControl_CommentType').focus();
		return false;
		} 

	if (document.getElementById('CommControl_inpName').value.length<1)
		{
		alert('You must enter your name to post a comment.');
		document.getElementById('CommControl_inpName').focus();
		return false;
		} 
	if (document.getElementById('CommControl_inpFrom').value.length<1)
		{
		alert('You must enter where you are from to post a comment.');
		document.getElementById('CommControl_inpFrom').focus();
		return false;
		} 
	if (document.getElementById('CommControl_inpComment').value.length<2)
		{
		alert('You must enter a comment.');
		document.getElementById('CommControl_inpComment').focus();
		return false;
		} 

	if (window.location.href.toLowerCase().indexOf('default.aspx')!=-1)
		if (sDiffSetting=='E')
			if ( document.getElementById('testimg').clientWidth!=100)
				document.getElementById('CommControl_blnNoImages').value = 'NoImages';
		
		return true;
}

function FlashCheck()
{
var TDId;
if (location.hash.indexOf('AC')>-1)
	{
	TDId=location.hash.substring(4);
	document.getElementById('TD_1_' + TDId).parentElement.parentElement.bgColor='#ffffc2';
	}
}

function AddMore(sMoreComment,iKey)
{
var oOrigTD;
oOrigTD = document.getElementById('TD_2_' + iKey)
oOrigTD.innerHTML = oOrigTD.innerHTML + '<br><div>' + sMoreComment + '</div>';
}

function NmSet(sID,sText)
{
var sObj;
sObj=document.getElementById(sID);
if (sObj)
	{
	sObj.innerHTML="<div>" + sText + "</div>";
	}
}
