Entropico={wo:window.opener,host:window.location.host,proto:window.location.protocol,page:'',url:'http://entropico.com',version:'1.0',developedBy:'ajimenez@entropico.com',store:148,sex:208,perfilShow:undefined,perfilCodeudorShow:undefined,loginVar:'',init:function()
{if(Entropico.page!='login')
{yd.Event.addListener('UserLogin','click',Entropico.formLogin,this,true);yd.Event.addListener('UserPassword','click',Entropico.formLogin,this,true);yd.Event.addListener('UserPasswordHide','click',Entropico.formLogin,this,true);yd.Event.addListener('UserLogin','blur',Entropico.formLogin,this,true);yd.Event.addListener('UserPassword','blur',Entropico.formLogin,this,true);yd.Event.addListener('UserPasswordHide','blur',Entropico.formLogin,this,true);yd.Event.addListener('UserLogin','focus',Entropico.formLogin,this,true);yd.Event.addListener('UserPassword','focus',Entropico.formLogin,this,true);yd.Event.addListener('UserPasswordHide','focus',Entropico.formLogin,this,true);}
yd.Event.addListener('modAudio','click',Entropico.openAudio,this,true);new Menu({container:'wpTabs',elements:{menu:'a',content:'div'},classes:{menu:'hasMenu',content:'Menu',over:'on'},style:{property:'padding',value:'7px 0px 2px 0px'},animation:{duration:1,open:'easeOutStrong',close:'easeInStrong'}});new Slide({container:'slideMarcas',autoplay:true,type:'all',items:3,animation:{duration:20,start:'left',end:'right'}});var checkboxes=yd.Dom.getElementsByClassName('chkMarca','input','btnMarcas');yd.Event.addListener(checkboxes,'click',Entropico.setCatalogo);var images=yd.Dom.getElementsByClassName('imgMarca','img','slideMarcas');yd.Event.addListener(images,'click',Entropico.catalogo);yd.Event.addListener('RecomiendaForm','submit',Entropico.sendRecomienda,this,true);var inputsRecomienda=yd.Dom.getElementsByClassName('attachMe','input','RecomiendaForm');yd.Event.addListener(inputsRecomienda,'click',Entropico.inputsRecomienda,this,true);yd.Event.addListener(inputsRecomienda,'blur',Entropico.inputsRecomienda,this,true);yd.Event.addListener(inputsRecomienda,'focus',Entropico.inputsRecomienda,this,true);yd.Event.addListener('boletinForm','submit',Entropico.sendBoletin,this,true);yd.Event.addListener('BoletinEmail','click',Entropico.inputBoletin,this,true);yd.Event.addListener('BoletinEmail','blur',Entropico.inputBoletin,this,true);yd.Event.addListener('BoletinEmail','focus',Entropico.inputBoletin,this,true);yd.Event.addListener('pollForm','submit',Entropico.sendPoll,this,true);yd.Event.addListener('statsBtn','click',Entropico.viewPoll,this,true);if(Entropico.page=='index')
{new AJAX({loading:{img:'/img/loader-white.gif',position:'right',el:'wpSlide',width:20,height:20},url:'/page/slide/',onSuccess:Entropico.returnSlide,idUpdaterNode:'returnSlide'});}
if(Entropico.page=='contactanos'||Entropico.page=='registrate')
{new Accordion({container:'wpAcc',elements:{ac:'h2',content:'div'},classes:{ac:'link',content:'content'},animation:{duration:1,open:'easeOutStrong',close:'easeInStrong'},images:{open:'arrow-down-gris.jpg',close:'arrow-left-gris.jpg'}});}
if(Entropico.page=='registrate')
{yd.Event.addListener('Registrate.login','blur',Entropico.testLogin,this,true);}
if(Entropico.page=='tucuenta')
new Accordion({container:'wpAcc',elements:{ac:'h2',content:'div'},classes:{ac:'link',content:'content'},animation:{duration:1,open:'easeOutStrong',close:'easeInStrong'},images:{open:'arrow-down-gris.jpg',close:'arrow-left-gris.jpg'}});if(Entropico.page=='crediescape')
{new Accordion({container:'wpAc',elements:{ac:'h2',content:'div'},classes:{ac:'link',content:'acContent'},animation:{duration:1,open:'easeOutStrong',close:'easeInStrong'},images:{open:'arrow-down-gris.jpg',close:'arrow-left-gris.jpg'}});Entropico.findPerfil();Entropico.findPerfilCodeudor();yd.Event.addListener('CrediescapePerfil','change',Entropico.setPerfil,this,true);yd.Event.addListener('Crediescape1Perfil','change',Entropico.setPerfilCodeudor,this,true);}
if(Entropico.page=='articulo')
{new Zoom({image:'zoomImg',type:'one',by:454,clicks:1,animation:{duration:0.2,increase:'easeInStrong',decrease:'easeOutStrong'}});var images=yd.Dom.getElementsByClassName('art-more-imgs','img','wpImagesArt');yd.Event.addListener(images,'mouseover',Entropico.overImagesArt,this,true);}},overImagesArt:function(e,ev)
{var newSrc=yd.Event.getTarget(e).src;yd.Event.getEl('zoomImg').src=newSrc;},returnSlide:function()
{new Slide({container:'returnSlide',autoplay:true,interval:3000,type:'one',animation:{duration:0.5,start:'left',end:'right'}});},viewPoll:function(e,ev)
{var el=yd.Dom.get('pollId');if(el)
{var pollId=yd.Dom.get('pollId').value;new AJAX({loading:{img:'/img/loader-white.gif',position:'right',el:'statsBtn',width:20,height:20},url:'/page/stats/'+pollId,onSuccess:Entropico.returnViewPoll,idUpdaterNode:'returnPoll'});}},returnViewPoll:function(e,ev)
{},sendPoll:function(e,ev)
{yd.Event.stopEvent(e);new AJAX({loading:{img:'/img/loader-white.gif',position:'left',el:'pollBtn',width:20,height:20},url:'/page/vote/',onSuccess:Entropico.returnPoll,form:'pollForm',idUpdaterNode:'returnPoll'});},returnPoll:function(o,arg)
{yd.Event.addListener('pollForm','submit',Entropico.sendPoll,this,true);},sendBoletin:function(e,ev)
{yd.Event.stopEvent(e);new AJAX({loading:{img:'/img/loader-white.gif',position:'left',el:'btnBoletin',width:20,height:20},url:'/page/add/',onSuccess:Entropico.returnBoletin,form:'boletinForm',idUpdaterNode:'returnBoletin'});},returnBoletin:function(o,arg)
{yd.Event.addListener(this.form,'submit',Entropico.sendBoletin,this,true);yd.Event.addListener('BoletinEmail','click',Entropico.inputBoletin,this,true);yd.Event.addListener('BoletinEmail','blur',Entropico.inputBoletin,this,true);yd.Event.addListener('BoletinEmail','focus',Entropico.inputBoletin,this,true);},inputBoletin:function(e,ev)
{var el=yd.Event.getTarget(e);if(e.type=='click'||e.type=='focus')
el.value='';if(e.type=='blur')
{if(el.value=='')
el.value='Tu e-mail... ';}},inputsRecomienda:function(e,ev)
{var el=yd.Event.getTarget(e);if(e.type=='click'||e.type=='focus')
el.value='';if(e.type=='blur')
{if(el.id=='RecomiendaEmail')
if(el.value=='')
el.value='E-mail amigo...';if(el.id=='RecomiendaFriend')
if(el.value=='')
el.value='Nombre de amigo...';}},sendRecomienda:function(e,ev)
{yd.Event.stopEvent(e);new AJAX({loading:{img:'/img/loader-white.gif',position:'left',el:'btnRecomienda',width:20,height:20},url:'/page/recomendar/',onSuccess:Entropico.returnRecomienda,form:'RecomiendaForm',idUpdaterNode:'returnRecomienda'});},returnRecomienda:function(o,arg)
{yd.Event.addListener(this.form,'submit',Entropico.sendRecomienda,this,true);var inputsRecomienda=yd.Dom.getElementsByClassName('attachMe','input','RecomiendaForm');yd.Event.addListener(inputsRecomienda,'click',Entropico.inputsRecomienda,this,true);yd.Event.addListener(inputsRecomienda,'blur',Entropico.inputsRecomienda,this,true);yd.Event.addListener(inputsRecomienda,'focus',Entropico.inputsRecomienda,this,true);},openAudio:function(e,ev)
{var wnd=open('/page/audio/','Audio','status=no, modal=yes, width=337, height=110, scrollbars=no');if(wnd)wnd.focus();},findPerfil:function()
{var sel=yd.Dom.get('CrediescapePerfil');if(sel&&sel.value!='')
{for(var i=0;i<sel.options.length;i++){if(sel.options[i].value==sel.value)
var selected=sel.options[i].text;};selected=selected.replace(/\s+/g,'_');var el=yd.Dom.getElementsByClassName(selected+'_first','div','content');Entropico.perfilShow=el[0];}},findPerfilCodeudor:function()
{var sel=yd.Dom.get('Crediescape1Perfil');if(sel&&sel.value!='')
{for(var i=0;i<sel.options.length;i++){if(sel.options[i].value==sel.value)
var selected=sel.options[i].text;};selected=selected.replace(/\s+/g,'_');var el=yd.Dom.getElementsByClassName(selected+'_second','div','content');Entropico.perfilCodeudorShow=el[0];}},setPerfil:function(e,ev)
{var sel=yd.Event.getTarget(e);for(var i=0;i<sel.options.length;i++){if(sel.options[i].value==sel.value)
var selected=sel.options[i].text;};selected=selected.replace(/\s+/g,'_');var el=yd.Dom.getElementsByClassName(selected+'_first','div','wpAc');if(Entropico.perfilShow!=undefined)
yd.Dom.addClass(Entropico.perfilShow,'hide');yd.Dom.removeClass(el[0],'hide');Entropico.perfilShow=el[0];},setPerfilCodeudor:function(e,ev)
{var sel=yd.Event.getTarget(e);for(var i=0;i<sel.options.length;i++){if(sel.options[i].value==sel.value)
var selected=sel.options[i].text;};selected=selected.replace(/\s+/g,'_');var el=yd.Dom.getElementsByClassName(selected+'_second','div','wpAc');if(Entropico.perfilCodeudorShow!=undefined)
yd.Dom.addClass(Entropico.perfilCodeudorShow,'hide');yd.Dom.removeClass(el[0],'hide');Entropico.perfilCodeudorShow=el[0];},formLogin:function(e,ev)
{var input=yd.Event.getTarget(e);if(e.type=='click'||e.type=='focus')
{if(input.value=='Tu usuario...'||input.value=='Contraseña...')
{if(input.id=='UserPassword')
{yd.Dom.addClass('UserPassword','hide');yd.Dom.removeClass('UserPasswordHide','hide');yd.Dom.get('UserPasswordHide').focus();}
input.value='';}}
if(e.type=='blur')
{if(input.value=='')
{if(input.id=='UserLogin')
input.value='Tu usuario...';if(input.id=='UserPassword')
{yd.Dom.addClass('UserPasswordHide','hide');yd.Dom.removeClass('UserPassword','hide');input.value='Contraseña...';}
if(input.id=='UserPasswordHide')
{yd.Dom.addClass('UserPasswordHide','hide');yd.Dom.removeClass('UserPassword','hide');yd.Dom.get('UserPasswordHide').value='';yd.Dom.get('UserPassword').value='Contraseña...';}}}},testLogin:function(e)
{var input=yd.Event.getTarget(e);if(input.value=='')return;new AJAX({loading:{img:'/img/loader-white.gif',position:'right',el:'Registrate.login',width:20,height:20},url:'/page/testUser/'+input.value,idUpdaterNode:'returnTest'});},link:function(page)
{window.location=page;},submit:function(form,id)
{if(form=='tiendas')
{var sel=yd.Dom.get(id).getElementsByTagName('select');var store=sel[0].value==-1?'':'/tienda:'+sel[0].value;var mall=sel[1].value==-1?'':'/centro:'+sel[1].value;var citie=sel[2].value==-1?'':'/ciudad:'+sel[2].value;window.location='/page/tiendas'+store+mall+citie+'#content';}
if(form=='catalogo')
{var selects=yd.Dom.get(id).getElementsByTagName('select');var inputs=yd.Dom.get(id).getElementsByTagName('input');var tipo=selects[0].value==-1?'':'/tipo:'+selects[0].value;var marca=selects[1].value==-1?'':'/marca:'+selects[1].value;var talla=selects[2].value==-1?'':'/talla:'+selects[2].value;var color=selects[3].value==-1?'':'/color:'+selects[3].value;var acabo=inputs[2].checked?'/acabo:1':'';var sale=inputs[3].checked?'/sale:1':'';window.location='/page/catalogo/'+inputs[0].value+'/genero:'+inputs[1].value+tipo+marca+talla+color+acabo+sale+'#content';}},setCatalogo:function(e)
{var el=yd.Event.getTarget(e);var check=el.id.substr(el.id.lastIndexOf('_')+1);if(check=='store')
Entropico.store=el.value;if(check=='sex')
Entropico.sex=el.value;},catalogo:function(e)
{var idMarca=yd.Event.getTarget(e).id.substr(yd.Event.getTarget(e).id.lastIndexOf('_')+1);window.location='/page/catalogo/'+Entropico.store+'/genero:'+Entropico.sex+'/marca:'+idMarca;}}
function Zoom(options)
{this.options=options;this.inCount=0;this.deCount=0;this.anim=undefined;this.direction='increase';this.w=undefined;this.h=undefined;if(this.options.type=='one')
{yd.Event.addListener(this.options.image,'click',this.init,this,true);this.w=yd.Dom.get(this.options.image).width;this.h=yd.Dom.get(this.options.image).height;}}
Zoom.prototype.init=function()
{var image=yd.Dom.get(this.options.image);if(this.inCount==this.options.clicks)
{this.inCount=0;this.direction='decrease';}
if(this.deCount==this.options.clicks)
{this.deCount=0;this.direction='increase';}
if(this.inCount<=this.options.clicks&&this.direction=='increase')
{if(image.width>image.height)
var percentage=(this.options.by/image.width);else
var percentage=(this.options.by/image.height);var toWidth=Math.round(image.width*percentage);var toHeight=Math.round(image.height*percentage);var att={width:{from:image.width,to:toWidth},height:{from:image.height,to:toHeight}};var ease=yd.Easing.easeInStrong;if(this.options.animation.increase)
{var t=this.options.animation.increase;ease=eval('yd.Easing'+'.'+t);}
this.inCount++;}
if(this.deCount<=this.options.clicks&&this.direction=='decrease')
{if(image.width>image.height)
var percentage=(this.options.by/image.width);else
var percentage=(this.options.by/image.height);var toWidth=Math.round(image.width*percentage);var toHeight=Math.round(image.height*percentage);var att={width:{from:image.width,to:(this.w)},height:{from:image.height,to:(this.h)}};var ease=yd.Easing.easeOutStrong;if(this.options.animation.increase)
{var t=this.options.animation.increase;ease=eval('yd.Easing'+'.'+t);}
this.deCount++;}
var duration=1;if(this.options.animation.duration)
duration=this.options.animation.duration
this.anim=new YAHOO.util.Anim(image,att,duration,ease);this.anim.animate();}
Debug={show:function(msg,position)
{var debug=yd.Dom.get('debug');if(!debug)
{var div=document.createElement('div');div.id='debug';div.className='debug';div.innerHTML=msg;if(position)
{if(position='top')
{yd.Dom.insertAfter(div,document.body);}
if(position='bottom')
{yd.Dom.insertBefore(div,document.body);}}
else document.body.appendChild(div);}
else
debug.innerHTML+=msg;}}
function Slide(options)
{Slide.url='http://entropico.com';Slide.version='1.0';Slide.developedBy='ajimenez@entropico.com';if(typeof(options)=='object')
this.options=options;else return;this.el=undefined;this.imgs=undefined;this.xyEl=undefined;this.xy=undefined;this.count=0;this.key=0;this.dr=this.options.start;this.timer=undefined;this.motion=undefined;this.motionIsStop=false;this.init();};Slide.prototype.init=function()
{if(this.options.autoplay)
{if(this.options.interval)
this.setInterval();else
this.animate();}};Slide.prototype.setInterval=function()
{this.timer=setInterval(function(obj)
{return(function()
{obj.animate();});}(this),this.options.interval);}
Slide.prototype.stop=function(e,ev)
{if(this.motion&&this.motion.isAnimated())
{this.motionIsStop=true;this.motion.stop();}
else
{var xy=yd.Dom.getXY(this.el);this.motionIsStop=false;if(this.atachOut==undefined)
yd.Event.addListener(this.options.container,'mouseout',this.animate,this,true);this.atachOut=true;}}
Slide.prototype.animate=function()
{if(this.el==undefined)
this.el=yd.Dom.get(this.options.container);if(this.imgs==undefined)
this.imgs=this.el.getElementsByTagName('img');this.count=this.imgs.length;if(this.count==0||!this.el)return;this.xy=yd.Dom.getXY(this.el);if(this.options.type=='all')
{if(this.moveBy==undefined)
{var moveBy=0;var len=this.options.items?this.imgs.length-this.options.items:this.imgs.length;for(var a=0;a<len;a++)
moveBy+=this.imgs[a].clientWidth;this.moveBy=moveBy;}
if(this.options.animation.start=='left')
{this.maxLeft=this.xy[0]-this.moveBy;var att={points:{to:[this.xy[0]-this.moveBy,this.xy[1]]}};var ease=yd.Easing.easeNone;}
if(this.options.animation.start=='right')
{this.maxRight=this.xy[0]+this.moveBy;var att={points:{to:[this.xy[0]+this.moveBy,this.xy[1]]}};var ease=yd.Easing.easeNone;}}
if(this.options.type=='one')
{if(this.options.animation.start=='left')
{var att={points:{to:[this.xy[0]-this.imgs[this.key].width,this.xy[1]]}};var ease=yd.Easing.easeInStrong;this.key++;}
if(this.options.animation.start=='right')
{var att={points:{to:[this.xy[0]+this.imgs[this.key].width,this.xy[1]]}};var ease=yd.Easing.easeOutStrong;this.key--;}}
var duration=1;if(this.options.animation.duration)
duration=this.options.animation.duration
this.motion=new yd.Motion(this.el,att,duration,ease);this.motion.Slide=this;if(this.options.interval==undefined)
{this.motion.onComplete.subscribe(function(){if(this.Slide.options.type=='all')
{if(this.Slide.options.animation.start=='left')
this.Slide.options.animation.start='right';else
this.Slide.options.animation.start='left';}
if(this.Slide.options.type=='one')
{if(this.Slide.key==(this.Slide.count-1))
this.Slide.options.animation.start='right';if(this.Slide.key==0)
this.Slide.options.animation.start='left';}
this.Slide.animate();});}
else
{if(this.options.type=='one')
{if(this.key==0)
this.options.animation.start='left';if(this.key==(this.count-1))
this.options.animation.start='right';}
this.motion.animate();}
if(!this.motionIsStop)
this.motion.animate();};function Menu(options)
{Menu.url='http://entropico.com';Menu.version='1.0';Menu.developedBy='ajimenez@entropico.com';this.options=options;this.openers=yd.Dom.getElementsByClassName(this.options.classes.menu,this.options.elements.menu,options.container);this.contents=yd.Dom.getElementsByClassName(this.options.classes.content,this.options.elements.content,options.container);this.parners=yd.Dom.get(this.options.container).getElementsByTagName(this.options.elements.menu);if(this.openers.length!=this.contents.length)
Debug.show('the number of elements that are trigger by the Menu ( class: '+this.options.classes.menu+') are different, check the markup (html)','top');for(var i=0;i<this.openers.length;i++)
yd.Event.addListener(this.openers[i],'mouseover',this.show,{obj:this,opener:i},true);for(var a=0;a<this.parners.length;a++)
{if(!yd.Dom.hasClass(this.parners[a],this.options.classes.menu)&&this.parners[a].clientHeight>0)
yd.Event.addListener(this.parners[a],'mouseover',this.others,this,true);}
this.showIt=undefined;this.opener=undefined;};Menu.prototype.others=function(e,ev)
{if(this.showIt!=undefined)
{if(!this.motion.isAnimated())
this.hide(this.showIt,this.opener);else
{this.motion.onComplete.subscribe(function(){if(this.Menu.obj)
this.Menu.obj.hide(this.Menu.obj.showIt,this.Menu.obj.opener);});}}}
Menu.prototype.hide=function(menu,link)
{var att={height:{to:0}};var ease=yd.Easing.easeOutStrong;if(this.options.animation)
{var t=this.options.animation.close;ease=eval('yd.Easing'+'.'+t);}
var duration=1;if(this.options.animation)
duration=this.options.animation.duration;this.motion=new yd.Motion(menu,att,duration,ease);this.motion.Menu={opener:this.opener,over:this.options.classes.over};this.motion.onComplete.subscribe(function(){yd.Dom.removeClass(this.Menu.opener,this.Menu.over);});this.motion.animate();}
Menu.prototype.show=function(e,ev)
{var link=yd.Event.getTarget(e);yd.Dom.addClass(link,this.obj.options.classes.over);var menu=this.obj.contents[ev.opener];if(menu.clientHeight!=menu.scrollHeight)
{if(this.obj.showIt!=undefined)
this.obj.hide(this.obj.showIt,link);var xy=yd.Dom.getXY(link);var height=link.clientHeight;yd.Dom.setXY(menu,[xy[0],xy[1]+height]);var att={height:{to:menu.scrollHeight}};var ease=yd.Easing.easeOutStrong;if(this.obj.options.animation)
{var t=this.obj.options.animation.open;ease=eval('yd.Easing'+'.'+t);}
this.obj.showIt=menu;this.obj.opener=link;var duration=1;if(this.obj.options.animation)
duration=this.obj.options.animation.duration;this.obj.motion=new yd.Motion(menu,att,duration,ease);this.obj.motion.Menu=this;this.obj.motion.onStart.subscribe(function(){if(this.Menu.obj.options.style)
yd.Dom.setStyle(menu,this.Menu.obj.options.style.property,this.Menu.obj.options.style.value);});this.obj.motion.onComplete.subscribe(function(){yd.Dom.addClass(this.Menu.obj.opener,this.Menu.obj.options.classes.over);});this.obj.motion.animate();}}
function Accordion(options)
{Accordion.url='http://entropico.com';Accordion.version='1.0';Accordion.developedBy='ajimenez@entropico.com';this.options=options;this.openers=yd.Dom.getElementsByClassName(this.options.classes.ac,this.options.elements.ac,options.container);this.contents=yd.Dom.getElementsByClassName(this.options.classes.content,this.options.elements.content,options.container);if(this.openers.length!=this.contents.length)
Debug.show('the number of elements that are trigger by the acordion ( class: '+this.options.classes.ac+') are different, check the markup (html)','top');for(var i=0;i<this.openers.length;i++)
yd.Event.addListener(this.openers[i],'click',this.animate,{obj:this,clicked:i},true);}
Accordion.prototype.animate=function(e,ev)
{var el=this.obj.contents[ev.clicked];var h=el.clientHeight;var clicked=yd.Event.getTarget(e);if(h==0)
{var att={height:{to:el.scrollHeight}};var ease=yd.Easing.easeOutStrong;if(this.obj.options.animation)
{var t=this.obj.options.animation.open;ease=eval('yd.Easing'+'.'+t);}
if(this.obj.options.images&&clicked.firstChild.tagName.toLowerCase()=='img')
clicked.firstChild.src=document.location.protocol+'//'+document.location.host+'/img/'+this.obj.options.images.open;}
else
{var att={height:{to:0}};var ease=yd.Easing.easeInStrong;if(this.obj.options.animation)
{var t=this.obj.options.animation.close;ease=eval('yd.Easing'+'.'+t);}
if(this.obj.options.images&&clicked.firstChild.tagName.toLowerCase()=='img')
clicked.firstChild.src=document.location.protocol+'//'+document.location.host+'/img/'+this.obj.options.images.close;}
var duration=1;if(this.obj.options.animation)
duration=this.obj.options.animation.duration;var motion=new yd.Motion(el,att,duration,ease);motion.animate();}
function AJAX(opt)
{this.debug=false;this.opt=opt;this.loading=this.opt.loading;this.url=this.opt.url;this.onSuccess=this.opt.onSuccess;this.idUpdaterNode=this.opt.idUpdaterNode;this.form=this.opt.form;this.arguments=this.opt.arguments;this.forceCallback=this.opt.forceCallback;this.data=this.opt.data;this.arguments=this.opt.arguments;this.showLoading();this.callback={success:this.load,failure:this.error,timeout:60000,scope:this,argument:[]};if(typeof this.arguments!='undefined'&&this.arguments!=null)
this.callback.argument=this.arguments;if(typeof this.form!='undefined')
{this.callback.argument.push(this.form);YAHOO.util.Connect.setForm(this.form);}
if(typeof this.form!='undefined'||typeof this.data!='undefined')
var method='POST';else
var method='GET';YAHOO.util.Connect.asyncRequest(method,this.url,this.callback,this.data);};AJAX.prototype.load=function(o)
{this.hideLoading();try
{var response=eval('('+o.responseText+')');}
catch(err)
{this.showError(o.responseText);return;}
switch(response.type)
{case'HTML':if(typeof this.idUpdaterNode!='undefined')
yd.Dom.get(this.idUpdaterNode).innerHTML=response.html;if(this.onSuccess!=undefined)
this.onSuccess(response,o.argument);break;case'JSON':if(this.onSuccess!=undefined)
this.onSuccess(response,o.argument);break;case'REDIRECT':if(this.onSuccess!=undefined)
this.onSuccess(response,o.argument);window.location=response.path;break;case'SUCCESS':if(typeof response.msg!='undefined')
GENERAL_muestreSuccess(response.msg);if(this.onSuccess!=undefined)
this.onSuccess(response,o.argument);break;case'ERR_VALID':var form=o.argument[o.argument.length-1];GENERAL_muestreValidacion(response.errores,form);if(this.onSuccess!=undefined&&this.forceCallback===true)
this.onSuccess(response,o.argument);break;default:if(this.onSuccess!=undefined&&this.forceCallback===true)
this.onSuccess(response,o.argument);this.showError(response.msg);break;}};AJAX.prototype.showError=function(response)
{if(this.debug)
{var debug=yd.Dom.get('debug');if(!debug)
{var div=document.createElement('div');div.id='debug';div.className='debug';div.innerHTML=response;document.body.appendChild(div);}
else
debug.innerHTML=response;}
else
alert(response);};AJAX.prototype.showLoading=function()
{if(typeof this.loading=='object')
{var el=yd.Dom.get(this.loading.el);var xy=yd.Dom.getXY(el);var w=el.offsetWidth;var image=yd.Dom.get(this.loading.el+'_loading');if(!image)
{var imgLoading=new Image();imgLoading.id=this.loading.el+'_loading';yd.Dom.setStyle(imgLoading,'position','absolute');imgLoading.src=this.loading.img;if(this.loading.width)imgLoading.width=this.loading.width;if(this.loading.height)imgLoading.height=this.loading.height;document.body.appendChild(imgLoading);this.loading.image=imgLoading;}
else
{this.loading.image=image;yd.Dom.removeClass(this.loading.image,'hide');}
if(this.loading.position=='right')
yd.Dom.setXY(this.loading.image,[(xy[0]+w+5),xy[1]]);if(this.loading.position=='left')
yd.Dom.setXY(this.loading.image,[(xy[0]-this.loading.image.width-5),xy[1]]);}};AJAX.prototype.hideLoading=function()
{if(typeof this.loading=='object')
yd.Dom.addClass(this.loading.image,'hide');};if(typeof YAHOO!="undefined")
{yd=YAHOO.util;yd.Event.addListener(window,'load',Entropico.init);}
