//	used in product.aspx for the product preview

var j = 0;
var pid = new Array();
var pnm = new Array();
var pimg = new Array();

function getProduct() {
	for (i=0;i<pid.length;i++) {
		if (pid[i] == curProdID) { j = i; }
	}
	advproduct(1);
}

function advproduct(incrmnt) {
	j = j + incrmnt;
	if (j >= pid.length) { j = (pid.length - 2); }
	if (j < 0) { j = 0; }
	showproduct();
}

function showproduct() {
	var idiv = document.getElementById("pvwImg");
	var w = u.replace("[]", pid[j]);
	
	var txt = '<table>';
	txt += '<tr>';
	txt += '<td class="pvwBtn">';
	if (j == 0) { txt += '&lt;'; }
	else { txt += '<a href="JavaScript:advproduct(-1);">&lt;</a>'; }
	txt += '</td>';
	txt += '<td class="pvwImg">';
	txt += '<a href="' + w + '">';
	txt += '<img src="sendbinary.aspx?path=' + strPath + pimg[j] + '&width=100&height=100" alt="' + pnm[j] + '">';
	txt += '<br />' + pnm[j] + '</a>';
	txt += '</div></td>';
	txt += '<td class="pvwBtn">';
	if (j == (pid.length - 1)) { txt += '&gt;'; }
	else { txt += '<a href="JavaScript:advproduct(1);">&gt;</a>'; }
	txt += '</td>';
	txt += '</tr>';
	txt += '</table>';

	idiv.innerHTML = txt;
//	alert(txt);
}
