//Função para criar um Objeto XMLHttp.

function getxmlhttp () {

	// Criar uma variável booleana para verificar a existência de uma instância

	//  Microsoft active x válida.

	var xmlhttp = false;



	//Verificar se estamos usando IE.

	try {

		// Se a versão JavaScript for maior que 5.

		xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP");

	} catch (e) {

		// Se não, então usar o objeto active x mais antigo.

		try {

			    // Se estivermos usando IE.

				xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP");

		} catch (E) {

				// Ou devemos estar usando um navegador diferente do IE.

				xmlhttp = false;

		}

	}

	// Se estivermos usando um navegador diferente do IE, criar uma 

	//instância JavaScript do Objeto.

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

	  xmlhttp = new XMLHttpRequest();

	}

	return xmlhttp;

}





function show_fotos_body(mth,page,objID) {

	var xmlhttp = getxmlhttp ();

    obj = document.getElementById(objID); 

	xmlhttp.open (mth, page);

	xmlhttp.onreadystatechange = function () {

	  if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

  obj.innerHTML = xmlhttp.responseText;

	  } 

	}

	xmlhttp.send(null);	  	  

}



function fotos_body(theform){

	var idfoto = theform.evento.value;

//    var serverPage = "g_fotos.php?ida="+idfoto;
    var serverPage = "galeria_nave.php?ida="+idfoto;
    show_fotos_body("GET",serverPage,"main_foto_body");	  

}

