var img=new Array()
var name=new Array()
var division=new Array()
var url=new Array()
var winName=new Array()
var thumbnail=new Array()
var tempThumbnail=new Array()

function sortArray(seg) {
	tempArray=new Array(); tempLength=name[seg].length
	for (x=0;x<tempLength;x++) {
		tempArray[x]=new Array();
		tempArray[x]=[name[seg][x],url[seg][x],winName[seg][x],division[seg][x],img[seg][x],x]
	}
	tempArray.sort()
	for (x=1;x<tempLength;x++) {
		if (thumbnail[seg]==tempArray[x][5]) {
			tempThumbnail[seg]=x
		}
		name[seg][x]=tempArray[x][0]
		url[seg][x]=tempArray[x][1]
		winName[seg][x]=tempArray[x][2]
		division[seg][x]=tempArray[x][3]
		img[seg][x]=tempArray[x][4]
	}
	thumbnail[seg]=tempThumbnail[seg]
}

function showProduct() {
	document.write("<tr><td height='20' align='left' valign='middle' width='280'>");
	document.write("<a href='" + url[seg][x] + "' target='" + winName[seg][x] + "' onClick='openWin(&quot;" + url[seg][x]+"&quot;,&quot;"+winName[seg][x]+"&quot;)'>" + name[seg][x] + "</a>" + "</td><td height='20' valign='middle'>"+division[seg][x]+"</td></tr>");
}	

function showImage() {
	document.write("<a href='javascript:openWin(\&quot;"+url[seg][thumbnail[seg]]+"\&quot;,&quot;"+winName[seg][thumbnail[seg]]+"&quot;)'><img src='images/prod_"+img[seg][thumbnail[seg]]+".jpg' width=80 title='"+name[seg][thumbnail[seg]]+"' alt='"+name[seg][thumbnail[seg]]+"' border=0></a>")
}

