var $arrImages = new Array();

var $globalImgPos = 0;

function imageObj(smallImgURL, mediumImgURL, bigImgURL, bigImgWidth, bigImgHeight, submittedBy, itemURL)
{
	this.smallImgURL = smallImgURL;
	this.mediumImgURL = mediumImgURL;
	this.bigImgURL = bigImgURL;
	this.submittedBy = submittedBy;
	this.bigImgWidth = bigImgWidth;
	this.bigImgHeight = bigImgHeight;
	this.itemURL = itemURL;
}

function changeInfo(pos){
	$globalImgPos = pos;
	if($globalImgPos != null){
		with (document) {
			getElementById("mediumImg").src = $arrImages[pos].mediumImgURL;
			getElementById("mediumImg").alt = $arrImages[pos].submittedBy;
			getElementById("submittedBy").innerHTML = $arrImages[pos].submittedBy;
			getElementById("detailsId").href = $arrImages[pos].itemURL;
		}
	}
}

function showBigImg(){
	if (!$globalImgPos)
		$globalImgPos = 0;
	var w = $arrImages[$globalImgPos].bigImgWidth + 20;
	var h = $arrImages[$globalImgPos].bigImgHeight + 40;
	var $wnd = window.open("", "popupWnd", "width=" + w + ", height=" + h);
	if ($arrImages[$globalImgPos].bigImgURL) {
		with ($wnd.document) {
			write("<html><head><title>Larger View</title></head><body><img src=\"");
			write($arrImages[$globalImgPos].bigImgURL);
			write("\"></body><html>");
		}
	}
	$wnd.focus();
}
