

function imageMoveOver(name) {
		 with (this)  if (pressed==0) name.src = image2.src;
}

function imageMoveOff(name) {
		 with (this) if (pressed == 0) name.src = image1.src;
}

function imageClick(nme,start) {
		 if (firstClick==0) {
		 	old = start;
			firstClick=1;
		 }
		 if (flipped==1) {
		 	 num.pressed = 0;
		 	 num.imageMoveOff(old);
		 }
		 else flipped = 1;
		 with (this) {
		 	  pressed = 1;
		 	  num = this;
			  old = nme;
		 	  nme.src = image3.src;
		 }
}

function setSelected() {
		 flipped = 1;
		 with (this) {
		 	  pressed = 1;
		 	  num = this;
		 }
}
 

function imageProcess(file1,file2,file3) {
		 this.image1 = new Image;
		 this.image2 = new Image;
		 this.image3 = new Image;
		 this.image1.src = file1;
		 this.image2.src = file2;
		 this.image3.src = file3;
		 this.pressed = 0;
		 this.imageMoveOff = imageMoveOff;
		 this.imageMoveOver = imageMoveOver;
		 this.imageClick = imageClick;
		 this.setSelected = setSelected;
}

flipped=0;
var old;
var num;
var firstClick=0;
