aMML=aMMLnkImg.length //how many pics
aMMLnk=new Array(6) //array for shown links
imgOffset=0 //start showing from
aoMMImg=new Array(aMML) //array of image objects for cash

path_to_images = "http://www.sapere.it/tca"
//path_to_images = "http://194.244.21.234/tca"

//cash loop

for (i=0;i<aMML;i++) {
	aoMMImg[i]=new Image()
	aATRS=aMMLnkImg[i].split("|")
	aoMMImg[i].src=aATRS[1]
}

document.write ("								<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"149\">")
document.write ("									<tr>")
document.write ("										<td colspan=\"5\"><img src=\"/img/dot.gif\" width=\"14\" height=\"6\" border=\"0\" alt=\" \"></td>")
document.write ("									</tr>")
document.write ("									<tr>")

ImgRow("024")

document.write ("									</tr>")
document.write ("									<tr>")
document.write ("										<td colspan=\"5\"><img src=\"/img/dot.gif\" width=\"14\" height=\"11\" border=\"0\" alt=\" \"></td>")
document.write ("									</tr>")
document.write ("									<tr>")

ImgRow("135")

document.write ("									</tr>")
if(aMML>6) {
document.write ("									<tr>")
document.write ("										<td colspan=\"5\" align=\"center\">")
document.write ("											<a href=\"javascript:void(0)\" class=\"blubig\" onClick=\"MMIMove(-2)\">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:void(0)\" class=\"blubig\" onClick=\"MMIMove(2)\">&gt;&gt;</a></td>")
document.write ("									</tr>")
}
document.write ("								</table>")


//print rows with images
function ImgRow(sOrd) {
for (i=0;i<3;i++) {
	iRI=sOrd.substr(i,1)
	if (iRI<aMML) {
		aATRS=aMMLnkImg[iRI].split("|")
		sLFI= path_to_images + aATRS[1]
		aMMLnk[iRI]=aATRS[0]
	}
	else {
		sLFI="/img/dot.gif"
		aMMLnk[iRI]=""
	}

	document.write ("										<td width=\"40\">")
	document.write ("											<a href=\"javascript:GoToMM(" + iRI + ")\"><img src=\"" + sLFI + "\" width=\"40\" height=\"50\" border=\"0\" alt=\"m" + iRI + "\" name=\"medas" + iRI + "\"></a></td>")
	if (i<2) {
		document.write ("										<td width=\"14\"><img src=\"/img/dot.gif\" width=\"14\" height=\"1\" border=\"0\" alt=\" \"></td>")
	}
}
}

//for changing images to new position
function putMMImgs() {
	for (i=0;i<6;i++) {
		if (aMML>(i+imgOffset)) {
			aATRS=aMMLnkImg[i+imgOffset].split("|")
			document.images["medas" + i].src= path_to_images + aATRS[1]
                        // alert(path_to_images + aATRS[1]);
			aMMLnk[i]=aATRS[0]
		}
		else {
			document.images["medas" + i].src="/img/dot.gif"
			aMMLnk[i]=""
		}
	}
}

//for shifting position
function MMIMove(i) {
CHmove=imgOffset+i
if (!(CHmove<0 || CHmove>=(aMML-4))) {
	imgOffset=CHmove
	putMMImgs()
}
}

//for take taking the right URL for pic
function GoToMM(i) {
	if (aMMLnk[i]!="") {
		newWin = window.open('', 'Sapere', 'toolbar=0,scrollbars=1,resizable=1,height=500,width=617');
		newWin.location = aMMLnk[i] + '&tmpl=vr/page.jsp'
		newWin.focus();
	}
}
