function LWjsLibClass(){if(top.LWjsLib){return;}
this.rutaBiblioteca='/js/lwjslib/';this.version='1.0.0';this.lastEventType='';this.lastCheckEl=null;this.reminder=new Array();this.allModules=new Array('LWjsAPI','LWjsNav','LWjsScroll','LWjsNumbers','LWjsMenu','LWjsForm','LWjsForm-gfv','LWjsForm-sel','LWjsXML','LWjsIO','LWjsPager','LWjsTpl','LWjsLib-mke','LWjsCode');for(var j=0;j<this.allModules.length;j++){this.allModules[this.allModules[j]]=true;}
this.incModules=new Array();top.LWjsLib=this;this.lastDerive=0;this.derive(this,LWjsMsgErrorHandlerClass);this.setIntroMsgError('Se ha producido un error controlado en el ámbito de LWjsLib:');for(j=0;j<this.allModules.length;j++){this.setMsgError('no'+this.allModules[j],'Se ha intentando crear un objeto '+this.allModules[j]+' sin haber\nincluido el módulo correspondiente.');this.setMsgError('depfail'+this.allModules[j],'Se ha producido un error de dependencias en '+this.allModules[j]+'.\nPrecisa de otros módulos no incluidos.');}
this.appprefix='#';}
;var p=LWjsLibClass.prototype;p.setLibraryPath=function(ab){if(typeof(ab)=='string'){this.rutaBiblioteca=ab;}
}
;p.include=function(){var j,m;for(j=0;j<arguments.length;j++){m=arguments[j];if(this.allModules[m]){if(!this.incModules[m]){this.arrayPush(this.incModules,m);this.incModules[m]=true;document.write('<SCRIPT language="Javascript" src="'+this.rutaBiblioteca+m+'.js"><\/SCRIPT>\n');}
}
else{this.showMsgError('Se ha incluido un módulo no conocido: '+m);}
}
}
;p.isIncluded=function(){for(var j=0;j<arguments.length;j++){if(!this.incModules[arguments[j]]||!this.allModules[arguments[j]]){return(false);}
}
return(true);}
;p.remind=function(v,k){var r=this.reminder;if(k){r['v'+k]=v;}
else{k=r.length;}
LWjsLib.arrayPush(r,v);return(k);}
;p.remember=function(bb,cb){var r=this.reminder;var db=r[bb];if(typeof(db)=='undefined'){db=r['v'+bb];}
if(typeof(db)!='undefined'){if(cb!=true){delete(r[bb]);}
return(db);}
else{return(null);}
}
;var n=navigator.userAgent;p.isDOM=document.getElementById?true:false;p.isIE=n.indexOf("MSIE")>0;p.isFX=n.indexOf("Firefox")>0;p.isKONQ=n.indexOf("Konqueror")>0;p.isIE60=n.indexOf("MSIE 6.0")>0;p.isIE70=navigator.userAgent.indexOf("MSIE 7.0")>0;p.isNS=n.indexOf("Gecko")>0;p.isMac=n.indexOf("Mac")>0;p.evalPercent=function(eb,fb){eb=String(eb);if(eb.search('%')<0){eb=parseInt(eb,10);return(isNaN(eb)?0:eb);}
else{eb=parseInt(eb.substr(0,eb.search('%')),10);if(isNaN(eb)){return(0);}
if(eb<0){eb+=100;}
return(Math.round(fb*eb)/100);}
}
;p.arraySplice=function(m,i,c){if(!m){return(null);}
i=i||0;c=isNaN(c)?m.length:c;if(!this.isIE50&&m.splice&&arguments.length==3){return(m.splice(i,c));}
else{var h=0;var gb=new Array();for(var j=0;j<m.length;j++){if(j<i||j>=i+c){m[h]=m[j];h++;}
else{this.arrayPush(gb,m[j]);if(arguments.length>3+(j-i)){m[h]=arguments[3+(j-i)];h++;}
}
}
m.length=h;return(gb);}
}
;p.arrayInsert=function(m,i,v){var hb=m[i],t,j=i+1;m[i]=v;var ib=m.length+1;while(typeof(hb)!='undefined'&&j<ib){t=m[j];m[j]=hb;hb=t;j++;}
}
;p.arrayPush=function(m,v){var jb=m.length;m[m.length]=v;if(m.length==jb){m.length++;}
}
;p.fillString=function(c,n){var kb='';if(arguments.length==2){c=String(c);for(var j=0;j<n;j++){kb+=c;}
}
return(kb);}
;p.stringTrim=function(lb){var i=lb.search(/[^\s\n\r\t]/);i=i>0?i:0;var f=lb.search(/[\s\n\r\t]+$/);f=f>0?f:lb.length;return(lb.substring(i,f));}
;p.getDocumentWindow=function(d,m){m=m||top;d=d||document;if(d.defaultView){return(d.defaultView);}
else{if(m.document==d){return(m);}
for(var j=0;j<m.frames.length;j++){var mb=this.getDocumentWindow(d,m.frames[j]);if(mb){return(mb);}
}
return(null);}
}
;p.isChild=function(h,p){if(!h||!p){return(false);}
var nb=h;while(nb){if(nb==p){return(true);}
nb=nb.parentNode;}
return(false);}
;p.getOwnerDocument=function(e){return(e.ownerDocument||e.document);}
;p.addEvent=function(o,t,f){t=t.substr(0,2).toLowerCase()=='on'?t.substr(2):t;if(o.addEventListener){o.addEventListener(t,f,true);}
else{if(t.indexOf('key')==0&&LWjsLib.isIE){o['on'+t]=f;}
else{if(o.attachEvent){o.attachEvent('on'+t,f);}
else{return null;}
}
}
t='adedEv_'+t;if(o[t]){o[t]++;}
else{o[t]=1;}
}
;p.removeEvent=function(t,f){t=t.substr(0,2).toLowerCase()=='on'?t.substr(2):t;if(o.removeEventListener){o.removeEventListener(t,f,true);}
else{if(o.detachEvent){o.detachEvent('on'+t,f);}
else{return(null);}
}
o['adedEv_'+t]=false;}
;p.getCurrentTarget=function(e){var ob=e;if(LWjsLib.isIE){if(!e){e=this._searchEvent(top);}
}
else{return(e.currentTarget);}
if(this.lastCheckEl&&this.lastEventType==e.type&&this.isChild(e.srcElement,this.lastCheckEl)){var nb=this.lastCheckEl;}
else{var nb=e.srcElement;}
var pb=false,qb='adedEv_'+e.type;while(true){if(nb[qb]){if(!this.lastEventCount){this.lastEventType=e.type;this.lastEventCount=nb[qb];}
this.lastEventCount--;this.lastCheckEl=this.lastEventCount?nb:nb.parentNode;break;}
nb=nb.parentNode;if(!nb){if(pb){break;}
else{pb=true;nb=e.srcElement;}
}
}
if(!ob){nb._eventfound=e;}
return(nb);}
;p._searchEvent=function(w){var e=w.event;if(!e){for(var j=0;j<w.document.frames.length;j++){e=this._searchEvent(w.document.frames[j]);if(e){break;}
}
}
return(e);}
;p.stopPropagation=function(e){if(this.isIE){var w=this.getDocumentWindow(this.getOwnerDocument(e.srcElement));w.event.cancelBubble=true;w.event.returnValue=false;}
else{e.preventDefault();e.stopPropagation();}
}
;p.derive=function(rb,sb,tb){var ub=sb.toString().split('LWjs');if(ub[1]){ub='isLWjs'+ub[1].split('Class')[0];if(rb[ub]){return;}
}
for(var m in sb.prototype){if(typeof(rb[m])=='undefined'){rb[m]=sb.prototype[m];}
}
if(tb&&tb.areArguments){m=new Array(false,false);m=m.concat(tb);}
else{m=arguments;}
this._construct(rb,sb,m);}
;p.cast=function(rb,sb,tb){for(var m in sb.prototype){rb[m]=sb.prototype[m];}
if(tb&&tb.areArguments){m=new Array(false,false);m=m.concat(tb);}
else{m=arguments;}
this._construct(rb,sb,m);}
p._construct=function(rb,sb,m){rb._derive=sb;var n=this.lastDerive;this.lastDerive++;this['_actD'+n]=rb;this['_actM'+n]=m;var vb='top.LWjsLib._actD'+n+'._derive('+(m.length>2?'top.LWjsLib._actM'+n+'[2]':'');for(var j=3;j<m.length;j++){vb+=',top.LWjsLib._actM'+n+'['+j+']';}
vb+=')';eval(vb);this.lastDerive--;rb._derive=null;}
;p.scanDocument=function(d){if(arguments.length!=1){return;}
this.scanDocumentFragment(d.documentElement);}
;p.scanDocumentFragment=function(e){if(e.id){if(e.onScanDocument){e.onScanDocument();}
var wb=String(e.id).split('::');var xb,yb='';var sb,zb,$b;var j,i,p,_b;for(j=0;j<wb.length;j++){xb=wb[j].split(':');_b=xb[0];if(_b=='LW'||this.appprefix.indexOf('#'+_b+'#')>-1){sb=xb[1];zb=xb[2];$b=_b+'js'+sb+'Class';if(this[$b]){c=sb;if(zb){zb=zb.split('_');for(i=0;i<zb.length;i++){p=zb[i];if(p=='false'||p=='true'){zb[i]=p=='true';}
else{p=p.search("^\d+$")!=-1?parseInt(p,10):p;}
}
zb.areArguments=true;this.derive(e,this[$b],zb);}
else{this.derive(e,this[$b]);}
}
}
else{yb+=(yb.length?'::':'')+wb[j];}
}
e.id=yb;}
e=e.firstChild;while(e){this.scanDocumentFragment(e);e=e.nextSibling;}
}
;p.setAppPrefix=function(p){this.appprefix+=p+'#';}
;p.unsetAppPrefix=function(p){this.appprefix=this.appprefix.replace(p+'#','');}
;p.newLWjsMsgErrorHandler=function(o){o=o||new Object();LWjsLib.derive(o,LWjsMsgErrorHandlerClass);return(o);}
;function LWjsMsgErrorHandlerClass(){this.introMsgError="Se ha detectado el siguiente error:\n\n";this.defMsgError='*** error genérico ***';this.matrizMsgError=new Array();this.isLWjsMsgErrorHandler=true;}
;p.LWjsMsgErrorHandlerClass=LWjsMsgErrorHandlerClass;LWjsMsgErrorHandlerClass.prototype.showMsgError=function(ac,bc){bc=arguments.length>1?bc:(this.matrizMsgError[ac]?this.matrizMsgError[ac].ta:0);var cc=this.introMsgError;cc+=ac?(this.matrizMsgError[ac]?this.matrizMsgError[ac]:ac):this.defMsgError;switch(bc){case 0:{alert(cc);break;}
case 1:return(confirm(cc));case 2:return(prompt(cc));}
}
;LWjsMsgErrorHandlerClass.prototype.setMsgError=function(ac,cc,bc){if(!ac){return(1);}
bc=arguments.length>2?bc:0;this.matrizMsgError[ac]=new String(cc||this.defMsgError);this.matrizMsgError[ac].ta=bc;}
;LWjsMsgErrorHandlerClass.prototype.setIntroMsgError=function(cc){this.introMsgError=cc?cc+'\n\n':this.introMsgError;}
;LWjsMsgErrorHandlerClass.prototype.setDefMsgError=function(cc){if(cc){this.defMsgError=cc;}
}
;LWjsLib=new LWjsLibClass();