function openModal(url1,w,h)
{
		window.open(url1,"name","height="+h+",width="+w+",left=0,top=0");
}
function limpiarDiv(nombre)
{
		document.getElementById(nombre).innerHTML="";
}
function IsTipoArchivo(nA,tipo) {
	//alert(tipo);
	tipo=tipo.toUpperCase();
	nA=nA.toUpperCase();
	if (nA != "" && nA.indexOf("."+tipo)!=-1)
	{
		p=nA.indexOf("."+tipo);
		if(nA.substr(p+1,nA.length-(p+1))==tipo)
			return true;
	}
    return false;
}

function Isfecha(valor) 
{
	if (valor.indexOf("/")>-1)
	{
		aJecha=valor.split("/");
		if (aJecha.length==3)
		{
			var dia=aJecha[0];
			var mes=aJecha[1];
			var ano=aJecha[2];
			if (IsNumeric(ano) && IsNumeric(mes) && IsNumeric(dia) && ano!="" && aJecha[1].length==2 && aJecha[0].length==2)
			{ 
				ano=parseInt(ano,10);
				mes=parseInt(mes,10);
				dia=parseInt(dia,10);
				if ((ano==0) || (ano<1900) || (ano>2100)) 
					{return false; }
				if (mes ==2) 
				{ 
					if ((ano%4 == 0) && (dia<=29) && (dia>0)) 
						{return true;}
					else if((dia<=28) && (dia>0))
						{return true;}
					else
						{return false; }
				} 
				else if (((mes==1) || (mes==3) || (mes==5) || (mes==7) || (mes==8) || (mes==10) || (mes==12)) && (dia<=31) && (dia>0)) 
				{return true; } 
				else if (((mes==4) || (mes==6) || (mes==9) || (mes==11)) && (dia<=30) && (dia>0)) 
				{return true; }
				else 
					{return false; }
			} 
			else 
				{return false; } 
		}
		else 
			{return false; }
	}else 
		{return false; }
}


function IsNumeric(valor) 
{ 
	var log=valor.length; var sw="S"; 
	for (x=0; x<log; x++) 
	{ 
		v1=valor.substr(x,1); 
		v2 = parseInt(v1); 
		//Compruebo si es un valor numérico 
		if (isNaN(v2)) { sw= "N";} 
	} 
	if (sw=="S") 
		{return true;} 
	else 
		{return false; } 
} 