function toggle_display(e) {
	o = document.getElementById(e);
	if(!o)
		o = e;
	if(o.style.display == '') {	
		o.style.display = 'none';
		return false;
	} else {
		o.style.display = '';
		return true;
	}
}

td = toggle_display;

function de(i) {
	return document.getElementById(i);
}

function add_class(ptr, c) {
	v = ptr.className;	
	
	if(v.indexOf(c) > -1) {
		f = c;
		v = v.replace(f,'');
		ptr.className = v;
	} else
		ptr.className += ' ' + c;
}

function createRequestObject(){
	var request_o;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_o = new XMLHttpRequest();
	}
	return request_o;
}

hl_objs = [];
function toggle_highlight(obj, cat, c) {
	if(document.getElementById(obj))
		n_obj = document.getElementById(obj);
	else
		n_obj = obj;
		
	if(hl_objs[cat])
		add_class(hl_objs[cat], c);
		
	add_class(n_obj, c);
	hl_objs[cat] = n_obj;
}

function fill_junk(f) {
	frm = document.forms[f];
	for(x = 0; x < frm.elements.length; x++) {
		e = frm.elements[x];
		if(e.type == 'text')
			e.value = '1';
		if(e.type == 'checkbox' || e.type == 'radio')
			e.checked = true;
	}
	
	frm = document.getElementsByTagName('select');
	for(x = 0; x < frm.length; x++)
		frm[x].selectedIndex = 1;
}