// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function setActive (active_id, inactive_id, other_control_id, oc_value) {
	document.getElementById(active_id).className = 'active';
	document.getElementById(inactive_id).className = 'inactive';
	if(other_control_id) {
		document.getElementById(other_control_id).value = oc_value;
	}
}

function findPos(obj) {
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}
