var tmp;
var sayi = 0;
var animationing = false;

// Bu kısım eğer tek menu açılması istenirse tanımlanacak
var myMenuDis=new Array();
var myMenuIc=new Array();
// ----------------------------

function yardimanimasyon(div1,div2)
{

            if (document.getElementById(div1).offsetHeight >= document.getElementById(div2).offsetHeight)
            {
                //menukapat(div1,div2);
                document.getElementById(div1).style.height = "0px";
                
            } else 
            {
               //menuac(div1,div2);
               document.getElementById(div1).style.height = document.getElementById(div2).offsetHeight +"px";
            }
}

function animasyon(div1,div2)
{

    for (count = 0; count < myMenuDis.length; count++)
    {

        if ( myMenuDis[count] !=  div1 )
        {
        
            if (document.getElementById(myMenuDis[count]).offsetHeight >= document.getElementById(myMenuIc[count]).offsetHeight)
            {
                menukapat(myMenuDis[count],myMenuIc[count]);
            }
        }
        else 
        {
            if (document.getElementById(myMenuDis[count]).offsetHeight <= 1 )
            {
                if ( animationing == false ) 
                {
                    menuac(myMenuDis[count],myMenuIc[count]);
                }
            }
        }
  
    
    }
    
}

function menuac(div1,div2)
{
    uzunluk = document.getElementById(div2).offsetHeight;
    
    var str = String(document.getElementById(div1).offsetHeight);
    var arttir = parseInt(str) + 60 ;
    document.getElementById(div1).style.height = String(arttir)+'px';
    
    if (document.getElementById(div2).offsetHeight >= document.getElementById(div1).offsetHeight)
    {
        animationing = true;
        
        var t=setTimeout("menuac('"+div1+"','"+div2+"');",1);
    }
    else
    { 
        animationing = false;
    }
}


function menukapat(div1,div2)
{
    

    uzunluk = document.getElementById(div2).offsetHeight;
    
    var str = String(document.getElementById(div1).offsetHeight);
    
    
    var azalt = 1;
    
    if (parseInt(str) >= 10)
        azalt = parseInt(str) - 60  ;
    
    document.getElementById(div1).style.height = String(azalt)+'px';
    if (document.getElementById(div1).offsetHeight > 1 )
    {
        var t=setTimeout("menukapat('"+div1+"','"+div2+"');",1);
    }
}

