<!--
function openf(tr)
{
	if(document.getElementById(tr).style.display=="none")
		document.getElementById(tr).style.display="";
	else
		document.getElementById(tr).style.display="none";			
}

function research(page)
{
	document.form12.page.value=page;
	document.form12.submit();
}
							
function enlarge(pic){window.open("enlarge.asp?pic=" + pic,null,"width=500,height=500,scrollbars=1");}
function addcomment(id){window.open("addcomment.asp?id=" + id,null,"width=500,height=260,scrollbars=0");}
function requery(pagenum,id){window.location.href="boardview.asp?page=" + pagenum + "&id=" + id;}
function nextpage(currentpage,forum_id){window.location.href="messages_list.asp?forum_id=" + forum_id + "&currentpage=" + currentpage;}
function validMail(strEmail) //if valid mail - return true
{
	var r, re;
	var email = new String(strEmail);
	re = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ig;
	if(email.search(re)==0) 
		return true;
	else
		return false;	
}
var oEditSelection;

function BtnDown()
{
	text = window.event.srcElement.innerText;
	if (text != "ContentEditable")
		window.event.srcElement.style.borderStyle = "inset";
}

function BtnUp()
{	
	text = window.event.srcElement.innerText;
	if (text != "ContentEditable")
		window.event.srcElement.style.borderStyle = "outset";
}

function Toggle()
{
	try{
	text = window.event.srcElement.innerText;

	if (text == "ContentEditable")
	{
		if (document.all("edit").contentEditable == "true")
		{
			document.all("edit").contentEditable = "false";
			window.event.srcElement.style.borderStyle = "outset";
		}
		else
		{
			document.all("edit").contentEditable = "true";
			window.event.srcElement.style.borderStyle = "inset";
		}
	}

	if (text == "Bold")
	{
		oEditSelection.select();
		document.execCommand("Bold", false, null);
	}

	if (text == "Italic")
	{
		oEditSelection.select();
		document.execCommand("Italic", false, true);
	}	
	if (text == "FontColor")
	{
		var theColor = document.all.fontcolor.value;
		if (theColor == "") return;
		
		oEditSelection.select();
		document.execCommand("ForeColor", false, theColor);
	}	
	if (text == "FontSize")
	{
		var theSize = document.all.fontsize.value;
		if (theSize == "getsize") theSize = null;
		
		oEditSelection.select();
		document.execCommand("FontSize", false, theSize);
	}	
	if (text == "FontName")
	{
		var theName = document.all.fontname.value;
		if (theName == "getname") theName = null;
		
		oEditSelection.select();
		document.execCommand("FontName", false, theName);
	}
	if (text != "ContentEditable")
		window.event.srcElement.style.borderStyle = "outset";
	}
	catch(e){}	
}
function InsertImage(theImg)
{
	if (theImg == "") theImg = null;
	try
	{
		//oEditSelection.select();
		document.getElementById("edit").focus();
		document.execCommand("InsertImage", false, theImg);
	}
	catch(e){}	
}
function document.onselectionchange()
{
	var temp = document.selection.createRange();
	try{
	oElem = temp.parentElement();
	
	while (oElem != null)
	{
		if (oElem.id == "edit")
		{
			oEditSelection = temp;
			//window.status = "Stored Selection: " + oEditSelection.htmlText;
			return;
		}
		
		oElem = oElem.parentElement;
	}
	}
	catch(e){}
}

function addsmiles(){window.open("smiles.asp",null,"width=620, height=450, scrollbars=1");}

function send()
{
	document.msg.message.value=document.getElementById("edit").innerHTML;
	document.msg.submit();
}
//-->

