function ApplyValues() {
var o = new Object();
o.companyname = document.getElementById("company").value;
o.address = document.getElementById("address").value;
o.city = document.getElementById("city").value;
o.state = document.getElementById("state").value;
o.country = document.getElementById("country").value;
o.phone = document.getElementById("phone").value;
o.email = document.getElementById("email").value;
o.firstName = document.getElementById("firstName").value;
window.returnValue = o;
window.close();
}
<table><tbody><tr><td width="198" bgcolor="#DBDBDB"><a href="#" onclick="javascript:return ApplyValues()" class="menuItem">Apply</a><br>
</br></td></tr></tbody></table>