//******************************************************************************
// Generate the top frame-set for the web site.
//
function TopFrameSet()
{
    var columns = "152,*,115";
    if (window.screen.availWidth < 900)
        columns = "81,*,77";

    var headheight = "141";
    if (window.screen.availWidth < 900)
        headheight = "90";

    var txt  = ' <frameset cols="' + columns + '" frameborder="no" border="0">';
        txt += '   <frameset rows="' + headheight + ',*" frameborder="no" border="0">';
        txt += '     <frame src="churchicon.htm" border="0" marginwidth="0" marginheight="0">';
        txt += '     </frame>';
        txt += '     <frame src="navigation.htm" border="0" marginwidth="0">';
        txt += '     </frame>';
        txt += '   </frameset>';
        txt += '   <frame src="home.htm" border="0" name="main">';
        txt += '   </frame>';
        txt += '   <frame src="border.htm" border="0" scrolling="no">';
        txt += '   </frame>';
        txt += ' </frameset>';
        txt += ' </html>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate a subframe for the center column of the main frame.
//
// The subframe is divided vertically, with the upper part containing
// the title.htm file and the lower containing the body.htm file.
//
// Parameters:
//     prefix -- the prefix of the title and body.htm files
//
function Frame(prefix)
{
    var size = 140;
    if (window.screen.availWidth < 900)
        size = 90;
    
    var txt  = '<frameset rows="' + size + ',*" frameborder="no" border="0">';
        txt += '  <frame src="' + prefix + 'title.htm" border="0" scrolling="no">';
        txt += '  </frame>';
        txt += '  <frame src="' + prefix + 'body.htm" border="0" name="main" marginwidth="20">';
        txt += '  </frame>';
        txt += '</frameset>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference with no special alignment.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function GenImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<img src="Images/' + fileName + '"';
        txt += ' width=' + width + ' height=' + height;
        txt += ' alt="' + altTag + '" border="0" hspace="10">';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference that is aligned left.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function LImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<img src="Images/' + fileName + '"';
        txt += ' width=' + width + ' height=' + height;
        txt += ' alt="' + altTag + '" border="0" align="left" hspace="10">';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference that is aligned right.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function RImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<img src="Images/' + fileName + '"';
        txt += ' width=' + width + ' height=' + height;
        txt += ' alt="' + altTag + '" border="0" align="right" hspace="10">';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Show a full-sized picture.
//
// Parameters:
//     file -- the base name of the file
//     altTag -- the text for the alt tag for the image
//     
function ShowPicture(file, altTag)
{
    var txt  = '<html>';
        txt += '<head>';
        txt += '  <title>First Presbyterian Church in Victor, NY';
        txt += '  </title>';
        txt += '</head>';
        txt += '<body background="Images/pctile.gif">';
        txt += '<font color="#000000">';
        txt += '<center>';
        txt += '  <img src="Images/F-' + file + '" border="5"';
        txt += '       alt="' + altTag + '">';
        txt += '<br><br>';
        txt += altTag + '<br>';
        txt += '<font size="-1">';
        txt += '  Click the browser back button to return to previous page.';
        txt += '</font>';
        txt += '</center>';
        txt += '</body>';
        txt += '</html>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference that has a link to a bigger picture with no
// special alignment.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.  The name of the full image
//             is constructed by adding "F-" before the file parameter.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function RefImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<A HREF="javascript:ShowPicture(\'' + file + '\', \'' + altTag + '\')" target="_top">'
        txt += '  <img src="Images/' + fileName + '"';
        txt += '   width=' + width + ' height=' + height;
        txt += '   alt="Click for bigger image" border="0" hspace="10">';
        txt += '</A>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference that has a link to a bigger picture with right
// alignment.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.  The name of the full image
//             is constructed by adding "F-" before the file parameter.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function RefRImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<A HREF="javascript:ShowPicture(\'' + file + '\', \'' + altTag + '\')" target="_top">'
        txt += '  <img src="Images/' + fileName + '"';
        txt += '   width=' + width + ' height=' + height;
        txt += '   alt="Click for bigger image" border="0" align="right" hspace="10">';
        txt += '</A>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate an image reference that has a link to a bigger picture with left
// alignment.
//
// Parameters:
//     file -- the basic name of the image file.  The actual file is constructed
//             by adding "L-" or "S-" before the file parameter, depending on
//             whether the screen is large or small.  The name of the full image
//             is constructed by adding "F-" before the file parameter.
//     LW -- the width of the image for a large screen
//     LH -- the height of the image for a large screen
//     SW -- the width of the image for a small screen
//     SH -- the height of the image for a small screen
//     altTag -- the text for the alt tag for the image
//
function RefLImage(file, LW, LH, SW, SH, altTag)
{
    var fileName = 'L-' + file;
    var width = LW;
    var height = LH;
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-' + file;
        width = SW;
        height = SH;
    }

    var txt  = '<A HREF="javascript:ShowPicture(\'' + file + '\', \'' + altTag + '\')" target="_top">'
        txt += '  <img src="Images/' + fileName + '"';
        txt += '   width=' + width + ' height=' + height;
        txt += '   alt="Click for bigger image" border="0" align="left" hspace="10">';
        txt += '</A>';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************
//
// Generate a border with a background tile of the appropriate size
//
// No parameters
//
function Bordertile()
{
    var fileName = 'L-WindowTile.jpg';
    if (window.screen.availWidth < 900)
    {
        fileName = 'S-WindowTile.jpg';
    }

    var txt  = '<body background="Images/' + fileName + '">';

    window.document.open();
    window.document.write(txt);
    window.document.close();
}

//******************************************************************************

