function FechaEsValida (dia,mes,ano,oblig){
	Error=true;
	if (oblig==true){
		if (dia=="" || mes=="" || ano=="")
			Error=false;
	}
	if ((mes>12) || (dia>31))
			{Error=false;}
	if (((mes==4)||(mes==6)||(mes==9)||(mes==11)) && (dia==31)){
			Error=false;}
	if ((mes==2) && (dia>28)){
			Error=false;}
	resto=ano%4;

	if ((resto==0) && (mes==2) && (dia==29)){
			Error=true;}
	if (ano<1880)
		{Error=false;}
	return Error;
}


function EmailValido(pass){
    if (pass)
    {
       var tevaloresults = true;
       var index = 0;
       var filter=/^.+@.+\..{2,3}$/
       var filter2=/\.\./
       var rejected = false;
       var rejectedDomain=new Array();
       rejectedDomain[index]="";
       if (filter.test(pass))
       {
	    	var tempstring = pass.split("@");
            tempstring = tempstring[1].split(".")
            for ( i = 0; i < rejectedDomain.length; i++)
              if (tempstring[0]==rejectedDomain[i])
                rejected=true
            if (rejected)
            {
              return false
            }
            if ( filter2.test(pass) )
              return false;
       }
       else
         return false;
   }
   else
     return false;
  return true;
}


/*
 *  WRAPPER DEL DIALOG
 *  Recibe :
 *     title : el titulo del Alert
 *     mensaje : texto informativo
 *     options : opciones para inciar el dialog
 *     
 **/
function Alertar(title,mensaje,options){
    $("<div title='"+ title +"'>"+ mensaje +"</div>").dialog({
        modal: true ,
        buttons: { "Ok": function() {$(this).dialog("close");} }
    });
}


function AlertarConEvtCerrar ( title , mensaje , onCloseEvent ){

    $("<div title='"+ title +"'>"+ mensaje +"</div>").dialog({
        modal: true ,
        buttons: { "Ok": function() {$(this).dialog("close");} },
        close : onCloseEvent
    });

}

function IsNumeric(input){
   return (input - 0) == input && input.length > 0;
}

function isInt(x) {
   var y=parseInt(x);
   if (isNaN(y)) return false;
   return x==y && x.toString()==y.toString();
}



