
function foto1()

{
  window.open("foto1.asp","","height=600,width=450 ");
}
function foto2()

{
  window.open("foto2.asp","","height=600,width=450 ");
}
function foto3()

{
  window.open("foto3.asp","","height=600,width=450 ");
}
function foto4()

{
  window.open("foto4.asp","","height=600,width=450 ");
}
function foto5()

{
  window.open("foto5.asp","","height=600,width=450 ");
}
function foto6()

{
  window.open("foto6.asp","","height=600,width=450 ");
}
function aprifinestra()

{
  window.open("saluto.html","","height=300,width=300 ");
}
function checkLogin() {
  sUtente = document.forms['login'].elements['sUtente'].value;
  sPassword = document.forms['login'].elements['sPassword'].value;

  if (sUtente == '' || sPassword == '') {
    alert('E\' necessario inserire nome utente e password per effettuare l\'accesso.')

    if (sUtente == '') {
      document.forms['login'].elements['sPassword'].value = '';
      document.forms['login'].elements['sUtente'].focus();
    } else if (sUtente != '' && sPassword == '') {
      document.forms['login'].elements['sPassword'].focus();
    }
    
	return false
  }

}
function checkSemplice() {
  sMarca = document.forms['semplice'].elements['mar'].value;

  if (sMarca == '') {
    alert('La zona sarà selezionabile solo dopo aver indicato un Tipo Escursione.');
	return false;
  }
}
function ApriCalendariotutte()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/stampa_calendario.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function ApriListatutte()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listatutte.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apriroccia()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listaroccia.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apriciaspe()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listaciaspe.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Aprinormali()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listanormali.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apritrekking()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listatrekking.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apriferrate()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listaferrate.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apriscialpinismo()
{ 
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listascialpinismo.asp','', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apricalendario()
{ 
aSeason = document.forms['menuanno'].elements['stampaanno'].value;
aSeason1 = document.forms['menuanno'].elements['stampacosa'].value;

popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listacalendario.asp?data=' + aSeason  + '&tip=' + aSeason1 ,'', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apricalendario1()
{ 
aSeason1 = document.forms['menuanno1'].elements['stampaanno1'].value;
popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listacalendario1.asp?tip=' + aSeason1  ,'', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function Apricalendario0()
{ 
aSeason1 = document.forms['menuanno'].elements['stampacosa'].value;
aSeason = document.forms['menuanno'].elements['stampaanno'].value;

popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../amministrazione/listacalendario1.asp?tip=' + aSeason1  + '&data=' + aSeason ,'', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}
function stampa(stampa)
{ 
sIDE = stampa
	popW = 600;
	popH = 500;
	popL = (screen.width - popW) / 2;
	popT = (screen.height - popH) / 2;		
	window.open('../escursioni/stampa.asp?id=' + sIDE,'', 'top=' + popT + ', left=' + popL + ', width=' + popW + ', height=' + popH + ', innerWidth=' + popW + ', innerHeight=' + popH + ', scrollbars=1');
}

function Cercaanno()
{ 
iSeason = document.forms['anno'].elements['stagione'].value;

location.replace('programmi.asp?sea=' + iSeason);

}
function cancellaLinks()
{
ici = document.forms['modificalinks'].elements['lin'].value;

	location.replace ('cancellalinks.asp?pi=' + ici);
}
function cancellacale()
{
aci = document.forms['inseriscicale'].elements['id'].value;

	location.replace ('cancellacale.asp?ci=' + aci);
}

function Categoria()
{ 
icategoria = document.forms['categoria'].elements['categoria'].value;

location.replace('links.asp?cat=' + icategoria);

}
function checkNuova() {
  bChoice = confirm('Gli eventuali dati contenuti nei campi saranno persi, continuare?');
	
  if (bChoice != true) {
	document.forms['inseriscicale'].elements['dat'].focus();
    return false;
  } else {
	location.replace('/amministrazione/agg_calendario.asp');
  }
}
function checkNuovaEscursione() {
  bChoice = confirm('Gli eventuali dati contenuti nei campi saranno persi, continuare?');
	
  if (bChoice != true) {
	document.forms['inserisci'].elements['tar'].focus();
    return false;
  } else {
	location.replace('/amministrazione/inserisci.asp');
  }
}
function checkNuovaLinks() {
  bChoice = confirm('Gli eventuali dati contenuti nei campi saranno persi, continuare?');
	
  if (bChoice != true) {
	document.forms['inseriscilinks'].elements['lin'].focus();
    return false;
  } else {
	location.replace('/amministrazione/agg_links.asp');
  }
}
function checkTorna() {

	location.replace('/amministrazione/lista_calendario.asp');
  
}

function focustext() {
document.forms['inseriscicale'].elements['dat'].focus();
}
function focustexti() {
document.forms['inserisci'].elements['tar'].focus();
}

function passafocusdat() {
	if (document.forms['inseriscicale'].elements['dat'].value.length >= 10) {
	
document.forms['inseriscicale'].elements['ann'].focus();
	}	
} 

function passafocusann() {
	if (document.forms['inseriscicale'].elements['ann'].value.length >= 4) {
	
document.forms['inseriscicale'].elements['esc'].focus();
	}	
} 
function carInserisciPreview(foto) {
  	sFoto = document.forms['inserisci'].elements[foto].value;
  
  
  if (sFoto != '') { 
    iNumero = sFoto.substring(4, 8)
  
    imgW = 320;
    imgH = 240;
    scrW = screen.Width;
    scrH = screen.Height;
    middleW = (scrW - imgW) / 2;
    middleH = (scrH - imgH) / 2;

    window.open('/amministrazione/anteprima-ins.asp?id=' + iNumero + '', '', 'top=' + middleH + ' left=' + middleW + ' width=' + imgW + ', height=' + imgH + ', scrollbars=no');
    window.opener = self;
  }
}
function carModificaPreview(foto) {
  	sFoto = document.forms['modifica'].elements[foto].value;
  
  
  if (sFoto != '' ) {
	  if  (sFoto.substring(9,12) == 'jpg' ) { 
    iNumero = sFoto.substring(4, 8)
  
    imgW = 320;
    imgH = 240;
    scrW = screen.Width;
    scrH = screen.Height;
    middleW = (scrW - imgW) / 2;
    middleH = (scrH - imgH) / 2;

    window.open('/amministrazione/anteprima-ins.asp?id=' + iNumero + '&fo=1' + '', '', 'top=' + middleH + ' left=' + middleW + ' width=' + imgW + ', height=' + imgH + ', scrollbars=no');
    window.opener = self;
  } else {
    imgW = 320;
    imgH = 240;
    scrW = screen.Width;
    scrH = screen.Height;
    middleW = (scrW - imgW) / 2;
    middleH = (scrH - imgH) / 2;

    window.open('/amministrazione/anteprima-ins.asp?id=' + sFoto + '&fo=2' + '', '', 'top=' + middleH + ' left=' + middleW + ' width=' + imgW + ', height=' + imgH + ', scrollbars=no');
    window.opener = self;
}
}
}


