// BEGIN FLOCK GPL
//
// Copyright Flock Inc. 2005-2009
// http://flock.com
//
// This file may be used under the terms of the
// GNU General Public License Version 2 or later (the "GPL"),
// http://www.gnu.org/licenses/gpl.html
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// END FLOCK GPL

function onLoad() {
  var params = window.arguments[0];
  var viewDoc = document.getElementById("viewBrowser").contentWindow.document;

  // Style and script
  var head = viewDoc.documentElement.getElementsByTagName("head")[0];
  var cssNode = viewDoc.createElement("link");
  cssNode.type = "text/css";
  cssNode.rel = "stylesheet";
  cssNode.href = "chrome://flock/content/blog/preview.css";
  cssNode.media = "screen";
  head.appendChild(cssNode);
  var scriptNode = viewDoc.createElement("script");
  scriptNode.type = "application/x-javascript";
  scriptNode.src = "chrome://flock/content/blog/preview.js";
  head.appendChild(scriptNode);

  // Set the content
  viewDoc.body.innerHTML = params.content;
  viewDoc.body.setAttribute("onclick", "previewClick(event);");
}
