parent.iframePDF is undefined
<p>I get 'parent.iframePDF is undefined' JavaScript error when i use the below code in Firefox and an 'object expected' error in IE. </p>

<p>Can someone tell me what it is that i'm doing wrong? Thanks</p>

<pre><code>function PrintFrame(xFile){
    parent.iframePDF.location.href = xFile;
    document.getElementById("spanMess").style.display = "block";

    parent.iframePDF.onload = new function() {
        setTimeout("parent.iframePDF.print();parent.document.getElementById('spanMess').style.display='none';",10000);
    }
}

&lt;iframe id="iframePDF" src="about:blank" style="display:none"&gt;&lt;/iframe&gt;

&lt;input type="image" onclick="PrintFrame('525.pdf')" src="../../cms_res/DisneyChannel/playhouse/images/buttons/printer.png" /&gt;

&lt;span id="spanMess" style="display:none;color:red;"&gt;
    &lt;h3&gt;Preparing Document For Print&lt;/h3&gt;
&lt;/span&gt;
</code></pre>
