// FUNCIONES GOOGLE MAPS
var geocoder = null;
var map= null;
var marker=null;

function initialize() {
	if (GBrowserIsCompatible()) {
		if (document.getElementById("map_canvas")!= null) {
			map = new GMap2(document.getElementById("map_canvas"));
			map.setCenter(new GLatLng(42.674359,-1.647949), 1);


			GEvent.addListener(map, "moveend", function() {
				var center = map.getCenter();
				//document.getElementById("map_message").innerHTML = center.toString();
			});
			geocoder = new GClientGeocoder();
			//map.setMapType(G_NORMAL_MAP);
			map.setMapType(G_HYBRID_MAP);
			map.setZoom(3);
			//map.setMapType(G_SATELLITE_MAP);
			/*
			GDownloadUrl("/asp/tiempo.asp", function(data) {
				var xml = GXml.parse(data);
				var markers = xml.documentElement.getElementsByTagName("location");
				for (var i = 0; i < markers.length; i++) {
					var latlng = new GLatLng(parseFloat(markers[i].getAttribute("latitude")),
										parseFloat(markers[i].getAttribute("longitude")));
					map.addOverlay(new GMarker(latlng));
				}
			 });
			*/
			cargaDiv('viajeros','sub_menu_der','sub_menu_der');
			//cargaDiv('viajeros','buscador','buscador');
			OnLoad();
		}
	} 
}

// addAddressToMap() is called when the geocoder returns an
// answer.  It adds a marker to the map with an open info window
// showing the nicely formatted version of the address and the country code.
function addAddressToMap(response) {
	
	var x= document.getElementById("map_form")
	//var nota = x.map_nota.value;
	var address = x.map_localizacion.value;
	//alert(nota);
	//alert(document.getElementById("map_nota2").innerHTML);
	var nota = document.getElementById("map_nota2").innerHTML;
	
	var baseIcon = new GIcon(G_DEFAULT_ICON);
	baseIcon.shadow = "/estilo/google/shadow50.png";
	baseIcon.iconSize = new GSize(20, 24);
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, 34);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	
	var aicIcon = new GIcon(baseIcon);
	aicIcon.image = "/estilo/google/marcador.png";

	map.clearOverlays();
	if (!response || response.Status.code != 200) {
		alert("Lo siento, pero no localizo el geocode de esa direccion.\n"+address);
	
	} else {
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],
							place.Point.coordinates[0]);
		markerOptions = { icon:aicIcon };
		marker = new GMarker(point, markerOptions);
		map.addOverlay(marker);
		marker.openInfoWindowHtml('<b>' +place.address + '</b><br />' +
		  '' + place.AddressDetails.Country.CountryNameCode+ '<br />' +nota);
		map.addControl(new GSmallMapControl());
		//map.setZoom(15); 
		map.setZoom(3);
	}
	// document.getElementById("map_canvas").style.display='block';
}

// showLocation() is called when you click on the Search button
// in the form.  It geocodes the address entered into the form
// and adds a marker to the map at that location.
function showLocation() {
	var x = document.getElementById("map_form");
	var pais = x.map_localizacion.value;
	geocoder.getLocations(pais, addAddressToMap);
	searchControl.execute(pais);
	
	
}

// findLocation() is used to enter the sample addresses into the form.
function findLocation(address) {
	var x = document.getElementById("map_form")
	x.map_localizacion.value = address;
	//x.map_nota.value = '';
	document.getElementById("map_nota2").innerHTML = '';
	cargaNotas(address);

	
	//alert(address);
	
}

function cargaNotas(pais)
	{
		//var pieza = 'sub_menu_izq'
		var x = document.getElementById("map_form")
		var url = '/web/viajeros/paises/' + pais+"/nota.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		//var entrada = document.getElementById('map_nota');
		var entrada2 = document.getElementById('map_nota2');
		var entrada3 = document.getElementById('detalle_pais');
		
		//entrada.value = '';
		var valores =""
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada2.innerHTML=imgLoadPeq; 
				 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					//entrada.value = xmlHttp.responseText; 
					entrada2.innerHTML = xmlHttp.responseText;  
					salida.innerHTML = '<b>Mostrando nota en '+pais+'</b>';
					cargaDetalle(pais);
					//alert(document.getElementById('map_nota').value);
				}
				else if (xmlHttp.status==404)
				{
					//alert('eeooo');
					entrada2.innerHTML = '<dl><dd><a href="#en_internet">En Internet</a></dd></dl>';
					entrada3.innerHTML = '';
					salida.innerHTML = 'La direccion no existe.';
					showLocation();
				}else{
					
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}

function cargaDetalle(pais)
	{
		//var pieza = 'sub_menu_izq'
		var x = document.getElementById("map_form")
		var url = '/web/viajeros/paises/' + pais+"/detalle.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById('detalle_pais');
		var valores =""
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando nota en '+pais+'</b>';
					//alert(document.getElementById('map_nota').value);
					showLocation();
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}

// FUNCIONES CONONLINE GENERALES

	function GetXmlHttpObject()
	{
		var objetoAjax=false;
		try {
			/*Para navegadores distintos a internet explorer*/
			objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
				/*Para explorer*/
				objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				objetoAjax = false;
			}
		}
		if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
			objetoAjax = new XMLHttpRequest();
		}
		return objetoAjax;
	}

	var url1 = '/web/';
	var url2 = '/piezas/';
	var imgLoadPeq = '<img src="/estilo/loadingpeq.gif" />';
	var imgLoadGra = '<table border="0" width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/estilo/loadinggra.gif" /></td></tr></table>';
	
	function cargaDiv(scc,pieza,donde)
	{
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+".asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		var valores =""
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}


function relojFecha(){
	var mydate=new Date();var year=mydate.getYear();
	if (year < 1000)year+=1900;
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10)daym="0"+daym;
	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado");
	var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto",
	                                             "Septiembre","Octubre","Noviembre","Diciembre");
	var horas = mydate.getHours();
	horas = (horas<10)?"0"+horas:horas;
	var minutos = mydate.getMinutes();
	minutos = (minutos<10)?"0"+minutos:minutos;
	var segundos = mydate.getSeconds();
	segundos = (segundos<10)?"0"+segundos:segundos;
	document.getElementById("idReloj").innerHTML = "<"+"small><"+"font color='000000' face='Verdana'>"+
	                                                dayarray[day]+" "+daym+" de "+montharray[month]+" de "+
                                                       year+" "+horas+":"+minutos+":"+segundos+"<"+"/font><"+"/small>";
	setTimeout('relojFecha()',1000);
}
	
	function limpiarDivGoibiAntimMosquitos()
	{
		//limpiarDiv('centro');
		/*limpiarDiv('informacion_tecnica');
		limpiarDiv('informacion_productos');
		limpiarDiv('informacion_comunicacion');
		limpiarDiv('salvapantallas');
		limpiarDiv('presentacion');
		limpiarDiv('contacto');*/
	}
	function limpiarDivFarmacia()
	{
		//limpiarDiv('centro');
		/*limpiarDiv('informacion_tecnica');
		limpiarDiv('informacion_productos');
		limpiarDiv('informacion_comunicacion');
		limpiarDiv('salvapantallas');
		limpiarDiv('presentacion');
		limpiarDiv('contacto');*/
	}
	function limpiarDivViajeros()
	{
		//limpiarDiv('map_canvas');
		//limpiarDiv('buscador');
		//limpiarDiv('sub_menu_der');
		/*		
		limpiarDiv('info_general');
		limpiarDiv('vacunas');
		limpiarDiv('visados');
		limpiarDiv('emergencias');
		limpiarDiv('consejos_practicos');
		limpiarDiv('consejos');
		limpiarDiv('contacto');*/
		
		
	}
	function limpiarDiv(div)
	{
		var url = "/blank.asp?sid="+Math.random();
		var salida = document.getElementById("indicadorestados");
		var entrada = document.getElementById(div);
		var valores = "id=0";
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("El navegador no soporta HTTP Request: editaRegistro");
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = "<b>Mostrando "+div+":</b>";
					// iniciaMenuCabecera();
					
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = "La direccion no existe";
				}else{
					salida.innerHTML = "Error: ".xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	function mandaContacto(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+"_respuesta.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		var contacto_nombre = encodeURIComponent(document.getElementById('contacto_nombre').value);
		var contacto_apellidos = encodeURIComponent(document.getElementById('contacto_apellidos').value);
		var contacto_email = encodeURIComponent(document.getElementById('contacto_email').value);
		var contacto_texto = encodeURIComponent(document.getElementById('contacto_texto').value);
		
		
		var valores = 'contacto_nombre='+contacto_nombre+'&contacto_apellidos='+contacto_apellidos+'&contacto_email='+contacto_email+'&contacto_texto='+contacto_texto;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	function mandaParticipa(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+"_respuesta.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		var participa_dni = encodeURIComponent(document.getElementById('participa_dni').value);
		var participa_nombre = encodeURIComponent(document.getElementById('participa_nombre').value);
		var participa_apellidos = encodeURIComponent(document.getElementById('participa_apellidos').value);
		var participa_email = encodeURIComponent(document.getElementById('participa_email').value);
		var participa_telefono = encodeURIComponent(document.getElementById('participa_telefono').value);
		var participa_ciudad = encodeURIComponent(document.getElementById('participa_ciudad').value);
		var participa_codigo = encodeURIComponent(document.getElementById('participa_codigo').value);
		
		
		
		var valores = 'participa_dni='+participa_dni+'&participa_nombre='+participa_nombre+'&participa_apellidos='+participa_apellidos+'&participa_email='+participa_email+'&participa_telefono='+participa_telefono+'&participa_ciudad='+participa_ciudad+'&participa_codigo='+participa_codigo;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	function mandaParticipaCopia(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+"_respuesta.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		var participa_dni = encodeURIComponent(document.getElementById('participa_dni').value);
		var participa_nombre = decodeURI(document.getElementById('participa_nombre').value);
		var participa_apellidos = decodeURI(document.getElementById('participa_apellidos').value);
		var participa_email = decodeURI(document.getElementById('participa_email').value);
		var participa_telefono = decodeURI(document.getElementById('participa_telefono').value);
		var participa_ciudad = decodeURI(document.getElementById('participa_ciudad').value);
		var participa_codigo = decodeURI(document.getElementById('participa_codigo').value);
		
		
		
		var valores = 'participa_dni='+participa_dni+'&participa_nombre='+participa_nombre+'&participa_apellidos='+participa_apellidos+'&participa_email='+participa_email+'&participa_telefono='+participa_telefono+'&participa_ciudad='+participa_ciudad+'&participa_codigo='+participa_codigo;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	function mandaCodigoCliente(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+".asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		var codigo = document.getElementById('codigo').value;
		
		var valores = 'codigo='+codigo;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}	
	
	function mandaContactoFarmacia(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+"_respuesta.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		
		
		
		var contacto_nombre = encodeURIComponent(document.getElementById('contacto_nombre').value);
		var contacto_apellidos = encodeURIComponent(document.getElementById('contacto_apellidos').value);
		var contacto_farmacia = encodeURIComponent(document.getElementById('contacto_farmacia').value);
		var contacto_email = encodeURIComponent(document.getElementById('contacto_email').value);
		var contacto_texto = encodeURIComponent(document.getElementById('contacto_texto').value);
		
		
		var valores = 'contacto_nombre='+contacto_nombre+'&contacto_apellidos='+contacto_apellidos+'&contacto_farmacia='+contacto_farmacia+'&contacto_email='+contacto_email+'&contacto_texto='+contacto_texto;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	function mandaCodigo(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+".asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		
		
		
		var colegiado = document.getElementById('colegiado').value;
		var dni = document.getElementById('dni').value;
		
		
		var valores = 'colegiado'+colegiado+'&dni='+dni;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	function mandaRegistro(scc,pieza,donde)
	{
		// Para llamar a la funcion ejemplo: mandaContacto('viajeros','contacto','centro');
		//var pieza = 'sub_menu_izq'
		var url = url1 + scc + url2 + pieza+"_respuesta.asp?sid="+Math.random();
		var salida = document.getElementById('indicadorestados');
		var entrada = document.getElementById(donde);
		
		
		
		
		var registro_nombre = encodeURIComponent(document.getElementById('registro_nombre').value);
		var registro_apellidos = encodeURIComponent(document.getElementById('registro_apellidos').value);
		var registro_dni = encodeURIComponent(document.getElementById('registro_dni').value);
		var registro_direccion = encodeURIComponent(document.getElementById('registro_direccion').value);
		var registro_cp = encodeURIComponent(document.getElementById('registro_cp').value);
		var registro_ciudad = encodeURIComponent(document.getElementById('registro_ciudad').value);
		var registro_provincia = encodeURIComponent(document.getElementById('registro_provincia').value);
		var registro_colegiado = encodeURIComponent(document.getElementById('registro_colegiado').value);
		var registro_centro = encodeURIComponent(document.getElementById('registro_centro').value);
		
		
		var valores = 'registro_nombre='+registro_nombre+'&registro_apellidos='+registro_apellidos+'&registro_dni='+registro_dni+'&registro_direccion='+registro_direccion+'&registro_cp='+registro_cp+'&registro_ciudad='+registro_ciudad+'&registro_provincia='+registro_provincia+'&registro_colegiado='+registro_colegiado+'&registro_centro='+registro_centro;
		
		var xmlHttp = new GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ('El navegador no soporta HTTP Request: editaRegistro');
			return;
		}
		//alert(url);
		xmlHttp.open ('POST', url, true);
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==1)
			{
				 entrada.innerHTML=imgLoadPeq; 
			}
			else if (xmlHttp.readyState==4)
			{
				if(xmlHttp.status==200)
				{
					entrada.innerHTML = xmlHttp.responseText; 
					salida.innerHTML = '<b>Mostrando '+pieza+' en '+scc+'</b>';
				}
				else if (xmlHttp.status==404)
				{
					salida.innerHTML = 'La direccion no existe.';
				}else{
					salida.innerHTML = 'Error: '.xmlHttp.status;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send(valores);	
	}
	
	
	
	
	
	
	
