var i = 0 ;
var swaplist = new Array() ;
    swaplist.length = 0 ;
var sourcedetect = 0 ;
var holdimage = new Image () ;
var utilitySource = "text" ;

swaplist.length = 0 ;

function wrapperOpen (file) {
      utility = window.open ( file, "MultiPurpose","WIDTH=350,HEIGHT=450,RESIZABLE=YES,SCROLLBARS=YES") ;
	  clearTimeout(openit) ;
      utility.focus()
}

function OpenUtility(utilitySource) {
  if ( window.utility ) {
	if ( utility.closed ) openit = eval ( 'setTimeout("wrapperOpen(\'' + utilitySource + '\')",1000)' )
    else {
      utility.location = utilitySource ;
      utility.focus()
    }
  }
  if ( !window.utility ) openit = eval ( 'setTimeout("wrapperOpen(\'' + utilitySource + '\')",1000)' )
} ;

function NoAction () {
}

function preload ( imagename, imagesource ) {
	i = swaplist.length ;
	eval ( 'swapimage' + i + ' = new Image ()' ) ;
	eval ( 'swapimage' + i + '.src = "' + imagesource + '"' ) ;
	swaplist[i] = [ imagename, eval ( 'swapimage' + i + '.src' ) ]
}

function swap ( imagename ) {
	for ( i = 0 ; i < swaplist.length; i++ ) if ( imagename == swaplist[i][0] )	sourcedetect = i ;
	holdimage.src = document.images[imagename].src ;
	document.images[imagename].src = swaplist[sourcedetect][1] ;
	swaplist[sourcedetect][1] = holdimage.src
}