

    function getOffsetTop(ele)
    {
        var top = 0;
    	var parentScroll = getScrollParent(ele);
    	var scroll = parentScroll == null ? 0 : parentScroll.scrollTop;
    	
    	
        while (ele != null)
        {
	        if(ele.offsetTop != null)
		        top += parseInt(ele.offsetTop); 		
	        ele = ele.offsetParent;
        }
        return top - scroll;	
    }

   
    function getOffsetLeft(ele)
    {
        var left = 0;
        var parentScroll = getScrollParent(ele);
    	var scroll = parentScroll == null ? 0 : parentScroll.scrollLeft;
    	
        while (ele != null)
        {
	        if(ele.offsetLeft != null)
		        left += parseInt(ele.offsetLeft); 		
	        ele = ele.offsetParent;
        }
        return left - scroll;	
    }
    
    
    function getScrollParent(ele)
    {
        var left = 0;
    	var ele = ele.parentElement;
    	
        while (ele != null && ele.scrollTop == 0 && ele.scrollLeft == 0)
        {
	        ele = ele.parentElement;
        }
        
        return ele
    }
    
    
    

    function isTrue(value)
	{
		if(value == true || value == 'true' || value == 'True' || value == 'TRUE' || value == 1 || value == '1' || value == -1 || value == '-1')
			return true;
		else
			return false;
	}
    
    
   function executeFunctions(f)
    {
        var functions = f.split(';');
        var iFunc = 0;
        var retValue = null;
        var a = new Array();
        var paramString = '';
        
        //build the parameter string
        for(var i = 1; i < arguments.length; i++)
        {
            a[i-1] = arguments[i];
            paramString += 'a['+(i-1).toString() + '],'
        }
        
        //remove the last ','
        if(paramString.length > 0)
            paramString = paramString.substring(0, paramString.length-1);
        
        for(iFunc = 0; iFunc < functions.length; iFunc++)
        {
            if(functions[iFunc].length > 0)
            {  
                var currFunc = functions[iFunc] + '(' + paramString + ')';
                if (currFunc.substring('return') != 0)
                    currFunc = 'return ' + currFunc;
                var func = new Function("a", currFunc); //pass a param to the function
                retValue =  func(a); //call the function
                delete func;  //dont think this works but try and clean up the function
                func = null;
            }
        }
        return retValue;
    }
    
    /* Begin class bufferedString */
    function bufferedString()
    {
	    this.stringBuffer = new Array(); 
	    this.m_length = 0;
	    this.toString = bufferedString_toString;
	    this.length = bufferedString_length;
	    this.clear = bufferedString_clear;
	    this.add = bufferedString_add;
    }

    function bufferedString_toString()
    { 
	    return this.stringBuffer.join(""); 
    };

    function bufferedString_length()
    { 
        alert('length no longer available due to performance enhancements.');
    };

    function bufferedString_clear()
    { 
	    this.length = 0;
	    this.stringBuffer = null; 
	    this.stringBuffer = new Array(); 
    };

    function bufferedString_add(data)
    {
        this.stringBuffer.push(data);
    };
/* end class bufferedString */


    