
var con;

function printIt(target) { 
  var mytitle = document.title;
  var thebase = document.getElementsByTagName("base");
  var theBase = thebase[0].href;

if (document.getElementById('contentwide')) {
  mecon = document.getElementById('contentwide').innerHTML;
  con = "<div id=\"contentwide\">" + mecon + "";

  // now add feature boxes if they exist
  if (document.getElementById('feature')) {
    mecon = document.getElementById('feature').innerHTML;
    con = con + "<div id=\"feature\">" + mecon + "";
  }
  if (document.getElementById('seealso')) {
    mecon = document.getElementById('seealso').innerHTML;
    con = con + "<div id=\"feature\">" + mecon + "";
  }
  if (document.getElementById('onpage')) {
    mecon = document.getElementById('onpage').innerHTML;
    con = con + "<div id=\"feature\">" + mecon + "";
  }
} else if (document.getElementById('contentwidenofeature')) {
  mecon = document.getElementById('contentwidenofeature').innerHTML;
  con = "<div id=\"contentwidenofeature\">" + mecon + "";
} else if (document.getElementById('content')) {
  mecon = document.getElementById('content').innerHTML;
  con = "<div id=\"content\">" + mecon + "";
} else {
  fecon = document.getElementById('content_feature').innerHTML;
  featurebox = document.getElementById('feature').innerHTML;
  con = "<div id=\"content_feature\">" + fecon + "</div><div id=\"feature\">" + featurebox + "</div><div id=\"clearspace\"><img src=\"resources/images/spacer.gif\" width=\"780\" height=\"1\"></div></div>";
}

  winId=window.open('','printwin','width=800,height=600,scrollbars=yes'); 
  winId.document.write("<html><head><base href=\"" + theBase + "\"><title>Print-friendly - " + mytitle + "</title><style type=\"text/css\">h1 {color:#000;font-size:125%;} h2 {color:#000;font-size:110%;} h3 {color:#000;font-size:100%;} body {font-family:verdana, arial, san-serif;}#contentwide {font-size:80%;} #contentwidenofeature {font-size:80%;} .disclaimer {font-size:80%;}#lastUpdated {font-size:80%;}#closeprintfriendly {font-size:80%;}  #feature {width:100%;} .featuretitle {font-weight:bold;color:#000083} table {font-size:100%;}</style><img src=\"resources/images/qg_solid_sstacked_sml.jpg\" width=\"199\" height=\"63\">"); 
  winId.document.write("</head><body><div id=\"closeprintfriendly\" align=\"right\"><a href=\"#\" onclick=\"window.close()\">Close print-friendly page</a></div>"); 
  winId.document.write(con); 
  winId.document.write("<br><br><div class=\"disclaimer\">&copy; The State of Queensland (Department of Justice and Attorney-General) 2009.<br>The State of Queensland makes no statements, representations, or warranties about the accuracy or completeness of, and you should not rely on, any information contained in this document.</div></body></html>"); 
  winId.document.write("<script language='javascript'>");
  winId.document.write("var i=0; while(i<document.anchors.length){document.anchors[i].href='#';i++;}");
  winId.document.write("</script>");

  winId.document.close(); 
  winId.focus(); 
  if (window.print) winId.print();
  } 
