window.onload = function() {
	order();
	search();
}

function order() {
	if (document.getElementById('order')) {
		document.getElementById('order').getElementsByTagName('select')[0].onchange = function() {
			if (this.selectedIndex != 0) {
				this.parentNode.parentNode.submit();
			}
		}
	}
}

function popup(url,specs) {
	var this_url = url;
	var this_specs = specs+',menubar=0,resizeable=0,status=0,toolbar=0';
	window.open(this_url,'_blank',this_specs);
}

function search() {
	if (document.searchform) {
		document.searchform.category.onchange = function() {
			if (this.value == 'prices') {
				document.searchform.terms.style.display = 'none';
				this.parentNode.getElementsByTagName('span')[0].style.display = 'inline';
			} else {
				document.searchform.terms.style.display = 'inline';
				this.parentNode.getElementsByTagName('span')[0].style.display = 'none';
			}
		}
	}
}

