// JScript source code
function newPopPage(sLink, sPageId, nWidth, nHeight)
{
	var nLeft = (window.screen.width / 2) - (nWidth / 2 + 10);
	var nTop  = (window.screen.height / 2) - (nHeight / 2 + 50);
	var winNew = window.open(sLink, sPageId, "width=" + nWidth + ",height=" + nHeight + ",left=" + nLeft + ",top=" + nTop + ",scrollbars=yes,resizable=yes");
	winNew.focus();
}

function newPopPageXX(sLink, sPageId, nWidth, nHeight)
{
	window.location.href=sLink;
}

function showAndHidden(obj)
{
	if ( obj.style.display == "none" )
		obj.style.display = "block";
	else
		obj.style.display = "none"
}


function isNum(obj,msg){
	if (!isNaN(obj.value) && obj.value!=""){
		return true;
	}else{		
		alert("输入的"+msg+'数值有错误');		
		obj.focus();
		return false;
	}
}

function $$(id){
	return document.getElementById(id);
}


/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

var CurTar
function getXlsLink(path,target){

	CurTar=target;
	eval(CurTar).innerHTML = "<font color=red>正在生成</font>";
	xmlHttp.open("GET", path, true);
	xmlHttp.onreadystatechange = updatePageLink;
	xmlHttp.send(null);

}

function updatePageLink() {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
    eval(CurTar).innerHTML = response;
  }
}


