	function check_all(form)
    {
     for(i=0 ; i<form.elements.length; i++)
     {
       if(form.elements[i].name.substring(form.elements[i].name.lastIndexOf("chkEdit"),form.elements[i].name.length) == "chkEdit")
       {
         if(form.ChkHeader.checked)
         {
           form.elements[i].checked = true;
         }
         else
         {
           form.elements[i].checked = false;
         }
      }
    }
   }
   function check_parent(form)
    {
     var intCont=0;
     var intSel=0;
     
     for(i=0 ; i<form.elements.length; i++)
     {
       if(form.elements[i].name.substring(form.elements[i].name.lastIndexOf("chkEdit"),form.elements[i].name.length) == "chkEdit")
       {
         intCont++;
         if (form.elements[i].checked)
           intSel++;
      }
     }
     if (intCont>0)
     {
       if (intCont==intSel)
         form.ChkHeader.checked=true;
       else
         form.ChkHeader.checked=false;
     }          
   }
function FCalendario(num_campo) 
{
    var matParam = new Array(2);
    campo = num_campo;
    matParam[0] = window;
    switch (campo) 
    {
         case 0:	matParam[1] = "txtFecha"; break;
        
    }
    window.showModalDialog("Calendario/calendar.html",matParam,"dialogHeight:210px; dialogWidth:280px; center:yes; help:no; resizable:no; status:no");
}

function FCalendarioMant(tipo,campo) 
{
    var matParam = new Array(2);
    matParam[0] = window;
    switch (campo) 
    {
        case 0:	matParam[1] = "txtFecInicio"; break;
       
        
    }
    
    window.showModalDialog("../Calendario/calendar.html",matParam,"dialogHeight:210px; dialogWidth:280px; center:yes; help:no; resizable:no; status:no");
}

function IsMail(YourMail)
{
//	var Template = /^[a-z][a-z-_0-9.]+@[a-z-_=>0-9.]+.[a-z]{2,3}$/i //Formato de direccion de correo electronico

	var Template = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ //Formato de direccion de correo electronico

	if(YourMail.value!="") 
	{
		if (Template.test(YourMail.value)) 
		{							}
		
		
		else
		{   
				alert("El Email que ha Ingresado tiene Caracteres Invalidos");
			YourMail.focus();
			YourMail.select();
		}		
	}
	return false;
}


function NewWindow(mypage,myname,w,h,scroll,resi)
{
    var win = null;
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
    MH = screen.height,
    MW = screen.width,
    //settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable=' + resi + ', fullscreen=yes'
    settings = 'height=' + MH + ',width=' + MW + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable=yes, fullscreen=yes'
    win = window.open(mypage,myname,settings,resi)

    if (win.window.focus) { win.window.focus(); }
    
}


function AbreVentana(pagina,nombre) {
  var win = null;
  var windowName = nombre;
//  alert("Hola");
    win =  window.open(pagina, windowName,'toolbar=no,location=no, directories=no, status=no, menubar=no ,scrollbars=yes, resizable=yes, fullscreen=yes', 1 );
    if(win.window.focus){win.window.focus();}
}


function cerrar() {
    //opener.location.reload(); 
    var ventana = window.self;
    ventana.opener = window.self;
    parent.close();
}

function Regresar() {

var ventana = window.self;
ventana.opener = window.self;
ventana.opener.focus();
}

function CerraryRegresar() {
var ventana = window.self;
ventana.opener = window.self;
parent.close();
}

