<!--
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();
}


function nextpage(currentpage,forum_id){window.location.href="messages_list.asp?forum_id=" + forum_id + "&currentpage=" + currentpage;}


function validNumber(){if(event.keyCode < 48 || event.keyCode >57) event.keyCode=0;}

function addToFavorites(url){window.external.AddFavorite('http://' + url,'Site name');}

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;	
}

function printflash(src, w, h)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'" VIEWASTEXT>');
	document.write('<param name="movie" value="'+src+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="'+src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" wmode="opaque">');
	document.write('</object>');	
}

function validform()
{
	if(document.contact.fname.value=="")
	{
	alert("נא לרשום שם פרטי");
	document.contact.fname.focus();
	return false;
	}
	if(document.contact.lname.value=="")
	{
	alert("נא לרשום שם משפחה");
	document.contact.lname.focus();
	return false;
	}
	
	if(document.contact.email.value=="")
	{
	alert("נא לרשום אי-מייל");
	document.contact.email.focus();
	return false;
	}
	if(!validMail(document.contact.email.value))
	{
	alert("נא לרשום אי-מייל");
	document.contact.email.focus();
	return false;
	}	
	
	if(document.contact.phone.value=="")
	{
	alert("נא לרשום טלפון");
	document.contact.phone.focus();
	return false;
	}
	document.contact.submit();
	return true;
}
//-->