/*
var tagPanelOpened = false;
function opentagpanel()
{
document.getElementById('idtrtag').style.display = '';
if (tagPanelOpened == false)
{
tagPanelOpened = true;
processtagpanel();
}
}
function processtagpanel()
{
var tagsTmp = WAYN.tags.prepareTags(document.tmpForm.tag_name.value);
WAYN.tags.validateTags(tagsTmp);
var tag_array = tagsTmp.split(' ');
var tag_array_idx= new Array;
var index = 1;
if (tag_array.length > 5)
{
alert('You have added too many tags - You can have up to 5 tags.');
return;
}
while(document.getElementById('tag_'+index) != null)
{
document.getElementById('tag_'+index).style.background='';
for(i=0;i<tag_array.length;i++)
{
if(document.getElementById('tag_'+index).innerHTML == tag_array[i])
{
tag_array_idx.push(index);
break;
}
}
index++;
}
for (i = 0; i < tag_array_idx.length; i++)
{
document.getElementById('tag_'+tag_array_idx[i]).style.backgroundColor='#dfffef';
}
}
function closeTags() { document.getElementById('idtrtag').style.display = 'none'; }
*/
function emote(text) { $('entry_text').insertAtCursor(text); }
function selecttag(obj)
{
var oTags = $('tag_name');
if (!oTags) return;
oTags.focus();
if ((obj.style.backgroundColor == '' || obj.style.backgroundColor == 'transparent') && oTags.value.indexOf(obj.innerHTML) == -1 )
{
var str = oTags.value;
var arr = str.split(",");
var cnt = arr.length;
obj.style.backgroundColor = '';
oTags.value = str;
if(cnt >= 5)
{
//alert('You have selected too many tags - You can have up to 5 tags.');
msgBox('error', 'You have selected too many tags - You can have up to 5 tags.', null, null, 'Error');
return;
}
obj.style.backgroundColor='#dfffef';
oTags.value = oTags.value + (oTags.value != ''?', ':'') + obj.innerHTML;
} else {
obj.style.backgroundColor='';
var idx_start = oTags.value.indexOf(obj.innerHTML);
if(idx_start>-1)
{
oTags.value = oTags.value.substring(0,idx_start-2) + oTags.value.substring(idx_start+obj.innerHTML.length);
}
if (oTags.value.substring(0,2) == ', ') 	oTags.value = oTags.value.substring(2);
}
}
