<!-- begin script
ie4=(document.all)?1:0						
ns4=(document.layers)?1:0						
ns6=(document.getElementById&&!document.all)?1:0
var speed=50;
var capaMovil=false;
var loop,timer;
var muestro=1;
var elementoz;
var totalpag;
var movingx=true;
var elementoz=-1
function cambiaaesto(tt){
if (elementoz!=-1){
document.getElementById("tit"+elementoz).style.visibility="hidden";
document.getElementById("divo"+elementoz).className="co"+elementoz+"_2";
document.getElementById("logi"+elementoz).style.visibility="hidden";
document.getElementById("prec"+elementoz).style.visibility="hidden";
}
document.getElementById("divo"+tt).className="co"+tt;
document.getElementById("tit"+tt).style.visibility="visible";
document.getElementById("logi"+tt).style.visibility="visible";
document.getElementById("prec"+tt).style.visibility="visible";
elementoz=tt;
}

function sobrecoche(tt){
if (window.parent.frames['explp'].hacargado){
window.parent.frames['explp'].fijapic(tt);
}
}

function fueracoche(tt){
if (window.parent.frames['explp'].hacargado){
window.parent.frames['explp'].desfijala();
}
}

function hvueltas(senti,nume,temporal,ulti,primi){
var vueltas=0;
if (senti==0){
while (nume>ulti){
temporal=temporal+1;
vueltas=vueltas+1;
ulti=(temporal-1)+5;
}
}else{
while(nume<primi){
temporal=temporal-1;
vueltas=vueltas+1;
primi=(temporal-1)+1;
}
}
return (vueltas);
}

function halloarticulo (numero){
tempori=muestro;
ultimoregistro=(muestro-1)+5;
primerregistro=(muestro-1)+1;
if (numero>ultimoregistro){
vueltas=hvueltas (0,numero,tempori,ultimoregistro,primerregistro);
moving(30,0,(150*vueltas),crolltoti,'r',(3*vueltas),vueltas);
}
if (numero<primerregistro){
vueltas=hvueltas (1,numero,tempori,ultimoregistro,primerregistro);
moving(30,0,(150*vueltas),crolltoti,'l',(3*vueltas),vueltas);
}
}

function mecargo(){
document.getElementById("divo"+seleccionado).className="co"+seleccionado;
document.getElementById("tit"+seleccionado).style.visibility="visible";
document.getElementById("logi0").style.visibility="hidden";
document.getElementById("logi"+seleccionado).style.visibility="visible";
document.getElementById("prec"+seleccionado).style.visibility="visible";
elementoz=seleccionado;

}
function ObjScroll(obj,nest,def1,def2){
this.contHeight=1;
this.contHeight+=4;
this.contWidth=def1;
nest=(!nest) ? '':'document.'+nest+'.'
if (ie4){
this.css=eval(obj+'.style');
this.scrollHeight=eval(obj+'.offsetHeight');
this.scrollWidth=eval(obj+'.offsetWidth');
}else if (ns4){
this.css=eval(nest+'document.'+obj);
this.scrollHeight=this.css.document.height;
this.scrollWidth=this.css.document.width;
}else if (ns6){
this.css=eval('document.getElementById(["'+obj+'"]).style');
this.scrollHeight=eval('document.getElementById(["'+obj+'"]).offsetHeight');
this.scrollWidth=def2;
}
this.left=goLeft
this.right=goRight
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}

function moving (move,total,totalbaj,scrollt,sentido,m,vuel){
if (movingx){
scrollinit(totalbaj,scrollt);
loop=true;
if (sentido=="l"){
capaMovil.left (move,total,totalbaj,m,vuel)
}else{
capaMovil.right (move,total,totalbaj,m,vuel)

}
}
}



function goRight(move,total,totalbaj,m,vuel){
if (muestro!=totalpag){
movingx=false;
//if(parseInt(this.css.left)>-this.scrollWidth+this.contWidth){
this.css.left=parseInt(this.css.left)-move;
total=total+move;
if (total==totalbaj){
if (m!=0){
timer=setTimeout(this.obj+".right("+m+",0,"+m+",0,"+vuel+")",speed)
}else{
muestro=muestro+vuel;
domlay('fleft',1);
if (muestro==totalpag){
domlay('fright',0);
}
noScroll();
movingx=true;
}
}else{
if (loop) timer=setTimeout(this.obj+".right("+move+","+total+","+totalbaj+","+m+","+vuel+")",speed)
}
}else{
//document.write (this.scrollWidth+"+"+this.contWidth);
}
//}
}
function goLeft(move,total,totalbaj,m,vuel){
if (muestro!=1){
movingx=false;
if(parseInt(this.css.left)<0){
this.css.left=parseInt(this.css.left)+move
total=total+move;
if (total==totalbaj){
if (m!=0){
timer=setTimeout(this.obj+".left("+m+",0,"+m+",0,"+vuel+")",speed)
}else{
muestro=muestro-vuel;
domlay('fright',1);
if (muestro==1){
domlay('fleft',0);
}
noScroll();
movingx=true;
}
}else{
if (loop) timer=setTimeout(this.obj+".left("+move+","+total+","+totalbaj+","+m+","+vuel+")",speed)
}
}
}
}
function noScroll(){
loop=false
clearTimeout(timer)
}
function scrollinit(def1,def2){
if (!capaMovil){
capaMovil=new ObjScroll('divTextTod','divContTod',def1,def2);
}
}
function domlay(id,trigger,lax,lay,content) {
if (trigger=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
}
else if (trigger=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
if (lax){
if (document.layers){document.layers[''+id+''].left = lax}
else if (document.all){document.all[''+id+''].style.left=lax}
else if (document.getElementById){document.getElementById(''+id+'').style.left=lax+"px"}
}
if (lay){
if (document.layers){document.layers[''+id+''].top = lay}
else if (document.all){document.all[''+id+''].style.top=lay}
else if (document.getElementById){document.getElementById(''+id+'').style.top=lay+"px"}
}
if (content){
if (document.layers){
sprite=document.layers[''+id+''].document;
sprite.open();
sprite.write(content);
sprite.close();
}
else if (document.all) document.all[''+id+''].innerHTML = content;
else if (document.getElementById){
rng = document.createRange();
el = document.getElementById(''+id+'');
rng.setStartBefore(el);
htmlFrag = rng.createContextualFragment(content)
while(el.hasChildNodes()) el.removeChild(el.lastChild);
el.appendChild(htmlFrag);
}
}
}

// end script -->
