	var number=0;
	function setnum(num){
		number=num;
	}
	function show(nume){
		for(i=1;i<=number;i++){
			document.getElementById('selectat'+i).style.display="none";
		}
		document.getElementById('selectat'+nume).style.display="block";
	}
	function highlight(who){
		who.style.border='1px solid #DDDDDD';
	}
	function dehighlight(who){
		who.style.border='1px solid #FFFFFF';
	}

	var arr_tag_inchide=new Array();
	var arr_obiecte=new Array();
	var arr_old_value=new Array();
	var i=0;
	var obiectcurent=null;
	var old_value="";
	var saved_destination=null;
	
	function trimite(){
		while(arr_obiecte.length!=0){
			obiectcurent=arr_obiecte.pop();
			old_value=arr_old_value.pop();
			obiectcurent.value=old_value;
			tagcurent=arr_tag_inchide.pop();
			document.getElementById(saved_destination).value+=tagcurent;
		}
		return true;
	}

	function aa(cine,destination,start,inchide){
		var tagcurent="";
		saved_destination=destination;
		if(cine.value.charAt([cine.value.length-1])=="*"){
			do{
				obiectcurent=arr_obiecte.pop();
				old_value=arr_old_value.pop();
				obiectcurent.value=old_value;
				tagcurent=arr_tag_inchide.pop();
				document.getElementById(destination).value+=tagcurent;
			}while((tagcurent!=inchide)&&(arr_obiecte.length!=0))
		}
		else{
			arr_tag_inchide.push(inchide);
			arr_obiecte.push(cine);
			arr_old_value.push(cine.value);
			cine.value+="*";
			document.getElementById(destination).value+=start;
		}
		document.getElementById(destination).focus();
	}
	
	function Tip(id,newtext){
		var old = document.getElementById(id).firstChild;
		var txt = document.createTextNode(newtext);
		document.getElementById(id).replaceChild(txt, old);
	}
