//
//                      screen_change
//
//    This provides a method for creating a TV that will flash through two images
//
function TV(label, obj, delay, before, after) {
    this.label  = label                           ;
    this.obj    = obj                             ;
    this.delay = delay                            ;

    this.imageList = new Array
        ( new Image(215,215), new Image(215,215)) ; // 215,155

    this.imageList[0].src = before                ;
    this.imageList[1].src = after                 ;

    this.imageNo = 0                              ;
}

TV.prototype.showImage = function()
{
    var action = this.obj+".showImage();" ;
    
    document.images[this.label].src = this.imageList[this.imageNo].src;

    if (++this.imageNo > 1) {  
        this.imageNo = 0 ; 
    }
    setTimeout(action,this.delay);
}
	
