control in client side have static id such as :
[ContentPlaceHolder name]_[client name]
use static text in your JS code
may be this
<script type="text/javascript" >
function passvalue()
{
window.opener.document.getElementById('MainContent_txt_quatno').value = "my value";
self.close();
}
</script>