/*code to generate doubleclick spotlight tags using valid XHTML*/ function generateSpotlightTags(container, url) { //is url valid if (url != "" && url != null) { //does browser support DOM scripting? if (document.getElementById) { //find the container var _con = document.getElementById(container); if (_con != null) { //create a new element var _img = document.createElement('img'); _img.setAttribute('alt', 'DoubleClick Spotlight tracking image'); _img.setAttribute('src', url); _img.setAttribute('width', "1"); _img.setAttribute('height', "1"); //attach to container _con.appendChild(_img); } } //does browser support document.images? else if (document.images) { var _img = new Image(); _img.src = url; } //does browser support document.write? else if (document.write) { document.open(); document.write("\"DoubleClick"); document.close(); } } }