function getSlide(mode, max)
{
	valore = document.getElementById('counterize').value;
	if (mode == 'next'){
	valore = parseInt(valore) + 1;
	sp1.showNextPanel();
	} else {
	valore = parseInt(valore) - 1;
	sp1.showPreviousPanel();
	}
	if (valore < 1){
	valore = 1;
	}
	if (valore > max){
	valore = max;
	}
	document.getElementById('counterize').value = valore;
	document.getElementById('con').innerHTML = valore;
}

function getNews(cat){
	
	alert("Creami!")
	
}

function getSlide2(mode, max)
{

	valore = document.getElementById('contatore').value;

	if (mode == 'next'){
	
		valore = parseInt(valore) + 1;
		sp2.showNextPanel();
	
	} else {
	
		valore = parseInt(valore) - 1;
		sp2.showPreviousPanel();
	
	}
						
	if (valore < 1){
	valore = 3;
	sp2.showPanel(2);
	}
	if (valore > max){
	valore = 1;
	sp2.showPanel(0);
	}
	
	document.getElementById('contatore').value = valore;
	document.getElementById('con2').innerHTML = valore;
}

function scrolla_automatico()
{
	var lavoro = document.getElementById('job').value;
	if (lavoro == 1)
	{	
		var attivo = document.getElementById('ctr').value;
		var prossimo = parseInt(attivo) + 1;
		
		//alert(attivo + ' ' + prossimo);
		if (document.getElementById('ex1_p' + prossimo))
		{
			sp1.showPanel(prossimo);
		} else {
			prossimo = 0;
			sp1.showPanel(0);
		}
		document.getElementById('con').innerHTML = prossimo + 1;
		document.getElementById('ctr').value = prossimo;
	}
}
	
function attiva_auto(){
	document.getElementById('job').value = 1;		
}
	
function disattiva_auto(){
	document.getElementById('job').value = 0;		
}

