
//  a safe way to add onload events
//  usage: function name, without parentheses
//  e.g., addLoadEvent( start_slide_rotation )


function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function remote_window_close( win )
{
	win.close();
}



/****************

For image slideshows

*****************/


var images = Array();
var next_slide = 1;

var initial_delay = 3500;

function rotateSlide()
{
	document.getElementById( 'Slideshow' ).src = images[next_slide][0];
	setTimeout ('rotateSlide()', images[next_slide][1] );
	if ( next_slide >= 0 && next_slide < images.length - 1)
	{
		next_slide++;
	}
	else
	{
		next_slide = 0;
	}
}

function start_slide_rotation()
{
	setTimeout ( 'rotateSlide()', initial_delay );
}
