Converting to use postMessage

for cross domain frames