/*
function pastesmile(smile)
{
//	alert(smile);
//	alert(document.getElementById("totip").value);
	document.getElementById("totip").value +=  " " + smile + " ";
	document.getElementById("totip").focus();

}
*/
function pasteSmiley(idTextArea, strSmiley)
{
	if(!(document.getElementById && (objTextarea = document.getElementById(idTextArea))))
		return;

	objTextarea.focus();

	//ie
	if(document.selection)
	{
		var range = document.selection.createRange();
		range.move('character', range.text.length);

		range.text = strSmiley;

		range = document.selection.createRange();
		range.move('character', range.text.length);
		range.select();
	}
	else if(0 <= objTextarea.selectionStart) //moze und co
	{
		runner = objTextarea.selectionStart = objTextarea.selectionEnd;

		objTextarea.value = objTextarea.value.substr(0, runner) +
												strSmiley +
												objTextarea.value.substr(objTextarea.selectionEnd);

		objTextarea.selectionStart = objTextarea.selectionEnd = (runner + strSmiley.length);
	}

	objTextarea.focus();
}

function pastesmile(smile)
{
//	alert(smile);
//	alert(document.getElementById("totip").value);
	pasteSmiley("totip", smile);

}

function addFlashLayer(file, width, height, bgColor, trans)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"  + width + "' height='" + height + "' id='" + file + "' align='middle' style='vertical-align:text-top;margin:0;'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
  document.write(((trans) ? "<param name='wmode' value='transparent' />":""));
	
	document.write("<param name='quality' value='best' />");
	document.write("<param name='bgcolor' value='" + bgColor + "' />");
	document.write("<param name='movie' value='flashlayer/" + file + ".swf"  + "'/>");
	document.write("<embed src='flashlayer/" + file + ".swf" +  "' quality='best'  bgcolor='" + bgColor + "' width='" + width + "' height='" + height + "' name='" + file +  "' align='middle' allowScriptAccess='sameDomain' " + ((trans) ? "wmode='transparent'" : "") + " type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}