// JavaScript Document
function submit_query(formName, actionName, actionValue) {
//	alert("document."+formName);
	var form_obj = eval("document."+formName);
	eval("window.document."+formName+"."+actionName).value = actionValue;
	form_obj.submit();
}

function submit_query_prompt(formName, actionName, actionValue, msg) {
	if ((msg != "") && (!window.confirm(msg))) {
		return false;
	}
	submit_query(formName, actionName, actionValue);
	return true;
}

function clearInput(formName, inputName) {
	eval("document."+formName+"."+inputName).value = '';
}

function view_image(path, width, height, id) {
	//window.confirm(path);
	//window.location = "admin/popup/view_image.php?"+path;
	pop = popup("units/catalog/view_image.php?file="+path+"&id="+id, "popup", width, height, false, false, 50, 150);
}
function popup(href, name, width, height, scroll, resize, top, left) {
	if (href.length == 0) {
		window.alert("No page to display");
		return false;
	}
	if (!top)    top = 150;
	if (!left)   left = 150;
	if (!width)  width = 400;
	if (!height) height = 400;
	param = "top="+top+",left="+left+",width="+width+",height="+height;
	if (scroll) {
		param+=",scrollbars";
	}
	if (resize) {
		param+=",resizable";
	}
	window.open(href, name, param);
	return true;
}
