﻿function doSlide(id,id1) {

    timeToSlide = 8; // in milliseconds

    obj = document.getElementById(id);
    obj1 = document.getElementById(id1);

    if (obj.style.height == "0px") { // if it's allready hidden we slide it down  

        obj.style.visibility = "hidden";

        obj.style.display = "block";
                
        height = obj1.offsetHeight;

        obj.style.height = "0px";

        obj.style.visibility = "visible";

        slideDown(obj, 0, height, Math.ceil(height / timeToSlide));
        //NLBfadeBg(id, '#FFFFFF', '#fff1e4', '1000');

    } else {

    slideUp(obj, Math.ceil(obj.offsetHeight / timeToSlide), 0);
    //NLBfadeBg(id, '#fff1e4', '#FFFFFF', '1000');

    }

}
 function slideDown(obj, offset, full, px) {

     if (offset < full) {

         obj.style.height = offset + "px";

         offset = offset + px;

         setTimeout((function() { slideDown(obj, offset, full, px); }), 1);

     } else {

         obj.style.height = full + "px"; //If the data inside is updated on runtime you can use auto instead...  

     }

 }
 function slideUp(obj, px, full) {

     if ((obj.offsetHeight - px) > 0) {

         obj.style.height = obj.offsetHeight - px + "px";         

         setTimeout((function() { slideUp(obj, px, full); }), 1);

     } else {

         obj.style.height = full + "px"; // we reset the height if we were to slide it back down  

         //obj.style.display = 'none';

     }

 }


 function doSlide1(id, id1) {

     timeToSlide = 20; // in milliseconds

     obj = document.getElementById(id);
     obj1 = document.getElementById(id1);

     if (obj.style.height == "25px") { // if it's allready hidden we slide it down  

         //obj.style.visibility = "hidden";

         //obj.style.display = "block";

         height = obj1.offsetHeight;

         obj.style.height = "25px";

         //obj.style.visibility = "visible";

         slideDown1(obj, 25, height, Math.ceil(height / timeToSlide));
         //NLBfadeBg(id, '#FFFFFF', '#fff1e4', '1000');

     } else {

         slideUp1(obj, Math.ceil(obj.offsetHeight / timeToSlide), 25);
         //NLBfadeBg(id, '#fff1e4', '#FFFFFF', '1000');

     }

 }
 function slideDown1(obj, offset, full, px) {

     if (offset < full) {

         obj.style.height = offset + "px";

         offset = offset + px;

         setTimeout((function() { slideDown1(obj, offset, full, px); }), 1);

     } else {

         obj.style.height = full + "px"; //If the data inside is updated on runtime you can use auto instead...  

     }

 }
 function slideUp1(obj, px, full) {

     if ((obj.offsetHeight - px) > 25) {

         obj.style.height = obj.offsetHeight - px + "px";

         setTimeout((function() { slideUp1(obj, px, full); }), 1);

     } else {

         obj.style.height = full + "px"; // we reset the height if we were to slide it back down  

         //obj.style.display = 'none';

     }

 }
