<!--
ns4 = (document.layers) ? true:false
ie4 = (document.all) ? true:false 
ng5 = (document.getElementById) ? true:false 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function conferma(intIdServizio, strServizio, pageRedirect) {
    var is_confirmed = confirm('Sei Sicuro di voler cancellare questo Record in modo Definitivo?\n\nRecord da Cancellare: ' + strServizio);
	if (is_confirmed) {
        location.href = pageRedirect + intIdServizio;
    }
}
function confermaGeneral(intIdServizio, strServizio, pageRedirect) {
    var is_confirmed = confirm(strServizio);
	if (is_confirmed) {
        location.href = pageRedirect + intIdServizio;
    }
}
function confermaSubmitSiNo(strText) {
    var is_confirmed = confirm(strText);
	if (is_confirmed) {
        return true;
    } 
	return false;
}
function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve contenere un indirizzo E-Mail valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' deve essere numerico.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
  } if (errors) alert('Si sono verificati i seguneti Errori:\n\n'+errors);
  document.MM_returnValue = (errors == '');
}

var IE = document.getElementById?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
var tempX = 0
var tempY = 0

function setDivToMouse(e) {
noCaledario()
//OFFSET
//if( typeof( window.pageYOffset ) == 'number' ) {
//	//Netscape compliant
//	var scrOfY = window.pageYOffset;
//	var scrOfX = window.pageXOffset;
//} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//	//DOM compliant
//	var scrOfY = document.body.scrollTop;
//	var scrOfX = document.body.scrollLeft;
//} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	//IE6 standards compliant mode
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario() {
  livello = document.getElementById('calendarioDiv');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}

function setDivToMouse2(e) {
noCaledario2()
//OFFSET
//if( typeof( window.pageYOffset ) == 'number' ) {
//	//Netscape compliant
//	var scrOfY = window.pageYOffset;
//	var scrOfX = window.pageXOffset;
//} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//	//DOM compliant
//	var scrOfY = document.body.scrollTop;
//	var scrOfX = document.body.scrollLeft;
//} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//	//IE6 standards compliant mode
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv2');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario2() {
  livello = document.getElementById('calendarioDiv2');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}

function setDivToMouse3(e) {
noCaledario3()
//OFFSET
//if( typeof( window.pageYOffset ) == 'number' ) {
//	//Netscape compliant
//	var scrOfY = window.pageYOffset;
//	var scrOfX = window.pageXOffset;
//} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//	//DOM compliant
//	var scrOfY = document.body.scrollTop;
//	var scrOfX = document.body.scrollLeft;
//} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//	//IE6 standards compliant mode
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv3');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario3() {
  livello = document.getElementById('calendarioDiv3');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}

function setDivToMouse4(e) {
noCaledario4()
//OFFSET
//if( typeof( window.pageYOffset ) == 'number' ) {
//	//Netscape compliant
//	var scrOfY = window.pageYOffset;
//	var scrOfX = window.pageXOffset;
//} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//	//DOM compliant
//	var scrOfY = document.body.scrollTop;
//	var scrOfX = document.body.scrollLeft;
//} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//	//IE6 standards compliant mode
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv4');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario4() {
  livello = document.getElementById('calendarioDiv4');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}

function setDivToMouse5(e) {
noCaledario5()
//OFFSET
//if( typeof( window.pageYOffset ) == 'number' ) {
//	//Netscape compliant
//	var scrOfY = window.pageYOffset;
//	var scrOfX = window.pageXOffset;
//} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//	//DOM compliant
//	var scrOfY = document.body.scrollTop;
//	var scrOfX = document.body.scrollLeft;
//} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//	//IE6 standards compliant mode
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv5');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario5() {
  livello = document.getElementById('calendarioDiv5');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}

function setDivToMouse6(e) {
noCaledario6()
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv6');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario6() {
  livello = document.getElementById('calendarioDiv6');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}




function setDivToMouse7(e) {
noCaledario7()
	var scrOfY = document.documentElement.scrollTop;
	var scrOfX = document.documentElement.scrollLeft;
//}

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + scrOfX
    tempY = event.clientY + scrOfY
	//tempX = event.clientX
    //tempY = event.clientY
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  livello = document.getElementById('calendarioDiv7');
  livello.style.top=tempY;
  livello.style.left=tempX;
  livello.style.visibility='visible';
  return true;
}

function noCaledario7() {
  livello = document.getElementById('calendarioDiv7');
  livello.style.top='0';
  livello.style.left='0';
  livello.style.visibility='hidden';
  return true;
}




















function finanziamentoSi() {
	document.getElementById('finanziamentoNo').style.visibility='hidden';
	document.getElementById('finanziamentoSi').style.visibility='visible';
//	document.preventivatore.finanziamento_antifurto.selectedIndex=0;
}
function finanziamentoNo() {
	document.getElementById('finanziamentoNo').style.visibility='visible';
	document.getElementById('finanziamentoSi').style.visibility='hidden';
//	document.getElementById('pacchettoDett').innerHTML='';
	document.getElementById('pacchettoDett').style.visibility='hidden';
	document.getElementById('pacchettoDett').style.padding='0px';
	document.getElementById('pacchettoDett').style.margin='0px';
}

function formNfield(strNameDiv, intQuantity) {
	var baseDiv=document.getElementById(strNameDiv);
	var tempDiv='';
	if (intQuantity>6) {intQuantity=6}
	for (ip=1; ip<=intQuantity; ip++) {
		tempDiv=tempDiv + '<tr><td colspan=\"6\"><strong>N.'+ip+':</strong> <input name=\"nomeDett'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"nomeDett'+ip+'\" size=\"70\"> &nbsp;&nbsp; <span title=\"Indica se il promoter pu&oacute; scegliere di comprare questa garanzia\">Opzionale:</span> <input name=\"radioOpz'+ip+'\" id=\"radioOpz'+ip+'\" type=\"checkbox\" value=\"si\"></td></tr>';
		tempDiv=tempDiv + '<tr><td width=\"20\">&nbsp;</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 1</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 2</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 3</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 4</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 5</td></tr>';
		tempDiv=tempDiv + '<tr>';
		tempDiv=tempDiv + '<td width=\"20\">&nbsp;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a1'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a1'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a2'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a2'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a3'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a3'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a4'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a4'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a5'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a5'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '</tr>';
		tempDiv=tempDiv + '<tr><td colspan=\"6\"><hr style=\"height: 1px; color: #999999;\"></td></tr>';
	}
	if (intQuantity>0) {
		baseDiv.innerHTML='<table border=\"0\" width=\"100%\">'+tempDiv+'</table>';
	} else {
		baseDiv.innerHTML='';
	}
}


function fattureNrecord(strNameDiv, intQuantity) {
	var baseDiv=document.getElementById(strNameDiv);
	var tempDiv='';
//	if (intQuantity>6) {intQuantity=6}
	for (ip=1; ip<=intQuantity; ip++) {
/*		tempDiv=tempDiv + '<tr><td colspan=\"6\"><strong>N.'+ip+':</strong> <input name=\"nomeDett'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"nomeDett'+ip+'\" size=\"70\"> &nbsp;&nbsp; <span title=\"Indica se il promoter pu&oacute; scegliere di comprare questa garanzia\">Opzionale:</span> <input name=\"radioOpz'+ip+'\" id=\"radioOpz'+ip+'\" type=\"checkbox\" value=\"si\"></td></tr>';
		tempDiv=tempDiv + '<tr><td width=\"20\">&nbsp;</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 1</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 2</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 3</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 4</td><td align=\"left\" class=\"new-intestazione-cella-interna\">Anno 5</td></tr>';
		tempDiv=tempDiv + '<tr>';
		tempDiv=tempDiv + '<td width=\"20\">&nbsp;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a1'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a1'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a2'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a2'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a3'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a3'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a4'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a4'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '<td align=\"left\" class=\"new_tabellaPrimaria\"><input name=\"prezzoDett_a5'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"prezzoDett_a5'+ip+'\" size=\"10\">&nbsp;&euro;</td>';
		tempDiv=tempDiv + '</tr>';
		tempDiv=tempDiv + '<tr><td colspan=\"6\"><hr style=\"height: 1px; color: #999999;\"></td></tr>';*/
		tempDiv=tempDiv + '<tr><td><strong>Data:</strong></td><td align=\"left\"><input name=\"data_FD'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"data_FD'+ip+'\" size=\"10\"></td></tr>';
		tempDiv=tempDiv + '<tr><td><strong>N.Polizza:</strong></td><td align=\"left\"><input name=\"nPolizza_FD'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"nPolizza_FD'+ip+'\" size=\"15\"></td></tr>';
		tempDiv=tempDiv + '<tr><td><strong>Descrizione:</strong></td><td align=\"left\"><input name=\"descrizione_FD'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"descrizione_FD'+ip+'\" size=\"30\"></td></tr>';
		tempDiv=tempDiv + '<tr><td><strong>&euro;/unit.:</strong></td><td align=\"left\"><input name=\"euroUnit_FD'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"euroUnit_FD'+ip+'\" size=\"15\">&nbsp;&euro;</td></tr>';
		tempDiv=tempDiv + '<tr><td><strong>EURO:</strong></td><td align=\"left\"><input name=\"euro_FD'+ip+'\" type=\"text\" class=\"new_inputText\" id=\"euro_FD'+ip+'\" size=\"15">&nbsp;&euro;</td></tr>';
		tempDiv=tempDiv + '<tr><td><strong>Con Ritenuta?</strong></td><td align=\"left\"><input name=\"ritenutaaccount_FD'+ip+'\" type=\"checkbox\" class=\"new_inputText\" id=\"ritenutaaccount_FD'+ip+'\" value=\"si\"></td></tr>';
		tempDiv=tempDiv + '<tr><td colspan=\"2\"><hr style=\"height: 1px; color: #999999;\"></td></tr>';
	}
	if (intQuantity>0) {
		baseDiv.innerHTML='<table border=\"0\" width=\"100%\">'+tempDiv+'</table>';
	} else {
		baseDiv.innerHTML='';
	}
}

function checkRadioFormSelectedOne (strCampo) {
	var repeat=true;
	var ccTemp=true;
	for (cci=0; cci<eval(strCampo).length; cci++) {
		if(repeat==true) {
			if(eval(strCampo+'['+cci+'].checked')==true){ccTemp=true;repeat=false;}else{ccTemp=false;repeat=true;}
		}
	}
	if(ccTemp==false){alert('Selezione un metodo di Pagamento!');}
	return ccTemp;
}

//-->