﻿<!-- DATA -->
<!-- hide from old browsers
  function GetDay(intDay){
    var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                         "Thursday", "Friday", "Saturday")
    return DayArray[intDay]
    }

  function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
    }
  function getDateStrWithDOW(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetDay(today.getDay()) + ", "
    todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
    }
//-->
<!-- DATA -->

<!--  STAMPA LA PAGINA -->

	<!--
	function stampaPagina(lname) {


window.print();



} 
//--> 
<!--  STAMPA LA PAGINA -->
 
 
 
 
 
 <!-- **************     div risultati   **************  -->
        
        <!-- javascript per ordinare i contenuti -->

            currentCol = 0
            previousCol = -1

            function CompareAlpha(a, b) {
                if (a[currentCol] < b[currentCol]) { return -1; }
                if (a[currentCol] > b[currentCol]) { return 1; }
                return 0;
            }

            function CompareAlphaIgnore(a, b) {
                strA = a[currentCol].toLowerCase();
                strB = b[currentCol].toLowerCase();
				
                if (strA < strB) { return -1; }
                else {
                    if (strA > strB) { return 1; }
                    else { return 0; }
                }
            }

            function CompareAlphaImgName(a, b) {

                subStrA = a[currentCol].substring(0,a[currentCol].lastIndexOf(".gif"));
                posSlashA = subStrA.lastIndexOf("/");

                subStrB = b[currentCol].substring(0,b[currentCol].lastIndexOf(".gif"));
                posSlashB = subStrB.lastIndexOf("/");

                strA = a[currentCol].substring(posSlashA+1,a[currentCol].lastIndexOf(".gif"));
                strB = b[currentCol].substring(posSlashB+1,b[currentCol].lastIndexOf(".gif"));
				
                if (strA < strB) { return -1; }
                else {
                    if (strA > strB) { return 1; }
                    else { return 0; }
                }
            }

            function CompareDate(a, b) {
                // this one works with date formats conforming to Javascript specifications, e.g. m/d/yyyy
                datA = new Date(a[currentCol]);
                datB = new Date(b[currentCol]);
                if (datA < datB) { return -1; }
                else {
                    if (datA > datB) { return 1; }
                    else { return 0; }
                }
            }

            function CompareDateEuro(a, b) {
                // this one works with european date formats, e.g. d.m.yyyy
                strA = a[currentCol].split("/");
                strB = b[currentCol].split("/")
                datA = new Date(strA[2], strA[1], strA[0]);
                datB = new Date(strB[2], strB[1], strB[0]);
                if (datA < datB) { return -1; }
                else {
                    if (datA > datB) { return 1; }
                    else { return 0; }
                }
            }

            function CompareNumeric(a, b) {
                //window.alert ("CompareNumeric");
                numA = a[currentCol]
                numB = b[currentCol]
                if (isNaN(numA)) { return 0;}
                else {
                    if (isNaN(numB)) { return 0; }
                    else { return numA - numB; }
                }
            }


                        function CompareAlphaLinkName(a, b) {
                            upStrA = a[currentCol].toUpperCase();
                            upStrB = b[currentCol].toUpperCase();
                            strA = a[currentCol].substring(a[currentCol].indexOf(">")+1,(upStrA.indexOf("</A>")));
                            strB = b[currentCol].substring(b[currentCol].indexOf(">")+1,(upStrB.lastIndexOf("</A>")));
                            //alert("strA"+strA);
                            //alert("strB"+strB);
                                strA = strA.toLowerCase();
                                strB = strB.toLowerCase();

                            if (strA < strB) { return -1; }
                            else {
                                if (strA > strB) { return 1; }
                                else { return 0; }
                            }
                        }


            function TableSort(myTable, myCol, myType) {
                // Create a two-dimensional array and fill it with the table's content
                var mySource = document.all(myTable);
                var myRows = mySource.rows.length;
                var myCols = mySource.rows(0).cells.length;
                currentCol = myCol
                myArray = new Array(myRows)
                for (i=0; i < myRows; i++) {
                   	myArray[i] = new Array(myCols)
                    for (j=0; j < myCols; j++) {
                        if ( (document.all(myTable).rows(i).cells(j).innerHTML.toUpperCase().indexOf("<IMG")>-1) || (document.all(myTable).rows(i).cells(j).innerHTML.toUpperCase().indexOf("<A ")>-1)) {
                            var cellValue = document.all(myTable).rows(i).cells(j).innerHTML;
                            myArray[i][j] = cellValue;
                        }
                        else{
                            myArray[i][j] = document.all(myTable).rows(i).cells(j).innerText;
                        }
                    }
                }

                if (myCol == previousCol) {
                    myArray.reverse(); // clicked the same column as previously - reverse the sort
                }
                else { // clicked on a new column - sort as indicated
                    switch (myType) {
                        case "a":
                            myArray.sort(CompareAlpha);
                            break;
                        case "ai":
							myArray.sort(CompareAlphaIgnore);
                            break;
                        case "d":
                            myArray.sort(CompareDate);
                            break;
                        case "de":
                            myArray.sort(CompareDateEuro);
                            break;
                        case "n":
                            myArray.sort(CompareNumeric);
                            break;
                        case "img":
                            myArray.sort(CompareAlphaImgName);
                            break;
                      case "lnk":
                          myArray.sort(CompareAlphaLinkName);
                          break;
                        default:
                            myArray.sort()
                    }
                }

                // Re-write the table contents
                for (i=0; i < myRows; i++) {
                    for (j=0; j < myCols; j++) {
                        if ( (myArray[i][j].indexOf("<IMG")>-1) || (myArray[i][j].indexOf("<A ")>-1) ) {
                            var cellValue = myArray[i][j];
                            if (cellValue.indexOf("SelectRow")>-1) {
                                var bPos = cellValue.indexOf("SelectRow(");
                                var ePos = cellValue.lastIndexOf("');");
                                var bcellValue = cellValue.substring(0,bPos);
                                var mcellValue = "SelectRow(\'itemRow_" + i;
                                var ecellValue = cellValue.substring(ePos,cellValue.length);
                                cellValue = bcellValue + mcellValue + ecellValue;
                            }


                            //mySource.rows(i).cells(j).innerHTML = myArray[i][j]
                            mySource.rows(i).cells(j).innerHTML = cellValue;
                        }
                        else{
                            mySource.rows(i).cells(j).innerText = myArray[i][j]
                        }
                    }
                }

                previousCol = myCol; // remember the current sort column for the next pass
	              return 0;
            }

						function sortDesc(imgS){
							var ctrl = top.document.images[imgS].src.substring(top.document.images[imgS].src.lastIndexOf("\/")+1,top.document.images[imgS].src.length);
							if(ctrl == "up_down_comm.gif"){
								top.document.images[imgS].src = "/images/cm/icons/down_up_comm.gif";
								top.document.images[imgS].alt = "A-Z";
							}
							else if (ctrl == "pixel.gif"){
								top.document.images['imgTipo'].src = "/images/cm/icons/pixel.gif";
								top.document.images['imgDesc'].src = "/images/cm/icons/pixel.gif";
								top.document.images['imgForn'].src = "/images/cm/icons/pixel.gif";
								top.document.images['imgData'].src = "/images/cm/icons/pixel.gif";
								top.document.images[imgS].src = "/images/cm/icons/up_down_comm.gif";
								top.document.images[imgS].alt = "Z-A";
							}
							else{
								top.document.images[imgS].src = "/images/cm/icons/up_down_comm.gif"
								top.document.images[imgS].alt = "Z-A";
							}
						}


            function SortWrapper() {
                switch (document.all("SelectFieldToSort").value) {
                    case "0":
                        k = TableSort("inventory2", 0, "a");
                        break;
                    case "1":
                        k = TableSort("inventory2", 1, "ai");
                        break;
                    case "2":
                        k = TableSort("inventory2", 2, "d");
                        break;
                    case "3":
                        k = TableSort("inventory2", 3, "de");
                        break;
                    case "4":
                        k = TableSort("inventory2", 4, "n");
                        break;
                    default:
                        //window.alert (document.all("SelectFieldToSort").value);
                }
            }

            function MM_reloadPage(init) {  //reloads the window if Nav4 resized
              if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
                document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
              else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
            }
            MM_reloadPage(true);


            function MM_findObj(n, d) { //v4.0
              var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
                d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
              if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
              for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
              if(!x && document.getElementById) x=document.getElementById(n); return x;
            }

             function MM_showHideLayers() { //v3.0
              var i,p,v,obj,args=MM_showHideLayers.arguments;
              for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
                if (obj.style) {LayerOpened =obj.id; obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
                obj.visibility=v;if(v=="hidden")LayerOpened=""; }
            }

			LayerOpened ="";
			function ShowHideMem(){
				if(ArrayDiv){
				for(i=0;i<ArrayDiv.length;i++){
					if(document.all[ArrayDiv[i]].style.visibility=="visible"){
						LayerOpened =ArrayDiv[i];
						break;
					}
					else{
						LayerOpened ="";
					}
				}
				MM_showHideLayers(LayerOpened,'','hide')
				}
			}

			
			var GlobalSort = ""
			var oldBgColorRow = "";
            var idSelected = "";
			function SelectRow(idRow,el){
                //alert(el.outerHTML);
                if (idRow != idSelected) {
                    if (idSelected!="") UnSelectRow();
                    oldBgColorRow = document.all[idRow].style.backgroundColor;
                    document.all[idRow].style.backgroundColor = "#CFD6E1";
                    idSelected = idRow;
					GlobalSort = document.all[idSelected].innerText
                }
			}
            function UnSelectRow() {
                document.all[idSelected].style.backgroundColor = oldBgColorRow;
                idSelected = "";
            }


			function UnSelectRowSort(myTable) {
				var mySource = document.all(myTable);
				var myRows = mySource.rows.length;
					if(idSelected != ""){
						document.all[idSelected].style.backgroundColor = oldBgColorRow;
							for (i=0; i < myRows; i++) {
								var myRiga = "itemRow_" + i;
									 if(GlobalSort == document.all[myRiga].innerText){
									 	document.all[myRiga].style.backgroundColor = "#CFD6E1";
										idSelected = myRiga;
			 						}
							}
					}
			}

			function ridDiv(nomeTbl,nomeDiv){
				var Tabella = document.getElementById(nomeTbl);
				var altTabella = Tabella.offsetHeight;
					if(altTabella>399){
						document.getElementById(nomeDiv).style.height=330;
					}
				}

        <!-- *******    javascript per ordinare i contenuti     ******* -->

        <!-- *******    javascript per Drag degli attributi     ******* -->

		<!--

		//Generic Drag Script- © Dynamic Drive (www.dynamicdrive.com)
		//For full source code and terms of usage,
		//visit http://www.dynamicdrive.com

		var ie=document.all
		var ns6=document.getElementById&&!document.all

		var dragapproved=false
		var z,x,y

		function libera(){
		dragapproved = false
		}

		function move(e){
		if (dragapproved){
		z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
		z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
		return false
		}
		}

		function drags(e){
		if (!ie&&!ns6)
		return
		var firedobj=ns6? e.target : event.srcElement
		var topelement=ns6? "HTML" : "BODY"

		while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
		}

		if (firedobj.className=="drag"){
		dragapproved=true
		z=firedobj
		temp1=parseInt(z.style.left+0)
		temp2=parseInt(z.style.top+0)
		x=ns6? e.clientX: event.clientX
		y=ns6? e.clientY: event.clientY
		document.onmousemove=move
		return false
		}
		}

		//fine script drag

		function PosizioneDiv(nomediv,topdiv,leftdiv){
			document.getElementById(nomediv).style.top = topdiv;
			document.getElementById(nomediv).style.left = leftdiv;
		}




        function mandiAzione(azione,pidValue,tkAction){
            document.forms[azione].pid.value = pidValue;
            document.forms[azione].azione.value = tkAction;
            //document.all.pid.value = pidValue;
            //document.all.azione.value = tkAction;
            eval("document.forms['" + azione +"'].target='_parent'");

            var expFolders = getExpandedFolders();
            if (expFolders!='empty') document.forms[azione].expandedFolder.value = expFolders;

            eval(azione + ".submit()");
        }

        function CreaNuovo(azione,pidValue,tkAction){
            	document.all.itemTypeChi.value = document.all.itemTypesNamesRcvd.value;
                mandiAzione(azione,pidValue,tkAction);
        }

		//-->


        
<!-- inizio tabella risultati -->




	<!--
	function stampaPagina(lname) {

window.print();

} 
//--> 




	
        <!-- *******    javascript per Drag degli attributi     ******* -->

		<!--

		//Generic Drag Script- © Dynamic Drive (www.dynamicdrive.com)
		//For full source code and terms of usage,
		//visit http://www.dynamicdrive.com

		var ie=document.all
		var ns6=document.getElementById&&!document.all

		var dragapproved=false
		var z,x,y

		function libera(){
		dragapproved = false
		}

		function move(e){
		if (dragapproved){
		z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
		z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
		return false
		}
		}

		function drags(e){
		if (!ie&&!ns6)
		return
		var firedobj=ns6? e.target : event.srcElement
		var topelement=ns6? "HTML" : "BODY"

		while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
		}

		if (firedobj.className=="drag"){
		dragapproved=true
		z=firedobj
		temp1=parseInt(z.style.left+0)
		temp2=parseInt(z.style.top+0)
		x=ns6? e.clientX: event.clientX
		y=ns6? e.clientY: event.clientY
		document.onmousemove=move
		return false
		}
		}

		//fine script drag

		function PosizioneDiv(nomediv,topdiv,leftdiv){
			document.getElementById(nomediv).style.top = topdiv;
			document.getElementById(nomediv).style.left = leftdiv;
		}




        function mandiAzione(azione,pidValue,tkAction){
            document.forms[azione].pid.value = pidValue;
            document.forms[azione].azione.value = tkAction;
            //document.all.pid.value = pidValue;
            //document.all.azione.value = tkAction;
            eval("document.forms['" + azione +"'].target='_parent'");

            var expFolders = getExpandedFolders();
            if (expFolders!='empty') document.forms[azione].expandedFolder.value = expFolders;

            eval(azione + ".submit()");
        }

        function CreaNuovo(azione,pidValue,tkAction){
            	document.all.itemTypeChi.value = document.all.itemTypesNamesRcvd.value;
                mandiAzione(azione,pidValue,tkAction);
        }

		//-->
	

	
	
	

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed = 1;
var cache= 2;


function initialize()
{
	if (document.getElementById){
		dataobj=document.getElementById("datacontainer")
		if (dataobj.style.pixelTop)
			dataobj.style.pixelTop = 5
		else
			dataobj.style.top = 5

		thelength=dataobj.offsetHeight
		scrolltest()
	}
	else		
		if(document.layers)
		{
			return;
		}
		else 
		{
			if(document.all){
				dataobj=document.all.datacontainer
				if (dataobj.style.pixelTop)
					dataobj.style.pixelTop = 5
				else
					dataobj.style.top = 5
					thelength=dataobj.offsetHeight
				scrolltest()
			}
		}

}

function scrolltest(){
	if(document.layers){
		return;
	}
	else{
		if (dataobj.style.pixelTop)
			{
			dataobj.style.pixelTop=parseInt(dataobj.style.pixelTop)-scrollspeed 
			if (parseInt(dataobj.style.pixelTop)<=thelength*(-1))
			{
				dataobj.style.pixelTop=5
				}
			}	
		else
			{
			dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed 
			if (parseInt(dataobj.style.top)<=thelength*(-1))
			{
				dataobj.style.top=5
				}
			}	
	}
	setTimeout("scrolltest()",40)
}

function reload_document()
{
	if(document.getElementById && document.all)
		document.location.reload();
}


