function results_per_page_form_submit() {
	var current_location = new String(window.location);	 // what URL are we at now
	var new_location = new String(current_location); // we'll update this later
	var num; // current number of results per page
	var page; // current page number

	var tmp;

	// establish what the current number of results per page and current page numbers are
	if (tmp = current_location.match(/num=\d+/)) {
		tmp = new String(tmp);
		num = parseInt(tmp.match(/\d+/));
	} else {
		num = 10;
	}
	if (tmp = current_location.match(/page=\d+/)) {
		tmp = new String(tmp);
		page = parseInt(tmp.match(/\d+/));
	} else {
		page = 1;
	}

	// establish the new desired num of results per page
	var new_perpage;
	var select_em = document.getElementById("select_perpage_num");
	var i;
	for (i = 0; i < select_em.options.length; i++) {
		if (select_em.options[i].selected) {
			var new_perpage = parseInt(select_em.options[i].value);
			break;
		}
	}

	// where are we in the results (what is the offset of the first result on
	// this page) 
	// so with defaults on page 1, it's 1*10-10+1 = 1 (result #1 is first)
	// so with defaults on page 5, it's 5*10-10+1 = 41  (result #41 is first)
	var current_offset = (page * num) - num + 1; 
	var new_page = Math.floor(current_offset / new_perpage) + 1;

	if (new_location.match(/num=\d+/)) {
		new_location = new_location.replace(/num=\d+/,"num="+new_perpage);
	} else {
		new_location += "&num=" + new_perpage;
	}
		
	if (new_location.match(/page=\d+/)) {
		new_location = new_location.replace(/page=\d+/,"page="+new_page);
	} else {
		new_location += "&page=" + new_page;
	}
	
	//alert_text = "num=" + num + ",page=" + page + ",current_offset=" + current_offset + "new_perpage=" + new_perpage + ",new_page=" + new_page + "\n" + new_location;
	//alert(alert_text);
	window.location = new_location;

}

function thumbnail_image_resize_mousein ( id ) {
	var em = document.getElementById(id);
	em.style.width = em.style.height = "200px";
	return;
}
function thumbnail_image_resize_mouseout ( id ) {
	var em = document.getElementById(id);
	em.style.width = "96px";
	em.style.height = "100px";
	return;
}
