// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// JavaScript Functions For Web Publishers                 12/2000
// ---------------------------------------          stray@stray.ch  
// http://stray.ch/articles/publib.html        *  *        *
// This library provides a couple of functions      *  //     *
// for everyday webdesign tasks                 *    /. .\  *
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-m-U-m-=-=-=-=


// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Preload a list of images
// Usage: preload('file1.gif', 'file2.gif', ...);

function preload() {
   if (document.images) {
      for (var i = 0; i < preload.arguments.length; i++) {
         this[i+1] = new Image();
         this[i+1].src = preload.arguments[i];
      }
   }
}


// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Show an image instead of the existing image tag
// HTML:  <IMG src="old_image.gif" name="image_tag_name">
// Usage: show('image_tag_name', 'new_image.gif"');

function show(i,newsrc) {
   if (document.images) {
      document.images[i].src = newsrc ;
   }    
}


// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Open a pop-up window
// Usage: popup('url.html', 600, 400);
// Usage: popup('url.html', 600, 400, 'location=1,scrollbars=1');

function popup(url,w,h,args) {
   window.open(url,'_blank','height='+h+',width='+w+','+args);
}


