function openImg(tipo,immagine){
	
	var width="400", height="400";
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var stile = 'status=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	
	switch(tipo){
		case 'prod':
			dove = "upload/prodotti/";
		break;
		default:
			dove = "upload/";
	}
	
	var msgWindow = window.open(dove + immagine, "Seteck", stile);
	
}

function apriVoip(valore1,valore2){
	//alert(valore1+", "+valore2);
	document.getElementById('tab_voip').style.display = valore1;
	document.getElementById('tab_voipR').style.display = valore2;


}

function cancellaSelect(tipo,numeroRoutine){
	
	for (i=1;i<=numeroRoutine;i++) {
		var object = document.getElementById(tipo+i);
        object.checked = false;
    }
	
	step4();
	
}

function searchButton(){
	
	var form = document.searchForm;
	var campo = document.searchForm.key;
	var error = document.getElementById('errore_search');
	
	if(campo.value == "parole chiave..." || campo.value == ""){
		error.innerHTML = 'Inserire una parola chiave'
	} else {
		form.submit();	
	}
	
}

function apriFritz(){
	
	var width="800", height="600";
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var stile = 'status=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

var msgWindow = window.open("page/include/fritz.htm", "", stile);
	
}

function apriCarrello(){

	document.getElementById('carrello').style.display = 'block';

}

function trim(stringa){
    while (stringa.substring(0,1) == ' '){
        stringa = stringa.substring(1, stringa.length);
    }
    while (stringa.substring(stringa.length-1, stringa.length) == ' '){
        stringa = stringa.substring(0,stringa.length-1);
    }
    return stringa;
}

function check_segnalazione() {

	if(trim(document.form_segnalazione.email.value)=="" || trim(document.form_segnalazione.segnalazione.value)==""){
		alert("Inserire sia l'email che la segnalazione");
		return false;
	}else{
		return true;
	}
}








