
function indexData() {
	//createCode();
	indexdata.doPlatformInfo(path, function (data) {
		document.getElementById("platform").innerHTML = data;
	});
	indexdata.getService(path, function (data) {
		document.getElementById("serviceList").innerHTML = document.getElementById("serviceList").innerHTML+data;
	});
	indexdata.doHotResource(path, function (data) {
		document.getElementById("hotResource").innerHTML = data;
	});
	indexdata.doRecommendResource(path, function (data) {
		document.getElementById("recommendResource").innerHTML = data;
	});
	indexdata.newsList(path, function (data) {
		document.getElementById("newsList").innerHTML = data;
	});
	indexdata.doCompanyInfo(path, function (data) {
		document.getElementById("company").innerHTML = data;
	});
	//indexdata.getLogoList(path, function (data) {
	//	document.getElementById("footerLogo").innerHTML = data;
	//});
	jsCMSBaseService.getCMSLinks("CMS002001", "", function (data) {
		DWRUtil.addOptions("select1", {"":"          \u5144\u5f1f\u56ed\u533a\u7f51\u7ad9               "});
		DWRUtil.addOptions("select1", data);
	});
	jsCMSBaseService.getCMSLinks("CMS002002", "", function (data) {
		DWRUtil.addOptions("select2", {"":"          \u5168\u56fd\u5f00\u53d1\u533a\u7f51\u7ad9                "});
		DWRUtil.addOptions("select2", data);
	});
	jsCMSBaseService.getCMSLinks("CMS002003", "", function (data) {
		DWRUtil.addOptions("select3", {"":"          \u56ed\u533a\u4f01\u4e1a\u7f51\u7ad9                "});
		DWRUtil.addOptions("select3", data);
	});
	jsCMSBaseService.getCMSLinks("CMS002004", "", function (data) {
		DWRUtil.addOptions("select4", {"":"          \u957f\u6c99\u8f6f\u4ef6\u56ed                "});
		DWRUtil.addOptions("select4", data);
	});
}
function toAgentService() {
	window.location.href = path + "/web/home/agentServiceList.action";
}
function doSearch() {
	document.getElementById("searchForm").submit();
}
function dhtmlxEvent(el, event, handler) {
	if (el.addEventListener) {
		el.addEventListener(event, handler, false);
	} else {
		if (el.attachEvent) {
			el.attachEvent("on" + event, handler);
		}
	}
}
dhtmlxEvent(window, "load", indexData);

//提交登陆表单
function submitMe() {
	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	var auditcode = document.getElementById("auditcode").value.toUpperCase();
	if (username == "" || username == null) {
		alert("\u8bf7\u8f93\u5165\u7528\u6237\u540d\uff01");
		return false;
	}
	if (password == "" || password == null) {
		alert("\u8bf7\u8f93\u5165\u5bc6\u7801\uff01");
		return false;
	}
	if (auditcode == "" || auditcode == null) {
		alert("\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801\uff01");
		return false;
	}
	if(auditcode != code ){
		alert("验证码输入不准确，请重新输入!");
		document.getElementById("auditcode").value="";
		document.getElementById("auditcode").focus();
		createCode();//刷新验证码
		return false; 
	}
	window.document.getElementById("loginForm").submit();
}

function SetClick(evt) {
	if (KeyInput(evt) == 13) {
		submitMe();
	}
}
function KeyInput(evt) {
	if (window.event) { // IE
		return evt.keyCode;
	} else {
		if (evt.which) {// FF NE
			return evt.which;
		}
	}
}


//查询企业信息
function getCompany() {
	var name = document.getElementById("name").value;
	window.location = path + "/web/mm/home/company.jsp?companyName=" + name;
}
//查询更多企业
function moreCompany(){
	window.location = path + "/web/mm/home/company.jsp?companyName=";
}

//查询更多成功案例
function moreAnli(){
	window.location = path + "/web/mm/home/anli.jsp";
}

//查询企业详情
function showcompanyInfo(companyCode) {
	window.open(path + "/web/home/company.action?companyCode=" + companyCode, "newwindow", "height=400, width=530, top=200, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
}
//查询企业产品详情
function showproductInfo(productCode, companyCode) {
	window.open(path + "/web/home/product.action?productCode=" + productCode + "&companyCode=" + companyCode, "newwindow", "height=490, width=530, top=200, left=300, toolbar=auto, menubar=no, scrollbars=no, resizable=no,location=no, status=no");
}
//查看固定资源信息
function showGdzyInfo(url){
	window.open(url, "newwindow", "height=400, width=750, top=200, left=300, toolbar=auto, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
}
//查询资源详情
function showResourceInfo(indexID, type) {
	if("测试用例库"==type){
		window.open(path + "/web/ps/csinfo.action?tableName=T_SC_CSINDEX&bean.indexID=" + indexID, "newwindow", "height=400, width=750, top=200, left=300, toolbar=auto, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
	}else if("行业知识库"==type){
		window.open(path + "/web/ps/zsinfo.action?tableName=T_SC_ZSINDEX&bean.indexID=" + indexID, "newwindow", "height=400, width=750, top=200, left=300, toolbar=auto, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
	}else{
		window.open(path + "/web/ps/zsinfo.action?tableName=T_SC_ZSINDEX&bean.indexID=" + indexID, "newwindow", "height=400, width=750, top=200, left=300, toolbar=auto, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
	}
}
//查询案例详情
function showAnliInfo(platFromSEid){
	window.open(path + "/web/home/anliinfo.action?platFromSEid=" + platFromSEid, "newwindow", "height=170, width=530, top=200, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
}

function kefu() {
	var kefu = window.document.getElementById("backi");
	kefu.style.display = "block";
}
function toRegist(busiTypeID, kindBusiName) {
	if (userID == null || userID == "") {
		alert("\u60a8\u8fd8\u672a\u767b\u9646\uff01\u8bf7\u5148\u767b\u9646\uff01");
		return false;
	} else {
		window.open(path + "/web/mm/home/service_apply.jsp?busiTypeID=" + busiTypeID + "&kindBusiName=" + kindBusiName + "&isTry=0");
	}
}

function cleanQiye() {
	document.getElementById("companBean.agentCode").value = "";
}

function toactionurl(url){
	window.open(url);
}

function changeInfoType(object) {
	document.getElementById("zjtg_a").className="";
	document.getElementById("wljr_a").className="";
	document.getElementById("rjcs_a").className="";
	document.getElementById("other_a").className="";
	object.className="current first";

	document.getElementById("zjtg").style.display="none";
	document.getElementById("wljr").style.display="none";
	document.getElementById("rjcs").style.display="none";
	document.getElementById("other").style.display="none";
	document.getElementById(object.id.replace("_a","")).style.display="block";

	if(object.id == "zjtg_a") document.getElementById("show_tab_img").src = path + "/web/images/new_index/import_ad.jpg";
	if(object.id == "wljr_a") document.getElementById("show_tab_img").src = path + "/web/images/new_index/import_ad2.jpg";
	if(object.id == "rjcs_a") document.getElementById("show_tab_img").src = path + "/web/images/new_index/import_ad3.jpg";
	if(object.id == "other_a") document.getElementById("show_tab_img").src = path + "/web/images/new_index/import_ad4.jpg";
}

function changeZyInfo(objectName) {
	document.getElementById("hotzy").className="";
	document.getElementById("commendzy").className="";
	document.getElementById(objectName).className="title";

	document.getElementById("hotResource").style.display="none";
	document.getElementById("recommendResource").style.display="none";
	if(document.getElementById(objectName).id=="hotzy")
		document.getElementById("hotResource").style.display="block";
	if(document.getElementById(objectName).id=="commendzy")
		document.getElementById("recommendResource").style.display="block";
}

function openOtherUrl(name) {
	var url = "#";
	if("测试用例库"==name) {
		url = path + "/JspTemplateServlet?systemID=20090622000000000357";
	}
	if("行业知识库"==name) {
		url = path + "/JspTemplateServlet?systemID=20090622000000000362";
	}
	if("软件构件库"==name) {
		url = "#";
	}
	document.getElementById("hotPlatformopen").href = url;
	document.getElementById("hotPlatformopen").click();
}

