function showhide(system, obj) {
	var cur = document.getElementById(system).style;
	if (cur.display == "block") {
		cur.display = "none";
	} else {
		cur.display = "block";	
	}
	return true;
}

function isNum(str){
	for (var i = 0; i < str.length; i++) {
		var ch = str[i];
		if ((ch < "0" || ch > "9") && ch != "." && ch != "+" && ch != "-" && ch != "e" && ch != "E") return false;
    }
	return true;
}

function setFocus(name) {
	var focusField = document.getElementById(name);
	focusField.focus();
}

var	slider = null;
var x = 0;
var dx = 0;
var w = 0;
var dw = 0;
var moving = false;
var def_el = null;

function m_light(el) {
	if (el == null) return;
	if (def_el == null) {
		def_el = el;
	}
	if (slider == null) {
		slider = document.getElementById('slider');
	}
	dx = el.offsetLeft - 2;
	dw = el.offsetWidth + 4;
	slider.style.height = el.offsetHeight + 8 + 'px';
	if (!moving) move_slider();
}

function move_slider() {
	if (x != dx) {
		moving = true;
		var d = (dx > x) ? 1 : -1;
		var mx = Math.round((dx - x) / 4);
		if (mx == 0) mx = d;
		x += mx;
		slider.style.marginLeft = x + 'px';
		
		if (dw != w) {
			var d = (dw > w) ? 1 : -1;
			var mw = Math.round((dw - w) / 4);
			if (mw == 0) mw = d;
			w += mw;
			slider.style.width = w + 'px';
		}
		
		setTimeout('move_slider()', 30);
	} else {
		if (w != dw) {
			w = dw;
			slider.style.width = w + 'px';
		}
		moving = false;
	}
}

function inputtext(el,text){
	if (el.value==text){
		el.value='';
		el.style.color="#000000";
	}
}

function inputtextout(el,text){
	if (el.value=='') {
		el.value=text;
		el.style.color="#808080";
	}
}
