//CHANGE TAB
function tab(num) {
  for (i=1;i<128;i++) {
    divid = 'div'+i;
    if (document.getElementById(divid)) {
      if (i==num)   {
         document.getElementById(divid).className = 'usermodabos dspblock';
      }
      else {
        document.getElementById(divid).className = 'usermodabos dspnone';
      }
    }
    else continue;
  }
}
function tabinpt(num) {
  for (i=1;i<128;i++) {
    divid = 'div'+i;
	spanid = 'span'+i;
    if (document.getElementById(divid)) {
      if (i==num)   {
         document.getElementById(divid).className = 'usermodabos dspblock';
		 document.getElementById(spanid).className = 'bolder boldcolorap';
      }
      else {
        document.getElementById(divid).className = 'usermodabos dspnone';
		document.getElementById(spanid).className = 'bolder';
      }
    }
    else continue;
  }
}
//end
//limit selects chechbox
function chkcontrol(j,limitch) {
	var total=0; limitch;
	for(var i=0; i < document.form1.elements.length; i++){
		if(document.form1.elements[i].checked){total =total +1;}
	}
	//alert("total"+total+"\n");
	//alert("limit"+limitch);
	if(total === Number(limitch+1)){
		alert("Il suo abbonamento consente la selezione fino a "+limitch+" categorie."+"\n\n"+"Per poter scegliere più categorie è necessario cambiare la tipologia di abbonamento")
		document.form1.elements[j+1].checked = false;
		return false;
	}
} 
//end
//WINDOW POPUP
function pop_window(pURL, pWidth, pHeight) {
  if (!pURL) {
    return;
  }
  var offsetWidth = 50;
  var offsetHeight = 70;
  var windowFeatures = "toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,"
    + "width=" + (pWidth + offsetWidth) + ",height=" + (pHeight + offsetHeight);
  var popup = window.open(pURL, 'imagePopup', windowFeatures);
  if (popup) {
    popup.focus();
	popup.moveTo(0,0);
  }
}
//END WINDOW  POPUP