﻿// JScript File

function OpenWindow(url)
{
window.open(url,'mywindow','scrollbars=1,resizable=1');
}

function OpenSizedAndPositionedWindow(url,x,y,h,w)
{
window.open (url, 'mywindow','location=1,status=1,scrollbars=1,width='+ w +',height=' + h);
testwindow.moveTo(x,y);
}


function CheckPopUps()
{
var dmy = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');

     if(dmy)
        { dmy.close(); }
     else          
        { alert('It appears you have pop-up blocking enabled on your browser.  You may not be able to use all the features found on this site.'); }
}

function test() // will return xxx to a label with Text="<script type='text/javascript'>test();</script>"
{
document.write('xxx');
}

//Generating Pop-up Print Preview page
function ViewPrint(print_area, title){ 

//Creating new page
var pp = window.open('','','width=820,height=600,left=0,top=0,scrollbars=no');

//Adding HTML opening tag with <HEAD> … </HEAD> portion
pp.document.writeln('<HTML><HEAD><title>' + title +'</title>');
pp.document.writeln('<LINK href=Styles.css type="text/css" rel="stylesheet">');
pp.document.writeln('<LINK href=PrintStyle.css type="text/css" rel="stylesheet" media="print">');
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 align=right>');
pp.document.writeln('<INPUT ID="PRINT" type="button" value="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></TABLE>');

//Writing print area of the calling page
pp.document.writeln(document.getElementById(print_area).innerHTML);

//Ending Tag of </form>, </body> and </HTML>
pp.document.writeln('</form></body></HTML>');

} 