var bourse_symbolsWithImg = new Array('TSX-I','COMP-I','DJIA-I','SPX-I');
	
function Value_In_Array(ArrayObj, SearchFor)
{
for (var i = 0; i < ArrayObj.length; i++)
{
  if (ArrayObj[i] == SearchFor)
  {
    return true;
  }
}
return false;
}


function bourse_getArrow(val){
	switch (val){
		case 'U':
			document.write('<img src="/media/images/icons/fleche_haut.png">');
			return;
		case 'D':
			document.write('<img src="/media/images/icons/fleche_bas.png">');
			return;
		case 'N':
		default:
			document.write('<img src="/media/images/icons/vide.png">');
			return;
	}
}

function bourse_changechart(symbol){
	if (!Value_In_Array(bourse_symbolsWithImg, symbol) )
	{
    document.getElementById("globechart").innerHTML = "<strong>Graphique non disponible<"+"/strong>";
	  return;
  }
	
	var path = 'http://freechart.globeinvestor.com/servlet/charting?';
	var att =  "chart_type=png&" +
							"chart_style=stock_price&" +
							"period=INTRA&" +
							"chart_plot_type=area&" +
							"symbol=" + symbol + "&" +
							"lang=FR&" +
							"chart_fg=86A7BA&" +
							"chart_bg=FFFFFF&" +
							"img_bg=FFFFFF&" +
							"img_fg=50768B&" +
							"price_open_colour=d00b1c&" +
							"chart_size=tiny&" +
							"x_scale=true&" +
							"showTitle=TRUE&" +
							"showDate=FALSE&" +
							"chart_width=300&" +
							"chart_height=120&" +
							"showHeader=TRUE&" +
							"showYTitle=false&" +
							"removeMinute=true&" +
							"space=false&" +
							"close_line=true&" +
							"copyright=true";
	document.getElementById("globechart").innerHTML = "<img src="+path + att+" /"+">";
	return;
}
