Files
jasoc.org/archive/version_01/en/jairus.js
2017-03-02 21:32:16 -06:00

37 lines
1022 B
JavaScript
Executable File

// JavaScript Document for Jairus Society : english
if( document.images )
{
var ourmission_btn = PreLoad( 'ourmission' );
var ourfamilies_btn = PreLoad( 'ourfamilies' );
var support_btn = PreLoad( 'support' );
var contactus_btn = PreLoad( 'contactus' );
var links_btn = PreLoad( 'links' );
}
function PreLoad( btn )
{
var img_path = "./graphics/"; //file path to find button images
var temp = new Array();
temp[ 0 ] = new Image(); //don't know which image we're actually loading
temp[ 1 ] = new Image(); //so format temp to hold an image, any image
//then we can use .src to load each button img
temp[ 0 ].src = img_path + btn + "_btn" + ".gif"; //first version: no mouse over image
temp[ 1 ].src = img_path + btn + "_btn_2" + ".gif"; //second version: mouse over image
return temp;
}
function Swap( img, mouse_on )
{
if( document.images )
{
var image_id = img + "_btn";
var temp = eval( img + "_btn" );
document[ image_id ].src = temp[ mouse_on ].src;
}
}