function assignEmail( id )
{
    if ( document.getElementById != null ) 
    {
        var element = document.getElementById(id);
        if ( element != null ) {
            element.href      = "mailto:webmaster@fotogroepveldhoven.nl?subject=Request for the FGV Webmaster";
            element.innerHTML = id;
        } else {
            alert("Tag with ID '" + id + "' not found, not able to assign data!");
            return;
        }
    }
}
function getLastModified()
{
    var lastMod = new Date();
    if ( document.lastModified )
        lastMod = new Date(document.lastModified);
    return lastMod;
}
function assignPresentYear( id )
{
    if ( document.getElementById != null ) 
    {
        var lastMod = getLastModified();
        
        var element = document.getElementById(id);
        if ( element != null ) {
            element.innerHTML = lastMod.getFullYear();
        } else {
            alert("Tag with ID '" + id + "' not found, not able to assign data!");
            return;
        }
    }
}
function assignLastModified( id )
{
    if ( document.getElementById != null ) 
    {
        var lastMod   = getLastModified();

        var day  = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
        var mnth = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

        var weekday   = day[lastMod.getDay()];
        var monthfull = mnth[lastMod.getMonth()];
        var date      = lastMod.getDate();
        var yearfull  = lastMod.getFullYear();
        
        var element = document.getElementById(id);
        if ( element != null ) {
            element.innerHTML = weekday + " " + date + " " + monthfull + " " + yearfull;
        } else {
            alert("Tag with ID '" + id + "' not found, not able to assign data!");
            return;
        }
    }
}
function setStatusBar( text )
{
    var status = "www.fotogroepveldhoven.nl";
    if( text )
    {
        status += " - ";
        status += text;
    }
    window.defaultStatus = status;
}
function setFrameHeight( id )
{
    if ( document.getElementById != null ) 
    {
        var height = document.body.clientHeight;
        height -= 15; // size of horizontal line
        height -= 20; // size of frame title
        height -= 15; // size of horizontal line
        
        var element = document.getElementById(id);
        if ( element != null ) {
            element.height = height;
        } else {
            alert("Tag with ID '" + id + "' not found, not able to assign height!");
        }
    }
}
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial( title, lastmodified )
{
    if ( document.getElementById != null )
    {
        // Start a new html page and its header
        var html = '<HT'+'ML>\n<HE'+'AD>\n';

        // Copy the page's `head` i.e. used stylesheet(s), script(s), etc.
        if ( document.getElementsByTagName != null )
        {
            var headTags = document.getElementsByTagName('head');
            if ( headTags.length > 0 )
                html += headTags[0].innerHTML;
        }

        // Close page header and open its body
        html += '\n</HE'+'AD>\n<BO'+'DY>\n';

        var printReadyElem = document.getElementById('printReady');
        if ( printReadyElem != null )
        {
            // Backup some properties
            var height    = document.getElementById('ProgrammaView').height;
            var scrolling = document.getElementById('ProgrammaView').scrolling;

            // Re-assign properties
            document.getElementById('ProgrammaView').height    = "100%";
            document.getElementById('ProgrammaView').scrolling = "no";

            // Copy applicable data
            html += printReadyElem.innerHTML;

            // Restore properties
            document.getElementById('ProgrammaView').scrolling = scrolling;
            document.getElementById('ProgrammaView').height    = height;
        }
        else
        {
            alert("Could not find the printReady section in the HTML");
            return;
        }

        // Close page body
        html += '\n</BO'+'DY>\n</HT'+'ML>';

        // Open a new window and assign html data
        var printWin = window.open("","printSpecial");
        printWin.document.open();
        printWin.document.write(html);
        printWin.document.close();
        
        if ( gAutoPrint )
            printWin.print();
    }
    else
    {
        alert("Sorry, the print ready feature is only available in modern browsers.");
    }
}

