// JavaScript Document
function objetoAjax(){
	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 publicimgexcursions(){
	id_clientweb= document.imageformnineteen.id_clientweb.value;    
	excursion_max= document.imageformnineteen.excursion_max.value;
	excursion_erw= document.imageformnineteen.excursion_erw.value;
	excursion_kind= document.imageformnineteen.excursion_kind.value;
	excursion_bezah= document.imageformnineteen.excursion_bezah.value;
	excursion_inklusive= document.imageformnineteen.excursion_inklusive.value;
	excursion_besch= document.imageformnineteen.excursion_besch.value;
	categoria_client= document.imageformnineteen.categoria_client.value;
		
	ajax=objetoAjax();
	ajax.open("POST", "public_imgexcursion.php",true);
	ajax.onreadystatechange=function() {
	
		if (ajax.readyState==4) {
			//alert(ajax.responseText);
			 if (ajax.status == 404) {
				  //alert(ajax.responseText);
			//document.getElementById("formulario").innerHTML = ajax.responseText;
			document.getElementById("publicar_bann").innerHTML = "Página no encontrada!";
			} 
				
			if (ajax.status == 500) {				 
				document.getElementById("publicar_bann").innerHTML = " Ocurrio un error procesando los datos /n"+ajax.responseText;				
			}
				
			 if (ajax.status == 200) {	
			 contvalor = ajax.responseText;
			 verificartext = contvalor.match("finox");
				
				if (verificartext == null) {
						document.getElementById("publicar_bann").innerHTML = ajax.responseText;	
				 }	 
				 else{
						document.imageformnineteen.id_clientweb.value = "";
						document.imageformnineteen.excursion_max.value = "";
						document.imageformnineteen.excursion_erw.value = "";
						document.imageformnineteen.excursion_kind.value = "";
						document.imageformnineteen.excursion_bezah.value = "";
						document.imageformnineteen.excursion_inklusive.value = "";
						document.imageformnineteen.excursion_besch.value = "";
						document.imageformnineteen.categoria_client.value = "";
																		
						limpiar = "";
						contenidotext = ajax.responseText;
					    textomostrar = contenidotext.replace(/finox/, limpiar);
						document.getElementById("publicar_bann").innerHTML = textomostrar;	
				}
				
				
			}
		}
		//else{	 
		//	 imagen1 = "<img src=img/41.1.gif  border=0 />";	
		//	 document.getElementById("formulario").innerHTML =  imagen1;
		//}
	}
	
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("id_clientweb="+id_clientweb+"&excursion_max="+excursion_max+"&excursion_erw="+excursion_erw+"&excursion_kind="+excursion_kind+"&excursion_bezah="+excursion_bezah+"&excursion_inklusive="+excursion_inklusive+"&excursion_besch="+excursion_besch+"&categoria_client="+categoria_client)
}
