   var elem = "TR";
   var rClick;
   var rClick2;
   dom = (document.getElementById)? document.getElementById :(document.all)? document.all : document;
   //CID="C125";
   CID="0";
   CIDSX="F0";
function valu1(ID) {
CIDSX=ID;

}

function valu2(ID) {
CID=ID;

}

function risultato() {

alert("risultato = "+CIDSX+"-"+CID);
}
 window.onload = function(){
 load();
  if(document.getElementsByTagName){
   var el = document.getElementsByTagName(elem);
 
 
    for(var i=0; i<el.length; i++){
     
     if(el[i].childNodes[0].tagName != "TH"
     && el[i].parentNode.parentNode.className.indexOf("tab2") != -1){
     if(i%2 == 1){
      el[i].className = "on2";
      el[i].oldClassName = "on2";
      el[i].onmouseout  = function(){
	     this.className = "on2";
      }
    } else {
      el[i].className = "off2";
      el[i].oldClassName = "off2";
      el[i].onmouseout  = function(){
	     this.className = "off2";
      }
    }
      el[i].onmouseover = function(){
	     if(this.className == this.oldClassName)
	       {this.className = "hover2";}
      }
      el[i].onclick = function(){
        if(rClick2){
        rClick2.className=rClick2.oldClassName;
        rClick2.onmouseout = function(){this.className = this.oldClassName};
       }
        this.className = "click2";
        rClick2 = this;
        this.onmouseout = function(){return true};
       }
    }
  }
 }

  if(document.getElementsByTagName){
   var el = document.getElementsByTagName(elem);
 
    for(var i=0; i<el.length; i++){
     
     if(el[i].childNodes[0].tagName != "TH"
     && el[i].parentNode.parentNode.className.indexOf("tbl") != -1){
     if(i%2 == 1){
      el[i].className = "on";
      el[i].oldClassName = "on";
      el[i].onmouseout  = function(){
	     this.className = "on";
      }
    } else {
      el[i].className = "off";
      el[i].oldClassName = "off";
      el[i].onmouseout  = function(){
	     this.className = "off";
      }
    }
      el[i].onmouseover = function(){
	     if(this.className == this.oldClassName)
	       {this.className = "hover";}
      }
      el[i].onclick = function(){
       if(rClick){
        rClick.className=rClick.oldClassName;
        rClick.onmouseout = function(){this.className = this.oldClassName};
       }
        this.className = "click";
        rClick = this;
        this.onmouseout = function(){return true};
       }
    }
  }
 }

}  
 //****

function invia() {
var ta

nn = /(\d+)/;
nn.exec(CIDSX);


var valore1= RegExp.$1;
nn.exec(CID);
var valore2= RegExp.$1;

ff= /(\D+)/;
ff.exec(CID);
var valore3= RegExp.$1;

valore3=valore3.replace("'","_")
valore3=valore3.replace("/","_")
valore3=valore3.replace(/\ /g,"_")


if (valore3.indexOf("#")==-1) { 
    var indirizzo='index.asp?'+valore3+'='+valore2

}else
{
var avalore=valore3.split("#");
avalore[1]=avalore[1].toLowerCase();

    var indirizzo=''+avalore[1]+'/'
  } 


if (valore3 != '0' && valore3 != 'invia'){
document.forms[0].action=indirizzo
document.forms[0].submit()
}else{
alert("Seleziona prima una località")
}

	}

function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}

