// Test for minimal Javascript required by Drupal. if (document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById) { var DrupalEmbed = DrupalEmbed || []; DrupalEmbed[DrupalEmbed.length] = { src: "", wid: "", width: , height: }; for (var i in DrupalEmbed) { if (!DrupalEmbed[i]['processed']) { DrupalEmbed[i]['processed'] = true; var separator = DrupalEmbed[i].src.indexOf('?') == -1 ? '?' : '&'; if(undefined===window.widget_count){ window.widget_count = 0; } else { widget_count++; } var script = document.getElementById('widget-embed-script-' + DrupalEmbed[i].wid); script.setAttribute('id', 'widget-embed-script-' + DrupalEmbed[i].wid + widget_count); var iframe = document.createElement('iframe'); iframe.setAttribute('id', 'widget-embed-' + widget_count); iframe.setAttribute('frameBorder', '0'); iframe.setAttribute('width', DrupalEmbed[i].width); iframe.setAttribute('height', DrupalEmbed[i].height); iframe.setAttribute('src', DrupalEmbed[i].src + separator + 'embed_widgets_id=' + DrupalEmbed[i].wid); iframe.onload = function () { var iframeDocument = this.contentDocument ? this.contentDocument : (this.contentWindow ? this.contentWindow.document : null); if (iframeDocument) { var height = iframeDocument.height || iframeDocument.body.scrollHeight || null; if (height) { this.setAttribute('height', (height + 40) + 'px'); } } } script.parentNode.insertBefore(iframe, script); } } }