<!--
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
parm= 0
dom = 0
// alert(navigator.appVersion)
// alert(navigator.appVersion.indexOf("MSIE 6"))
if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf("MSIE 6") != -1) {dom = 1}

schermo = screen.height
     // per il movimento
x = 1

function getRefToDiv(divID) {
     if( document.layers ) { //Netscape layers
         return document.layers[divID]; }
     if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
         return document.getElementById(divID); }
     if( document.all ) { //Proprietary DOM; IE4
         return document.all[divID]; }
     if( document[divID] ) { //Netscape alternative
         return document[divID]; }
     return false;
 }
 

function init() {

	if (n)  {
          block = document.LayerM;
          layerRef = 'document.layers';

          max = -200;
          min = 290}

	if (ie)  {  
          block = LayerM.style;
          layerRef = 'document.all';
					/*
          if(schermo < 768) {  max = "-390"; min = "310"}
                       else { if(schermo < 1024) { max = "-390";  min = "500"}
                           else { max = "-390";  min = "750"} }
            */
						max= 390
						min = schermo - 280
						//alert(min)
						 }

	if (dom)  {  
      // qui mozilla e firefox e ie
          block  = document.getElementById('LayerM').style
          layerRef = 'document.getElementById';
  /*   
          if(schermo < 768) {  max = "-390"; min = "310"}
                       else { if(schermo < 1024) { max = "-390";  min = "500"}
                           else { max = "-390";  min = "750"} }
*/
           max= 390
						min = schermo - 280
						//alert(min) 
						}
						
      block.ypos = parseInt(block.top)
	block.active = 0

      //alert(min+'min-max'+max)
    }


function inizia(tipo) {block.active=1;
                       parm=0;
                       if (tipo == 'su') { su() } else { giu() }
                       }

function finisci() {block.active=0;
                    parm=0;
                   }

function giu() {
  //alert(block.active)
	myReference = getRefToDiv('Sotto');
  myReference = myReference.style
  sotto = myReference.top
	sotto = Number(sotto.substr(0,sotto.length-2)) //toglie 'px'
	//alert('Sotto= '+sotto)
	min = sotto - 30  // 20 = altezza freccia 10 = un po' di distanza
	if (block.active) {parm = parm + 1
               if (parm < 10) {count = 10} else {count+=1}
               numtop = Number(block.top.substr(0,block.top.length-2)) //toglie 'px'
							 if (numtop >= min) {block.active = 0;
                                    block.top=min // forza inizio se troppo veloce
							                    	}
        	            else {block.ypos += count
		                        block.top = block.ypos}
                            setTimeout("giu()",30)
	                          }
              }

function su() { parm = parm + 1
                if (parm < 10) {count = 10} else {count+=1}
                max = -(posfr-80) // posizione freccia in giu'
								//alert('max ' + max)
								//alert(block.active)
	              if (block.active) {//alert(block.active)
                         numtop = block.top.substr(0,block.top.length-2) //toglie 'px'
												 //alert(numtop)
                         if (numtop <= max) {block.active = 0;
                                                 block.top=max // forza fine se troppo veloce
								}
	                     else {block.ypos -= count
                                 block.top = block.ypos}
	                   setTimeout("su()",30)
	                            } 
                   }

function act(numlay) {
             if (document.images) {
//lay = 'ST'+numlay
//eval(layerRef + '("' + lay + '").style.color = "#00ff00"')
lay = 'TXT'+numlay
// Con con IE manda a capo il testo ogni volta che incontra un blank
eval(layerRef + '("' + lay + '").style.visibility= "hidden"')
lay = 'FAN'+numlay
eval(layerRef + '("' + lay + '").style.visibility= "visible"')
	}
        }

function inact(numlay) {
	if (document.images) {
//lay = 'ST'+numlay
//eval(layerRef + '("' + lay + '").style.color = "#FF0000"')
lay = 'TXT'+numlay
eval(layerRef + '("' + lay + '").style.visibility= "visible"')
lay = 'FAN'+numlay
eval(layerRef + '("' + lay + '").style.visibility= "hidden"')
			}
}

function loadFrames(ling,indirizzo,dir,sottocartella) {
 param_totale = document.location.search.substring(1)
  //alert(param_totale)
  page1 = ''
  if (indirizzo == 'no') {parm = '0'} 
           else {parm = '1'}            

  page2 = 'Cartelle/Elenco_cartelle_unico_con_tabella.asp?lang='+ling+'&num='+parm +'&cart='+dir 
  eval("parent.destra.location='"+page2+"'");
  //alert(page2)
  if (sottocartella == '1') {page1 = 'Elenco_sottocartelle_con_tabella.asp?'+param_totale+'&sottocart='+dir
                           parm = '1'
													 //alert(page1)
													  eval("parent.sinistra.location='"+page1+"'");
		                 }

                                       }
// End -->

