﻿// JScript File


var popUp;	
function openCalendar(formName, ctrlName, initialDate, anioInicial, anioFinal)    
{ 
    popUp = window.open('/deportic/forms/comun/calendario.aspx?formName=' + formName + '&ctrlName=' + ctrlName + '&initialDate=' + initialDate + '&anioInicial=' + anioInicial +'&anioFinal=' + anioFinal , "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no"); 
}
function getDate(formName, id, newValue)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newValue;
	//window.document.forms[0].elements[id].value = newValue
}

	function toggleVisibility(me){
		if (me.style.visibility=="hidden"){
			me.style.visibility="visible";
			}
		else {
			me.style.visibility="hidden";
			}
		}
		   
  function ComprobarCampos(checklist,n,msg1)
    {
        var check=false;

            for (i=0; i<n && check==false;i++)
            {
                if (document.getElementById(checklist.id + "_" + i).checked==true)
                 check=true;
            }
            if (check==false)
             {
                alert(msg1);
                return false;
             }

        return true;
    }
    function ComprobarCheck(control,checklist,n)
    {
        if (control.checked==true)
        {
            for (i=0;i<n;i++)
            {
                if (control.id!=document.getElementById(checklist.id + "_" + i).id)
                {
                    document.getElementById(checklist.id + "_" + i).checked=false;
                }
            }
        }
    }