// Global variables var PicArray = new Array(); var isNav4, isIE4, i_pic_main; if (parseInt(navigator.appVersion) >= 4) {if (navigator.appName.indexOf("Microsoft") != -1) {isNav4 = true;} else {isIE4 = true;} } function load_pics(pic_dir,pic_prefix,pic_ext,pic_start,pic_end) {for (i=PicArray.length, i_pic=pic_start; i_pic <= pic_end; i++, i_pic++) { PicArray[i]=new Image(); PicArray[i].src=pic_dir + pic_prefix + i_pic + pic_ext; PicArray[i].pic_name=pic_prefix + i_pic + "_" +i; PicArray[i].format=pic_format(PicArray[i]); PicArray[i].link=pic_prefix + "/index.html"; document.write(''); //document.write(i,' ',i_pic,' ',PicArray[i].pic_name,' ', PicArray[i].src, ' ',PicArray[i].format,' ',PicArray[i].width,' ',PicArray[i].height); document.close(); } } function pic_format(pic) {if (pic.height > pic.width ) {pic="portrait";} else {pic="landscape";} return pic; } function swap_img(i_pic_dest, i_pic_src) {document.images[PicArray[i_pic_dest].pic_name].src=document.images[PicArray[i_pic_src].pic_name].src; // document.links[i_pic_dest].href=document.links[i_pic_src].href; document.links[PicArray[i_pic_dest].pic_name].href=document.links[PicArray[i_pic_src].pic_name].href; } function fill_main(img_source) {swap_img(i_pic_main.toString(10),img_source); } function img_format(orientation) // the CSS case statement doesn't work on all browsers..... {if (orientation == "portrait") { orientation = ' width="81" height="109" ';} else { orientation = ' width="108" height="81" ';} return orientation; } function fill_index(i_pic,orientation) {document.write(''); document.close(); } function display_main(pic) {i_pic_main = PicArray.length+1; PicArray[i_pic_main]=new Image(); PicArray[i_pic_main].src=PicArray[pic].src; PicArray[i_pic_main].pic_name="main_pic"; document.write(''); document.close(); } function display_link(i_pic,orientation) {document.write(''); document.close(); }