Element.Ex={removeAllChildren:function(_1){
while($(_1).firstChild){
$(_1).removeChild($(_1).firstChild);
}
}};
Object.extend(Element,Element.Ex);
var gallerySlide=Class.create();
gallerySlide.prototype={catalog:0,prevImage:0,nextImage:0,scrollBy:0,startDisplayIndex:0,displayImages:0,activePage:0,PAGE_ID_PREFIX:"page",PADDING:16,backImg:0,backHoverImg:0,backDisabledImg:0,forwardImg:0,forwardHoverImg:0,forwardDisabledImg:0,pageColor:0,pageCurrentColor:0,imageClickEvt:0,imageMouseOverEvt:0,imageMouseOutEvt:0,pagerMouseOverEvt:0,pagerMouseOutEvt:0,nameClickEvt:0,nameMouseOverEvt:0,nameMouseOutEvt:0,initialize:function(_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14){
var _15=this;
this.scrollBy=_3+this.PADDING;
this.displayImages=_4;
this.backImg=_5;
this.backHoverImg=_6;
this.backDisabledImg=_7;
this.forwardImg=_8;
this.forwardHoverImg=_9;
this.forwardDisabledImg=_a;
this.pageColor=_b;
this.pageCurrentColor=_c;
this.imageClickEvt=_d;
this.imageMouseOverEvt=_e;
this.imageMouseOutEvt=_f;
this.pagerMouseOverEvt=_10;
this.pagerMouseOutEvt=_11;
this.nameClickEvt=_12;
this.nameMouseOverEvt=_13;
this.nameMouseOutEvt=_14;
this.constructDivs();
var _16=$("galleryScrollPrevious");
var a=document.createElement("a");
this.prevImage=document.createElement("img");
this.prevImage.src=this.backImg;
this.prevImage.style.border="none";
this.prevImage.onmouseover=function(){
this.src=_15.backHoverImg;
};
this.prevImage.onmouseout=function(){
this.src=_15.backImg;
};
a.style.cursor="pointer";
a.appendChild(this.prevImage);
_16.appendChild(a);
var _18=$("galleryScrollNext");
var a=document.createElement("a");
this.nextImage=document.createElement("img");
this.nextImage.src=this.forwardDisabledImg;
this.nextImage.style.border="none";
this.nextImage.onmouseover=function(){
if(_15.startDisplayIndex>0){
this.src=_15.forwardHoverImg;
}
};
this.nextImage.onmouseout=function(){
if(_15.startDisplayIndex>0){
this.src=_15.forwardImg;
}
};
a.style.cursor="pointer";
a.appendChild(this.nextImage);
_18.appendChild(a);
$("galleryOuterBox").style.width=_2+"px";
},constructDivs:function(){
Element.removeAllChildren("gallerySlide");
var _19=document.createElement("div");
_19.setAttribute("id","galleryScrollPrevious");
$("gallerySlide").appendChild(_19);
var _1a=document.createElement("div");
var _1b=document.createElement("div");
_1b.setAttribute("id","galleryOuterBox");
var _1c=document.createElement("div");
_1c.setAttribute("id","galleryInnerBox");
var _1d=document.createElement("div");
_1d.setAttribute("id","galleryIEHack");
_1c.appendChild(_1d);
_1b.appendChild(_1c);
_1a.appendChild(_1b);
$("gallerySlide").appendChild(_1a);
var _1e=document.createElement("div");
_1e.setAttribute("id","galleryScrollNext");
$("gallerySlide").appendChild(_1e);
},render:function(_1f){
var _20=this;
Element.removeAllChildren("galleryIEHack");
var _21=$("galleryIEHack");
var ul=document.createElement("ul");
_1f.item.each(function(_23,i){
var li=document.createElement("li");
var a=document.createElement("a");
li.setAttribute("id",_1f.item[i].id);
var _27=document.createElement("img");
_27.src=_1f.item[i].img;
_27.onmouseover=function(){
if(_20.imageMouseOverEvt!=null){
_20.imageMouseOverEvt(_23,i,this);
}else{
this.style.border="1px solid #333";
}
};
_27.onmouseout=function(){
if(_20.imageMouseOutEvt!=null){
_20.imageMouseOutEvt(_23,i,this);
}else{
this.style.border="1px solid #CCC";
}
};
_27.onclick=function(){
if(_20.imageClickEvt!=null){
_20.imageClickEvt(_23,i,this);
}
};
a.style.cursor="pointer";
a.appendChild(_27);
li.appendChild(a);
if(_1f.item[i].name!=null){
var _28=document.createElement("div");
var _29=document.createElement("a");
_29.style.cursor="pointer";
_29.appendChild(document.createTextNode(_1f.item[i].name));
_29.onmouseover=function(){
if(_20.nameMouseOverEvt!=null){
_20.nameMouseOverEvt(_23,i,this);
}else{
this.style.textDecoration="underline";
}
};
_29.onmouseout=function(){
if(_20.nameMouseOutEvt!=null){
_20.nameMouseOutEvt(_23,i,this);
}else{
this.style.textDecoration="none";
}
};
_29.onclick=function(){
if(_20.nameClickEvt!=null){
_20.nameClickEvt(_23,i,this);
}
};
_28.appendChild(_29);
li.appendChild(_28);
}
if(_1f.item[i].detail!=null){
var _2a=document.createTextNode(_1f.item[i].detail);
li.appendChild(_2a);
}
ul.appendChild(li);
});
_21.appendChild(ul);
this.prevImage.onclick=function(){
if(_20.startDisplayIndex<_1f.item.length-_20.displayImages){
_20.slide(_1f,_20,-1);
_20.startDisplayIndex++;
_20.adjustArrowsAndPager(_1f);
_20.prevImage.onmouseover=function(){
if(_20.startDisplayIndex<_1f.item.length-_20.displayImages){
this.src=_20.backHoverImg;
}
};
_20.prevImage.onmouseout=function(){
if(_20.startDisplayIndex<_1f.item.length-_20.displayImages){
this.src=_20.backImg;
}
};
}
};
this.nextImage.onclick=function(){
if(_20.startDisplayIndex>0){
_20.slide(_1f,_20,1);
_20.startDisplayIndex--;
_20.adjustArrowsAndPager(_1f);
}
};
Element.removeAllChildren("galleryPager");
$("galleryPager").appendChild(document.createTextNode("page:\xa0\xa0"));
var _2b=Math.ceil(_1f.item.length/this.displayImages);
var _2c=new Array(_2b);
for(i=0;i<_2b;i++){
_2c[i]=i+1;
}
_2c.each(function(_2d,i){
var a=document.createElement("a");
a.setAttribute("id",_20.PAGE_ID_PREFIX+i);
a.style.cursor="pointer";
a.style.paddingRight="1em";
a.style.color=_20.pageColor;
a.appendChild(document.createTextNode(_2c[i]));
a.onmouseover=function(){
if(_20.pagerMouseOverEvt!=null){
_20.pagerMouseOverEvt(_2d,i,this,_20.activePage);
}else{
this.style.textDecoration="underline";
}
};
a.onmouseout=function(){
if(_20.pagerMouseOutEvt!=null){
_20.pagerMouseOutEvt(_2d,i,this,_20.activePage);
}else{
this.style.textDecoration="none";
}
};
a.onclick=function(){
var _30=_20.startDisplayIndex-i*_20.displayImages;
_20.slide(_1f,_20,_30,_2c);
_20.startDisplayIndex-=_30;
_20.adjustArrowsAndPager(_1f);
};
$("galleryPager").appendChild(a);
});
this.activePage=0;
$(this.PAGE_ID_PREFIX+this.activePage).style.color=this.pageCurrentColor;
},disableTriggerPoints:function(_31,_32){
if(_32!=null){
_32.each(function(_33,i){
$(_31.PAGE_ID_PREFIX+i).onclick=function(){
};
});
}
this.prevImage.onclick=function(){
};
this.nextImage.onclick=function(){
};
},enableTriggerPoints:function(_35,_36,_37,_38){
if(_36!=null){
_36.each(function(_39,i){
$(_35.PAGE_ID_PREFIX+i).onclick=function(){
var _3b=_35.startDisplayIndex-i*_35.displayImages;
_35.slide(_37,_35,_3b,_36);
_35.startDisplayIndex-=_3b;
_35.adjustArrowsAndPager(_37);
};
});
}
_35.prevImage.onclick=function(){
if(_35.startDisplayIndex<_37.item.length-_35.displayImages){
_35.slide(_37,_35,-1);
_35.startDisplayIndex++;
_35.adjustArrowsAndPager(_37);
_35.prevImage.onmouseover=function(){
if(_35.startDisplayIndex<_37.item.length-_35.displayImages){
this.src=_35.backHoverImg;
}
};
_35.prevImage.onmouseout=function(){
if(_35.startDisplayIndex<_37.item.length-_35.displayImages){
this.src=_35.backImg;
}
};
}
};
_35.nextImage.onclick=function(){
if(_35.startDisplayIndex>0){
_35.slide(_37,_35,1);
_35.startDisplayIndex--;
_35.adjustArrowsAndPager(_37);
}
};
},slide:function(_3c,obj,_3e,_3f){
obj.disableTriggerPoints(obj,_3f);
var _40=this;
var _41=_3e*obj.scrollBy;
if(obj.scrollBy==_40.PADDING){
_41=0;
if(_3e>0){
for(index=_40.startDisplayIndex-1;index>=_40.startDisplayIndex-_3e;index--){
_41+=(eval(_3c.item[index].imgWidth)+this.PADDING);
}
}else{
_3e=Math.abs(_3e);
for(index=_40.startDisplayIndex;index<_40.startDisplayIndex+_3e;index++){
_41-=(eval(_3c.item[index].imgWidth)+this.PADDING);
}
}
}
_3c.item.each(function(_42,i){
new Effect.MoveBy($(_3c.item[i].id),0,_41,{duration:1,afterFinish:function(){
if(i==_3c.item.length-1){
_40.enableTriggerPoints(_40,_3f,_3c,_3e);
}
}});
});
},adjustArrowsAndPager:function(_44){
if(this.startDisplayIndex==0){
this.nextImage.src=this.forwardDisabledImg;
}else{
if(this.startDisplayIndex>=_44.item.length-this.displayImages){
this.prevImage.src=this.backDisabledImg;
}else{
this.nextImage.src=this.forwardImg;
this.prevImage.src=this.backImg;
}
}
var _45=this.startDisplayIndex/this.displayImages;
var _46=Math.floor(_45);
if(_46!=this.activePage){
$(this.PAGE_ID_PREFIX+this.activePage).style.color=this.pageColor;
this.activePage=_46;
$(this.PAGE_ID_PREFIX+this.activePage).style.color=this.pageCurrentColor;
}
}};
var mainPage=Class.create();
mainPage.prototype={gallery:0,BOX_WIDTH:350,SCROLL_AMOUNT:84,DISPLAY_IMAGES:3,BACK_IMG:"img/anterior.png",BACK_HOVER_IMG:"img/anterior_over.png",BACK_DISABLED_IMG:"img/anterior_disabled.png",FORWARD_IMG:"img/siguiente.png",FORWARD_HOVER_IMG:"img/siguiente_over.png",FORWARD_DISABLED_IMG:"img/siguiente_disabled.png",category:0,initialize:function(){
this.gallery=new gallerySlide(this.BOX_WIDTH,this.SCROLL_AMOUNT,this.DISPLAY_IMAGES,this.BACK_IMG,this.BACK_HOVER_IMG,this.BACK_DISABLED_IMG,this.FORWARD_IMG,this.FORWARD_HOVER_IMG,this.FORWARD_DISABLED_IMG,"#737373","#e2001a",this.imageClickEvt,this.imageMouseOverEvt,null,this.pagerMouseOverEvt,this.pagerMouseOutEvt);
this.category={"item":[{"id":"img1","img":"fotos/control_thumb.jpg","largeImg":"fotos/control.jpg"},{"id":"img2","img":"fotos/panoramica_thumb.jpg","largeImg":"fotos/panoramica.jpg"},{"id":"img3","img":"fotos/control2_thumb.jpg","largeImg":"fotos/control2.jpg"},{"id":"img4","img":"fotos/primerplano_thumb.jpg","largeImg":"fotos/primerplano.jpg"},{"id":"img5","img":"fotos/monitor_thumb.jpg","largeImg":"fotos/monitor.jpg"},{"id":"img6","img":"fotos/dentropecera_thumb.jpg","largeImg":"fotos/dentropecera.jpg"},{"id":"img7","img":"fotos/pecera_thumb.jpg","largeImg":"fotos/pecera.jpg"},{"id":"img8","img":"fotos/amplibajo_thumb.jpg","largeImg":"fotos/amplibajo.jpg"},{"id":"img9","img":"fotos/sinte_thumb.jpg","largeImg":"fotos/sinte.jpg"},{"id":"img10","img":"fotos/analogico_thumb.jpg","largeImg":"fotos/analogico.jpg"}]};
this.gallery.render(this.category);
new Effect.Appear($("largeImage"));
this.category.item.each(function(_47,i){
var _49=document.createElement("img");
_49.src=_47.largeImg;
_49.style.display="none";
$("preload").appendChild(_49);
});
},imageClickEvt:function(_4a,i,obj){
new Effect.Opacity($("aa"),{duration:1,transition:Effect.Transitions.linear,from:1,to:0,afterFinish:function(_4d){
$("aa").src=_4a.largeImg;
new Effect.Appear($("aa"));
}});
},imageMouseOverEvt:function(_4e,i,obj){
obj.style.border="1px solid #B8C705";
},pagerMouseOverEvt:function(_51,i,obj,_54){
obj.style.textDecoration="underline";
obj.style.color="#e2001a";
},pagerMouseOutEvt:function(_55,i,obj,_58){
if(i!=_58){
obj.style.textDecoration="none";
obj.style.color="#737373";
}
}};