var domDetect = null;

function Mark_Row(Row, Color)
	{
  theCells = Row.getElementsByTagName('td');

	if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined')
		{ domDetect = true; }
	else
	  { domDetect = false; }

  var rowCellsCnt  = theCells.length;

	if (domDetect)
		{
	  for (c = 0; c < rowCellsCnt; c++)
	  	{ theCells[c].setAttribute('bgcolor', Color, 0); }
	  }
	else
		{
		for (c = 0; c < rowCellsCnt; c++)
			{ theCells[c].style.backgroundColor = Color; }
	  }
  }

function Smilies()
	{
	fenster=window.open("/forum/smilies.html", "BoHSmile","width=450,height=250,resizable=no,scrollbars=no");
	fenster.focus();
	}

ArrSmilie = new Array (":)",":\\\)","smile.gif","Smile",":(",":\\\(","sad.gif","Sad",":D",":D","happy.gif","Very Happy",":o",":o","surprised.gif","Surprised",":?",":\\\?","confused.gif","Confused","8)","8\\\)","cool.gif","Cool",":x",":x","mad.gif","Mad",":P",":P","razz.gif","Razz",";)",";\\\)","wink.gif","Wink",":|",":\\\|","neutral.gif","Neutral","8O","8O","shock.gif","Shock",":evil:",":evil:","evil.gif","Evil",":twisted:",":twisted:","twisted.gif","Twisted",":bigmouth:",":bigmouth:","bigmouth.gif","Bigmouth",":!:",":!:","exclamation.gif","Exclamation",":?:",":\\\?:","question.gif","Question",":idea:",":idea:","idea.gif","Idea");

function Smile(Text)
	{
	for(i=0;i<ArrSmilie.length;i+=4)
		{
		var smilie=ArrSmilie[i+1];
		var bild="<img src='/images/smilies/"+ArrSmilie[i+2]+"'>";

		eval("Muster=/"+smilie+"/g;");
		var Text=Text.replace(Muster,bild);

		if(i<=40)
			{
			var smilie=smilie.substr(0,1)+"-"+smilie.substring(1,smilie.length)
			eval("Muster=/"+smilie+"/g;");
			var Text=Text.replace(Muster,bild);
			}
		}

	document.write(Text);
	}

function Smilie_Table()
	{
	document.write("<table border='0'><tr>");

	for(i=0,j=0;i<ArrSmilie.length;i+=4)
		{
		j++;

		var symbol=ArrSmilie[i];
		var bild=ArrSmilie[i+2];
		var name=ArrSmilie[i+3];

		document.write("<td><a href=\"javascript:emoticon('" +symbol+ "')\"><img src='/images/smilies/" +bild+ "' alt='" +name+ "' title='" +name+ "' border='0'></a></td>");

		if(j==8)
			{
			document.write("</tr><tr>");
			j=0;
			}
		else
			{	document.write("<td width='6'></td>"); }
		}

	if(j!=0)
		{
		k=8-j+8-j+1;
		document.write("<td colspan='" +k+ "'></td>");
		}
	document.write("</tr></table>");
	}

function emoticon(text)
	{
	var doc=document.post;
	text = ' ' + text + ' ';

	if (doc.Text.createTextRange && doc.Text.caretPos)
		{
		var caretPos = doc.Text.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		doc.Text.focus();
		}
	else
		{
		doc.Text.value  += text;
		doc.Text.focus();
		}
	}

function storeCaret(textEl)
	{
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
	}


