/*
* Gestione degli appunti
* utilizzo un iframe su parent che si chiama copysaver
* copysaver chiama blocconote.php con alcuni parametri, in base a questi
* viene salvato o prelevato un appunto
* ad esempio
* copysaver.php=mod=add&nota=ciao aggiunge un elemento ciao
* e come body ha un javascript che aggiorna la variabile appunti
*/

var notes = new Array();


function aggiungi_nota(testo)
{
	document.getElementById('copysaver').setAttribute('src','blocconote.php?mod=add&nota='+urlencode(testo));
	BNs.push(testo);
	return false;
}

function update_note()
{
	document.getElementById('pref_count').innerHTML  = BNs.length;
}

function carica_note(note)
{
 notes = note;
 update_note();
}

/*
* cosa ci fa qua
*/
function urlencode(str) {
str = escape(str);
str = str.replace('+', '%2B');
str = str.replace('%20', '+');
str = str.replace('*', '%2A');
str = str.replace('/', '%2F');
str = str.replace('@', '%40');
return str;
}
