function CheckDOB(control)
{
	if (control.value != control.oldValue)
	{
		var sDate = PopCalendar.formatDate(control.value, "dd-mmm-yyyy", "d-mmmm-yyyy");
		if (sDate != "")
		{
			var re = /(\w+)-(\w+)-(\w+)/
			if (!confirm("Usted nacio el " + sDate.replace(re,"$1 de $2 de $3") + '.'))
			{
				control.value = control.oldValue;
			}
		}
	}
	control.focus();
}

function GetMonth(nMonth)
{
	var Months = new Array("01","02","03","04","05","06","07","08","09","10","11","12");
	return Months[nMonth];
}

function checkDate(o, f)
{
	if(document.selection){document.selection.empty();}
	var sDate = PopCalendar.formatDate(o.value, f, "yyyy-mm-dd");
	var hoy = new Date();
    var Ye,Mo,Da;
    Ye = hoy.getYear();
    Mo = GetMonth(hoy.getMonth());
//  Da = hoy.getDay();
    Da = hoy.getDate();
	if (Da<10){
	 Da="0"+Da;
	}
 // Mm = data.getMinutes() + ":";
  //Ss = data.getSeconds() + ":";
  //mm = data.getMilliseconds() + ":";
	fechaactual=Ye+"-"+Mo+"-"+Da;
	//var actual = PopCalendar.formatDate(fechaactual, f, "yyyy-mm-dd")
	/*if ((sDate == "") || (sDate < "1900-01-01") || (sDate < fechaactual))
	{	//alert(sDate);
		//alert(fechaactual);
		alert("Fecha ingresada es inferior a la fecha actual. Debe ingresar una fecha posterior.");
		o.value = ""

	}*/
	
}
function keyPressed(e)
{
	if (PopCalendar.ie)
	{
		if (event.keyCode==9) 
		{
			return true;
		}
		else if (event.keyCode==46) 
		{
			return true;
		}
	}
	else
	{
		return true;
	}
	return false;
}
