function changeCur(el)
{
	el.style.cursor = 'pointer';
	el.onmouseout = function()
		{
			el.style.cursor = 'default';
		}
}

//var selected_page='none';

function show_page(id)
	{
//		selected_page=id;
		open_page("p"+id);
//		document.getElementById('page_image').src='images/p'+id+'.jpg';
	}

function show_page2(id)
	{
		open_page("p"+id+"a");

	}

function show_page3(id,id2)
	{
		open_page("p"+id+"b"+id2);
		selected_foto = "f"+id2;
//		mouse_click_f(selected_foto);
//		document.getElementById('foto1415').src='images/p'+id+'_'+id2+'.jpg';
	}

function show_text(id)
	{
		document.getElementById(id).src='images/'+id+'.jpg';
	}

function hide_text(id)
	{
		document.getElementById(id).src='images/'+id+'s.jpg';
	}

var selected_foto = "f1";

function move_foto(step,N)
	{
		var i=parseInt(selected_foto.substr(1))+step;
		if (i>N)
			{i=1;}
		else if (i==0)			
			{i=N;}
			
		var next='f'+i;
//		mouse_on_f(next);
		mouse_click_f(next);
	}

function mouse_click_f(f)
	{
		document.getElementById('big_foto').src=document.getElementById(f).src;

		var previous=selected_foto;
		selected_foto=f;
//		mouse_out_f(previous);
	}



/* 8. AJAX MANAGEMENT */

var xmlReq = null;;

var Destinazione;

//FUNZIONE PER OTTENERE L'OGGETTO XMLHttpRequest

function getXmlHttpRequestObject() { 
	var xmlhttp=false;
	try
	{
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	}
	catch (e)
	{
		try
		{
	  		xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		catch (E)
		{
	  		xmlhttp = false;
		}
 	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    	xmlhttp = new XMLHttpRequest();
  	}
  	return xmlhttp;
}

function open_page(page) {	 
	var NomeDiv = "content";
	var NomePagina = page+".htm";

	var theDiv = document.getElementById(NomeDiv);
	
	if (NomePagina=='dont_display')
		{
			theDiv.innerHTML = "";
			theDiv.style.display = 'none';
			return;
		}
	else
		{
//			alert('open_page, nomeDiv='+NomeDiv+', NomePagina='+NomePagina+'.');
			theDiv.style.display = '';
		}

	var xmlhttp = getXmlHttpRequestObject();
	xmlhttp.onreadystatechange = function () {
		
		if (xmlhttp.readyState==4)
			{
				var theDiv = document.getElementById(NomeDiv)
				theDiv.innerHTML = xmlhttp.responseText;
			}
	}

	xmlhttp.open("GET",NomePagina,true);	
	xmlhttp.send(null);
}
