
// ===================================================
// arrange.aspx

function SchaduleChange()
{
	var idx = $("Schadule").selectedIndex;
	switch(idx) {
		case 0:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "none";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 1:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 2:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 3:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "";
			$("SchaduleDay").style.display = "none";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 4:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "none";
			$("SchaduleHour").style.display = "";
			$("SchaduleMinute").style.display = "";
			break;
		case 5:
			$("SchaduleYear").style.display = "";
			$("SchaduleMonth").style.display = "";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "";
			$("SchaduleHour").style.display = "";
			$("SchaduleMinute").style.display = "";
			break;
		case 6:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 7:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 8:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "";
			$("SchaduleDay").style.display = "none";
			$("SchaduleHour").style.display = "none";
			$("SchaduleMinute").style.display = "none";
			break;
		case 9:
			$("SchaduleYear").style.display = "none";
			$("SchaduleMonth").style.display = "none";
			$("SchaduleWeek").style.display = "none";
			$("SchaduleDay").style.display = "none";
			$("SchaduleHour").style.display = "";
			$("SchaduleMinute").style.display = "";
			break;
	}
}

// ===================================================
// browser.aspx

function LockIt(obj, path)
{
	if(obj.innerHTML.Contains("未加锁")) {
		var echo = AjaxPost("/desk/ajax/path.aspx?p=" + path);
		obj.innerHTML = "<img src=\"/images/lock.gif\">已加锁";
		obj.className = "lock";
	}
	else {
		var echo = AjaxPost("/desk/ajax/path.aspx?xp=" + path);
		obj.innerHTML = "(未加锁)";
		obj.className = "unlock";
	}
}

// ===================================================
// chat.aspx

function UserChange(obj, username)
{
	var objs = getElementsById2("span", "room");
	for(var i=0; i<objs.length; i++) {
		objs[i].className = "user2";
	}
	obj.className = "user1";

	$("board").src = "/desk/chatroom.aspx?user=" + username;
	$("repeat").src = "/desk/chatsay.aspx?user=" + username;
}

function AddBoard(obj, username)
{
	var rm = "<span id=\"room\" class=\"user2\" onclick=\"UserChange(this,'"  + username + "');\">" + obj.innerHTML + "</span> ";
	$("rooms").innerHTML = rm + $("rooms").innerHTML;
	var objs = getElementsById2("span", "room");
	UserChange(objs[0], username);
	obj.innerHTML = "";
	obj.style.display = "none";
}

// ===================================================
// files.aspx

function ShareIt(obj, path)
{
	var echo = AjaxPost("/desk/ajax/files.aspx?p=" + path);
	obj.innerHTML = "(已分享)";
	obj.className = "lock";
	var optionText = path;
    $("schemeNum1").options.add(new Option(optionText,optionText)); 
}


// ===================================================
// memo.aspx

function RadioAfter(idx)
{
	if(idx==1) $("Share").checked = false;
	else $("Share").checked = true;
}


// ===================================================
// passwordList.aspx

function ShowImage(id, md5)
{
	$("crypt").src = "/desk/ajax/Image.aspx?id=" + id + "&md5=" + md5;
}


// ===================================================
// peopleList.aspx

var PeopleSummary = "";

function PeopleSearch()
{
	var str = $("kvalue").value.toLowerCase();
	if(PeopleSummary != str) {
		PeopleSummary = str;
		var trs = getElementsById2("tr", "trFriends");
		var trv = getElementsById2("input", "tdFriends");
		for(var i=0; i<trs.length; i++) {
			if(trv[i].value.Contains(str)) {
				trs[i].style.display = "";
			}
			else {
				trs[i].style.display = "none";
			}
		}
	}
}

// ===================================================
// regist.aspx

function ShowExtention(obj)
{
	var trs = getElementsById2("tr", "Ext");
	for(var i=0; i<trs.length; i++)
		trs[i].style.display = "";
	obj.innerHTML = "";
}

function ShowTips(idx)
{
	$("notes").style.display = (idx==0) ? "" : "none";
}
