function get_source()
{
var s= get_chart_option_y_standard();
var box=document.getElementById("option_source");
box.value=s;
}
function get_source_tiaoXin()
{	
var s= get_chart_option_y_standard_tiaoXin();
var box=document.getElementById("option_source");
box.value=s; 
}
function get_source_bingXin()
{	
var s= get_chart_option_y_standard_bingXin();
var box=document.getElementById("option_source");
box.value=s; 
}
function show_chart()
{	
var box=document.getElementById("option_source");
var myChart =echarts.init(document.getElementById('chart_box'));
eval(box.value) 
myChart.setOption(option);
window.onresize = function ()
{
}
}
function print_this()
{
document.getElementById("tt").style.display="none";
window.print();
document.getElementById("tt").style.display="";
}
function down_this_page(typ)
{
var tb=document.getElementById("tb_data");
var trs="";
var docs="";
for(var i=0;i<tb.rows.length;i++)
{	
var tr="";
var doc="";
var douHao="";
for(var j=0;j<tb.rows[i].cells.length;j++)
{
if(j>0)douHao=",";
var v=tb.rows[i].cells[j].innerHTML;
if(v.indexOf(',')>-1)v='"'+v+'"';
tr+=douHao+v;
doc+="<td>"+v+"</td>"
}
trs+=tr+"\n\r";
docs+="<tr>"+doc+"</tr>";
}
var f=new Date().toLocaleString();
f=f.replace(/:/g,"：");
if (typ=='doc')
{	
f="报表"+f+".doc";
var s="<html><head>"
s+="<meta http-equiv=Content-Type content='text/html; charset=gb2312'>";
s+="<meta name=Generator content='Microsoft Word 11 (filtered)'>";
s+="</head>";
s+="<body>";
s+="<table>"+docs+"</table>";
s+="</body>";
s+="</html>";
if(js_save_file(f,s)==false)
{
down_this_page_sub(s,f)	;
}
}
else
{
f="报表"+f+".csv";
down_this_page_sub(trs,f);	
}
}
function down_this_page_sub(s,f)
{
var box=document.getElementById('down_box');
if(box)
{
box.value=s;
var file_box=document.getElementById('file_box');
file_box.value=f;
form1.action="?exe=down_tb";
form1.submit();
}else
{
alert("下载失败");	
}
}
function save_this_page(classID)
{
window.showModelessDialog('../main/dialog.htm?go=../asp/baoBiao_save.asp?exe=show_add&classID='+classID,window,'status:no;resizable:yes;help:no;dialogWidth:500px;dialogHeight:350px')
}
function show_baoBiao(obj)
{
gid('div_tu').style.display='none';
gid('div_baoBiao').style.display='';
show_cur(obj);
}
function show_zhuXinTu(obj,type)
{
gid('span_zhuXingtu').style.display='';
gid('div_tu').style.display='';
gid('div_baoBiao').style.display='none';
if(type=='100%')
{
w='100%'
}
else
{
var tb=document.getElementById('tb_data')
var c=tb.rows.length;
var w=c*20;
if(w<600)w=600;
w=w+"px"
}
var div_chart_box=document.getElementById("chart_box")
div_chart_box.style.width=w;
div_chart_box.style.height='500px';
get_source();
show_chart();	
show_cur(obj);
}
function show_tiaoXinTu(obj)
{
gid('span_zhuXingtu').style.display='none';
gid('div_tu').style.display='';
gid('div_baoBiao').style.display='none';
var tb=document.getElementById('tb_data')
var c=tb.rows.length;
var h=c*20;
if(h<400)h=400;
h=h+"px"
var div_chart_box=document.getElementById("chart_box")
div_chart_box.style.height=h;
div_chart_box.style.width='600px';
get_source_tiaoXin();
show_chart();
show_cur(obj);
}
function show_bingXinTu(obj)
{
gid('div_tu').style.display='';
gid('div_baoBiao').style.display='none';
get_source_bingXin();	
show_chart();
show_cur(obj);
}
function show_cur(obj)
{
var buts=gid('menu_bar').getElementsByTagName("BUTTON");
for(var i=0;i<buts.length;i++)
{
buts[i].className='menu_but'
}
obj.className='menu_but_cur'
}