
var root = 'http://'+location.host+'/';

function ajax_http()
{
	var xmlHttp;
	try
    {
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	return xmlHttp;
}

function clean_str(str)
{
	str=str.replace(/&/gi,"");
	str=str.replace(/</gi,"");
	str=str.replace(/>/gi,"");
	
	return str;
}

function add_click_to_banner(id)
{
	xmlHttp_1=ajax_http();
	
	var url= root + "includes/ajax/adsClicks.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_1.onreadystatechange=function()
	{
	
	}
	 xmlHttp_1.open('POST', url, true);
	 xmlHttp_1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_1.setRequestHeader("Content-length", parameters.length);
     xmlHttp_1.setRequestHeader("Connection", "close");
     xmlHttp_1.send(parameters);
}

function add_vote(id, vote)
{
	xmlHttp_2=ajax_http();
	
	var url= root + "includes/ajax/addVote.inc.php";
	var parameters="id="+ encodeURI(id) + "&vote="+ encodeURI(vote);
	
	xmlHttp_2.onreadystatechange=function()
	{
		if(xmlHttp_2.responseText == 'OK')
		{
			document.getElementById("cont_vote_"+id).className='displaynone';
			add_vote_reload(id);
		}
	}
	 xmlHttp_2.open('POST', url, true);
	 xmlHttp_2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_2.setRequestHeader("Content-length", parameters.length);
     xmlHttp_2.setRequestHeader("Connection", "close");
     xmlHttp_2.send(parameters);
}

function changeMood(id, obj)
{
	xmlHttp_3=ajax_http();
	
	var url= root + "includes/ajax/changeMood.inc.php";
	var parameters="status="+ encodeURI(id);
	
	xmlHttp_3.onreadystatechange=function()
	{
		if(xmlHttp_3.responseText != '')
		{
			document.getElementById("contCurrentMood").innerHTML=obj.innerHTML;
			document.getElementById("header_mood_id").className='nastroenie';
		}
	}
	 xmlHttp_3.open('POST', url, true);
	 xmlHttp_3.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_3.setRequestHeader("Content-length", parameters.length);
     xmlHttp_3.setRequestHeader("Connection", "close");
     xmlHttp_3.send(parameters);
}

function changeChatMood(id)
{
	xmlHttp_4=ajax_http();
	
	var url= root + "includes/ajax/changeChatMood.inc.php";
	var parameters="status="+ encodeURI(id);
	
	xmlHttp_4.onreadystatechange=function()
	{
		if(xmlHttp_4.responseText != '')
		{
			document.getElementById("contCurrentChatMood").innerHTML=xmlHttp_4.responseText;
		}
	}
	 xmlHttp_4.open('POST', url, true);
	 xmlHttp_4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_4.setRequestHeader("Content-length", parameters.length);
     xmlHttp_4.setRequestHeader("Connection", "close");
     xmlHttp_4.send(parameters);
}

function add_fav_joke(id)
{
	xmlHttp_5=ajax_http();
	
	var url= root + "includes/ajax/addFavJoke.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_5.onreadystatechange=function()
	{
		if(xmlHttp_5.responseText == 'OK')
		{
		document.getElementById("cont_fav_"+id).className='';
			document.getElementById("cont_fav_"+id).className='displaynone';
			
		}
	}
	 xmlHttp_5.open('POST', url, true);
	 xmlHttp_5.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_5.setRequestHeader("Content-length", parameters.length);
     xmlHttp_5.setRequestHeader("Connection", "close");
     xmlHttp_5.send(parameters);
}

function add_quote(id)
{
	xmlHttp_6=ajax_http();
	
	var url= root + "includes/ajax/addQuote.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_6.onreadystatechange=function()
	{
		document.getElementById("description").value=xmlHttp_6.responseText;
	}
	 xmlHttp_6.open('POST', url, true);
	 xmlHttp_6.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_6.setRequestHeader("Content-length", parameters.length);
     xmlHttp_6.setRequestHeader("Connection", "close");
     xmlHttp_6.send(parameters);
}

function check_for_popup()
{
	xmlHttp_7=ajax_http();
	
	var url= root + "includes/ajax/checkForPopup.inc.php";
	var parameters='do=100';
	
	xmlHttp_7.onreadystatechange=function()
	{
		if(xmlHttp_7.readyState==4)
  		{
			document.getElementById('popup_div').innerHTML=xmlHttp_7.responseText;
  		}
	}
	 xmlHttp_7.open('POST', url, true);
	 xmlHttp_7.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_7.setRequestHeader("Content-length", parameters.length);
     xmlHttp_7.setRequestHeader("Connection", "close");
     xmlHttp_7.send(parameters);
}

function pause(millisecondi)
   {
       var now = new Date();
       var exitTime = now.getTime() + millisecondi;
   
       while(true)
       {
           now = new Date();
           if(now.getTime() > exitTime) return;
   }
 }

function check_mails(typ)
{
	xmlHttp_8=ajax_http();
	
	var url= root + "includes/ajax/checkMails.inc.php";
	var parameters='do=100';
	
	xmlHttp_8.onreadystatechange=function()
	{
		if(xmlHttp_8.readyState==4)
  		{
			if(typ == 1)window.location = root + 'mail/inbox/';
		}
	}
	 xmlHttp_8.open('POST', url, true);
	 xmlHttp_8.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_8.setRequestHeader("Content-length", parameters.length);
     xmlHttp_8.setRequestHeader("Connection", "close");
     xmlHttp_8.send(parameters);
}

function edit_this_from_forum(id)
{
	xmlHttp_9=ajax_http();
	
	var url= root + "includes/ajax/addEditForum.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_9.onreadystatechange=function()
	{
		if(xmlHttp_9.readyState==4)
  		{
			//alert();
			/*var oEditor = FCKeditorAPI.GetInstance('description') ;
			oEditor.SetHTML(xmlHttp_9.responseText);
			alert(oEditor.GetHTML);*/
			document.getElementById("description").value=xmlHttp_9.responseText;
			document.getElementById("hidden_id").value=id;
  		}
	}
	 xmlHttp_9.open('POST', url, true);
	 xmlHttp_9.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_9.setRequestHeader("Content-length", parameters.length);
     xmlHttp_9.setRequestHeader("Connection", "close");
     xmlHttp_9.send(parameters);
}



function add_user_comment(to_id, text)
{
	xmlHttp_10=ajax_http();
	
	text = clean_str(text);
	
	var url= root + "includes/ajax/addUserComment.inc.php";
	var parameters='to_id=' + encodeURI(to_id) + '&text=' + encodeURI(text);
	
	xmlHttp_10.onreadystatechange=function()
	{
		document.getElementById('description').value = '';
		showUserComments(to_id, 1);
	}
	 xmlHttp_10.open('POST', url, true);
	 xmlHttp_10.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_10.setRequestHeader("Content-length", parameters.length);
     xmlHttp_10.setRequestHeader("Connection", "close");
     xmlHttp_10.send(parameters);
}

function edit_user_note(type, id, text)
{
	xmlHttp_11=ajax_http();
	
	var url= root + "includes/ajax/editUserNote.inc.php";
	var parameters='id=' + encodeURI(id) + '&text=' + encodeURI(text) + '&type=' + encodeURI(type);
	
	xmlHttp_11.onreadystatechange=function()
	{
		document.getElementById("popup_div").innerHTML=xmlHttp_11.responseText;
	}
	 xmlHttp_11.open('POST', url, true);
	 xmlHttp_11.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_11.setRequestHeader("Content-length", parameters.length);
     xmlHttp_11.setRequestHeader("Connection", "close");
     xmlHttp_11.send(parameters);
}

function add_mail_template(title, text)
{
	xmlHttp_12=ajax_http();
	
	title = clean_str(title);
	text = clean_str(text);
	
	var url= root + "includes/ajax/addMailTemplate.inc.php";
	var parameters='title=' + encodeURI(title) + '&text=' + encodeURI(text);
	
	xmlHttp_12.onreadystatechange=function()
	{
		alert("Ok!");
	}
	 xmlHttp_12.open('POST', url, true);
	 xmlHttp_12.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_12.setRequestHeader("Content-length", parameters.length);
     xmlHttp_12.setRequestHeader("Connection", "close");
     xmlHttp_12.send(parameters);
}

function use_mail_template(id)
{
	xmlHttp_13=ajax_http();
	
	var url= root + "includes/ajax/useMailTemplate.inc.php";
	var parameters='id=' + encodeURI(id);
	
	xmlHttp_13.onreadystatechange=function()
	{
		if(xmlHttp_13.readyState==4)
  		{
			document.getElementById("description").value=xmlHttp_13.responseText;
		}
	}
	 xmlHttp_13.open('POST', url, true);
	 xmlHttp_13.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_13.setRequestHeader("Content-length", parameters.length);
     xmlHttp_13.setRequestHeader("Connection", "close");
     xmlHttp_13.send(parameters);
}

function add_poem_vote(id, vote)
{
	xmlHttp_14=ajax_http();
	
	var url= root + "includes/ajax/addVotePoem.inc.php";
	var parameters="id="+ encodeURI(id) + "&vote="+ encodeURI(vote);
	
	xmlHttp_14.onreadystatechange=function()
	{
		if(xmlHttp_14.readyState==4)
  		{
			if(xmlHttp_14.responseText == 'OK')
			{
				document.getElementById("cont_vote_"+id).className='displaynone';
				add_poem_reload(id);
			}
		}
	}
	 xmlHttp_14.open('POST', url, true);
	 xmlHttp_14.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_14.setRequestHeader("Content-length", parameters.length);
     xmlHttp_14.setRequestHeader("Connection", "close");
     xmlHttp_14.send(parameters);
}

function add_fav_poem(id)
{
	xmlHttp_15=ajax_http();
	
	var url= root + "includes/ajax/addFavPoem.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_15.onreadystatechange=function()
	{
		if(xmlHttp_15.readyState==4)
  		{
			if(xmlHttp_15.responseText == 'OK')
			{
			document.getElementById("cont_fav_"+id).className='';
				document.getElementById("cont_fav_"+id).className='displaynone';
				
			}
		}
	}
	 xmlHttp_15.open('POST', url, true);
	 xmlHttp_15.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_15.setRequestHeader("Content-length", parameters.length);
     xmlHttp_15.setRequestHeader("Connection", "close");
     xmlHttp_15.send(parameters);
}

function getThisPresent(id)
{
	xmlHttp_17=ajax_http();
	
	var url= root + "includes/ajax/getThisPresent.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_17.onreadystatechange=function()
	{
		if(xmlHttp_17.readyState==4)
  		{
			if(xmlHttp_17.responseText != '')
			{
				alert(xmlHttp_17.responseText);
				window.location.reload();
			}
		}
	}
	 xmlHttp_17.open('POST', url, true);
	 xmlHttp_17.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_17.setRequestHeader("Content-length", parameters.length);
     xmlHttp_17.setRequestHeader("Connection", "close");
     xmlHttp_17.send(parameters);
}

function add_vote_reload(id)
{
	xmlHttp_18=ajax_http();
	
	var url= root + "includes/ajax/addVoteReload.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_18.onreadystatechange=function()
	{
		if(xmlHttp_18.readyState==4)
  		{
			document.getElementById("joke_percents_"+id).innerHTML=xmlHttp_18.responseText;
		}
	}
	 xmlHttp_18.open('POST', url, true);
	 xmlHttp_18.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_18.setRequestHeader("Content-length", parameters.length);
     xmlHttp_18.setRequestHeader("Connection", "close");
     xmlHttp_18.send(parameters);
}

function add_poem_reload(id)
{
	xmlHttp_19=ajax_http();
	
	var url= root + "includes/ajax/addPoemReload.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_19.onreadystatechange=function()
	{
		if(xmlHttp_19.readyState==4)
  		{
			document.getElementById("poem_percents_"+id).innerHTML=xmlHttp_19.responseText;
		}
	}
	 xmlHttp_19.open('POST', url, true);
	 xmlHttp_19.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_19.setRequestHeader("Content-length", parameters.length);
     xmlHttp_19.setRequestHeader("Connection", "close");
     xmlHttp_19.send(parameters);
}

function drop_fav_joke(id)
{
	xmlHttp_20=ajax_http();
	
	var url= root + "includes/ajax/dropFavJoke.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_20.onreadystatechange=function()
	{
		if(xmlHttp_20.readyState==4)
  		{
			document.getElementById("joke_drop_fav_"+id).className='displaynone';
		}
	}
	 xmlHttp_20.open('POST', url, true);
	 xmlHttp_20.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_20.setRequestHeader("Content-length", parameters.length);
     xmlHttp_20.setRequestHeader("Connection", "close");
     xmlHttp_20.send(parameters);
}

function drop_fav_poem(id)
{
	xmlHttp_21=ajax_http();
	
	var url= root + "includes/ajax/dropFavPoem.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_21.onreadystatechange=function()
	{
		if(xmlHttp_21.readyState==4)
  		{
			document.getElementById("poem_drop_fav_"+id).className='displaynone';
		}
	}
	 xmlHttp_21.open('POST', url, true);
	 xmlHttp_21.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_21.setRequestHeader("Content-length", parameters.length);
     xmlHttp_21.setRequestHeader("Connection", "close");
     xmlHttp_21.send(parameters);
}

function showUserComments(id, page)
{
	xmlHttp_22=ajax_http();
	
	var url= root + "includes/ajax/showUserComments.inc.php";
	var parameters="id="+ encodeURI(id) + "&page="+ encodeURI(page);
	
	xmlHttp_22.onreadystatechange=function()
	{
		if(xmlHttp_22.readyState==4)
  	{
			document.getElementById("comments_container").innerHTML=xmlHttp_22.responseText;
		}
	}
	 xmlHttp_22.open('POST', url, true);
	 xmlHttp_22.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_22.setRequestHeader("Content-length", parameters.length);
     xmlHttp_22.setRequestHeader("Connection", "close");
     xmlHttp_22.send(parameters);
}

function addInterest(title, cat_id)
{
	xmlHttp_23=ajax_http();
	
	title = clean_str(title);
	
	var url= root + "includes/ajax/addInterest.inc.php";
	var parameters="title="+ encodeURI(title) + "&cat_id="+ encodeURI(cat_id);
	
	xmlHttp_23.onreadystatechange=function()
	{
		if(xmlHttp_23.readyState==4)
  		{
			alert(xmlHttp_23.responseText);
			document.getElementById('ulikes_title').value = ulikes_default_text;
			showInterestings(cat_id);
		}
	}
	 xmlHttp_23.open('POST', url, true);
	 xmlHttp_23.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_23.setRequestHeader("Content-length", parameters.length);
     xmlHttp_23.setRequestHeader("Connection", "close");
     xmlHttp_23.send(parameters);
}

function showInterestings(cat_id)
{
	xmlHttp_24=ajax_http();
	
	var url= root + "includes/ajax/showInterestings.inc.php";
	var parameters="cat_id=" + encodeURI(cat_id);
	
	xmlHttp_24.onreadystatechange=function()
	{
		if(xmlHttp_24.readyState==4)
  		{
  			document.getElementById('ulikes_favstaff').className = 'myfavstuff';
			document.getElementById('ulikes_favstaff').innerHTML = xmlHttp_24.responseText;
		}
	}
	 xmlHttp_24.open('POST', url, true);
	 xmlHttp_24.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_24.setRequestHeader("Content-length", parameters.length);
     xmlHttp_24.setRequestHeader("Connection", "close");
     xmlHttp_24.send(parameters);
}

function dropInterest(id, cat_id)
{
	xmlHttp_25=ajax_http();
	
	var url= root + "includes/ajax/dropInterest.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_25.onreadystatechange=function()
	{
		if(xmlHttp_25.readyState==4)
  		{
			alert(xmlHttp_25.responseText);
			showInterestings(cat_id);
		}
	}
	 xmlHttp_25.open('POST', url, true);
	 xmlHttp_25.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_25.setRequestHeader("Content-length", parameters.length);
     xmlHttp_25.setRequestHeader("Connection", "close");
     xmlHttp_25.send(parameters);
}

function attachVideoToMail(id, name, msg_ok)
{
	xmlHttp_26=ajax_http();
	
	var url= root + "includes/ajax/attachVideoToMail.inc.php";
	var parameters="id="+ encodeURI(id) + "&name="+ encodeURI(name);
	
	xmlHttp_26.onreadystatechange=function()
	{
		if(xmlHttp_26.readyState==4)
  		{
  			alert(msg_ok);
		}
	}
	 xmlHttp_26.open('POST', url, true);
	 xmlHttp_26.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_26.setRequestHeader("Content-length", parameters.length);
     xmlHttp_26.setRequestHeader("Connection", "close");
     xmlHttp_26.send(parameters);
}

function addVideoToUser(id, name, vfile, msg_ok)
{
	xmlHttp_27=ajax_http();
	
	var url= root + "includes/ajax/addVideoToUser.inc.php";
	var parameters="id=" + encodeURI(id) + "&name=" + encodeURI(name) + "&vfile=" + encodeURI(vfile);
	
	xmlHttp_27.onreadystatechange=function()
	{
		if(xmlHttp_27.readyState==4)
  		{
  			alert(msg_ok);
		}
	}
	 xmlHttp_27.open('POST', url, true);
	 xmlHttp_27.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_27.setRequestHeader("Content-length", parameters.length);
     xmlHttp_27.setRequestHeader("Connection", "close");
     xmlHttp_27.send(parameters);
}

function galleryUserShVotingBar(id)
{
	xmlHttp_28=ajax_http();
	
	var url= root + "includes/ajax/galleryUserShVotingBar.inc.php";
	var parameters="id=" + encodeURI(id);
	
	xmlHttp_28.onreadystatechange=function()
	{
		if(xmlHttp_28.readyState==4)
  		{
  			document.getElementById('votingcont').innerHTML = xmlHttp_28.responseText;
		}
	}
	 xmlHttp_28.open('POST', url, true);
	 xmlHttp_28.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_28.setRequestHeader("Content-length", parameters.length);
     xmlHttp_28.setRequestHeader("Connection", "close");
     xmlHttp_28.send(parameters);
}

function rateUserPicture(id, vote)
{
	xmlHttp_29=ajax_http();
	
	var url= root + "includes/ajax/rateUserPicture.inc.php";
	var parameters="id=" + encodeURI(id) + "&vote=" + encodeURI(vote);
	
	xmlHttp_29.onreadystatechange=function()
	{
		if(xmlHttp_29.readyState==4)
  		{
  			galleryUserShVotingBar(id);
  			alert(xmlHttp_29.responseText);
		}
	}
	 xmlHttp_29.open('POST', url, true);
	 xmlHttp_29.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_29.setRequestHeader("Content-length", parameters.length);
     xmlHttp_29.setRequestHeader("Connection", "close");
     xmlHttp_29.send(parameters);
}

function refreshPopup()
{
	check_for_popup();
	setTimeout('refreshPopup()', 15000);
}

refreshPopup();

function ismaxlength(obj)
{
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	obj.value=obj.value.substring(0,mlength)
}


function view(tab, all)
{
	for (var i=1; i<=all; i++) 
	{
		document.getElementById("tab"+i).className = 'active_not';
		document.getElementById("cont"+i).className = 'displaynone';
	}
	document.getElementById('tab'+tab).className = 'active';
	document.getElementById('cont'+tab).className = 'displaynone_not';

}
function view2(tab, all)
{
	for (var i=1; i<=all; i++) 
	{
		document.getElementById("tab2"+i).className = 'active_not';
		document.getElementById("cont2"+i).className = 'displaynone';
	}
	document.getElementById('tab2'+tab).className = 'active';
	document.getElementById('cont2'+tab).className = 'displaynone_not';

}

function result_tabs(tab, all)
{
	for (var i=1; i<=all; i++) 
	{
		document.getElementById("tab"+i).className = 'tab';
	}
	document.getElementById('tab'+tab).className = 'tab-o';
}

var status = 0;  
function changeCheckboxChecked()
{
	var checks = document.getElementsByTagName("input");
	if (status == 0)     //If the boxes are not checked
	{
		for (var i = 0; i <= checks.length -1; i++)
		{
			if (checks[i].type == "checkbox")
			{
				checks[i].checked = true;
			}
		}
		status = 1;     //Sets Boxes to checked status
	}
	else     //If they already are checked
	{
		for (var i = 0; i <= checks.length-1; i++)
		{
			if (checks[i].type == "checkbox")
			{
				checks[i].checked = false;
			}
		}
		status = 0;     //Sets Boxes to unchecked status
	}
}

function panic()
{
	document.getElementById('panicdiv').className = 'displaynone_not';
	document.getElementById('panicdiv').height = screen.height*2;
	document.getElementById('panicdiv').width = screen.width;
	document.getElementById('panicframe').height = screen.height*2;
	document.getElementById('panicframe').width = screen.width;
	document.getElementById('panicframe').src = 'http://google.com';
	
}

function hidepanic()
{
	document.getElementById('panicdiv').className = 'displaynone';
}

function confirmation() {
	var answer = confirm(confirm_question)
	if (answer){
		return true;
	}
	else{
		return false;
	}
}

function insertAtCursor() {

	myValue = arguments[0];
	if (arguments[1])
		myField = document.getElementById(arguments[1]);
	else
		myField = document.getElementById('description');

	if(myField.value == comments_default_text)
	{
		myField.value = myValue;
	}
	else
	{
		//IE support
		if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = myValue;
		}
	
		//MOZILLA/NETSCAPE support
		else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		myField.value = myField.value.substring(0, startPos)
		+ myValue
		+ myField.value.substring(endPos, myField.value.length);
		} else {
		myField.value += myValue;
		myField.value.select();
		}
	}

}

function showInterest(id, all)
	 {
	 		for(var i=0; i<all; i++)
	 		{
	 			document.getElementById('ulikes_a_'+i).className = '';
	 		}
	 		document.getElementById('ulikes_a_'+id).className = 'active';
	 		
	 	document.getElementById('interestId').value = id;
	 	showInterestings(id);
	}