<!--

var selezionato = '';

function onmouseover_classi(questo) {
	questo.style.background = '#7aa1e2';
	if(questo.value == questo.name) return;
	questo.value = questo.name; 
	questo.focus();
	//insert_comment_xmlhttprequest(questo.name,document.form_commenti.commento.value);
}

function onmouseout_classi(questo) {
	if(selezionato == questo.name) return; 
	questo.style.background = '#fff';
}

function click_classi(class_name) {
	if(document.getElementById(selezionato) && selezionato != class_name)
		document.getElementById(selezionato).style.background = '#fff';
	selezionato = class_name;
	show_table_comment_xmlhttprequest(class_name);
	/*
	document.form_commenti.commento.value = trim(document.form_commenti.commento.value);
	if(trim(document.form_commenti.commento.value) == '')
		select_comment_xmlhttprequest(class_name);
	else
		insert_comment_xmlhttprequest(class_name,document.form_commenti.commento.value);
	
	document.form_commenti.commento.focus();
	*/
}

function click_edit(k, comm_totali, nome_classe) {
	for(i=0; i<comm_totali; i++) {
		document.getElementById('confirm_'+i).style.display = 'none';
		document.getElementById(nome_classe+'_'+i).readOnly = true;
		document.getElementById(nome_classe+'_'+i).value = document.getElementById(nome_classe+'_hidden_'+i).value;
		document.getElementById(nome_classe+'_'+i).style.border = '0px solid #bbbbbb';
		document.getElementById(nome_classe+'_'+i).style.background = 'transparent';
		document.getElementById('edit_'+i).style.display = 'block';
	}
	document.getElementById('edit_'+k).style.display = 'none';
	document.getElementById(nome_classe+'_'+k).readOnly = false;
	document.getElementById(nome_classe+'_'+k).style.border = '1px solid #bbbbbb';
	document.getElementById(nome_classe+'_'+k).style.background = '#fff';
	document.getElementById('confirm_'+k).style.display = 'block';
	document.getElementById(nome_classe+'_'+k).focus();
}

function click_confirm(nome_classe, commento_originale, nuovo_commento) {
	modify_comment_xmlhttprequest(nome_classe, commento_originale, nuovo_commento.value);
}

function click_delete(nome_classe, commento) {
	remove_comment_xmlhttprequest(nome_classe,commento);
}

function click_chiudi_commenti () {
	document.getElementById('div_area_info').style.display = 'none';
	document.getElementById('commenti').style.display = 'none';
	if(document.getElementById(selezionato))
		document.getElementById(selezionato).style.background = '#fff';
	selezionato = '';
}


/**
*
* Javascript trim, ltrim, rtrim
* http://www.webtoolkit.info/
*
*
**/

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
//-->
