function swap(obj, prop, state1, state2) {
	thing = 'obj.' + prop;
	if (eval(thing+'==state1')) {
		eval(thing+'=state2');
	} else {	
		eval(thing+'=state1')
	}
}

function swap2(obj, prop, state1, state2, obj2, prop2, state21, state22) {
	thing = 'obj.' + prop;
	thing2 = 'obj2.' + prop2;
	if (eval(thing+'==state1')) {
		eval(thing+'=state2');
		eval(thing2+'=state22');
	} else {
		eval(thing+'=state1');
		eval(thing2+'=state21')
	}
}

function toggle( id ) {
	if (typeof(id)=='string') {
		id = document.getElementById(id); 
	};
	swap(id.style, 'display', '', 'none');
	return false;
}

function flip(section,link) {
	obj=document.getElementById(section).style;
	swap(obj, 'display', 'none', '');
	swap(link, 'innerHTML', '+', '-');
	return false;
}

function borderFlip(id) {
	obj=document.getElementById('sect'+id).style;
	img=document.getElementById('sectimg'+id);
	swap2(obj, 'display', 'none', '', img, 'src', '/img/downarrow.gif', '/img/uparrow.gif');
}

function resizeframe() {
	window.frameElement.style.height=document.body.scrollHeight+'px';
}

function noBubble() {
	event.cancelBubble= true;
	return false;
}
