﻿function GetObj(strkj) {
    try {
        if (GetObj) {
            return eval('document.getElementById("' + strkj + '")');
        }
        else {
            return eval('document.all.' + strkj);
        }
    }
    catch (e)
	{ }
}

function initForm(sid) {
    //initialize form UI and add triggers
    var infobox;
    var x = GetObj("st");
    if (!x) return;
    var y = x.getElementsByTagName("a");
    for (var i = 0; i < y.length; i++) {
        if (sid == i) {
            y[i].className = "nt";
            GetObj("t").value = sid;
        } else y[i].className = "";
    }
}
function EnterKey() {
    if (event.keyCode == 13) GetObj("seBtn").focus();
}
function toSearch(mWord) {
    var iType = GetObj('stype').options[GetObj('stype').selectedIndex].value;
    var mWord = GetObj("sWords").value;
    if (mWord == "") alert("please enter keywords");
    else {
        if (iType == 1) window.location.href = "/supply/se_" + encodeURIComponent(mWord) + "-p1.html"; 
        else window.location.href = "/supply/se_" + encodeURIComponent(mWord) + "-p1.html";        
    }
}

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';
        }
    }
}