function Slide(slidePanel, slideContent, slideHeight)
{
    //Constants.
    var SLIDING_ELEMENT_INCREMENT = 10;  //Higher is faster.
    var SLIDING_ELEMENT_TIMEOUT = 30;  //Lower is faster.

    var OnBeginSlideCallBackMethod = null;
    var OnSlideCancelCallBackMethod = null;
    var OnSlideCompleteCallBackMethod = null;
    
    var slidingPanelOriginalHeight = 0;
    var cancelSlideTimeoutID = '';

    this.SlidePanel = document.getElementById(slidePanel);
    this.SlideContent = document.getElementById(slideContent);

    this.BeginSlide = function()
    {
        try
        {
            if (this.SlideContent.style.display == 'block')
            {
                //Do nothing as it's already visible.
            }
            else
            {
                var height = 0;
                if (slidingPanelOriginalHeight == 0)
                {
                    this.SlidePanel.style.display = 'block';
                    slidingPanelOriginalHeight = slideHeight;
                    height = 0;
                }
                else
                    height = this.SlidePanel.offsetHeight;

                // Set the element height
                var currentHeight = parseInt(height) + parseInt(SLIDING_ELEMENT_INCREMENT);
                this.SlidePanel.style.height = currentHeight + 'px';

                // if this is our first parse in this methoe fire the begin slide event
                if (currentHeight <= parseInt(SLIDING_ELEMENT_INCREMENT))
                    if (OnBeginSlideCallBackMethod != null) OnBeginSlideCallBackMethod();

                // Work out if further sliding is required
                if (currentHeight >= slidingPanelOriginalHeight)
                {
                    this.SlidePanel.style.height = 'auto';
                    slidingPanelOriginalHeight = 0;
                    this.SlidePanel.style.height
                    this.SlideContent.style.display = 'block';

                    // fire complete slide event
                    if (OnSlideCompleteCallBackMethod != null) OnSlideCompleteCallBackMethod();
                }
                else
                {
                    var me = this;
                    cancelSlideTimeoutID = setTimeout(function() { me.BeginSlide() }, SLIDING_ELEMENT_TIMEOUT);
                }
            }
        }
        catch (e)
        {
        }
    }

    //Cancels the slide and returns the panel back to its original state.
    this.CancelSlide = function() 
    {
        try 
        {
            // only raise the event if it has been displayed
            var raiseEvent = this.SlideContent.style.display == 'block';
            
            this.SlidePanel.style.height = '';
            this.SlidePanel.style.display = 'none';
            this.SlideContent.style.display = 'none';
            slidingPanelOriginalHeight = 0;
            clearTimeout(cancelSlideTimeoutID);

            if (raiseEvent)
                if (OnSlideCancelCallBackMethod != null) OnSlideCancelCallBackMethod();
        }
        catch (e) 
        {
        }
    }
    
    this.IsVisible = function()
    {
        if (this.SlideContent.style.display == 'block')
		    return true;
	    else
	        return false;
	}

	this.OnBeginSlide = function(callBackMethod) 
	{
	    OnBeginSlideCallBackMethod = callBackMethod;
	}

	this.OnSlideComplete = function(callBackMethod)
	{
	    OnSlideCompleteCallBackMethod = callBackMethod;
	}

	this.OnSlideCancel = function(callBackMethod) 
	{
	    OnSlideCancelCallBackMethod = callBackMethod;
	}    
}