﻿
/*--首页右侧选项卡切换--*/

function $(o) {
var o = document.getElementById(o) ? document.getElementById(o) : '';
return o;
}
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url, returnfun) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = returnfun;
xmlHttp.open("GET", url, true);
xmlHttp.send(null);

}



var showsoft = false;
function showStm(n) {
if (n == 0) showindexhtml();
if (showsoft == false && n == 1) {
$("indexsoft").innerHTML = "正在加载中,请稍候……";
softinfo();
showsoft = true;
}
for (i = 0; i <= 1; i++) {
document.getElementById("stgm" + i).className = "blur";
document.getElementById("stm" + i).style.display = "none";
}
document.getElementById("stgm" + n).className = "";
document.getElementById("stm" + n).style.display = "block";
}
function softinfo() {
startRequest("apps/soft.html", showsoftinfo);
}
function showsoftinfo() {
if (xmlHttp.readyState == 4) {
$("indexsoft").innerHTML = xmlHttp.responseText;
}
}
var tmptxt = '';
function gositesearch(keyword) {
oldkeyword = keyword;
if (tmptxt == '') {
tmptxt = $("indexhtml").innerHTML; // 保存临时变量
}
url = 'apps/insidesearch.php?keyword=' + encodeURIComponent(keyword) + '&t=' + (new Date()).getTime();
$("indexhtml").innerHTML = '<center><img src="images/loading.gif" />正在搜索中,请稍候...</center>';
startRequest(url, showsearchsite);
}

function showindexhtml() {
if (tmptxt != '') {
$("indexhtml").innerHTML = tmptxt;
}
}

var showsoft = false;
function showstm__(n) {
if (n == 0) showindexhtml();
if (showsoft == false && n == 1) {
$("indexsoft").innerHTML = "正在加载中,请稍候……";
softinfo();
showsoft = true;
}
for (i = 0; i <= 1; i++) {
document.getElementById("stgm_" + i).className = "blur";
document.getElementById("stm_" + i).style.display = "none";
}
document.getElementById("stgm_" + n).className = "";
document.getElementById("stm_" + n).style.display = "block";
}
