function moveOver(){
	var boxLength = document.choiceForm.choiceBox.length;
	var selectedItem = document.choiceForm.available.selectedIndex;
	var selectedText = document.choiceForm.available.options[selectedItem].text;
	var selectedValue = document.choiceForm.available.options[selectedItem].value;
	var i;
	var isNew = true;
	if (boxLength != 0) {
	for (i = 0; i < boxLength; i++) {
	thisitem = document.choiceForm.choiceBox.options[i].text;
	if (thisitem == selectedText) {
	isNew = false;
	break;
		  }
	   }
	} 
	if (isNew) {
	newoption = new Option(selectedText, selectedValue, false, false);
	document.choiceForm.choiceBox.options[boxLength] = newoption;
	}
	document.choiceForm.available.selectedIndex=-1;
	document.choiceForm.hid.value = saveMe();
}
function removeMe() {
	var boxLength = document.choiceForm.choiceBox.length;
	arrSelected = new Array();
	var count = 0;
	for (i = 0; i < boxLength; i++) {
	if (document.choiceForm.choiceBox.options[i].selected) {
	arrSelected[count] = document.choiceForm.choiceBox.options[i].value;
	}
	count++;
	}
	var x;
	for (i = 0; i < boxLength; i++) {
	for (x = 0; x < arrSelected.length; x++) {
	if (document.choiceForm.choiceBox.options[i].value == arrSelected[x]) {
	document.choiceForm.choiceBox.options[i] = null;
	   }
	}
	boxLength = document.choiceForm.choiceBox.length;
	}
	document.choiceForm.hid.value = saveMe();
}
function removeselected(){
	var boxLength = document.choiceForm.choiceBox.length;
	arrSelected = new Array();
	var count = 0;
	for (i = 0; i < boxLength; i++) {
		arrSelected[count] = document.choiceForm.choiceBox.options[i].value;
		count++;
	}
	var x;
	for (i = 0; i < boxLength; i++) {
	for (x = 0; x < arrSelected.length; x++) {
		document.choiceForm.choiceBox.options[i] = null;
	}
		boxLength = document.choiceForm.choiceBox.length;
		document.choiceForm.hid.value = " ";
	}
}
function saveMe() {
	var strValues = "";
	var boxLength = document.choiceForm.choiceBox.length;
	var count = 0;
	if (boxLength != 0) {
	for (i = 0; i < boxLength; i++) {
	if (count == 0) {
	strValues = document.choiceForm.choiceBox.options[i].value;
	}
	else {
	strValues = strValues + " " + document.choiceForm.choiceBox.options[i].value;
	}
	count++;
	   }
	}
	return strValues;
}
max=1024;
timerID=null;
running=false;
function countChars_descriere()
{
if(document.choiceForm.continut.value.length>max)
{
document.choiceForm.continut.blur();
document.choiceForm.lungime.value =0;
alert("1024 characters only, sorry :) ");
}
else document.choiceForm.lungime.value =
max-document.choiceForm.continut.value.length;
if (document.choiceForm.lungime.value==0)
	{
	var text=document.choiceForm.continut.value
	document.choiceForm.continut.value=text.substr(0,max);
	}
}
function timerTick()
	{
	if(running)
		{
		stopTimer();
		if(navigator.appName=="Netscape")
			{
			//document.formular.Descript.blur();
			}
		startTimer();
		countChars_descriere();
		}
	}

function stopTimer()
	{
	clearTimeout(timerID);
	running=false;
	}

function startTimer()
	{
	if(!running)
		{
		running=true;
		timerID=setTimeout("timerTick()",1024);
		}
	}
