// 功能：打开居中窗口
// 调用：onClick="winopen('http://www.yzwind.com', 'yzwind', 400, 200)"
function winopen(url,win,w,h){
	if (w==null) {w=500};
	if (h==null) {h=300};
	var l = (screen.width - w) / 2; 
	var t = (screen.height - h) / 2; 
	var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l; 
	s += ', toolbar=no, scrollbars=yes, menubar=no, location=no, resizable=no'; 
	window.open(url, win, s); 
}
//打印局部
function PrintPages(printpage){
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body></html>";
var newstr = document.getElementById(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print(); 
document.body.innerHTML = oldstr;
//return false;
}

function CheckAll(id){
	oElements =document.getElementsByName(""+id+"")
	if (oElements[0].checked){
		for(i=0;i<oElements.length;i++)
		oElements[i].checked=true;
	}
	if (!oElements[0].checked){
		for(i=0;i<oElements.length;i++)
		oElements[i].checked=false;
	}
}

function CheckIsAll(id){
	oElements =document.getElementsByName(""+id+"")
	oElements[0].checked=true;
	for(i=0;i<oElements.length;i++)
	if (!oElements[i].checked)
	oElements[0].checked=false;
}
//切换选项卡(TAB名称,点击的ID,所有选项卡)
function SwitchTab(tabname,order,alltab){
	for(i=1; i<=alltab; i++){
		if(order==i)
		{
			document.getElementById("a" + tabname + "_" + i).className = "atabnow";
			document.getElementById("rpt" + tabname + "_" + i).className = "display_y";
		}
		else{
			document.getElementById("a" + tabname + "_" + i).className = "atabnow2";
			document.getElementById("rpt" + tabname + "_" + i).className = "display_n";
		}
	}
}

