(function(){if(!/*@cc_on!@*/0)return;var e="abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(',');for(var i=0;i<e.length;i++){document.createElement(e[i])}})();


window.addEvent("domready",function(){
	var request = new Request({
		data: 'ajax=true',
		evalScripts: true,
		onSuccess: function(html){
			$("leContenido").set("html",html);
			$("leContenido").fade('in');
			onPageUpdate();
		}
	});
	var loadPage = function(url) {
		$("leContenido").fade('out');
		new Fx.Scroll(document.body).toTop();
		request.send({ url: url });
	};
	
	var listener = function(evt){
		evt.preventDefault();
		var href = this.get('href');
		History.push(href);
	};
	var back = function(evt){
		evt.preventDefault();
		History.back();
	};
	document.body.addEvent("click:relay(a:not([href=#],[href^=http://],[data-noxhr]))",listener);
	var onPageUpdate = function() {
		
	};
	
	History.addEvent('change', loadPage);
	if(!History.hasPushState()) {
		var hash = document.location.hash.substr(1);
		if (!hash) return;
		var path = document.location.pathname.split('/');
		path = path[path.length - 1];
		if (hash == path) return;
		loadPage(hash);
	}
	onPageUpdate();			
});



function dP(id){$(id).fadeToggle();}
function sU(txt){$(txt).fade("Out");}
function sD(txt){$(txt).fade("In");}
function fI(txt){$(txt).fade("In");}
function fO(txt){$(txt).fade("Out");}
function off(txt){document.getElementById(txt).style.display = "none";}
function on(txt){document.getElementById(txt).style.display ="";}
function inner(id,txt){document.getElementById(id).innerHTML=txt;}
function foco(id){document.getElementById(id).focus();}
function color(id,txt){document.getElementById(id).style.color = txt;}
function borde(id,txt){document.getElementById(id).style.border = txt;}
function cursor(id,txt){document.getElementById(id).style.cursor = txt;}
function fondo(id,txt){document.getElementById(id).style.backgroundColor = txt;}
function valor(id,txt){document.getElementById(id).value = txt;}
function subm(id){document.getElementById(id).submit();}
function sacavalor(txt){return document.getElementById(txt).value;}
function sacainner(txt){return document.getElementById(txt).innerHTML;}

var geSelection = function() {
	return $try(
		function(){return window.getSelection();},
		function(){return document.getSelection();},
		function(){ 
	        var selection = document.selection && document.selection.createRange();
			if(selection.text){return selection.text;}
				return false;
			}
		)||false;
};
var seleciona=function(e){
	var selection=geSelection();
	if(selection&&(selection=new String(selection).replace(/^\s+|\s+$/g,''))){
		new Request({url:'/letranet/others/seleciona.asp',method:'post',data:'te='+encodeURI(selection)}).send();
	}
}
var kli=function(e){
	var dla=e.page.x-$('cuerpo').offsetLeft;
	new Request({url:'/letranet/others/click.asp',method:'get',data:'xx='+dla+'&yy='+e.page.y}).send();
}
function ytb(){
	var ca=sacavalor("cansion");
	var si=prompt("Enlace?","");
	valor("cansion","[you]"+si+"[/you]\n\n"+ca);
}
function verClicks(){
	var dla=$('cuerpo').offsetLeft;
	new Request({url:'/letranet/others/click.asp',method:'get',evalResponse:true,data:'dl='+dla}).send();
}
function verSeles(){
	new Request({url:'/letranet/others/seleciona.asp',method:'get',evalResponse:true,data:'dl=sho'}).send();
}
function cierrTra(){
	var tn,td=true;
	while(td){
		tn=document.body.lastChild;
		if(tn.get('class')!='punto'){td=false}
		else{document.body.removeChild(tn);}
	}
	off('trasero');
}
function ajx(url,datos){
	new Request({
		url:'/letranet/letras/'+url,
		method:'get',
		data:datos,
		onSuccess:function(responseText){
			inner('cancion',responseText);
		},
	}).send();	
}
function edita(txt,cantante){ajx("buscar.asp","id="+ txt+"&singer="+cantante);}
function cambiadisco(id,disco,cantante){ajx("changedisk.asp","id="+id);}
function nuevacancion(autor,disco){ajx("nueva.asp","autor="+autor+"&disco="+disco+"&ajax=yes");}


Class.Binds = new Class({$bound: {},bound: function(name){return this.$bound[name] ? this.$bound[name] : this.$bound[name] = this[name].bind(this);}});(function(){var events = Element.NativeEvents,location = window.location,base = location.pathname,history = window.history,hasPushState = ('pushState' in history),event = hasPushState ? 'popstate' : 'hashchange';this.History = new new Class({Implements: [Class.Binds, Events],initialize: hasPushState ? function(){events[event] = 2;window.addEvent(event, this.bound('pop'));} : function(){events[event] = 1;window.addEvent(event, this.bound('pop'));this.hash = location.hash;var hashchange = ('onhashchange' in window);if (!(hashchange && (document.documentMode === undefined || document.documentMode > 7)))this.timer = this.check.periodical(200, this);},push: hasPushState ? function(url, title, state){if (base && base != url) base = null;history.pushState(state || null, title || null, url);this.onChange(url, state);} : function(url){location.hash = url;},replace: hasPushState ? function(url, title, state){history.replaceState(state || null, title || null, url);} : function(url){this.hash = '#' + url;this.push(url);},pop: hasPushState ? function(event){var url = location.pathname;if (url == base){base = null;return;}this.onChange(url, event.event.state);} : function(){var hash = location.hash;if (this.hash == hash) return;this.hash = hash;this.onChange(hash.substr(1));},onChange: function(url, state){this.fireEvent('change', [url, state || {}]);},back: function(){history.back();},forward: function(){history.forward();},getPath: function(){return hasPushState ? location.pathname : location.hash.substr(1);},hasPushState: function(){return hasPushState;},check: function(){if (this.hash != location.hash) this.pop();}});}).call(this);History.handleInitialState = function(base){if (!base) base = '';var location = window.location,pathname = location.pathname.substr(base.length),hash = location.hash,hasPushState = History.hasPushState();if (!hasPushState && pathname.length > 1){window.location = (base || '/') + '#' + pathname;return true;}if (!hash || hash.length <= 1) return false;if (hasPushState){(function(){History.push(hash.substr(1));}).delay(1);return false;}if (!pathname || pathname == '/') return false;window.location = (base || '/') + hash;return true;};Events.Pseudos = function(pseudos, addEvent, removeEvent){var storeKey = 'monitorEvents:';var storageOf = function(object){return {store: object.store ? function(key, value){object.store(storeKey + key, value);} : function(key, value){(object.$monitorEvents || (object.$monitorEvents = {}))[key] = value;},retrieve: object.retrieve ? function(key, dflt){return object.retrieve(storeKey + key, dflt);} : function(key, dflt){if (!object.$monitorEvents) return dflt;return object.$monitorEvents[key] || dflt;}};};var splitType = function(type){if (type.indexOf(':') == -1 || !pseudos) return null;var parsed = Slick.parse(type).expressions[0][0],parsedPseudos = parsed.pseudos,l = parsedPseudos.length,splits = [];while (l--) if (pseudos[parsedPseudos[l].key]){splits.push({event: parsed.tag,value: parsedPseudos[l].value,pseudo: parsedPseudos[l].key,original: type});}return splits.length ? splits : null;};var mergePseudoOptions = function(split){return Object.merge.apply(this, split.map(function(item){return pseudos[item.pseudo].options || {};}));};return {addEvent: function(type, fn, internal){var split = splitType(type);if (!split) return addEvent.call(this, type, fn, internal);var storage = storageOf(this),events = storage.retrieve(type, []),eventType = split[0].event,options = mergePseudoOptions(split),stack = fn,eventOptions = options[eventType] || {},args = Array.slice(arguments, 2),self = this,monitor;if (eventOptions.args) args.append(Array.from(eventOptions.args));if (eventOptions.base) eventType = eventOptions.base;if (eventOptions.onAdd) eventOptions.onAdd(this);split.each(function(item){var stackFn = stack;stack = function(){(eventOptions.listener || pseudos[item.pseudo].listener).call(self, item, stackFn, arguments, monitor, options);};});monitor = stack.bind(this);events.include({event: fn, monitor: monitor});storage.store(type, events);addEvent.apply(this, [type, fn].concat(args));return addEvent.apply(this, [eventType, monitor].concat(args));},removeEvent: function(type, fn){var split = splitType(type);if (!split) return removeEvent.call(this, type, fn);var storage = storageOf(this),events = storage.retrieve(type);if (!events) return this;var eventType = split[0].event,options = mergePseudoOptions(split),eventOptions = options[eventType] || {},args = Array.slice(arguments, 2);if (eventOptions.args) args.append(Array.from(eventOptions.args));if (eventOptions.base) eventType = eventOptions.base;if (eventOptions.onRemove) eventOptions.onRemove(this);removeEvent.apply(this, [type, fn].concat(args));events.each(function(monitor, i){if (!fn || monitor.event == fn) removeEvent.apply(this, [eventType, monitor.monitor].concat(args));delete events[i];}, this);storage.store(type, events);return this;}};};(function(){var pseudos = {once: {listener: function(split, fn, args, monitor){fn.apply(this, args);this.removeEvent(split.event, monitor).removeEvent(split.original, fn);}},throttle: {listener: function(split, fn, args){if (!fn._throttled){fn.apply(this, args);fn._throttled = setTimeout(function(){fn._throttled = false;}, split.value || 250);}}},pause: {listener: function(split, fn, args){clearTimeout(fn._pause);fn._pause = fn.delay(split.value || 250, this, args);}}};Events.definePseudo = function(key, listener){pseudos[key] = Type.isFunction(listener) ? {listener: listener} : listener;return this;};Events.lookupPseudo = function(key){return pseudos[key];};var proto = Events.prototype;Events.implement(Events.Pseudos(pseudos, proto.addEvent, proto.removeEvent));['Request', 'Fx'].each(function(klass){if (this[klass]) this[klass].implement(Events.prototype);});})();(function(){var pseudos = {},copyFromEvents = ['once', 'throttle', 'pause'],count = copyFromEvents.length;while (count--) pseudos[copyFromEvents[count]] = Events.lookupPseudo(copyFromEvents[count]);Event.definePseudo = function(key, listener){pseudos[key] = Type.isFunction(listener) ? {listener: listener} : listener;return this;};var proto = Element.prototype;[Element, Window, Document].invoke('implement', Events.Pseudos(pseudos, proto.addEvent, proto.removeEvent));})();(function(){var eventListenerSupport = !(window.attachEvent && !window.addEventListener),nativeEvents = Element.NativeEvents;nativeEvents.focusin = 2;nativeEvents.focusout = 2;var check = function(split, target, event){var elementEvent = Element.Events[split.event], condition;if (elementEvent) condition = elementEvent.condition;return Slick.match(target, split.value) && (!condition || condition.call(target, event));};var bubbleUp = function(split, event, fn){for (var target = event.target; target && target != this; target = document.id(target.parentNode)){if (target && check(split, target, event)) return fn.call(target, event, target);}};var formObserver = function(eventName){var $delegationKey = '$delegation:';return {base: 'focusin',onRemove: function(element){element.retrieve($delegationKey + 'forms', []).each(function(el){el.retrieve($delegationKey + 'listeners', []).each(function(listener){el.removeEvent(eventName, listener);});el.eliminate($delegationKey + eventName + 'listeners').eliminate($delegationKey + eventName + 'originalFn');});},listener: function(split, fn, args, monitor, options){var event = args[0],forms = this.retrieve($delegationKey + 'forms', []),target = event.target,form = (target.get('tag') == 'form') ? target : event.target.getParent('form');if (!form) return;var formEvents = form.retrieve($delegationKey + 'originalFn', []),formListeners = form.retrieve($delegationKey + 'listeners', []),self = this;forms.include(form);this.store($delegationKey + 'forms', forms);if (!formEvents.contains(fn)){var formListener = function(event){bubbleUp.call(self, split, event, fn);};form.addEvent(eventName, formListener);formEvents.push(fn);formListeners.push(formListener);form.store($delegationKey + eventName + 'originalFn', formEvents).store($delegationKey + eventName + 'listeners', formListeners);}}};};var inputObserver = function(eventName){return {base: 'focusin',listener: function(split, fn, args){var events = {blur: function(){this.removeEvents(events);}}, self = this;events[eventName] = function(event){bubbleUp.call(self, split, event, fn);};args[0].target.addEvents(events);}};};var eventOptions = {mouseenter: {base: 'mouseover'},mouseleave: {base: 'mouseout'},focus: {base: 'focus' + (eventListenerSupport ? '' : 'in'),args: [true]},blur: {base: eventListenerSupport ? 'blur' : 'focusout',args: [true]}};if (!eventListenerSupport) Object.append(eventOptions, {submit: formObserver('submit'),reset: formObserver('reset'),change: inputObserver('change'),select: inputObserver('select')});Event.definePseudo('relay', {listener: function(split, fn, args){bubbleUp.call(this, split, args[0], fn);},options: eventOptions});})();MooTools.More={version:"1.3.2.1",build:"e586bcd2496e9b22acfde32e12f84d49ce09e59d"};(function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(c,b){this.element=this.subject=document.id(c);this.parent(b);if(typeOf(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}if(this.options.wheelStops){var d=this.element,e=this.cancel.pass(false,this);this.addEvent("start",function(){d.addEvent("mousewheel",e);},true);this.addEvent("complete",function(){d.removeEvent("mousewheel",e);},true);}},set:function(){var b=Array.flatten(arguments);if(Browser.firefox){b=[Math.round(b[0]),Math.round(b[1])];}this.element.scrollTo(b[0],b[1]);return this;},compute:function(d,c,b){return[0,1].map(function(e){return Fx.compute(d[e],c[e],b);});},start:function(c,d){if(!this.check(c,d)){return this;}var b=this.element.getScroll();return this.parent([b.x,b.y],[c,d]);},calculateScroll:function(g,f){var d=this.element,b=d.getScrollSize(),h=d.getScroll(),j=d.getSize(),c=this.options.offset,i={x:g,y:f};for(var e in i){if(!i[e]&&i[e]!==0){i[e]=h[e];}if(typeOf(i[e])!="number"){i[e]=b[e]-j[e];}i[e]+=c[e];}return[i.x,i.y];},toTop:function(){return this.start.apply(this,this.calculateScroll(false,0));},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,false));},toRight:function(){return this.start.apply(this,this.calculateScroll("right",false));},toBottom:function(){return this.start.apply(this,this.calculateScroll(false,"bottom"));},toElement:function(d,e){e=e?Array.from(e):["x","y"];var c=a(this.element)?{x:0,y:0}:this.element.getScroll();var b=Object.map(document.id(d).getPosition(this.element),function(g,f){return e.contains(f)?g+c[f]:false;});return this.start.apply(this,this.calculateScroll(b.x,b.y));},toElementEdge:function(d,g,e){g=g?Array.from(g):["x","y"];d=document.id(d);var i={},f=d.getPosition(this.element),j=d.getSize(),h=this.element.getScroll(),b=this.element.getSize(),c={x:f.x+j.x,y:f.y+j.y};["x","y"].each(function(k){if(g.contains(k)){if(c[k]>h[k]+b[k]){i[k]=c[k]-b[k];}if(f[k]<h[k]){i[k]=f[k];}}if(i[k]==null){i[k]=h[k];}if(e&&e[k]){i[k]=i[k]+e[k];}},this);if(i.x!=h.x||i.y!=h.y){this.start(i.x,i.y);}return this;},toElementCenter:function(e,f,h){f=f?Array.from(f):["x","y"];e=document.id(e);var i={},c=e.getPosition(this.element),d=e.getSize(),b=this.element.getScroll(),g=this.element.getSize();["x","y"].each(function(j){if(f.contains(j)){i[j]=c[j]-(g[j]-d[j])/2;}if(i[j]==null){i[j]=b[j];}if(h&&h[j]){i[j]=i[j]+h[j];}},this);if(i.x!=b.x||i.y!=b.y){this.start(i.x,i.y);}return this;}});function a(b){return(/^(?:body|html)$/i).test(b.tagName);}})();
