﻿function carrusel(hash){var MTM_a=document.getElementById(hash.cs_ulId);MTM_a.style.padding="0px";MTM_a.style.margin="0px";if(hash.cs_margenElementos!=undefined&&hash.cs_margenElementos!=""){MTM_a.MTM_c=hash.cs_margenElementos;MTM_a.MTM_i=hash.cs_margenElementos;}else{MTM_a.MTM_c=0;MTM_a.MTM_i=0;}MTM_a.auto=(hash.cs_auto!=undefined&&hash.cs_auto!="")?hash.cs_auto:false;MTM_a.width=0;MTM_a.action=true;MTM_a.MTM_f=(hash.cs_offsetInicial!=undefined)?hash.cs_offsetInicial:0;MTM_a.direction=hash.cs_direction;MTM_a.MTM_v=(hash.cs_delay==undefined)?1500:hash.cs_delay;MTM_a.MTM_t=(hash.cs_circular==undefined)?true:hash.cs_circular;MTM_a.first=(hash.cs_first==undefined)?false:(hash.cs_first-1);MTM_a.MTM_x=(hash.cs_type!=undefined)?hash.cs_type:"HORIZONTAL";MTM_a.MTM_r=(hash.cs_speed==undefined||hash.cs_speed=="")?10:hash.cs_speed;MTM_a.MTM_b=document.getElementById(hash.cs_mobibleLayer);MTM_a.MTM_e=MTM_a.getElementsByTagName("li");if(MTM_a.first<=(MTM_a.MTM_e.length-1))MTM_a.insertBefore(MTM_a.MTM_e[MTM_a.first],MTM_a.firstChild);MTM_a.MTM_q=1;MTM_a.MTM_z=MTM_a.MTM_e[0].offsetWidth+MTM_a.MTM_c+0;MTM_a.MTM_m=MTM_a.MTM_e[0].offsetHeight+MTM_a.MTM_i+0;MTM_a.MTM_y=(hash.cs_goOnclick==undefined)?true:hash.cs_goOnclick;if(MTM_a.MTM_x=="HORIZONTAL"){MTM_a.MTM_b.MTM_g=0;for(var x=0;x<MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.MTM_b.style.marginLeft= -MTM_a.MTM_b.MTM_g+"px";}if(MTM_a.MTM_x=="VERTICAL"){MTM_a.top=0;for(var x=0;x<MTM_a.MTM_f;x++){MTM_a.top+=MTM_a.MTM_e[x].offsetHeight+MTM_a.MTM_i;}MTM_a.MTM_b.style.top= -MTM_a.top+"px";}if(MTM_a.MTM_x=="HORIZONTAL"){for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";}if(hash.cs_type=="VERTICAL"){if(hash.cs_upButton!=undefined&&hash.cs_downButton!=undefined&&hash.cs_upButton!=""&&hash.cs_downButton!=""){MTM_a.MTM_s=document.getElementById(hash.cs_upButton);MTM_a.MTM_n=document.getElementById(hash.cs_downButton);if(!MTM_a.MTM_t){MTM_a.MTM_n.style.display="none";}}}else if(hash.cs_type=="HORIZONTAL"){if(hash.cs_leftButton!=undefined&&hash.cs_rightButton!=undefined&&hash.cs_leftButton!=""&&hash.cs_rightButton!=""){MTM_a.MTM_p=document.getElementById(hash.cs_leftButton);MTM_a.MTM_l=document.getElementById(hash.cs_rightButton);if(!MTM_a.MTM_t){MTM_a.MTM_l.style.display="none";}}}if(hash.cs_margenElementos!=undefined&&hash.cs_margenElementos!=""){for(var a=0;a<MTM_a.MTM_e.length;a++){if(MTM_a.MTM_x=="HORIZONTAL"){MTM_a.MTM_e[a].style.marginRight=MTM_a.MTM_c+"px";}if(MTM_a.MTM_x=="VERTICAL"){MTM_a.MTM_e[a].style.marginBottom=MTM_a.MTM_i+"px";}}}if(hash.cs_autoButton!=undefined&&hash.cs_autoButton!=""){MTM_a.MTM_k=document.getElementById(hash.cs_autoButton);MTM_a.MTM_h=(hash.cs_autoButtonSec!=undefined&&hash.cs_autoButtonSec!="")?hash.cs_autoButtonSec:undefined;MTM_a.MTM_w=MTM_a.MTM_k.className;MTM_a.MTM_k.onclick=function(){MTM_a.auto=(MTM_a.auto)?false:true;if(MTM_a.auto){window.setTimeout("autoSlide('"+hash.cs_ulId+"')",MTM_a.MTM_v);MTM_a.MTM_k.className=MTM_a.MTM_w;}else{if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}}}if(MTM_a.MTM_l!=undefined){MTM_a.MTM_l.onclick=function(){if(MTM_a.action){MTM_a.insertBefore(MTM_a.MTM_e[MTM_a.MTM_e.length-1].cloneNode(true),MTM_a.firstChild);MTM_a.MTM_b.style.marginLeft= -(MTM_a.MTM_e[0].offsetWidth+MTM_a.MTM_c+MTM_a.MTM_b.MTM_g)+"px";MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[0+MTM_a.MTM_f].offsetWidth+MTM_a.MTM_c+0;MTM_a.MTM_b.MTM_g=0;for(var x=0;x<MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.width=0;for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_o=setInterval("slideRight('"+hash.cs_ulId+"')",MTM_a.MTM_r);MTM_a.MTM_q-=1;if(!MTM_a.MTM_t){MTM_a.MTM_p.style.display="block";if(1==MTM_a.MTM_q)MTM_a.MTM_l.style.display="none";else MTM_a.MTM_l.style.display="block";}}if(MTM_a.auto){MTM_a.auto=false;if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}};}this.stop=function(){if(MTM_a.auto){MTM_a.auto=false;if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}};if(MTM_a.MTM_p!=undefined){MTM_a.MTM_p.onclick=function(){if(MTM_a.action){MTM_a.appendChild(MTM_a.MTM_e[0].cloneNode(true));MTM_a.width=0;for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_g=0;for(var x=0;x<=MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetWidth+MTM_a.MTM_c;MTM_a.MTM_b.MTM_o=setInterval("slideLeft('"+hash.cs_ulId+"')",MTM_a.MTM_r);MTM_a.MTM_q+=1;if(!MTM_a.MTM_t){MTM_a.MTM_l.style.display="block";if((MTM_a.MTM_e.length-1)==MTM_a.MTM_q)MTM_a.MTM_p.style.display="none";else{MTM_a.MTM_p.style.display="block";}}}if(MTM_a.auto){MTM_a.auto=false;if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}};}function photoClick(){if(MTM_a.action){MTM_a.appendChild(MTM_a.MTM_e[0].cloneNode(true));MTM_a.width=0;for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_g=0;for(var x=0;x<=MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetWidth+MTM_a.MTM_c;MTM_a.MTM_b.MTM_o=setInterval("slideLeft('"+hash.cs_ulId+"')",MTM_a.MTM_r);for(var i=0;i<MTM_a.MTM_e.length;++i)MTM_a.MTM_e[i].onclick=function(){photoClick();}}};if(MTM_a.MTM_y)for(var i=0;i<MTM_a.MTM_e.length;++i)MTM_a.MTM_e[i].onclick=function(){photoClick();};if(MTM_a.MTM_n!=undefined){MTM_a.MTM_n.onclick=function(){if(MTM_a.action){MTM_a.insertBefore(MTM_a.MTM_e[MTM_a.MTM_e.length-1].cloneNode(true),MTM_a.firstChild);MTM_a.MTM_m=0;MTM_a.top+=MTM_a.MTM_e[0].offsetHeight+MTM_a.MTM_i;MTM_a.MTM_b.style.top= -MTM_a.top+"px";MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetHeight+MTM_a.MTM_i;MTM_a.top=MTM_a.top-MTM_a.MTM_b.MTM_d;MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_o=setInterval("slideDown('"+hash.cs_ulId+"')",MTM_a.MTM_r);MTM_a.MTM_q-=1;MTM_a.MTM_s.style.display="block";if(1==MTM_a.MTM_q)MTM_a.MTM_n.style.display="none";else MTM_a.MTM_n.style.display="block";}if(MTM_a.auto){MTM_a.auto=false;if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}};}if(MTM_a.MTM_s!=undefined){MTM_a.MTM_s.onclick=function(){if(MTM_a.action){MTM_a.appendChild(MTM_a.MTM_e[0].cloneNode(true));MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetHeight+MTM_a.MTM_i+0;MTM_a.MTM_m=MTM_a.MTM_b.MTM_d;MTM_a.MTM_b.MTM_o=setInterval("slideUp('"+hash.cs_ulId+"')",MTM_a.MTM_r);MTM_a.MTM_q+=1;MTM_a.MTM_n.style.display="block";if((MTM_a.MTM_e.length-1)==MTM_a.MTM_q)MTM_a.MTM_s.style.display="none";else{MTM_a.MTM_s.style.display="block";}}if(MTM_a.auto){MTM_a.auto=false;if(MTM_a.MTM_h)MTM_a.MTM_k.className=MTM_a.MTM_h;}};}if(MTM_a.auto=="true"||MTM_a.auto){window.setTimeout("autoSlide('"+hash.cs_ulId+"')",MTM_a.MTM_v);}};function slideUp(MTM_j){var MTM_a=document.getElementById(MTM_j);MTM_a.action=false;MTM_a.MTM_b.MTM_d=parseInt(MTM_a.MTM_b.MTM_d/1.2);var MTM_u=parseInt(MTM_a.top+MTM_a.MTM_m-MTM_a.MTM_b.MTM_d);if(MTM_u==(MTM_a.top+MTM_a.MTM_m)){MTM_a.MTM_b.MTM_d=0;clearInterval(MTM_a.MTM_b.MTM_o);MTM_a.top=MTM_u-MTM_a.MTM_e[0].offsetHeight-MTM_a.MTM_i;MTM_a.MTM_b.style.top= -MTM_a.top+"px";MTM_a.removeChild(MTM_a.MTM_e[0]);MTM_a.MTM_b.MTM_d=MTM_a.MTM_m;if(MTM_a.auto)window.setTimeout("autoSlide('"+MTM_j+"')",MTM_a.MTM_v);MTM_a.action=true;return;}MTM_a.MTM_b.style.top= -MTM_u+"px";};function slideDown(MTM_j){var MTM_a=document.getElementById(MTM_j);MTM_a.action=false;MTM_a.MTM_b.MTM_d=MTM_a.MTM_b.MTM_d/1.2;var MTM_u=parseInt(MTM_a.top+MTM_a.MTM_b.MTM_d);if(MTM_u==MTM_a.top){clearInterval(MTM_a.MTM_b.MTM_o);MTM_a.MTM_b.style.top= -MTM_a.top+"px";MTM_a.removeChild(MTM_a.MTM_e[MTM_a.MTM_e.length-1]);if(MTM_a.auto)window.setTimeout("autoSlide('"+MTM_j+"')",MTM_a.MTM_v);MTM_a.action=true;return;}MTM_a.MTM_b.style.top= -parseInt(MTM_u)+"px";};function slideLeft(MTM_j){var MTM_a=document.getElementById(MTM_j);MTM_a.action=false;MTM_a.MTM_b.MTM_d=MTM_a.MTM_b.MTM_d/1.2;var MTM_u=MTM_a.MTM_b.MTM_g-MTM_a.MTM_b.MTM_d;if(MTM_u>(MTM_a.MTM_b.MTM_g-1)){clearInterval(MTM_a.MTM_b.MTM_o);MTM_a.MTM_b.style.marginLeft= -(MTM_a.MTM_b.MTM_g-MTM_a.MTM_e[0].offsetWidth)+MTM_a.MTM_c+"px";MTM_a.removeChild(MTM_a.MTM_e[0]);if(MTM_a.auto)window.setTimeout("autoSlide('"+MTM_j+"')",MTM_a.MTM_v);MTM_a.action=true;return;}else MTM_a.MTM_b.style.marginLeft= -parseInt(MTM_u)+"px";};function slideRight(MTM_j){var MTM_a=document.getElementById(MTM_j);MTM_a.action=false;MTM_a.MTM_b.MTM_d=MTM_a.MTM_b.MTM_d/1.2;var MTM_u=MTM_a.MTM_b.MTM_g+MTM_a.MTM_b.MTM_d;if(parseInt(MTM_u)==MTM_a.MTM_b.MTM_g){clearInterval(MTM_a.MTM_b.MTM_o);MTM_a.MTM_b.style.marginLeft= -MTM_a.MTM_b.MTM_g+"px";MTM_a.removeChild(MTM_a.MTM_e[MTM_a.MTM_e.length-1]);MTM_a.MTM_b.style.marginLeft= -MTM_a.MTM_b.MTM_g+"px";if(MTM_a.auto)window.setTimeout("autoSlide('"+MTM_j+"')",MTM_a.MTM_v);MTM_a.action=true;return;}else{MTM_a.MTM_b.style.marginLeft= -parseInt(MTM_u)+"px";}};function autoSlide(MTM_j){var MTM_a=document.getElementById(MTM_j);if(MTM_a.auto)switch(MTM_a.direction){case "left":{MTM_a.appendChild(MTM_a.MTM_e[0].cloneNode(true));MTM_a.width=0;for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_g=0;for(var x=0;x<=MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetWidth+MTM_a.MTM_c;MTM_a.MTM_b.MTM_o=setInterval("slideLeft('"+MTM_j+"')",MTM_a.MTM_r);break;}case "right":{MTM_a.insertBefore(MTM_a.MTM_e[MTM_a.MTM_e.length-1].cloneNode(true),MTM_a.firstChild);MTM_a.MTM_b.style.marginLeft= -(MTM_a.MTM_e[0].offsetWidth+MTM_a.MTM_c+MTM_a.MTM_b.MTM_g)+"px";MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[0+MTM_a.MTM_f].offsetWidth+MTM_a.MTM_c+0;MTM_a.MTM_b.MTM_g=0;for(var x=0;x<MTM_a.MTM_f;x++){MTM_a.MTM_b.MTM_g+=MTM_a.MTM_e[x].offsetWidth+MTM_a.MTM_c;}MTM_a.width=0;for(var i=0;i<MTM_a.MTM_e.length;i++){MTM_a.width+=MTM_a.MTM_e[i].offsetWidth+MTM_a.MTM_c;}MTM_a.style.width=MTM_a.width+"px";MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_o=setInterval("slideRight('"+MTM_j+"')",MTM_a.MTM_r);break;}case "down":{MTM_a.insertBefore(MTM_a.MTM_e[MTM_a.MTM_e.length-1].cloneNode(true),MTM_a.firstChild);MTM_a.MTM_m=0;MTM_a.top+=MTM_a.MTM_e[0].offsetHeight+MTM_a.MTM_i;MTM_a.MTM_b.style.top= -MTM_a.top+"px";MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetHeight+MTM_a.MTM_i;MTM_a.top=MTM_a.top-MTM_a.MTM_b.MTM_d;MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_o=setInterval("slideDown('"+MTM_j+"')",MTM_a.MTM_r);break;}case "up":{MTM_a.appendChild(MTM_a.MTM_e[0].cloneNode(true));MTM_a.MTM_e=MTM_a.getElementsByTagName("li");MTM_a.MTM_b.MTM_d=MTM_a.MTM_e[MTM_a.MTM_f].offsetHeight+MTM_a.MTM_i+0;MTM_a.MTM_m=MTM_a.MTM_b.MTM_d;MTM_a.MTM_b.MTM_o=setInterval("slideUp('"+MTM_j+"')",MTM_a.MTM_r);break;}}} 
