function CharacterFaces()
{
this.id;
this.visibility = "hidden";
}

var characterFaces = new Array();
characterFaces[0] = new CharacterFaces();
characterFaces[0].id = "coolie";
characterFaces[1] = new CharacterFaces();
characterFaces[1].id = "merchant";
characterFaces[2] = new CharacterFaces();
characterFaces[2].id = "communist";
characterFaces[3] = new CharacterFaces();
characterFaces[3].id = "soldier";
characterFaces[4] = new CharacterFaces();
characterFaces[4].id = "policeman";


function setFace(faceId)
{
var i;
	for (i=0; i<characterFaces.length; i++)
	{
		if(faceId)
		{
			if(characterFaces[i].id == faceId)
characterFaces[i].visibility = "visible";
		}
document.getElementById(characterFaces[i].id).style.visibility = characterFaces[i].visibility;
	}
document.chooserForm.characterSelection.value = "";
}



function showFace(faceId)
{
document.getElementById(faceId).style.visibility = "visible";
}


function stowFace()
{
var i;
	for (i=0; i<characterFaces.length; i++)
	{
document.getElementById(characterFaces[i].id).style.visibility = characterFaces[i].visibility;
	}
}


function selectCharacter(characterSelected)
{
document.chooserForm.characterSelection.value = characterSelected;
document.chooserForm.submit();
}



//-----------------------------------------------------------------------------------------

// Object ChinaImages and its method, ChangeChinaImage(), are used in the honor section
// to select the photo that will be displayed. See links in honorChina.inc. They will look
// like A_chinaImages[1].changeImage().

// Notice the first line of the object definition: this.image=new Image(). I believe this works
// to preload an image when each new A_chinaImages[] is made. Not sure.

// Unfortunately, I wasn't able to call the illustration in on the page chinaPhoto.php using 
// src="javascript: A_chinaImages[0].src". So "chinaWide.jpg" is actually being loaded into memory
// twice. This is not much of a problem here, but if there were a lot of photos it might be. Have
// to think about this.

// "return blur()" is to get rid of the selection outlines around the links. Check this on IE Windows,
// it may do something weird. 

function ChinaImages()
{
this.image = new Image();
this.id = "chinaImage";
this.visibility = "hidden";
}

var A_chinaImages = new Array();
A_chinaImages[0] = new ChinaImages();
A_chinaImages[0].src = "mopi/media/chinaWide.jpg";
A_chinaImages[1] = new ChinaImages();
A_chinaImages[1].src = "mopi/media/chinaDead.jpg";

function ChangeChinaImage()
{
document.getElementById(this.id).style.visibility = "hidden";
document.getElementById(this.id).src = this.src;
document.getElementById(this.id).style.visibility = "visible";
return blur();
}

ChinaImages.prototype.changeImage = ChangeChinaImage;





