/* Copyright (c) 2006 Photography by Michael K. Johnson. All rights reserved. */ /** * Base directory all javascripts are loacted * * We need to make sure that if a page doesn't define a base script directory * that we at least have an empty string */ SCRIPT_BIN = ( (SCRIPT_BIN == undefined || typeof SCRIPT_BIN != "string") ? "" : SCRIPT_BIN ); /** * Scripting calls performed once the page is loaded */ var ONLOAD_CALLS = new Array(); /** * Scripting calls performed when the page is resized */ var ONRESIZE_CALLS = new Array(); /** * Include additional javascripts */ include = function(file, strIncludePath){ //if we don't have an include path if(strIncludePath == null){ strIncludePath = ""; } //if we are dealing with a list of files if(typeof file == "object" && file.length){ var i = 0; for(i = 0; i < file.length; i++){ include(file[i], strIncludePath); } //if we are dealing with a string }else if(typeof file == "string"){ document.write( "\n" ); } } //include several standard functions include(SCRIPT_BIN+"stdlib.js"); /** * Add scripting call to startup queue */ load_on_startup = function(call){ ONLOAD_CALLS[ONLOAD_CALLS.length] = call; } /** * Add scripting call to resize queue */ load_on_resize = function(call){ ONRESIZE_CALLS[ONRESIZE_CALLS.length] = call; } /** * Function called what a page is loaded */ init_page = function(){ for(var i = 0; i < ONLOAD_CALLS.length; i++){ eval(ONLOAD_CALLS[i]); } } resize_page = function(){ for(var i = 0; i < ONRESIZE_CALLS.length; i++){ eval(ONRESIZE_CALLS[i]); } } //bind our custom page initialization and resize functions to the browser window.onload = init_page; window.onresize = resize_page;