// JavaScript Document
 function menu(nomeDiv,azione,menuPrincipale){
      document.getElementById(nomeDiv).style.display=azione;
	  
	  
		
  }
  
  function coloraRigaSottoMenu(riga,azione){
	  var coloreOn="#CCCCCC";
	  var coloreOff="#FFFFFF";
	  
	  if(azione=="on")
	  	riga.style.backgroundColor=coloreOn;
	  else
	  	riga.style.backgroundColor=coloreOff;
	   
  }
  
  function dimensioneSchermo(){
     
      if(screen.Height==1024)
        document.getElementById("corpo").style.height=761;
      else if(screen.Height==960)
        document.getElementById("corpo").style.height=697;
      else if(screen.Height==768)
        document.getElementById("corpo").style.height=505;
  }
  
  function visFoto(path){
     window.open('visFoto.asp?immagine='+path,'POPFOTO','top=0,left,width=300,height=300,resizable=yes,scrollbars=no,status=no')
  }
  
  function coloraRiga(riga,colore){
    riga.className=colore;
   
  }
  
  function calendario(idDiv, e)
  {
  
  
        xPos = (document.layers) ? e.pageX : ((document.all) ? event.x : e.clientX);
	    yPos = (document.layers) ? e.pageY : ((document.all) ? event.y : e.clientY);
	    _top=yPos;
	    _left=xPos+6;
	    
	    document.getElementById(idDiv).style.top=_top + "px";
	    document.getElementById(idDiv).style.left=_left + "px";
	    
	    if(document.getElementById(idDiv).style.display=="block")
	        document.getElementById(idDiv).style.display="none";
	    else
	     document.getElementById(idDiv).style.display="block";
	    
  }
  
  function coloraRiga(riga,colore){
    riga.className=colore;
   
  }
  
  function scriviGrafico(nFile)
       { 
       //scrive il div del grafico
       
           if(nFile=="")
             {
                //document.getElementById("flashcontent").innerHTML="";
             }
             else
             {
              var so = new SWFObject("../grafici/Grafico_2/swf/amline.swf", "amline", "950", "750", "8", "#FFFFFF");
               so.addVariable("path", "../grafici/Grafico_2/swf/");
               so.addVariable("settings_file", escape("../grafici/Grafico_2/xml/amline_settings.xml"));
               
               so.addVariable("data_file", escape("../grafici/Grafico_2/xml/" + nFile));
               so.addVariable("preloader_color", "#000000");
               so.write("flashcontent");
             }
          

           
       }
       
     function apriProtocolloIntroduttivo(idPaziente, idRicerca){
      //Apre la popUp per visualizzare il protocollo introduttivo
      
      window.open('../questionarioIntroduttivo.aspx?p='+idPaziente+'&r='+idRicerca,'PopUpQuestIntroduttivo','top=0,left=0,width=900,height=700,scrollbars=yes,resizable=yes')
      return false;
   } 
   
   function visSchedaUtenteFormazione(id){
    window.open('schedaUtente.aspx?id='+id,'popSchedaUtente','top=25,left=150,width=550,height=450,scrollbars=no,resizable=no');
    return false;
   }
   
   
    function fotoGrande(x,larghezza,altezza){
	xtop = ((screen.height - altezza) /2);
	xleft = ((screen.width - larghezza) /2);
	xaltezza = parseInt(altezza)+25;
	xlarghezza = larghezza;
	
	
	xtools="top="+ xtop +",left="+ xleft +"toolbar=no,"
	xtools+="location=no,directories=no,status=no,menubar=no,"
	xtools+="scrollbars=no,resizable=no,copyhistory=no,width="+ xlarghezza +",height="+ xaltezza;
	
	win = window.open('','',xtools);
	
	Html='<html>';
	Html+='<head>';
	Html+='<title>FOTO</title>';
	Html+='<style type="text/css">';
	Html+='html,body {margin:0;}';
	Html+='body {font:11px Arial; color:#000000;}';
	Html+='a {color:#483D8B;text-decoration:none;font-weight:bold;}';
	Html+='a:hover {color:#000000;text-decoration:none;font-weight:bold;}';
	Html+='</style>';
	Html+='</head>';
	Html+='<body bgcolor="#f5f5f5" onload="window.self.focus();">';
	Html+='<div align="center"><img src="'+ x +'" alt="" border=""><br><div style="margin-top:5px;">';
	Html+='<a href="#" onclick="window.self.close();">&#149; Chiudi &#149;</a></div></div></body></html>';
	
	win.document.write(Html);
	win.focus();

	return false;
}    

	function allegato (nome)
	{
		window.open(nome,'Allegato','scrollbars=no,resizable=no');
		
		return false;
	}
