// JavaScript Document



function invia_mail(indirizzo)
{
	window.location="mailto:?Subject="+document.title+"&Body='"+encodeURIComponent(indirizzo)+"'";
}

function printit(){
if (window.print) {
window.print() ;
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}

function invia_form()
	{
		document.main_form.submit();
	}
/*function azione(tipo_azione,invia)
{
	if (tipo_azione=='delete') 
	{
		var risposta=confirm('sei sicuro di voler <? if($_GET['vd_del']==-1){echo "ripristinare";}else{echo "eliminare";} ?> i record selezionati?');
		if (risposta==true) 
		{
			document.main_form.tipo_azione.value = tipo_azione;
			if(invia!=0){invia_form();}//il controllo della variabile invia serve quando ho 
		}
	}else
	{
			document.main_form.tipo_azione.value = tipo_azione;
			if(invia!=0){invia_form();}		
	}
}*/
 
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( 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 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()
}

// -->
