﻿function doSlide(id,id1) {

    timeToSlide = 30; // in milliseconds

    obj = document.getElementById(id);
    obj1 = document.getElementById(id1);

    if (obj.style.height == "75px") { // if it's allready hidden we slide it down  

        obj.style.visibility = "hidden";

        obj.style.display = "block";
        
        
        height = obj1.offsetHeight + 13;

        obj.style.height = "75px";

        obj.style.visibility = "visible";

        slideDown(obj, 75, height, Math.ceil(height / timeToSlide));
        NLBfadeBg(id, '#FFFFFF', '#fff1e4', '1000');

    } else {

    slideUp(obj, Math.ceil(obj.offsetHeight / timeToSlide), 75);
    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) > 75) {

         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 = 30; // in milliseconds

     obj = document.getElementById(id);
     obj1 = document.getElementById(id1);

     if (obj.style.height == "13px") { // if it's allready hidden we slide it down  

         obj.style.visibility = "hidden";

         obj.style.display = "block";


         height = obj1.offsetHeight;

         obj.style.height = "13px";

         obj.style.visibility = "visible";

         slideDown1(obj, 13, height, Math.ceil(height / timeToSlide));
         NLBfadeBg(id, '#FFFFFF', '#fff1e4', '1000');

     } else {

         slideUp1(obj, Math.ceil(obj.offsetHeight / timeToSlide), 13);
         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) > 13) {

         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';

     }

 }
