﻿String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
}


var myClass = new Class({ Implements: Chain });
var bHideListeAuthor = false;




function ChangeAutor(_elm) {
    var _select = $("author");
    if (typeof(loading)!='undefined') clearTimeout(loading);
    //loading=setTimeout("$('loading').setStyle('display', 'block')",200);
    var _txt = _select.value;
    new Request({
        url: "/Ressources/iTunes.aspx",
        data: { author: _txt.trim() },
        method: "get",
        onSuccess: function(responseText, responseXML) {
            if (typeof (loading) != 'undefined') clearTimeout(loading);
            $('loading').setStyle('display', 'none');
            $("listeIPOD").innerHTML = responseText;
        },
        onFailure: function() {
        clearTimeout(loading);
        $('loading').setStyle('display', 'none');
        }
    }).send();
}
var AuthorClass = new Class({

    Implements: [Chain],

    actions: new Hash({

        'author': 'author',
        'authorEntry': '#author .unAuteur'

    }),
    effects: [],

    initialize: function() {

    var oAuthor = $('author');
    oAuthor.addEvents({ "change": ChangeAutor });


    }

});
oSrc.addOnLoad(function() { oAuthor = new AuthorClass() });

