var pixelsToMove = 20;
var speed = 40;
var infoList = new Array();
function infoDetail (ele,cutaway,ind) {
    this.ele = ele;
    this.cutawayEle = cutaway;
    this.cutawayBorder = false;
    this.height = ele.offsetHeight;
    this.currHeight = 0;
    this.ind = ind;
    this.grower = null;
    this.shrinker = null;
    this.open = false;
    var thisObj = this;
    try
    {
			this.grow = function() {
				if (thisObj.shrinker) clearTimeout(thisObj.shrinker);
				if (!thisObj.cutawayBorder) {
					thisObj.cutawayEle.style.borderTop = '1px solid #ccc';
					thisObj.cutawayBorder = true;
				}
				if (thisObj.currHeight < thisObj.height) {
					if (thisObj.currHeight + pixelsToMove > thisObj.height) {
						thisObj.currHeight = thisObj.height;
						thisObj.ele.style.height = thisObj.height + 'px';
						if (thisObj.grower) clearTimeout(thisObj.grower);
					} else {
						thisObj.currHeight = thisObj.currHeight + pixelsToMove;
						thisObj.ele.style.height = thisObj.currHeight + 'px';
						thisObj.grower = setTimeout('infoList[' + thisObj.ind + '].grow()',speed);
					}
				}
			}
		  
			this.shrink = function() {
				if (thisObj.grower) clearTimeout(thisObj.grower);
				if (thisObj.currHeight > 0) {
					if (thisObj.currHeight - pixelsToMove < 0) {
						thisObj.currHeight = 0;
						thisObj.ele.style.height = '0px';
						thisObj.cutawayEle.style.borderTop = 'none';
						thisObj.cutawayBorder = false;
						if (thisObj.shrinker) clearTimeout(thisObj.shrinker);
					} else {
						thisObj.currHeight = thisObj.currHeight - pixelsToMove;
						thisObj.ele.style.height = thisObj.currHeight + 'px';
						thisObj.shrinker = setTimeout('infoList[' + thisObj.ind + '].shrink()',speed);
					}
				} else if (thisObj.cutawayBorder) {
					thisObj.cutawayEle.style.borderTop = 'none';
					thisObj.cutawayBorder = false;
				}
			}
      }
    catch(e)
    {}
}
function toggleShow(ind) {
try
{
    var showEle = document.getElementById('show_services_' + ind);
    var hideEle = document.getElementById('hide_services_' + ind);
    
    if (infoList[ind].open) {
        showEle.style.display = 'inline';
        hideEle.style.display = 'none';
        infoList[ind].open = false;
        checkForHideAll();
    } else {
        showEle.style.display = 'none';
        hideEle.style.display = 'inline';
        infoList[ind].open = true;
        checkForExpandAll();
    }
    }
    catch(e)
    {}
}
