var x,y;

if (self.innerHeight) // all except Explorer
{
	//alert("Not IE");
	x = self.innerWidth;
	y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	//alert("IE Strict");
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	//alert("IE Other");
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}
	var width=x;
	var height=y;
	var chartWidth=Math.floor(width*0.9);
	var chartType="FC_2_3_StckdColumn_MSLine_DY_2D.swf";		
	//"FC_2_3_StackedArea_MSLine_DY_2D.swf";		
	//"FC_2_3_Column3D.swf";
	var dataLoc="CallChart.xml";	//TestChart.xml
	var chartHeight=420;
	//var prefix="http://qqq.orderlyq.com/orderlystats/";
	var prefix="http://www.orderlyq.com/reports/";
	//alert(target);
	function writeChart(chartWidth, chartHeight, chartType, dataLoc,data) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="');
	document.write(chartWidth);
	document.write('" HEIGHT="');
	document.write(chartHeight);
	document.write('" id="FC_2_3_Column3D">');
	document.write('<PARAM NAME=movie VALUE="');
	document.write(prefix);
	document.write('Charts/');
	document.write(chartType);
	document.write('">');
	data=escape(data);
//	alert(data.length);
	if(dataLoc!=null) {
		document.write('<PARAM NAME="FlashVars" VALUE="&dataURL=');
		document.write(dataLoc);
	} else {
		document.write('<PARAM NAME="FlashVars" VALUE="&dataXML=');
		document.write(data);
	}
	document.write('&chartWidth=');
	document.write(chartWidth);
	document.write('&chartHeight=');
	document.write(chartHeight);
	document.write('">');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.write('<EMBED src="');
	document.write(prefix);
	document.write('Charts/');
	document.write(chartType);
	if(dataLoc!=null) {
		document.write('" FlashVars="&dataURL=');
		document.write(dataLoc);
	} else {
		document.write('" FlashVars="&dataXML=');
		document.write(data);
	}	
	document.write('&chartWidth=');
	document.write(chartWidth);
	document.write('&chartHeight=');
	document.write(chartHeight);
	document.write('" ');
	document.write('quality=high bgcolor=#FFFFFF WIDTH="');
	document.write(chartWidth);
	document.write('" HEIGHT="');
	document.write(chartHeight);
	document.write('" ');
	document.write('NAME="FC_2_3_Column3D" TYPE="application/x-shockwave-flash" ');
	document.write('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
}

