// project, p_id (i.e. project id)
// slot, project_slot
// user, u_id
function chooseZIME(project, slot, user, bits) {
	if (slot.toUpperCase() == 'CURRENT') {
		o = document.getElementById('z_project_slot');
		if (o) {
			slot = o.options[o.selectedIndex].value;
		} else {
			slot = 1;
		}
	}
	s = "index.php?page=mod_zime";
	if (project) {
		s += "&project=" + project;
	}
	if (slot) {
		s += "&slot=" + slot;
	}
	if (user) {
		s += "&user=" + user;
	} else {
		s += "&user=" + "current"; // ??
	}
	if (bits) {
		s += "&bits=" + bits;
	}
	document.location.href = s;
}

// project, project ID, select within a project, or 0
// user, options: all | current | [user_id1, user_id2, ...]
// sel, selected search page
// sort, sorting condition (e.g. date | relevance)
// isonline, 1 = user must be online, 0 = user must be offline
function searchZIME(project, user, sel, sort, bits, symmetry, isonline, group_by) {
	//alert(isonline);
	o = document.getElementById('txt_search');
	var term = (o.value);
	
	s = "index.php?page=search_results";
	if (project) {
		s += "&project=" + project;
	}
	if (user) {
		s += "&user=" + user;
	}
	if (term) {
		s += "&term=" + term;
	}
	if (sel) {
		s += "&sel=" + sel;
	}
	if (sort) {
		s += "&sort=" + sort;
	}
	if (symmetry) {
		s += "&symmetry=" + symmetry;
	}
	if (bits) {
		s += "&bits=" + bits;
	}
	if (isonline) {
		if (isonline.toUpperCase() == "Y") {
			s += "&isonline=1";
		} else if (isonline.toUpperCase() == "N") {
			s += "&isonline=0";
		}
	}
	if (group_by) {
		s += "&gb=" + group_by;
	}
	//var newurl = 'index.php?page=search_results&project=' + project + '&user=' + user + '&term=' + term + '&sel=' + sel + '&sort=' + sort + '';
	var newurl = s;
	document.location.href = newurl;
	return false;
}


