//namespace our global vars if (!IDXPRO) var IDXPRO = {}; // create widget object if it doesn't exist yet if (!IDXPRO.widget) IDXPRO.widget = {}; // if multiple instances, we'll need to make sure there are no duplicate ids. // widget loads in an iframe IDXPRO.widget.display_html = ""; // write the iframe to the page document.write(IDXPRO.widget.display_html);