<!-- Start AGGIUNTA SITO AI PREFERITI
function addbookmark(){
if (window.sidebar) {
    // versione FF
    window.sidebar.addPanel(document.title, location.href,'');
} else if( window.external ) {
    // versione IE
    window.external.AddFavorite( location.href, document.title); 
}
} 

function controllo_campo_num(campo,tipo)
{
 var lunghezza = campo.value.length;
 var codascii=campo.value.charCodeAt(lunghezza -1);
 if ( codascii==46 || ( codascii>=48 && codascii<=57) )
 	return true;
 else
 	document.getElementById(tipo).value = campo.value.substr(0,lunghezza -1);
}

	function calcola_rimborso(ruolo,cat,distanza){
		if(ruolo=='AE')
			if(cat=='ESO'){
				if(distanza<=50)
					return 19;
				else if(distanza<=100)
					return 25;
				else if(distanza<=150)
					return 30;
				else if(distanza<=200)
					return 37;	
			}
			
			else if(cat=='GIP' || cat=='GIR' || cat=='GIB' || cat=='GIN' || cat=='ALP' || cat=='ALB' || cat=='ALR' || cat=='ALN'
				|| cat=='5AR' || cat=='5GR'  ){
				if(distanza<=25)
					return 24;
				else if(distanza<=50)
					return 34;
				else if(distanza<=75)
					return 39;
				else if(distanza<=100)
					return 50;
				else if(distanza<=150)
					return 55;
				else if(distanza<=200)
					return 66;
				else if(distanza<=250)
					return 76;
				else if(distanza<=300)
					return 86;																									
						
			}
			
			else{
				if(distanza<=25)
					return 27;
				else if(distanza<=50)
					return 43;
				else if(distanza<=75)
					return 53;
				else if(distanza<=100)
					return 61;
				else if(distanza<=150)
					return 69;
				else if(distanza<=200)
					return 81;
				else if(distanza<=250)
					return 94;
				else if(distanza<=300)
					return 105;						
			}
		else if(ruolo=='AA'){
				if(distanza<=25)
					return 25;
				else if(distanza<=50)
					return 43;
				else if(distanza<=75)
					return 48;
				else if(distanza<=100)
					return 53;
				else if(distanza<=150)
					return 56;
				else if(distanza<=200)
					return 63;
				else if(distanza<=250)
					return 73;
				else if(distanza<=300)
					return 83;	
		}
		
		else if(ruolo=='OA' || ruolo=='OT'){
				if(distanza<=75)
					return 27;
				else if(distanza<=100)
					return 30;
				else if(distanza<=125)
					return 40;
				else if(distanza<=150)
					return 45;
				else if(distanza<=175)
					return 50;
				else if(distanza<=200)
					return 55;						
		}							
		
		return '';
	}
	
	function inserisci_rimborso(){
		var c=document.forms['partita'].cat_select.value;
		var r=document.forms['partita'].ruolo_select.value;
		var distanza=dijit.byId("km").attr("value");
		dijit.byId("rimborso").attr("value",calcola_rimborso(r,c,distanza));
	}


<!--
var NS = (document.getElementById &&! document.all)
var IE = (document.getElementById || document.all)
var n   = 0

function findInPage(str){
var txt, i, found
if (str == ""){
return false
}
// Find next occurance of the given string on the page, wrap around to the start of the page if necessary.

if (NS) { // Look for match starting at the current point. If not found, rewind back to the first match.
if (!window.find(str)){
while(window.find(str, false, true))
n++
}
else{
n++
}

if (n == 0){ // If not found in either direction, give message.
alert("Not found.")
}

}

if (IE) {
txt = document.body.createTextRange()
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { // Find the nth match from the top of the page.
txt.moveStart("character", 1)
txt.moveEnd("textedit")
}

if (found){ // If found, mark it and scroll it into view.
txt.moveStart("character", -1)
txt.findText(str)
txt.select()
txt.scrollIntoView()
n++
}
else{ // Otherwise, start over at the top of the page and find first match.
if (n > 0) {
n = 0
findInPage(str)
}
else{  // Not found anywhere, give message.
alert("Selected Word Not found.")
}

}
}
return false
}
// -->


