if( document.images ) { var whoarewe_btn = PreLoad( '_whoarewe' ); var whatdowedo_btn = PreLoad( '_whatdowedo' ); var howdowedoit_btn = PreLoad( '_howdowedoit' ); var where_btn = PreLoad( '_where' ); } function PreLoad(btn) { var img_path = "/pae.co.at/graphics/buttons/"; //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 + "" + ".jpg"; //first version: no mouse over image temp[1].src = img_path + btn + "2" + ".jpg"; //second version: mouse over image return temp; } function Swap(btn, mouse_on) { var img = btn.id; if(document.images ) { var temp = eval(img); document[img].src = temp[mouse_on].src; } }