	var map = new Object();
	map.isShow = "0";
	VersionInfoService.select_VersionInfo(map,function(list){
		if (list!=null){
			var tmpHTML = "";
			for ( i = 0; i<list.length; i++){
				if(list[i].versionName.indexOf("ocx")>-1 || list[i].versionName.indexOf("OCX")>-1){
					document.getElementById("ocxVersion").value = list[i].versionNumber;
					document.getElementById("ocxDownUrl").value = list[i].downloadUrl;
				}
				if(list[i].versionName=="谷歌浏览器"){
					document.getElementById("chromeDownUrl").value = list[i].downloadUrl;
				}
				if (list[i].downloadUrl =='useInfo'){
					 tmpHTML  +=" <button style='width:70px;padding:3px 6px;font-size:10px;margin-top:10px;background-color:#4F4F5D;' class = 'btn' onClick=decription()>"+list[i].versionName+" </button>   ";
				}else{
				 tmpHTML  +=" <button style='width:70px;padding:3px 6px;font-size:10px;margin-top:10px;background-color:#4F4F5D;' title='版本号:"+list[i].versionNumber+"&nbsp&nbsp发布时间:"+list[i].createTime+"' class = 'btn' onClick=blank('"+list[i].downloadUrl+"') >"+list[i].versionName+" </button>   ";
				}
			}
			document.getElementById('herfId').innerHTML = "" +tmpHTML ;
		}else{
			document.getElementById('herfIdDiv').style.display='none';
		}
		updateOcx();
	});
	
function downSource(downloadUrl){
	var model = {};
	model.downloadUrl = downloadUrl;
	VersionInfoService.download_VersionInfo(model, function(data) {
		if(data!=null){
			if(data.indexOf("&privatePath=versionPath")!=-1){
				window.location.href=downloadUrl;
			}else{
					window.location.href=data+"&privatePath=versionPath";
			}
		}else{
			alert("下载资源有问题!");
		}
//	window.location.href = downloadUrl;
	});
}

function decription(){
	var zz = document.getElementById("description_all").style.display;
	if(zz == "block"){
		document.getElementById("description_all").style.display="none";
	}else if (zz == "none"){
		document.getElementById("description_all").style.display="block";
	}
}
	
function btndownload(){
	if(document.getElementById("herfIdDiv").style.display=="none"){
		document.getElementById("herfIdDiv").style.display="";
	}else if (document.getElementById("herfIdDiv").style.display=="") {
		document.getElementById("herfIdDiv").style.display="none";
	}
}
	
function updateOcx() {
	var OCX_VERSION = "";
	try {		
//		alert("=="+ocx);
//		alert("=="+ocx.iSeeOcxGetVersion());
		var ocxVersion = ocx.iSeeOcxGetVersion();
//		alert("=ocxVersion="+ocxVersion);
//		alert(document.getElementById("ocxVersion").value);
		var sysOcxVersion = document.getElementById("ocxVersion").value;
//		alert("=sysOcxVersion="+sysOcxVersion);
		if(sysOcxVersion>ocxVersion){
			if (confirm("未安装WEBOCX或WEBOCX版本过低，是否下载最新版本WEBOCX?")) {
				var ocxDownUrl = document.getElementById("ocxDownUrl").value;
				downSource(ocxDownUrl);
			}
//			continue;
		}
		
	} catch (e) {
		if (confirm("未安装WEBOCX或WEBOCX版本过低，是否下载最新版本WEBOCX?")) {
			var ocxDownUrl = document.getElementById("ocxDownUrl").value;
			downSource(ocxDownUrl);
		}
	} 
}


