//namespace our global vars if (!IDXPRO) var IDXPRO = {}; // create widget object if it doesn't exist yet if (!IDXPRO.widget) IDXPRO.widget = {}; // later on we'll create a widgets array containing multiple types and instances. // but for now we only have one instance of one type: 'search' // 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);