function StampaPagina($chiave) {
  window.open('print.php?mod=' + $chiave,"Stampa","scrollbars=no,menubar=no,status=no,width=10,height=10");
  }

function ApriPagina($url, $width, $height, $scroll) {
  window.open($url,"popup","scrollbars="+$scroll+",menubar=no,status=no,width="+$width+",height="+$height);
}

function OpenWindowRecensioni(NmFile) {
  window.open('./recensioni/' + NmFile,"recensioni","scrollbars=yes,orangebar=yes,status=no,width=730,height=460");
}

function ApriCaseStudy(Id) {
  if (Id == 1) {
	url = "view.php?action=casestudy&mod=immobiliare";
  } else if (Id == 2) {
	url = "view.php?action=casestudy&mod=viaggi";	
  } else if (Id == 3) {
	url = "view.php?action=casestudy&mod=assicurazione";
  } else if (Id == 4) {
	url = "view.php?action=casestudy&mod=discoteca";
  } else if (Id == 5) {
	url = "view.php?action=casestudy&mod=club";	
  } else if (Id == 6) {
	url = "view.php?action=casestudy&mod=ristorante";		
  } else if (Id == 7) {
	url = "view.php?action=casestudy&mod=scuola";
  } else if (Id == 8) {
	url = "view.php?action=casestudy&mod=commercialista";
  } else if (Id == 9) {
	url = "view.php?action=casestudy&mod=parrucchiere";
  } else if (Id == 10) {
	url = "view.php?action=casestudy&mod=negozio";
  } else if (Id == 11) {
	url = "view.php?action=casestudy&mod=autorimessa";	
  } else if (Id == 12) {
	url = "view.php?action=casestudy&mod=spedizioni";
  } else if (Id == 13) {
	url = "view.php?action=casestudy&mod=crm";
  } else {
	url = "none";
  }
 
  if (url != "none") location.href = url;
  
}

function CalcolaPrezzo () {
	var Num = parseInt(document.ordine.quantita.value);

	/* Controllo dati inseriti */
	if (Num > 10000) {
		alert ('Per pacchetti superiori a 10.000 SMS contattaci per avere un preventivo personalizzato.');
	} else {
			if (isNaN(Num) || Num == 0) {
				alert('La quantit? inserita non ? corretta.');				
			} else {
					listino = 2;
		    		window.open ('calcolaprezzo.php?pacchetto=' + Num + '&listino=' + listino,"prezzo","scrollbars=yes,status=no,width=400,height=245");				
			}
		}
}
function ControllaNumeroInserito () {
	var StrNum = document.ordine.quantita.value;

	if (StrNum != "") {
		var Num = parseInt(document.ordine.quantita.value);
		if (isNaN(Num)) {
			alert('La quantit? di crediti inserita non ? corretta.');
			document.ordine.quantita.value = "";
			document.ordine.quantita.focus;
		} else {
		   if (Num < 50) {
		   	alert('Il pacchetto minimo acquistabile ? di 50 SMS.')
			document.ordine.quantita.value = "";
			document.ordine.quantita.focus;
		   }
		}
	}
}	

//disabilita copia&incolla
function checkCtrlKey(evt) { 
       if(!evt) evt = event; 
        var ctrl = (typeof evt.modifiers == "undefined") ? evt.ctrlKey : evt.modifiers & evt.CONTROL_MASK; 
        var v = (typeof evt.which == "undefined") ? evt.keyCode == 86 : evt.which == 86; 
        // If the control and ?V? keys are pressed at the same time 
        if (ctrl && v) 
        { 
                this.value = ""; 
                return false; 
        } 
        return true; 
} 	
