<!--
function CheckXls(StrPath)
{
	var ext = StrPath.substr(StrPath.lastIndexOf(".") + 1).toLocaleLowerCase();
	if (ext != "xls")
		return false;
	else
		return true;
}

function CheckJpeg(StrPath)
{
	var ext = StrPath.substr(StrPath.lastIndexOf(".") + 1).toLocaleLowerCase();
	if (ext != "jpg" && ext != "jpeg")
		return false;
	else
		return true;
}

function MM_openBrWindow( theURL, winName, features ) { //v2.0

  window.open( theURL, winName, features );

}


function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII

	obj.style.backgroundColor=pviiColor;

}

function isValidName(sName) 
{ 
	var emailexp = /[^a-zA-Z_0-9\-\.]/;

	if( emailexp.test(sName) ) 
		return false;
	else 
		return true; 
} 


function isValidEmail( sEmail ) { 

	var emailexp = /[a-z_0-9\-\.]@[a-z_0-9\-\.]+\.([a-z]{2}|[a-z]{3})$/i;
	if( emailexp.test( sEmail ) ) 
		return true;
	else 
		return false; 

} 


function getRadioValue(element) {

	for (var n = 0; n < element.length; n++) {
		if (element[n].checked)
			return element[n].value;
	}
	// Caso particular en el que hay solo un elemento en el objeto radio button
	// porque lentgh no devuelve nada.
	if (element.checked) 
		return element.value;
	else 
		return ("");

}


function ShowMessage( element, message, BolSelect ) {

	alert( message );
	element.focus();
	if( BolSelect )
		element.select();

}

function CheckDateInput( FieldName )
{
	if( FieldName.value == "" ) return false;

	var IntDay = FieldName.value.substring( 0, FieldName.value.indexOf( "/" ) );
	if( IntDay == "" || isNaN( IntDay ) || IntDay > 31 ) return false;

	var IntMonth = FieldName.value.substring( FieldName.value.indexOf( "/" ) + 1, FieldName.value.lastIndexOf( "/" ) );
	if( IntMonth == "" || isNaN( IntMonth ) || IntMonth > 12 ) return false;

	var IntYear = FieldName.value.substring( FieldName.value.lastIndexOf( "/" ) + 1, FieldName.value.length );
	if( IntYear == "" || isNaN( IntYear ) ) return false;

	if( CheckDate( IntYear, IntMonth, IntDay ) ) 
		{ return true; }
	else 
		{ return false; }
}

// funcion auxiliar para la validacion de fecha
function CheckDate( Year, Month, Day ) 
{
	DateFrom = new Date( Year, Month - 1, Day );
    if( DateFrom.getDate()!= Day || Day > DaysInMonth( Year, Month ) )
		{ return false; }
	else
		{ return true; }
} 

// funcion auxiliar para la validacion de fecha
function DaysInMonth( WhichYear, WhichMonth ) 
{
  var DaysInMonth = 31;

  if( WhichMonth == 4 || WhichMonth == 6 || WhichMonth == 9 || WhichMonth == 11) 
  	DaysInMonth = 30;

  else if( WhichMonth == 2 && ( WhichYear/4 ) != Math.floor( WhichYear/4 ) )
  	DaysInMonth = 28;

  else if( WhichMonth == 2 && ( WhichYear/4 ) == Math.floor( WhichYear/4 ) )
  	DaysInMonth = 29;

  return DaysInMonth;
}

//-->