    	/*
    	
    	
    	UTILITY FUNCTIONS
    	
    	
    	*/
    	
	    // return month abbreviation
	    function m(val, skip) {
	    	val = (val > 12) ? val - 12 : val;
			monthAbbreviations = (skip) ? "###Jan   Mar   May   Jul   Sep   Nov   " : "###JanFebMarAprMayJunJulAugSepOctNovDec";
	    	return monthAbbreviations.substring(val * 3, val * 3 + 3);
	    }
	    
	    function yr(val) {
	    	return (val > 12) ? '2009' : '2008';
	    }
	    
	    // create array for ticks
	    function monthTicks(max) {
	    	var ticks = [];
	    	for(i=1; i<=(max); i++) {
	    		ticks.push([i, m(i,true)]);
	    	}
	    	return ticks;
	    }
	    
		function showTooltip(x, y, contents) {
			$('<div id="tooltip">' + contents + '</div>').css( {
			    position: 'absolute',
			    display: 'none',
			    top: y + 5,
			    left: x + 5,
			    border: '1px solid #fdd',
			    padding: '2px',
			    'background-color': '#fee',
			    opacity: 0.80
			}).appendTo("body").fadeIn(200);
		}	 	    
		
		function addCommas(nStr)
		{
			nStr += '';
			x = nStr.split('.');
			x1 = x[0];
			x2 = x.length > 1 ? '.' + x[1] : '';
			var rgx = /(\d+)(\d{3})/;
			while (rgx.test(x1)) {
				x1 = x1.replace(rgx, '$1' + ',' + '$2');
			}
			return x1 + x2;
		}		
