
function pop (url,w,h,s,f) {
LeftPosition =(screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
window.open(url,'new','width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+s+',fullscreen='+f+'')
}

var imgTot = 6;


function thumbC() {
clearTimeout(s);
}

function thumbT(tot) {
mas=tot*66-396;
pos=document.getElementById('thumb').style.marginTop;
pos=parseFloat(pos);
if (pos!=-mas) {
document.getElementById('thumb').style.marginTop=pos-2;
s=setTimeout('thumbT('+tot+')',15);
}
else {s=setTimeout('v()',1);}
}

function thumbB() {
pos=document.getElementById('thumb').style.marginTop;
pos=parseFloat(pos);
if (pos!=0) {
document.getElementById('thumb').style.marginTop=pos+2;
s=setTimeout('thumbB()',15);
}
else {s=setTimeout('v()',1);}
}


function goImage(im,tot,tipo) {

im=parseFloat(im);

tot=parseFloat(tot);

for(i=1;i<=tot;i++) {
document.getElementById("ims"+i).style.background="#666666";
}

document.getElementById("img").src="images/"+im+"m.jpg";
document.getElementById("ims"+im).style.background="#cccccc";

if (im==tot) {
document.getElementById('centroDxControllerNextA').href="javascript:goImage('1','"+tot+"',1);";
}
else {
document.getElementById('centroDxControllerNextA').href="javascript:goImage('"+(im+1)+"','"+tot+"',1);";
}

if (im==1) {
document.getElementById('centroDxControllerPreviousA').href="javascript:goImage('"+tot+"','"+tot+"',1);";
}
else {
document.getElementById('centroDxControllerPreviousA').href="javascript:goImage('"+(im-1)+"','"+tot+"',1);";
}

if ((tipo==1) && (tot > imgTot)) {

mas=tot*66-330;

posIm=(im-1)*66;

lastPos = (tot-imgTot)*66;

pos=document.getElementById('thumb').style.marginTop;
pos=parseFloat(pos);

if (posIm<mas) {
document.getElementById('thumb').style.marginTop=-posIm;
}
else {
document.getElementById('thumb').style.marginTop=-lastPos;
}

}

}

function v() {}