	function selText()
		{
		document.getElementById("chart_link").select();
		}

	function gcg_create_link()
	{
	
	charttype_selected=document.forms[0].gcg_charttype;
	charttype="cht=p3";
	for (i=0;i<charttype_selected.length;++ i)
	{
		 if (charttype_selected[i].checked)
		{
			charttype="cht=" + charttype_selected[i].value;
		}
	}
		
	// Chart Size
	chart_width = document.forms[0].gcg_width.value;
	chart_height = document.forms[0].gcg_height.value;
	
	// Chart Background
	chart_bg = document.forms[0].gcg_bgcolor.value;
	if (chart_bg != "")
	{
		chart_bg = "&chf=bg,s," + chart_bg;
	}
	
	// Chart Data
	chartdata=document.forms[0].gcg_chartdata;
	var data = new Array();
	{
	for (i=0;i<chartdata.length;i++)
		if (chartdata[i].value) {
		data[i] = chartdata[i].value;
	  	}
	}
		
	// Chart Data Colors
	chartdata_colors=document.forms[0].gcg_data_color;
	var chart_colors= new Array();
	for (i=0;i<chartdata_colors.length;i++)
	{
	  if (chartdata_colors[i].value)
	  {	  
		chart_colors[i] = chartdata_colors[i].value;
		}
	}
	var data_color_string = chart_colors.join("|");
	if (data_color_string != "") {
	data_color_string = "&chco=" + data_color_string;
	}
	
	
	// Chart Labels
	chartlabels=document.forms[0].gcg_labels;
	var labels = new Array();
	for (i=0;i<chartlabels.length;i++)
	{
	  if (chartlabels[i].value)
	  {
		labels[i] = chartlabels[i].value;
		}
	}
	var labelstring = labels.join("|");
	if ((labelstring != "") && (charttype != "cht=lc")){
	labelstring = "&chl=" + labelstring;
	} else if ((labelstring != "") && ((charttype == "cht=lc") || (charttype == "cht=bvs"))){
	labelstring = "&chxt=x&chxl=0:|" + labelstring;
	}

	// Show Chart Data Point Labels
	
	if (document.forms[0].gcg_chart_point_labels.checked) {
		data_point_labels = "&chm=N*f0*,000000,0,-1,11";
	}
	else {
	data_point_labels = "";
	}
	
	// Chart Title
	chart_title_line_1 = document.forms[0].gcg_title_line1.value;
	if (chart_title_line_1 !="") {
		chart_title_line_1 = chart_title_line_1.replace(" ", "+");
		title="&chtt=" + chart_title_line_1;
		chart_title_line_2 = document.forms[0].gcg_title_line2.value;
			if (chart_title_line_2 !="") {
				chart_title_line_2 = chart_title_line_2.replace(" ", "+");
				title=title + "|" + chart_title_line_2;
			}
	}
	else {
	chart_title_line_2 = document.forms[0].gcg_title_line2.value;
	if (chart_title_line_2 !="") {
			alert("Chart Title Line 1 is empty.");
		}
		title="";
	}
	
	if (title !=""){
		chart_title_font_color = document.forms[0].gcg_title_font_color.value;
		chart_title_font_size = document.forms[0].gcg_title_font_size.value;
		if (chart_title_font_color != "") 
		{
			if (chart_title_font_size != "") 
				{
				title_font="&chts=" + chart_title_font_color + "," + chart_title_font_size;
				}
			else
				{
				title_font="&chts=" + chart_title_font_color;
				}
		}
		else 
		{
				title_font="";
				if (chart_title_font_size != "")
				{
				alert("Chart Tile must have a color if size is specified.");
				}
		}
	}
	
	document.getElementById("chart_link").value="http://chart.apis.google.com/chart?" + charttype + "&chs=" + chart_width + "x" + chart_height + chart_bg + "&chd=t:" + data + data_color_string + data_point_labels + labelstring + title + title_font;
	document.getElementById("chart").src=document.getElementById("chart_link").value;
	
}