function act_ciudad(cmb_depto,cmb_ciudad){
	var id_depto=cmb_depto.options[cmb_depto.selectedIndex].value;
	for(i = cmb_ciudad.length; i > 0; i--){
		if(navigator.appName == 'Netscape')
			cmb_ciudad.options[i] = null;
		else
			cmb_ciudad.remove(i);
	}		
	for(i=1;i<arrciudad.length;i++){	
		if(arrciudad[i].id_depto==id_depto)
			cmb_ciudad.options[cmb_ciudad.length]=new Option(arrciudad[i].nombre,arrciudad[i].id_ciudad);
	}
}

function abrir(url,nombre,w,h){
	window.open(url,nombre,"width="+w+",height="+h+",toolbar=no,scrollbars=yes")
}
function isNumeric(dato){
	if(dato=="")
		return false;
	else
		if(isNaN(dato))
			return false;
		else
			return true;
}

function vacio(dato){
	if(dato.length<=0)
		return true;
	else
		return false;
}

function val_campo(tipo,campo,nombre,formato,dim){
	switch (tipo){
		case 1://Caja de texto
			if(vacio(campo.value)){
				alert("El campo "+ nombre +" no puede ser vacío.");
				campo.focus();
				return false;
			}
			if((dim > 0)&&(campo.value.length<dim)){
				alert("El campo "+ nombre +" debe tener mínimo "+dim+" caracteres.");
				campo.focus();
				return false;
			}
		break;
		case 2://Lista desplegable
			if(campo.selectedIndex==0){
				alert("Seleccione una opción en "+nombre+".");
				campo.focus();
				return false
			}
		break;
	}
	return true;
}
function Posicion(x,y)
{
	var leftPosition =(screen.width) ?(screen.width-x)/2 :0;
	var topPosition =(screen.height) ?(screen.height-y)/2 :0;
	window.moveTo(leftPosition,topPosition);
	window.resizeTo(x,y);
}

function fb_VerificarEmail(sData){
	if (sData == "")
		return false;
	if (sData.indexOf("@")<2)
		return false;
	if (!((sData.indexOf(".com")> 1) || (sData.indexOf(".net")> 1) || (sData.indexOf(".org")> 1) && (sData.indexOf(".mil")> 1) || (sData.indexOf(".edu")> 1)))
		return false;
	return true;
}
