﻿//Function displays 'Help' files in a popup window
function DisplayHelp(helpfile) {
    var w = 400; var h = 350;
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    window.open(helpfile, null, 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=1');
}

//Generating Pop-up Print Preview page
function DisplayPrint(print_area) {
    //Creating new page
    var pp = window.open('', '','left=150,width=900,height=500,menubar=1,toolbar=0,scrollbars=1,status=0');
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<HTML><HEAD><title>Print Preview</title>')
    pp.document.writeln('<LINK href=StokeStyleSheet.css type="text/css" rel="stylesheet">')
    pp.document.writeln('<base target="_self"></HEAD>')

    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
    pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    pp.document.writeln('<form method="post">');

    //Creating two buttons Print and Close within a HTML table
    pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=left>');
    pp.document.writeln('<INPUT ID="PRINT" type="button" value="     Click to Print     " ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
    pp.document.writeln('<INPUT ID="CLOSE" type="button" ' + 'value="Close" onclick="window.close();">');
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');

    //Writing print area of the calling page
    pp.document.writeln(document.getElementById('PrintHead').innerHTML);
    pp.document.writeln('<div style="padding:10px 10px 10px 10px;"><br /><br /><br /><br />');
    pp.document.writeln(document.getElementById('PrintMain').innerHTML);
    pp.document.writeln('</div>');
    pp.document.writeln('<br /><br /><span class=NormalDouble>Copyright StokeDaSoul.com</span>');
    //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('</form></body></HTML>');
}




