﻿var includes = new Array('constants.js', 'script.js', 'photoalbum.js');

var elements = document.getElementsByTagName('head');

if (elements.length > 0) {
    var head = elements[0];     
    if (includes.length > 0) {        
        for (var i = 0; i < includes.length; ++i) {
            var file = includes[i];
            var script = document.createElement('script');
            script.setAttribute('src', 'script/' + file);
            script.setAttribute('type', 'text/javascript');                
            head.appendChild(script);        
        }
    }

    var site_enter = document.createElement('meta');
    site_enter.setAttribute('http-equiv', 'Site-Enter');    

    var page_enter = document.createElement('meta');
    page_enter.setAttribute('http-equiv', 'Page-Enter');    

    var page_exit = document.createElement('meta');
    page_exit.setAttribute('http-equiv', 'Page-Exit');

    site_enter.setAttribute('content', 'blendTrans(Duration=0.1)');
    page_enter.setAttribute('content', 'blendTrans(Duration=0.1)');
    page_exit.setAttribute('content', 'blendTrans(Duration=0.1)');

    head.appendChild(site_enter);
    head.appendChild(page_enter);
    head.appendChild(page_exit);
    
    var icon_ico = document.createElement('link');
    icon_ico.setAttribute('rel', 'shortcut icon');
    icon_ico.setAttribute('href', 'images/favicon.ico');
    icon_ico.setAttribute('type', 'images/x-icon');
    head.appendChild(icon_ico);

    var icon_png = document.createElement('link');
    icon_png.setAttribute('rel', 'shortcut icon');
    icon_png.setAttribute('href', 'images/favicon.png');
    icon_png.setAttribute('type', 'images/png');
    head.appendChild(icon_png);
}

