Change your 6 line to:
myJob1.Id = opportunity.records.Opportunityid;
myJob1.Id = opportunity.records[0].Opportunityid;
the "sforce.connection.query" don'tThe sforce.connection.query
method doesn't return the specified field, but rather a List<SObject>
.