//desactivar selección en cuadros de textos
document.onselectstart = function() {return false;}//IE
document.oncontextmenu = new Function("return false");

function quitar_poner_asterisco(e)
{
	var dpto = document.getElementById("dpto");
	var ciudad = document.getElementById("ciudad");
	var txt = document.getElementById("txtlikeptoatencion");
	
	if (window.ActiveXObject)
	{	        
		var tecla=event.keyCode;
		if ((tecla==8)||(tecla==46))//8 - back y 46 - sup
		{
			if (txt.value.length==1)
			{
				dpto.innerText = dpto.innerText.replace(" ","*");
				dpto.innerHTML = "<STRONG>" + dpto.innerText + "</STRONG>";
				ciudad.innerText = ciudad.innerText.replace(" ","*");
				ciudad.innerHTML = "<STRONG>" + ciudad.innerText + "</STRONG>";
			}	
		}
		else
		{
			if ((tecla!=16)&&(tecla!=93))//8 - shift y clic derecho tecla!
			{
				dpto.innerText = dpto.innerText.replace("*"," ");
				dpto.innerHTML = "<STRONG>" + dpto.innerText + "</STRONG>";
				ciudad.innerText = ciudad.innerText.replace("*"," ");
				ciudad.innerHTML = "<STRONG>" + ciudad.innerText + "</STRONG>";
			}
		}
	}	
	else if (document.implementation && document.implementation.createDocument)
	{           	
		document.onmousedown = new Function("return false"); // mozilla   		         
		if ((e.which==8)||(e.which==46))
		{
			if (txt.value.length==1)
			{
				dpto.innerHTML = dpto.innerHTML.replace(" ","*");
				dpto.innerHTML = "<STRONG>" + dpto.innerHTML + "</STRONG>";
				ciudad.innerHTML = ciudad.innerHTML.replace(" ","*");
				ciudad.innerHTML = "<STRONG>" + ciudad.innerHTML + "</STRONG>";
			}	
		}
		else
		{
			if ((e.which!=16)&&(e.which!=93)&&(e.which!=35)&&(e.which!=36)&&(e.which!=37)&&(e.which!=38)&&(e.which!=39)&&(e.which!=40))//8 - shift y clic derecho tecla!
			{
				dpto.innerHTML = dpto.innerHTML.replace("*"," ");
				dpto.innerHTML = "<STRONG>" + dpto.innerHTML + "</STRONG>";
				ciudad.innerHTML = ciudad.innerHTML.replace("*"," ");
				ciudad.innerHTML = "<STRONG>" + ciudad.innerHTML + "</STRONG>";
			}
			else
			{
				e.cancel;
			}
		}
	}
}

function quitar_asterisco()
{
	var dpto = document.getElementById("dpto");
	var ciudad = document.getElementById("ciudad");
	var txt = document.getElementById("txtlikeptoatencion");

	if (window.ActiveXObject) //IExplorer
	{	  	
		dpto.innerText = dpto.innerText.replace("*"," ");
		dpto.innerHTML = "<STRONG>" + dpto.innerText + "</STRONG>";
		ciudad.innerText = ciudad.innerText.replace("*"," ");
		ciudad.innerHTML = "<STRONG>" + ciudad.innerText + "</STRONG>";	
	}
}

function validar_forma()
{
	var objMensaje = document.getElementById("lbMensaje");
	var ObjOpcion = document.getElementById("rblOpcion_0");
	var ObjOpcion1 = document.getElementById("rblOpcion_1");
	
	if(ObjOpcion.checked)
	 {
	    var objDpto = document.getElementById("ddldepartamento");
	    var strDpto = objDpto.options[objDpto.selectedIndex].value;
	   
	    if (strDpto=="Seleccione un Departamento")
	    {
		    objMensaje.innerHTML = "Debe seleccionar un departamento";
		    return false;
	    }
	    //item_seleccionado_ciudad();
	    return true;
	 }
	else
	 {
	   if(ObjOpcion1.checked)
	   {
	        var objCiudad = document.getElementById("ddlCiudad1");
	        var strCiudad = objCiudad.options[objCiudad.selectedIndex].value;
	        if (strCiudad=="Seleccione una Ciudad")
	        {
		        objMensaje.innerHTML = "Debe seleccionar una ciudad";
		        return false;
	        }
	        //item_seleccionado_ciudad();
	        return true;	
	    }
	    objMensaje.innerHTML = "Seleccione el tipo de búsqueda: Departamento ó Ciudad";
		return false;	   
	 }	
}

function OpenWindow(theURL,winName,features, myWidth, myHeight, isCenter) 
{
	if(window.screen)if(isCenter)if(isCenter=="true")
	{
		var myLeft = (screen.width-myWidth)/2;
		var myTop = -35 + (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}