function handleErr(msg,url,l)
{
	txt="There was an error on this page.\n\n"
	txt+="Error: " + msg + "\n"
	txt+="URL: " + url + "\n"
	txt+="Line: " + l + "\n\n"
	txt+="Click OK to continue.\n\n"
	alert(txt)
	return true
}
	
function copyForm(frmname, parentfrm)
{
	onerror=handleErr
	
	this.theForm = document.forms[frmname];
	
	for (var i=0; i < this.theForm.elements.length; i++)
	{
		
		var fieldName = this.theForm.elements[i].name;
		var fieldType = this.theForm.elements[i].type;
		
		if (fieldType == 'text' || fieldType == 'textarea')
		{
			
			var fieldValue = this.theForm.elements[i].value;
			opener.document[parentfrm][fieldName].value = fieldValue;
			
		}
		
	}
	
	opener.document[parentfrm].submit();
	window.close();
	
	return false;
}

function openPopup(url, x, y)
{
	myPopup = window.open(url, 'popupWindow', 'width='+x+', height='+y+', scrollbars=no, status=no, resizable=no, menubar=no, location=no, toolbar=no');
    myPopup.focus();
	//myPopup = window.open(url, 'popupWindow', 'width=600, height=300, status=yes, resizable=yes, toolbar=yes');
	if (!myPopup.opener)
         myPopup.opener = self; 
}
