﻿//几何设计 http://www.sankela.cn 版权所有
//转载请注明出处
var DlId;
var nObj;
var obj;
var tobj;
var tnObj;
var tCount;
var tHeight = 0;
function ToShow(mCount) {
    var iHeight = tnObj.style.height;
    iHeight = iHeight.replace("px", "");
    if (iHeight < mCount * 25) {
        tHeight += 25;
        tnObj.style.height = tHeight + "px";
        tCount = mCount;
        setTimeout('ToShow(tCount)', '1');
    } else {
        tHeight = 0;
        obj.className = "BanUp";
    }
}
function ToHidden() {
    var iHeight = tnObj.style.height;
    iHeight = iHeight.replace("px", "");
    Hidden(iHeight);
}
function Hidden(iHeight) {
    if (iHeight > 0) {
        iHeight -= 25;
        tHeight = iHeight;
        tnObj.style.height = iHeight + "px";
        setTimeout('Hidden(tHeight)', '1');
    } else {
        tHeight = 0;
        tnObj.className = "close";
        tobj.className = "BanDown"
    }
}
function GetDl(dId, iCount) {
    tnObj = document.getElementById("Dl" + dId);
    tobj = document.getElementById("Sp" + dId);
    if (nObj.className == "show") {
        ToHidden();
    } else {
        ToShow(iCount);
        nObj.className = "show";
    }
}
function hDl(iId) {
    DlId = iId;
    nObj = document.getElementById("Dl" + DlId);
    obj = document.getElementById("Sp" + DlId);
    if (nObj.className == "show") {
        obj.className = "BanUp2";
    } else {
        obj.className = "BanDown2";
    }

}
function sDl() {
    if (nObj.className == "show") {
        obj.className = "BanUp";
    } else {
        obj.className = "BanDown";
    }
}
function GetObj(strkj) {
    try {
        if (GetObj) {
            return eval('document.getElementById("' + strkj + '")');
        }
        else {
            return eval('document.all.' + strkj);
        }
    }
    catch (e)
	{ }
}
function EnterKey() {
    if (event.keyCode == 13) GetObj("seBtn").focus();
}
function toSearch(mWord) {
    var mWord = GetObj("sWords").value;
    if (mWord == "") alert("please enter keywords");
    else window.location.href = "/Supply/Index.aspx?words=" + mWord;
}

function SetType(iId, iCount, obj) {
    var dt;
    var dl;
    for (var i = 1; i <= iCount; i++) {
        dt = GetObj("navDt" + i);
        dl = GetObj("nav" + i);
        if (iId == i) {
            if (obj == "0") {
                dt.className = 'dt_over';
                dl.className = 'nowDl dl_over';
            } else {
                GetObj("navDt" + i).className = 'dt_in';
                GetObj("nav" + i).className = 'nowDl dl_in';
            }
        } else {
            dt.className = 'dt_in';
            dl.className = 'nowDl dl_in';
        }
    }
}
