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

function anyProductCheck() {
	var x = document.getElementsByTagName("input");
	var p = document.getElementsByName("prod1");
	if(!p) {
		return;
	}
	var checked = p[0].checked;
//	alert("anyProductCheck: "+checked + " "+x.length);
	for (i in x) {
		if(x[i].type == "checkbox") {
			if(x[i].name.substring(0, 4) == "prod") {
				x[i].checked = checked;
			}
		}
	}
}
function anyPlatformCheck() {
	var x = document.getElementsByTagName("input");
	var p = document.getElementsByName("plat1");
	if(!p) {
		return;
	}
	var checked = p[0].checked;
//	alert("anyProductCheck: "+checked + " "+x.length);
	for (i in x) {
		if(x[i].type == "checkbox") {
			if(x[i].name.substring(0, 4) == "plat") {
				x[i].checked = checked;
			}
		}
	}
}
function filterChanged() {
	document.filter.submit();
}

function replace_text(id, text) {
	//alert ("replace_text "+id);
	var p = document.getElementById(id);
	if(p != null) {
		p.value = text
	}
	else {
	 // alert ("  element not found");
	}
}
