function set_act(obj,act){
	obj.act.value = act;
}

var newWin;
var flagModify = 0;
var wins = new Array();

function open_win(url,width,height,name){
	winopt =	"toolbar=no," +
				"scrollbars=yes," +
				"resizable=yes," +
				"location=no," +
				"status=yes," +
				"width=" + width + "," +
				"height=" + height;
	if (name == ""){
		name = "subwin";
	}
	newWin = window.open(url,name,winopt);
	newWin.focus();
	wins[wins.length] = newWin;
}

function close_all_window(){
	for(i = 0; i < wins.length; i++){
		if (!wins[i].closed){
			wins[i].close();
		}
	}
}

function open_close(src){
	var child,parent,childNum = 0;

	parent = src.parentNode;
	for (var i = 0; i < parent.childNodes.length; i++){
		if (parent.childNodes[i].nodeType != 1) continue;
		if (childNum != 1){
			childNum++;
			continue;
		}else{
			child = parent.childNodes[i];
		}
	}
	if (null != child &&
		"LI" == parent.tagName &&
		"UL" == child.tagName){
		parent.className = ("close" == parent.className ? "open":"close");
		child.className = ("expanded" == child.className ? "none":"expanded");
	}
}

function set_cookie_top(){
	document.cookie = "shlist='';path=/";
}

function format_number(num){
	var s = "" + num;
	var p = s.indexOf(".");
	if (p < 0) {
		p = s.length;
	}
	var r = s.substring(p,s.length);
	for (var i = 0; i < p; i++) {
		var c = s.substring(p - 1 - i, p - 1 - i + 1);
		if (c < "0" || c > "9") {
			r = s.substring(0, p - i) + r;
			break;
		}
		if (i > 0 && i % 3 == 0) {
			r = "," + r;
		}
		r = c + r;
	}
	return r;
}

