// Google Charts API Javascript settings.
	// Base Variable Setup
function gcharts(title, legendnames) {
	//this = {};
	this.sizes = {};	
	this.sizes.L = {};
	this.sizes.S = {};
	
	this.markers = {};
	this.labels = {};
	this.grid = {};
	this.data = {};
	this.datamax = 100;
	this.datamaxvalues = {};
	this.labels.x = [];
	this.labels.y = [];
	this.legend = {};
	this.type = {};
	
	// Master Custom Settings
	this.title = title;
	this.colours = "FFBB00,00BBFF,33FF99";		
	this.sizes.L.x = 650;
	this.sizes.L.y = 350;
	this.sizes.S.x = 300;
	this.sizes.S.y = 150;
	this.font = "";
	this.type.line = "";
	this.type.bar = "bvg";
	
	this.legend.pos = "b";
	this.legend.names = legendnames;	
	
	this.markers.type = "f0";
	this.markers.colour = "000000";
	this.markers.fontsize = 8;
	this.grid.x = (100/13);
	this.grid.y = (100/gcharts.datamax*100);
}
// Chart Data Encoding
var simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

function simpleEncode(valueArray,maxValue) {

	var chartData = [''];
	  for (var i = 0; i < valueArray.length; i++) {
	    var currentValue = valueArray[i];
	    if (!isNaN(currentValue) && currentValue >= 0) {
	    chartData.push(simpleEncoding.charAt(Math.round((simpleEncoding.length-1) * 
	      currentValue / maxValue)));
	    }
	      else {
	      chartData.push('_');
	      }
	  }
	return chartData.join('');
}
