function ToggleAll(e,theForm,chk_name)
{
	if (e.checked) {
		CheckAll(e,theForm,chk_name);
	} else {
		ClearAll(e,theForm,chk_name);
	}
}

function CheckAll(itself,theForm,chk_name)
{
	var len = theForm.elements.length;
	var myRegExp = new RegExp(chk_name);
	for (var i = 0; i < len; i++) {
		var e = theForm.elements[i];
		if (e.name.search(myRegExp) == 0 || e.name == itself.name) {
			e.checked = true;
		}
	}
}

function ClearAll(itself,theForm,chk_name)
{
	var len = theForm.elements.length;
	var myRegExp = new RegExp(chk_name);
	for (var i = 0; i < len; i++) {
		var e = theForm.elements[i];
		if (e.name.search(myRegExp) == 0 || e.name == itself.name) {
			e.checked = false;
		}
	}
}

function trim (str)
{
	return str.replace(/^\s+/, '').replace(/\s+$/, '');
}

function showotherfield(selected_os)
{
	var other_os = document.getElementById("other_os");
	if(selected_os=="other")
	{
		other_os.style.display = 'block';
	}
	else
	{
		other_os.style.display = 'none';
	}
}
