function PreviewSoldier(soldierName, bWidth, bHeight, parentPath) {
	this.soldierName = soldierName;
	this.largeWidth = bWidth;
	this.largeHeight = bHeight;
	this.position = 0;
	this.image = new Array(8);
	this.largeImage = new Array(8);
	this.largeView = null;
	var path = (commonUndefined(parentPath) || parentPath == null || parentPath == '')? '': (parentPath + '/');
	for (var i = 0; i < 8; ++ i) {
		this.image[i] = new Image();
		this.image[i].src  = path + soldierName + "/" + soldierName + "_" + (i+1) + ".gif";
		this.largeImage[i] = path + soldierName + "/" + soldierName + "_" + (i+1) + "b.jpg";
	}
	return this;
}

PreviewSoldier.prototype = {
	nextImage: function() {
		this.position ++;
		if (this.position >= this.image.length) {
			this.position = 0;
		}
		document.imageTag.src = this.image[this.position].src;
	},
	previousImage: function() {
		this.position --;
		if (this.position < 0) {
			this.position = this.image.length - 1;
		}
		document.imageTag.src = this.image[this.position].src;
	},
	openLargeImage: function() {
		try {
		this.largeView = window.open(this.largeImage[this.position], "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,height="+this.largeHeight+",width="+this.largeWidth);
		} catch (ex) {
			alert('Exception : ' + ex);
		}
	},
	printSoldier: function(varName, parentPath) {
		var path = (commonUndefined(parentPath) || parentPath == null || parentPath == '')? '': (parentPath + '/');
		document.write('<img src="'+this.image[this.position].src+'" name="imageTag" border="0" id="imageTag" />');
		document.write('<p><img src="' +  path 
					   + 'images/arrow_l.gif" alt="предыдущий вид" title="предыдущий вид" onmouseover="activeCursor(this)" onclick="' + varName 
					   + '.previousImage();" /><img onmouseover="activeCursor(this)" src="' + path 
					   + 'images/zoom.gif" alt="увеличить" title="увеличить" class="zoom" onclick="' + varName 
					   + '.openLargeImage();" /><img onmouseover="activeCursor(this)" src="' + path 
					   + 'images/arrow_r.gif" alt="следующий вид" title="следующий вид" onclick="' + varName 
					   + '.nextImage();" /></p>');
	}
};