var win;
function popWin(url, width, height){
    try { win.close(); } catch(e) {};
    win = window.open(url, "pw", "width="+width+",height="+height+",scrollbars=1");
    try { win.focus(); } catch(e) {};
}

function getV(arr) {
	var str = "";
	for(var i=0; i<arr.length; i++) str += "%" + arr[i];
	return unescape(str);
}

function clearForm(frm) {
	for(var i=0; i<frm.elements.length; i++) {
		var el = frm.elements[i];
		if(el.type == 'text') {
			el.value = '';
		} else if(el.type == 'select-one') {
			el.selectedIndex = 0;
		}
	}
}

