﻿ function megacarrusel(hash){MTM_a=document.getElementById(hash.cs_ulId);MTM_a.MTM_ad=(hash.cs_eClass)?hash.cs_eClass:false;MTM_a.MTM_l=(hash.cs_movil&&document.getElementById(hash.cs_movil))?document.getElementById(hash.cs_movil):false;MTM_a.MTM_k=(hash.cs_leftButton&&document.getElementById(hash.cs_leftButton))?document.getElementById(hash.cs_leftButton):false;MTM_a.MTM_j=(hash.cs_rightButton&&document.getElementById(hash.cs_rightButton))?document.getElementById(hash.cs_rightButton):false;MTM_a.MTM_s=(hash.cs_upButton&&document.getElementById(hash.cs_upButton))?document.getElementById(hash.cs_upButton):false;MTM_a.MTM_o=(hash.cs_downButton&&document.getElementById(hash.cs_downButton))?document.getElementById(hash.cs_downButton):false;MTM_a.margin=(hash.cs_margin!=undefined)?hash.cs_margin:false;MTM_a.auto=(hash.cs_auto)?hash.cs_auto:false;MTM_a.MTM_aa=(hash.cs_precarga)?hash.cs_precarga:false;MTM_a.MTM_P=(hash.cs_type)?hash.cs_type:"HORIZONTAL";MTM_a.MTM_E=(hash.cs_loadingClass)?hash.cs_loadingClass:"loading";MTM_a.MTM_d=(hash.cs_hiddenClass)?hash.cs_hiddenClass:MTM_a.MTM_d;MTM_a.MTM_ab=(hash.cs_speed!=undefined)?hash.cs_speed:10;MTM_a.MTM_ae=(hash.cs_delay!=undefined)?hash.cs_delay*1000:3000;MTM_a.MTM_n=null;MTM_a.MTM_T=(hash.cs_goclick)?hash.cs_goclick:false;MTM_a.first=(hash.cs_first!=undefined)?hash.cs_first-1:0;MTM_a.MTM_f=(hash.cs_visibleElements!=undefined)?hash.cs_visibleElements:1;MTM_a.MTM_c=(hash.cs_moveElements!=undefined)?hash.cs_moveElements:1;MTM_a.MTM_h=false;MTM_a.list=MTM_C(MTM_a.MTM_ad,MTM_a.id);MTM_a.list.MTM_u=MTM_a.list.length;MTM_a.MTM_b=MTM_a.first;MTM_g(MTM_a.list[MTM_a.MTM_b],"actual");MTM_a.MTM_I=MTM_a.list.MTM_u-MTM_a.MTM_f;MTM_a.MTM_e=0;MTM_a.style.width=(MTM_a.MTM_P=="HORIZONTAL")?(((MTM_a.list[0].offsetWidth+MTM_a.margin)*MTM_a.list.length)+"px"):((MTM_a.list[0].offsetWidth+MTM_a.margin)+"px");if(MTM_a.MTM_P=="HORIZONTAL")for(var i=0;i<MTM_a.list.MTM_u;++i)MTM_a.list[i].style.marginRight=MTM_a.margin+"px";else for(var i=0;i<MTM_a.list.MTM_u;++i)MTM_a.list[i].style.marginBottom=MTM_a.margin+"px";MTM_a.MTM_m=MTM_a.list[0].offsetWidth+MTM_a.margin;MTM_a.MTM_v=MTM_a.list[0].offsetHeight+MTM_a.margin;if(MTM_a.first<=MTM_a.MTM_I){if(MTM_a.MTM_P=="HORIZONTAL")MTM_a.MTM_l.style.marginLeft=(-(MTM_a.MTM_m*MTM_a.first))+"px";else MTM_a.MTM_l.style.marginTop=(-(MTM_a.MTM_m*MTM_a.first))+"px";MTM_a.MTM_e=(-(MTM_a.MTM_m*MTM_a.first));}for(var i=0;i<MTM_a.list.MTM_u;++i){MTM_g(MTM_a.list[i],MTM_a.MTM_E)}function MTM_L(){return(!((MTM_a.MTM_b+MTM_a.MTM_c)<=MTM_a.MTM_I)&& !((MTM_a.list.MTM_u-MTM_a.MTM_b-MTM_a.MTM_f)>0))};function MTM_U(){return(!((MTM_a.MTM_b-MTM_a.MTM_c)>=0)&& !((MTM_a.MTM_b>0)));};if(MTM_U()){MTM_g(MTM_a.MTM_j,MTM_a.MTM_d);MTM_g(MTM_a.MTM_o,MTM_a.MTM_d);}if(MTM_L()){MTM_g(MTM_a.MTM_k,MTM_a.MTM_d);MTM_g(MTM_a.MTM_s,MTM_a.MTM_d);}function MTM_M(){var MTM_q=0;var MTM_Y=MTM_q+MTM_a.MTM_c;for(var i=MTM_q;i<MTM_Y;++i)MTM_t(i);};function MTM_B(){var MTM_q=(MTM_a.MTM_b-MTM_a.MTM_c)>0?(MTM_a.MTM_b-MTM_a.MTM_c):0;var MTM_Y=MTM_q+MTM_a.MTM_c;for(var i=MTM_q;i<MTM_Y;++i)MTM_t(i);};function MTM_z(){var MTM_q=MTM_a.MTM_b+MTM_a.MTM_f-1;var MTM_Y=(MTM_q+MTM_a.MTM_c)<MTM_a.list.MTM_u?(MTM_q+MTM_a.MTM_c):MTM_a.list.MTM_u;for(var i=MTM_q;i<=MTM_Y;++i)MTM_t(i);};function MTM_J(){var MTM_q=MTM_a.MTM_b;var MTM_Y=(MTM_q+MTM_a.MTM_f)<MTM_a.list.MTM_u?(MTM_q+MTM_a.MTM_f):MTM_a.list.MTM_u;for(var i=MTM_q;i<=MTM_Y;++i)MTM_t(i);};function MTM_t(n){if(!MTM_a.MTM_aa)return false;if(!MTM_a.list[n]||MTM_a.list[n]==undefined)return false;if(!MTM_a.list[n].getElementsByTagName("script")[0])return false;var MTM_ag=MTM_a.list[n].getElementsByTagName("script")[0];var MTM_w=document.createElement("div");MTM_w.innerHTML=MTM_ag.innerHTML.replace("/*","").replace("*/","");MTM_w.MTM_H=MTM_w.getElementsByTagName("img");if(MTM_w.MTM_H.length>0){for(var i=0;i<MTM_w.MTM_H.length;++i){MTM_w.MTM_H[i].MTM_V=false;MTM_w.MTM_H[i].onload=function(){MTM_N(MTM_w,n,this);};}MTM_w.style.display="none";MTM_a.list[n].appendChild(MTM_w);MTM_w.MTM_H=MTM_w.getElementsByTagName("img");}else{MTM_a.list[n].innerHTML=MTM_w.innerHTML;}};function MTM_N(e,n,img){img.MTM_V=true;var MTM_ac=true;for(var i=0;i<e.MTM_H.length;++i){if(e.MTM_H[i].MTM_V===false){MTM_ac=false;break;}}if(MTM_ac){MTM_a.list[n].innerHTML=e.innerHTML;MTM_i(MTM_a.list[n],MTM_a.MTM_E);}};MTM_t(MTM_a.MTM_b);MTM_B();MTM_J();MTM_z();function MTM_g(n,className,MTM_Q){var MTM_K=new RegExp("(^|\\s)"+className+"(\\s|$)");if(!((MTM_Q==undefined||MTM_Q==false)&&MTM_K.test(n.className))){n.className+=' '+className;}};function MTM_i(n,className){var MTM_K=new RegExp("(^|\\s)"+className+"(\\s|$)");n.className=n.className.replace(MTM_K,' ');};MTM_a.MTM_G=function(){if(!MTM_a.MTM_h){MTM_i(MTM_a.list[MTM_a.MTM_b],"actual");MTM_i(MTM_a.MTM_j,MTM_a.MTM_d);if((MTM_a.MTM_b+MTM_a.MTM_c)<=MTM_a.MTM_I){MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)-((MTM_a.MTM_m)*MTM_a.MTM_c);MTM_y(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b+MTM_a.MTM_c;}else if((MTM_a.list.MTM_u-MTM_a.MTM_b-MTM_a.MTM_f)>0){var hidden=MTM_a.list.MTM_u-MTM_a.MTM_b-MTM_a.MTM_f;MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)-((MTM_a.MTM_m)*hidden);MTM_y(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b+hidden;}else{MTM_g(MTM_a.MTM_j,MTM_a.MTM_d);MTM_i(MTM_a.MTM_k,MTM_a.MTM_d);MTM_M();MTM_a.MTM_h=true;MTM_a.MTM_e=0;MTM_y(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=0;}MTM_g(MTM_a.list[MTM_a.MTM_b],"actual");if(MTM_L())MTM_g(MTM_a.MTM_k,MTM_a.MTM_d);MTM_z();}};MTM_a.MTM_X=function(){if(!MTM_a.MTM_h){MTM_i(MTM_a.list[MTM_a.MTM_b],"actual");MTM_i(MTM_a.MTM_k,MTM_a.MTM_d);if((MTM_a.MTM_b-MTM_a.MTM_c)>=0){MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)+((MTM_a.MTM_m)*MTM_a.MTM_c);MTM_y(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b-MTM_a.MTM_c;}else if(MTM_a.MTM_b>0){var hidden=MTM_a.MTM_b;MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)+((MTM_a.MTM_m)*hidden);MTM_y(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b-hidden;}MTM_g(MTM_a.list[MTM_a.MTM_b],"actual");if(MTM_U())MTM_g(MTM_a.MTM_j,MTM_a.MTM_d);MTM_B();}};MTM_a.MTM_W=function(){if(!MTM_a.MTM_h){MTM_i(MTM_a.list[MTM_a.MTM_b],"actual");MTM_i(MTM_a.MTM_o,MTM_a.MTM_d);if((MTM_a.MTM_b+MTM_a.MTM_c)<=MTM_a.MTM_I){MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)-((MTM_a.MTM_v)*MTM_a.MTM_c);MTM_x(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b+MTM_a.MTM_c;}else if((MTM_a.list.MTM_u-MTM_a.MTM_b-MTM_a.MTM_f)>0){var hidden=MTM_a.list.MTM_u-MTM_a.MTM_b-MTM_a.MTM_f;MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)-((MTM_a.MTM_v)*hidden);MTM_x(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b+hidden;}else{MTM_i(MTM_a.MTM_k,MTM_a.MTM_d);MTM_g(MTM_a.MTM_j,MTM_a.MTM_d);MTM_M();MTM_a.MTM_h=true;MTM_a.MTM_e=0;MTM_x(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=0;}MTM_g(MTM_a.list[MTM_a.MTM_b],"actual");if(MTM_L())MTM_g(MTM_a.MTM_s,MTM_a.MTM_d);MTM_z();}};MTM_a.MTM_Z=function(){if(!MTM_a.MTM_h){MTM_i(MTM_a.list[MTM_a.MTM_b],"actual");MTM_i(MTM_a.MTM_s,MTM_a.MTM_d);if((MTM_a.MTM_b-MTM_a.MTM_c)>=0){MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)+((MTM_a.MTM_v)*MTM_a.MTM_c);MTM_x(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b-MTM_a.MTM_c;}else if(MTM_a.MTM_b>0){var hidden=MTM_a.MTM_b;MTM_a.MTM_h=true;MTM_a.MTM_e=(MTM_a.MTM_e)+((MTM_a.MTM_v)*hidden);MTM_x(MTM_a.MTM_l.getAttribute("id"),MTM_a.MTM_e);MTM_a.MTM_b=MTM_a.MTM_b-hidden;}MTM_g(MTM_a.list[MTM_a.MTM_b],"actual");if(MTM_U())MTM_g(MTM_a.MTM_o,MTM_a.MTM_d);MTM_B();}};if(MTM_a.MTM_P=="HORIZONTAL"){if(MTM_a.MTM_k)MTM_a.MTM_k.onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_G()};if(MTM_a.MTM_j)MTM_a.MTM_j.onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_X()};if(MTM_a.MTM_T){for(var i=0;i<MTM_a.list.MTM_u;++i)MTM_a.list[i].onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_G();};}}else{if(MTM_a.MTM_s)MTM_a.MTM_s.onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_W()};if(MTM_a.MTM_o)MTM_a.MTM_o.onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_Z()};if(MTM_a.MTM_T){for(var i=0;i<MTM_a.list.MTM_u;++i)MTM_a.list[i].onclick=function(){clearInterval(MTM_a.MTM_n);MTM_a.MTM_W();};}}if(MTM_a.auto){MTM_a.MTM_n=setInterval(function(){MTM_a.MTM_G();},MTM_a.MTM_ae);}};function MTM_C(MTM_S,MTM_p,tagName){if(MTM_p==null)MTM_p=document;else if(document.getElementById(MTM_p))MTM_p=document.getElementById(MTM_p);else MTM_p=document;if(tagName==null)tagName='*';var MTM_a=new Array();var tags=MTM_p.getElementsByTagName(tagName);var MTM_ah=" "+MTM_S+" ";for(i=0,j=0;i<tags.length;i++){var test=" "+tags[i].className+" ";if(test.indexOf(MTM_ah)!= -1)MTM_a[j++]=tags[i];}return MTM_a;};function MTM_y(id,b){var e=document.getElementById(id);var MTM_r=MTM_a.MTM_ab;var MTM_D=1.25;var MTM_R=(e.style.marginLeft)?e.style.marginLeft:"0px";a=parseInt(MTM_R.substring(0,MTM_R.length-2));if(a==0)a=1;if(b==0)b=1;if(!e.a){e.a=parseInt(a);e.b=parseInt(b);e.d=(a<b)?"right":"left";}if(!e.MTM_D){e.MTM_D=1;}e.MTM_D=e.MTM_D*MTM_D;if(e.d=="right"){e.a=e.a+e.MTM_D;e.style.marginLeft=e.a+"px";if(e.a>e.b-5){MTM_a.MTM_h=false;e.style.marginLeft=e.b+"px";e.a=null;e.b=null;e.MTM_D=null;}else e.MTM_r=setTimeout(function(){MTM_y(e.id);},MTM_r);}else if(e.d=="left"){e.a=e.a-e.MTM_D;e.style.marginLeft=e.a+"px";if(e.a<e.b+5){MTM_a.MTM_h=false;e.style.marginLeft=e.b+"px";e.a=null;e.b=null;e.MTM_D=null;}else e.MTM_r=setTimeout(function(){MTM_y(e.id);},MTM_r);}};function MTM_x(id,MTM_O){var e=document.getElementById(id);var MTM_r=MTM_a.MTM_ab;var MTM_D=1.25;var MTM_R=(e.style.marginTop)?e.style.marginTop:"0px";MTM_A=parseInt(MTM_R.substring(0,MTM_R.length-2));e.MTM_af=(MTM_A>MTM_O)?"right":"left";if(MTM_A==0)MTM_A=1;if(MTM_O==0)MTM_O=1;if(!e.MTM_A){e.MTM_A=parseInt(MTM_A);e.MTM_O=parseInt(MTM_O);e.MTM_af=(MTM_A<MTM_O)?"right":"left";}if(!e.MTM_F){e.MTM_F=1;}e.MTM_F=e.MTM_F*MTM_D;if(e.MTM_af=="right"){e.MTM_A=e.MTM_A+e.MTM_F;e.style.marginTop=e.MTM_A+"px";if(e.MTM_A>e.MTM_O-5){MTM_a.MTM_h=false;e.style.marginTop=e.MTM_O+"px";e.MTM_A=null;e.MTM_O=null;e.MTM_F=null;}else e.MTM_r=setTimeout(function(){MTM_x(e.id,MTM_A);},MTM_r);}else if(e.MTM_af=="left"){e.MTM_A=e.MTM_A-e.MTM_F;e.style.marginTop=e.MTM_A+"px";if(e.MTM_A<e.MTM_O+5){MTM_a.MTM_h=false;e.style.marginTop=e.MTM_O+"px";e.MTM_A=null;e.MTM_O=null;e.MTM_F=null;}else e.MTM_r=setTimeout(function(){MTM_x(e.id,MTM_A);},MTM_r);}} 
