// JavaScript Document


 
function imgChange( id, new_img )
  {
    element = document.getElementById(id);
    if(element)
      element.src = new_img ;
/*
per usarla
<img id="immagine" onmouseover="imgChange('immagine', '../tts_web/images/mail_out.png')"  onmouseout="imgChange('immagine', '../tts_web/images/product2.png')" src="../tts_web/images/product2.png" width="32" height="32" />
 */
 }

function cambia_classe( id, newclass )
{
	element = document.getElementById(id);
	if(element)
    element.className = newclass ;
	/*per usare questa funzione basta scrivere nel tag
 	onmouseover="cambia_classe('caption', 'classe1')"
   	onmouseout="cambia_classe('caption', 'classe2')"*/
}

function check_browser()	
{
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
		{ 
		 return 'N';
		}
	 if (browserName=="Microsoft Internet Explorer")
		 {
		  return 'E';
		 }
		  return 'altro';
}

function apri_area_old( targetId ){
 if (document.getElementById){
		target = document.getElementById( targetId );
			if (target.style.display == "none"){
				if (check_browser() == "E") 
				{
					target.style.display = "block";//ci sono sia block che table-row perche explorer non capisce table row mentre firefox per block intende non tutta la riga
				}else
				{
					target.style.display = "table-row";
				}
			} else {
				target.style.display = "none";

			}
	}
}

/*function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}
*/

function apri_area(id){
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			//filter(("img"+id),'imgin');			
		} else {
			//filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				//filter(("img"+id),'imgin');
			} else {
				//filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				//filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

function seleziona(id_casella,id_riga )
{
 if (document.getElementById){
		casella = document.getElementById(id_casella);
		riga = document.getElementById(id_riga);
			if (casella.checked == true){
				riga.style.backgroundColor = "#FFFF99";
			} else {
				riga.style.backgroundColor = "#FFFFFF";

			}
	}
}
function spunta(id_casella,id_riga )
{
	casella = document.getElementById(id_casella);
	casella.checked = true;
	seleziona(id_casella,id_riga );
}

function apri_upload($url)
{
	finestra = window.open ($url, "upload","menubar=no,status=yes,scrollbars=yes,width=630,height=400,toolbar=no,resizable=yes");
	//finestra.moveTo(0,0);
}

function Chiudi(){

self.close()
}


// -->
