function ch_color(obj)
{    
    obj.style.color="white";

    obj.style.cursor="pointer";
    obj.style.textDecoration="underline";
    //document.getElementById("list").style.display='block';
    return;
}
    
function res_color(obj)
{    
    obj.style.color="#ffb600";

    obj.style.cursor="default";
    obj.style.textDecoration="none";
    //document.getElementById("list").style.display='none';
    return;
}

function set_menu(n)
{    
    var f=document.getElementById('menuform');
    f.elements[0].value=n;
    //alert(n);
    f.submit();
    return;
}

function comp_etos(obj)
{
    var x=0, y=0;
    var str='';

    x=parseInt(obj.value);
    if(isNaN(x))
    {
        obj.value='';
        document.getElementById('t4').value='';
        document.getElementById('t5').value='';
    }
    else
    {
        x;
        y=x;
        y++;
        obj.value=x +'-'+y;
        str=obj.value.split("-");
        document.getElementById('t4').value=str[0]+'-07-01';
        document.getElementById('t5').value=str[1]+'-06-30';
        document.getElementById('tyear_id').value= 10000*x + y;
    }
    
    return;
}
    
    function show(x)
    {
        switch(x)
        {
            case 0:
                document.getElementById('adm_id').style.display='none';
                document.getElementById('club').style.display='block';
            break;
            case 1:
                document.getElementById('adm_id').style.display='block';
                document.getElementById('club').style.display='none';
            break;
        }
        return;
    }
    
    function copy_id(from, to)
    {

        var k=0;
        k=from.value;
        //alert(k);
        document.getElementById(to).value=k;
        return;
    }
    
    function delrow(r)
    {

        var n=document.getElementById('maintable').rows.length;

        if (n > 3)
        {
            document.getElementById('maintable').deleteRow(r);
            document.getElementById('maintable').insertRow(r);
        }
        return;
    }
    
function CheckDate(x)
{
    var str='', d='', m='', y='';
    var k=0, dis=0;
    var DaysOfMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    var DaysOfMonthDis = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
    str=x.split("/");
    if(str.length==3)
    {
        d=str[0];
        m=str[1];
        y=str[2];
        k=parseInt(m,10);
        if (k > DaysOfMonth.length || k<1)
        {
            x='00/00/0000';
            return(x);

        }
        else
        {

            var k2=parseInt(d,10);

            if(k2 > DaysOfMonthDis[k-1])
            {
                x='00/00/0000';
                return(x);
            }
        }


        k=parseInt(m,10);
        if(k==2)
        {
            k=parseInt(y,10);
            if (k%100!=0)
            {
                //alert("οχι διαιρ με 100");
                if(k%4==0)
                {
                    //alert("διαιρ με 4 (δισ)");
                    dis=1;
                }
                else
                {
                    //alert("οχι διαιρ με 4 ή 100");
                    dis=-1;
                }
            }
            else
            {
                //alert('διαιρ με 100');
                if(k%400==0)
                {
                    //alert('διαιρ με 100 κ 400 (δισ)');
                    dis=1;
                }
                else
                {
                    //alert('διαιρ με 100 όχι με  400 ');
                    dis=-1;
                }
            }
            if(dis > 0)
            {
                if(d > DaysOfMonthDis[m-1])
                    x='00/00/0000';
            }
            else
            {
                if(d > DaysOfMonth[m-1])
                    x='00/00/0000';
            }
        }
    }
    else
    {
        x='00/00/0000';
    }
    return(x);
}

function open_win(surl)
{
    //alert(surl);
    //window.open(surl,"_blank","fullscreen=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,  width=450px, height=500px, titlebar=no")
    window.open(surl,"_blank","fullscreen=no, toolbar=no, location=no, directories=no, status=no, menubar=no, titlebar=no, scrollbars=yes, resizable=no,  width=450px, height=500px")
    return;
}

function setformcolor(num)
{
    var i=0;
    for (i=0;i<num;i++)
    {
        document.getElementById('idfrm1').elements[i].style.color='black';
        //document.getElementById('idfrm1').elements[i].style.fontStyle='normal';
        //document.getElementById('idfrm1').elements[i].style.color='white';
        //document.getElementById('idfrm1').elements[i].style.backgroundColor='white';
    }
    return;
}


