function zoom(link) {
searchWin = window.open(link,'','scrollbars=no,resizable=no,width=500,height=530,status=no,location=no,toolbar=no');
			searchWin.moveTo(1,1);
//        searchWin.refer = self;
}
function zoom_cert(link) {
searchWin = window.open(link,'','scrollbars=no,resizable=no,width=350,height=535,status=no,location=no,toolbar=no');
			searchWin.moveTo(1,1);
//        searchWin.refer = self;
}
/*function zoom(link,w,h) {
	var clientHt = window.screen.height;
	var clientWt = window.screen.width;					
    searchWin = window.open(link,'','scrollbars=yes,resizable=no,width=' + w + ',height=' + h + ',status=no,location=no,toolbar=no');       
	searchWin.moveTo( ((clientWt-w)/2) , ((clientHt-h)/2) );		
}*/
function chiudi(){
	window.close();
}
function stampa(){
	window.print();
}
function indietro(){
	window.history.back();
}
function avanti(){
	window.history.forward();
}
function allapagina(pag){
	window.history.go(pag);
}
function controllaCheckMail() {
	if(document.CheckMail.USERNAME.value==""){		
		alert("Inserire il Login");
		return;
	}
	if (document.CheckMail.PASSWORD.value==""){
		alert("Inserire la Password");
		return;
	}
	document.CheckMail.submit();	
	//zoom('http://mail.omeganet.it/cgi-bin/gx.cgi/AppLogic+moblogin',400,400);
}

function checkProdotti(ev,tipo,pag) {	
	if (ev == 0){
		if (document.articoli.fAdd.value == "") {			
			return;
		}
		document.articoli.action = pag + "&TP=" + tipo;		
		document.articoli.submit();	
	}else if (ev == 1) {
		document.articoli.action = pag + "&TP=" + tipo;		
		document.articoli.submit();
	}else if (ev == 2) {		
		if (document.articoli.fAdd.value == "") {			
			return;
		}
		document.articoli.action = pag + "&TP=" + tipo;		
		document.articoli.submit();			
	}else if (ev == 3) {		
		if (document.articoli.fDelete.value == "") {			
			return;
		}
		document.articoli.action = pag + "&TP=" + tipo;		
		document.articoli.submit();			
	}else{		
		if (document.articoli.fAdd.value == "") {			
			return;
		}				
		document.articoli.action = pag + "?PG=" + ev + "&TP=" + tipo;
		document.articoli.submit();			
	}
}

function checkLibri(ev) {
	if (ev == 0){
		if (document.articoli.fAdd.value == "") {			
			return;
		}
		document.articoli.action = "/ita/carrello/Conferma.asp?PG=ElencoProdotti";
		document.articoli.submit();	
	}else if (ev == 1) {
		document.articoli.action = "/ita/carrello/Conferma.asp?PG=Carrello_step1";
		document.articoli.submit();
	}else if (ev == 2) {		
		if (document.articoli.fAdd.value == "") {			
			return;
		}
		document.articoli.action = "/ita/carrello/Conferma.asp?PG=ElencoProdotti";
		document.articoli.submit();	
	}
}

//Controllo sulla data
function CtrData(NameForm, NameInputGG, NameInputMM, NameInputAA, Label){
	var booRis;
	    booRis = true;

	if (document.forms[NameForm].elements[NameInputGG][document.forms[NameForm].elements[NameInputGG].selectedIndex].value != "" || document.forms[NameForm].elements[NameInputMM][document.forms[NameForm].elements[NameInputMM].selectedIndex].value != "" || document.forms[NameForm].elements[NameInputAA].value != ""){
		//Controllo correttezza
		//************************************************
		var year
			year = document.forms[NameForm].elements[NameInputAA].value;
		var month
			month = document.forms[NameForm].elements[NameInputMM].options[document.forms[NameForm].elements[NameInputMM].selectedIndex].value;
		var day
			day = document.forms[NameForm].elements[NameInputGG].options[document.forms[NameForm].elements[NameInputGG].selectedIndex].value;
				
		//controllo che l'anno abbia 4 cifre
		if (year.length < 4) {
			alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
				booRis = false;
			}
		else {
			//controllo che l'anno sia un numero				
			if (isNaN(parseInt(year))) {				
				alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
					booRis = false;
				}
			else {
				//controllo che l'anno sia maggiore di 1800
				if ((parseInt(year))<1800) {				
					alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
						booRis = false;
					}
				else {
					//se l'utente ha selezionato "Febbraio"		
					if ( month == "2") {
						//se l'anno è bisestile				
						if ( year % 4 == 0 ) {				
							if ( day > 29 ) {
								alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
								booRis = false;
							}				
						}
						else { //se non è bisestile
							if ( day > 28 ){
								alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
								booRis = false;
							}
						}					
					}
						
					else { //per tutti gli altri mesi con elements[NameInputGG] = 30
						
						if ( (month == "11" || month == "4" || month == "6" || month == "9" ) && (day > 30) ) {//novembre
							alert("ATTENZIONE: [" + Label + "] deve essere una DATA !");
							booRis = false;
						}		
					}
				}				
			}
		}		
		
		//************************************************		
	}else{
	/*da attivare solo se il campo è obbligatorio
		if (document.forms[NameForm].elements[NameInputGG][document.forms[NameForm].elements[NameInputGG].selectedIndex].value == "" && document.forms[NameForm].elements[NameInputMM][document.forms[NameForm].elements[NameInputMM].selectedIndex].value == "" && document.forms[NameForm].elements[NameInputAA].value == ""){
			alert("ATTENZIONE: inserire la data !");
			booRis = false;
		}else{
			alert("ATTENZIONE: Digitare la data correttamente!");
			booRis = false;
		}//end if (document.forms[NameForm].elements[NameInputGG][document.forms[NameForm].elements[NameInputGG].selectedIndex].value == "-" && document.forms[NameForm].elements[NameInputMM][document.forms[NameForm].elements[NameInputMM].selectedIndex].value == "-" && document.forms[NameForm].elements[NameInputAA][document.forms[NameForm].elements[NameInputAA].selectedIndex].value == "-")	
	*/
	}//end if (document.forms[NameForm].elements[NameInputGG][document.forms[NameForm].elements[NameInputGG].selectedIndex].value != "-" && ...

	return booRis;
}//end function CtrData

