/*
 * Javascript
 *
 * LICENCIA: todos los derechos quedan reservados y en dado caso de utilizar total o parcialmente
 * este codigo se debera anunciar a su autor o propietario.
 *
 * @category   Javascript
 * @author     Israel Campoy <churritzu@gmail.com>
 * @copyright  2010 Media Mono
 * @license    http://www.mediamono.com
 * @version    SVN: 1.0
*/

function ubicaciones(){ 

	var xhr = false;
	if(window.XMLHttpRequest){
		xhr = new XMLHttpRequest();	
	}else{
		if(windows.ActiveXObject){
			try{
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
		}
	}
	
	if (xhr){
		var ci = encodeURIComponent(document.getElementById('ciudad').value);
		var ub = document.getElementById('ubicacion');
		xhr.open("GET", "ubicaciones.php?ciudad=" + ci, true);
		
		
		xhr.onreadystatechange=function(){
			if (xhr.readyState==4 && xhr.status==200){
				if(ci == "todas"){
					//ubAjax.disabled = true;
				}else{
					ub.innerHTML = xhr.responseText;

					
				}
				
			}
	  	};
		xhr.send(null);
						
	}
} 

