axt = {
    version : "0.003",
    base_style : "list",
    container : null,
    logo : null,
    body : null,
    basket : null,
    player : null,
    callback : null,
    tabs : null,
    width: "auto",
    height: "auto",
    tracks : false,//
    x: "http://www.levykauppax.fi",//
    limit : null,
    _t : null,
    _f : null,
    _isIE : false,
    _needs_scrolling : false,
    _container_class : "",
    _searches : [],
    _details : null,
    _start_height: null,
    _samples : [],
    _items : [],
    _playing : null,//
    _domain : "http://www.levykauppax.fi",//
    _loading : false,
    _current_search : null,
    _cache: {},
    
    init : function (id, settings) {
        if (!id) id = "ax-container";
        if (!document.getElementById) return;
        if (!document.getElementById(id)) return;
        //
        this.T = this._f;//
        this.container = document.getElementById(id);
        this.container.className = "ax-loading";
        this.container.style.position = "relative";
        var name = settings.shop ? settings.shop[1] : this.T["x"];
        if (settings.shop) this.x = this.x + "/" + settings.shop[0];
        var h = "<div class=\"ax-header\"><a href=\"" + this.x + "\" id=\"ax-logo\">" + name + "</a>";
        if (settings.tabs) {
            this.tabs = settings.tabs;
            h += "<ul class=\"ax-tabs\">";
            for (var i=0; i < settings.tabs.length; i++) {
                h += "<li><a href=\"#\" onclick=\"axt.getTab(" + i + ", this); return false;\" >" + settings.tabs[i]["text"] + "</a></li>";
            }
            h +="</ul>";
        }
        h += "</div><div class=\"ax-body\"></div><div id=\"ax-basket\"></div>";
        this.container.innerHTML = h;
        this._fixLinks();
        divs = this.container.getElementsByTagName("div");
        this.header = divs[0];
        this.body = divs[1];
        this.logo = document.getElementById("ax-logo");
        this.basket = document.getElementById("ax-basket");
        this._isIE = (document.all && (navigator.userAgent.indexOf('MSIE') != -1));
        if (settings) {
            if (settings.title)
                this.title = settings.title;                
            if (settings.width)
                this.width = settings.width;
            if (settings.font)
                this.font = settings.font;
            if (settings.margin)
                this.container.style.margin = settings.margin;
            if (settings.tracks)
                this.tracks = settings.tracks;
            if (settings.reminder)
                this.reminder = settings.reminder;
            if (settings.narrow) {
                this._container_class = "narrow";
                this.container.className += " narrow";
            }
            if (settings.limit)
                this.limit = settings.limit;
            if (parseInt(this.width) || parseInt(settings.width)) {
                this.container.style.width = parseInt(this.width) ? this.width + "px" : settings.width;
                var w = this.width - 2;
                if (this._isIE) w = w+2;
                this.body.style.width = w + "px";
                this.header.style.width = w + "px";
            }
            if (settings.height) this.height = settings.height;
            this.container.style.width = parseInt(settings.width) ? settings.width + "px" : this.width;
            this.body.style.width = parseInt(settings.width) ? settings.width + "px" : this.width;
            this.style = settings.style || this.base_style;
        }
        this.loadCss(this._domain + "/css/axt/" + this.style +".css?" + this.version);
        if (this._isIE) {
            this.header.style.zoom = 1;
            var ul = this.header.getElementsByTagName("ul");
            if (ul.length) ul[0].style.zoom = 1;
        }
    },
    
    play : function (url, el) {
        if (this._playing == el) {
            this.pause(el);
            return;
        }
        else if (this._playing) {
            this.pause(this._playing);
        }
        if (!this.player)
            this.player = window["ax_player"] ? window["ax_player"] : document.getElementById("ax_player");
            if (!this.player) return;
        if (this.player.GetVariable("file") != url) {
            this.player.SetVariable("autoStart", "true");
            this.player.SetVariable("file", url);
            this.player.GotoFrame(0);
            this.player.Play();
            this._playing = el;
            el.className = "playing";
            el.innerHTML = this.T['pause'];
        } else {
            this.player._play()
            this._playing = el;
            el.className = "playing";
            el.innerHTML = this.T['pause'];
        }
    },
    
    pause : function (el) {
        if (!this.player) return;
        this.player._pause();
        this._playing = null;
        el.className = "";
        el.innerHTML = this.T['play'];
    },

    _onstart : function (track) {
        var el = this.getTrackElement(track);
        if (el) el.className = "playing";
    },

    _onpause : function (track) {
        var el = this.getTrackElement(track);
        if (el) el.className = "";
    },
    
    _onfinish : function (track) {
        if (this._samples.length > 1) {
            for (var i=0; i < this._samples.length; i++) {
                var s = this._domain + this._samples[i];
                if (s == track && i == (this._samples.length - 1)) {
                    i = 0;
                    break;
                }
                else if (s == track){
                    i++;
                    break;
                }
            }
            var el = this.getTrackElement(this._samples[i]);
            this.play(this._samples[i], el);
        }
        if (this._playing) {
            el = this._playing;
            this._playing = null;
            el.className = "";
            el.innerHTML = this.T['play'];
        }
    },
    
    getTrackElement : function (url) {
        var tracks = this.body.getElementsByTagName("a");
        var el = null;
        for (var i=0; i<tracks.length; i++) {
            if (tracks[i].getAttribute("_url") == url) {
                el = tracks[i];
                break;
            }
        }
        return el;
    },
    // SEARCH
    get : function (search, callback) {
        if (!document.getElementById) return;
        var base = this._domain + "/api/products/?";
        if (search.length && this._searches.length == 0) {
            this._searches = search;
            this._current = 0;
            search = this._searches[0];
        }

        var params = [];
        if (search['artist'])
            params.push("artist=" + search['artist']);
        if (search['movie'])
            params.push("movie=" + encodeURIComponent(search['movie']));
        if (search['movies'])
            params.push("movies=" + search['movies']);
        if (search['product'])
            params.push("product=" + search['product']);
        if (search['products'])
            params.push("products=" + search['products']);
        if (search['type'])
            params.push("type=" + search['type']);
        if (this.limit)
            params.push("limit=" + this.limit);
        if (callback)
            this.callback = callback;
        params.push("callback=axt.loaded");
        params.push(this.version);
        
        this.load(base + params.join("&"));
        this._current_search = search;
        
        if (this._searches.length > 1) {
            var nav = [];
            nav.push("<a href=\"" + this.x + "\"  id=\"ax-logo\">" + this.T["x"]+ "</a>");
            nav.push("<div class=\"ax-nav\">");
            if (this._current == 0) {
                nav.push("<span class=\"ax-prev\"> &lt; </span>");
            } else {
                nav.push("<a href=\"#\" class=\"ax-prev\" onclick=\"axt.getPrevious(); return false;\">&lt;</a>");
            }
            if (this._current == (this._searches.length - 1)) {
                nav.push("<span class=\"ax-next\"> &gt; </span>");
            } else {
                nav.push("<a href=\"#\" class=\"ax-next\"  onclick=\"axt.getNext(); return false;\">&gt;</a>");
            }
            nav.push("</div>");
            this.header.innerHTML = nav.join("");
            this._fixLinks(this.header);
        }        
    },
    
    getNext : function () {
        this.hideBasket();
        this._current++;
        if (this._current == this._searches.length)
            this._current = 0;
        this.get(this._searches[this._current]);        
    },
    
    getPrevious : function () {
        this.hideBasket();
        this._current--;
        if (this._current < 0)
            this._current = this._searches.length - 1;
        this.get(this._searches[this._current]);
    },
    
    getTab : function (i) {
        var tabs = this.header.getElementsByTagName("li");
        for (var e = 0; e < tabs.length; e++) {
            tabs[e].className = "";
        }
        tabs[i].className = "ax-current";
        this.get(this.tabs[i]);
    },
        
    details: function (id) {
        var item = document.getElementById("ax-" + id);
        if (!item) return;
        if (item.className == "ax-current") {
            item.className = "";
        }
        else {
            var base = this._domain + "/api/products/?";
            var params = [];
            params.push("product=" + id);
            params.push("callback=axt.loaded");
            params.push("random=" + this.random);
            this.load(base + params.join("&"));

            var items = this.container.getElementsByTagName("li");
            for (var i=0; i < items.length; i++) {
                items[i].className = "";
            }
        }
    },
    
    hideBasket : function () {
        this.hide(this.basket);
    },
    
    update : function () {
        var base = this._domain + "/api/basket/?add="; 
        var total = 0;
        var ids = []
        
        for (var i=0; i < this._items.length; i++) {
            total += (this._items[i][2] * this._items[i][1]);
            ids.push([this._items[i][0], this._items[i][3]]);
        }
        total = this.formatPrice(total/100);
        var return_url = document.location.href;
        if (window.parent != window) {
            try {
                return_url = window.parent.document.location.href;
            } catch (e) {}
        }
        var prods = [];
        for (var i=0; i<ids.length; i++) {
                prods.push(ids[i][1] ? ids[i][0] +":"+ ids[i][1] : ids[i][0]);
        }
        var html = ["<div><p>" + this.T['added'] + "</p>"];
        html.push("<p>" + this.T['total'] + ": " + total + "&euro;</p>")
        html.push("<a href=\"#\" onclick=\"axt.hideBasket(); return false;\" class=\"ax-close\">X</a>");
        html.push("<p><strong><a href=\"" + base + prods.join(',') + "&return=" + return_url + "\">&raquo; " + this.T['checkout'] + "</a></strong></p>");
        if (this.tracks)
            html.push("<p><a href=\"#\" onclick=\"axt.hideBasket(); return false;\">&raquo; "+ this.T['or_continue'] + "</a></p>");
        html.push("<p class=\"ax-note\">" + this.T['powered'] + "</p></div>");
        this.basket.innerHTML = html.join("");
        this._fixLinks(this.basket);
        w = this.body.offsetWidth - 3;
        if (document.all && (navigator.userAgent.indexOf('MSIE') != -1)) w = w+2;        
        this.basket.style.width = w + "px";
        this.show(this.basket);

        this.basket.style.height = "auto";
        if (parseInt(this.container.offsetHeight) < parseInt(this.basket.offsetHeight)) {
            this.container.style.height = parseInt(this.basket.offsetHeight) + "px";
            this.body.style.height = parseInt(this.basket.offsetHeight) + "px";
        }
        this.basket.style.height = this.container.offsetHeight - 6 + "px";
    },
    
    add : function (id, track) {
        var ids = (typeof id == "object") ? id : [id];
        
        for (var i=0; i<ids.length; i++) {
            var found = false;
            for (var e=0; e < this._items.length; e++) {
                if (track) {
                    if (this._items[e][0] == ids[i] && this._items[e][3] == track)
                        found = true;
                } else {
                    if (this._items[e][0] == ids[i]) {
                        found = true;
                    }                
                }
            }
            if (!found) {
                var s = null;
                if (ids.length == 1){
                    var find = track ? ids[i]+":"+track : ids[i];
                    s = document.getElementById("ax-price-" + find).innerHTML;                
                }
                else if (i == 0) {
                    var find = ids.join(',')
                    s = document.getElementById("ax-price-" + find).innerHTML;
                }
                var price = s ? this.getPrice(s) : 0;
                this._items.push([ids[i], 1, price, track]);
            }
        }
        this.update()
    },
    
    getPrice : function (s) {
        return parseFloat(s.split(' ')[0].replace(',', '.'))*100;
    },
    
    formatPrice : function (f) {
        s = String(f).replace('.', ',');
        if (s.split(",").length < 2) 
            return s + ",00";
        else if (s.split(",")[1].length < 2) 
            return s + "0";
        else
            return s;
    },
    
    getDate : function (s) {
        var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
                "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
                "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
        var d = s.match(new RegExp(regexp));
        
        var offset = 0;
        var date = new Date(d[1], 0, 1);
        
        if (d[3]) { date.setMonth(d[3]); }
        if (d[5]) { date.setDate(d[5]); }
        if (d[7]) { date.setHours(d[7]); }
        if (d[8]) { date.setMinutes(d[8]); }
        if (d[10]) { date.setSeconds(d[10]); }
        if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
        if (d[14]) {
            offset = (Number(d[16]) * 60) + Number(d[17]);
            offset *= ((d[15] == '-') ? 1 : -1);
        }
        
        offset -= date.getTimezoneOffset();
        return date;
    },

    formatDate : function (s) {
        var d = this.getDate(s);
        return d.getDate() +"."+ d.getMonth() + ".";
    },
    
    toggleTracks : function (p) {
        if (!this._details)
            this._details = p.parentNode.parentNode;
        el = this._details.getElementsByTagName("ul")[0];
        if (p.className != "opened") {
            this.header.style.display = "none";
            p.className = "opened";
            this.slideDown(el, 1000);
        }
        else {
            this.header.style.display = "block";
            p.className = "";
            this.slideUp(el, 1000);
        }
    },
    
    show : function (el) {
        el.style.display = "block";
    },

    hide : function (el) {
        el.style.display = "none";
    },
    
    slideDown : function (el, time) {
        if(this._timer) {
            window.clearInterval(this._timer);
            this._timer = null;
        }
        this._slide(el, "down");
	}, 
	
	slideUp : function (el, time) {
        if(this._timer) {
            window.clearInterval(this._timer);
            this._timer = null;
        }
        this._slide(el, "up")
	},
	
	_slide : function (el, dir) {
        this._endHeight = parseInt(el.style.height);
        var details = parseInt(this._details.offsetHeight);

        if (isNaN(this._endHeight)) {
            el.style.visibility = "hidden";
            el.style.display = "block";
            el.style.height = "auto";
            this._endHeight = parseInt(el.offsetHeight);
            el.style.visibility = "visible";
        }
        if (dir == 'down') {
            var maxHeight = this.height - (parseInt(this.header.offsetHeight) + details);
            if (this._endHeight > maxHeight) {
                this.container.style.height = (this.height + (this._endHeight-maxHeight)) + "px";
                this.body.style.height = (this.height + (this._endHeight-maxHeight)) + "px";
            }
        } else {
            this.container.style.height = this.height + "px";
            this.body.style.height = this.height + "px";
        }
        this._startTime = new Date().getTime();

        if (dir == "down"){
            el.style.height = "1px";
        }
        
        el.style.display = "block";
        var t = 100;
        this._timer = window.setInterval(function () { axt._slider(el, dir, t)}, 25);
	},
	
	_slider : function (el, dir, time) {
        var elapsed = new Date().getTime() - this._startTime;
        
        if (elapsed > time) {
            window.clearInterval(this._timer);
            
            if(dir == "up")
                el.style.display = "none";
            
            el.style.height = this._endHeight + "px";
        }
        else {
            var d = Math.round(this.curve(elapsed / time) * this._endHeight);
            if(dir == "up")
                d = this._endHeight - d;
            el.style.height = d + "px";
        }
	},
	
	curve : function (i) {
	    return (1-Math.cos(i*Math.PI)) / 2;
	},
	
    remove : function (id) {
        for (var i=0; i < this._items.length; i++) {
            if (this._items[i][0] == id)
                this._items[i] = null;
        }        
        this.update();
    },

    loadCss: function(url) {
      css = document.createElement("link");
      css.rel = "stylesheet";
      css.type = "text/css";
      css.href = url;
      document.getElementsByTagName('head')[0].appendChild(css);
    },
    
    _get_cache_key : function (url) {
        for (var i=0; i < this._searches.length; i++) {
            if (this._searches[i] == url)
                break;
        }
        return i
    },
    
    load : function (url) {
        this._loading_url = url;
        if (this._cache[url]) {
            this.loaded(this._cache[url]);
            return;
        }
        this.container.className += " ax-loading";
        script = document.createElement("script");
        script.setAttribute("type", "text/javascript");
        script.setAttribute("src", url);
        document.getElementsByTagName('head')[0].appendChild(script);
    },
    
    loaded : function (data) {
        if (!this._cache[this._loading_url]) {
            this._cache[this._loading_url] = data;
            this._loading_url = null;
        }
        this.container.className = this._container_class;
        this.body.style.height = "auto";
        this.container.style.height = 1024 + "px";
        
        if (data.products) {
            this.body.innerHTML = this.createHTML(data);
            this._fixLinks(this.body);
        }
        else if (this.reminder) {
            this.body.innerHTML = this.reminderHTML(data);
            this._fixLinks(this.body);            
        }
        
        if (data.product) {
            var current_item = document.getElementById("ax-" + data.product.id);
            var details = current_item.getElementsByTagName("div")[0];

            current_item.className = "ax-current";
            details.innerHTML = this.createHTML(data);
            this._fixLinks(details)
        }
                
        if (this.callback) {
            this.callback();
            this.callback = null;
        }
        var h = this.body.offsetHeight;
        if (this._start_height && this._start_height > h)
            this.body.style.height = this._start_height + "px";
        if (!this._start_height) this._start_height = 100;
        this.container.style.height = "auto";
        if (this._isIE) {
            this.body.style.zoom = 1;
            this.container.style.zoom = 1;
            var li = this.body.getElementsByTagName("li");
            for (var i = 0; i < li.length; i++) {
                li[i].style.zoom = 1;
            }
        }
    },
    
    _tag : function (tag, root) {
        if (!root) root = this.container;
        return root.getElementsByTagName(tag);
    },
    
    _fixLinks : function (root) {
        if (!root) root = this.container;
        var links = root.getElementsByTagName("a");
        for (var i=0; i < links.length; i++)
            links[i].target = "_top";        
    },
    
    _flash : function (url) {
        var _flash_embed = "<embed id=\"ax_player\" width=\"14\" height=\"14\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\" src=\"" + this._domain + "/images/player.swf?file=" + url + "&" + this.version + "\"/>";
        var _flash_object = "<object id=\"ax_player\" width=\"14\" height=\"14\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"" + this._domain + "/images/player.swf?file=" +  url + "&" + this.version + "\"/><param name=\"allowscriptaccess\" value=\"always\"/><param name=\"wmode\" value=\"transparent\"/></object>";
        return (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) ? _flash_embed : _flash_object;
    },
    
    showReminderForm : function (el) {
        var f = document.getElementById("ax-reminder-form");
        //if (f.style.display == "block") {
        //    f.style.display = "none";
        //} else {
        f.style.display = "block";
        document.getElementById("ax-email").focus();
        //}
    },

    reminderAdded : function (data) {
        if (!data["error"]) {
            var el = document.getElementById("ax-reminder-form");
            el.innerHTML = this.T["reminder_added"];
        }
        else if (data["error"]) {
            var el = document.getElementById("ax-reminder-form");
            el.innerHTML = "<p class=\"ax-error\">" + this.T[data["error"]] + "</p>" + el.innerHTML;
        }
        else {
            var el = document.getElementById("ax-email");
            el.style.backgroundColor = "#ffc";
            el.focus();
        }
    },
    
    sendReminder : function (el) {
        if (this._current_search["movie"]) {
            t = "movie";
            s = this._current_search["movie"].replace("|", " --- ");
        }
        else if (this._current_search["artist"]) {
            t = "artist";
            s = this._current_search["artist"];
        }
        var email = document.getElementById("ax-email").value;
        var params = [];
        params.push("email=" + escape(email));
        params.push("search=" + encodeURIComponent(s));
        params.push("type=" + t);
        params.push("callback=axt.reminderAdded");
        params.push("domain=" + escape(document.location.href));
        this.load(this._domain + "/api/reminder/add/?" + params.join("&"));
        return false;
    },
    
    reminderHTML : function (data) {
        var html = [];
        var s = "";
        if (this._current_search["movie"])
            s = this.T["movie"] + this._current_search["movie"].replace("|", " - ");
        else if (this._current_search["artist"])
            s = this._current_search["artist"];
        html.push("<div class=\"ax-reminder\" onclick=\"axt.showReminderForm(this);\"><p>" + this.T["add_reminder"].replace("%s", " <em>"+ s+"</em>") + "</p>");
        html.push("<form id=\"ax-reminder-form\" onsubmit=\"axt.sendReminder(this); return false;\"><div>");
        html.push("<label for=\"ax-email\">" + this.T["email"] + "</label>");        
        html.push("<input type=\"text\" class=\"text\" id=\"ax-email\" name=\"ax-email\" value=\"\">");
        html.push("<span><input type=\"submit\" class=\"button\" value=\"" + this.T["add"] + "\"></span>");
        html.push("</div></form></div>");
        return html.join('');
    },
    
    createHTML : function (data) {
        var html = [];
        var total_price = 0;
        
        if (data.products) {
            p = data.products;
            html.push("<ul class=\"ax-products\">");
            for (var i=0; i < p.length; i++) {                
                var cover = p[i].cover;
                
                style = (i == 0) ? "class=\"ax-first\" " : "";
                html.push("<li id=\"ax-" + p[i].id + "\" " + style + ">");
                html.push("<div class=\"ax-cover\"><img src=\"" + this._domain + cover + "\" class=\"ax-cover\" alt=\"\"/></div>");
                html.push("<div class=\"ax-details\">");
                style = "";
                if (this.font) style = " style=\"font-size:" + parseInt(this.font)+ "px \"";
                if (data.artist) {
                    if (!this.tracks)
                        html.push("<h3 class=\"ax-product\"" + style +"><a href=\"" + this._domain + p[i].url + "\">" + data.artist.name + ": " + p[i].title + "</a></h3>");
                    else if (i == 0)
                        html.push("<h3 class=\"ax-product\"" + style +">" + data.artist.name + "</h3>");
                } else {
                    html.push("<h3 class=\"ax-product\"" + style +"><a href=\"" + this._domain + p[i].url + "\">" + p[i].title + "</a></h3>");
                }
                if (p[i].tracks && p[i].tracks.length) {
                    html.push("<ul class=\"ax-tracks\">");
                    t = p[i].tracks;
                    for (var e=0; e < t.length; e++) {
                        var alt = (e % 2 == 0) ? " class=\"ax-alternate\"" : "";
                        var sample_link = null;
                        if (t[e].sample) {
                            sample_link = "<a href=\"#\" _url=\"" + t[e].sample + "\" onclick=\"axt.play('" + t[e].sample + "', this); return false;\" title=\"" + this.T['play'] + "\">" + this.T['play'] + "</a>";
                            this._samples.push(t[e].sample);
                        }
                        html.push("<li" + alt + ">");
                        if (this.tracks && sample_link)
                            html.push(sample_link + " ");
                        else
                            html.push((e+1) + ". ");
                        html.push("<span class=\"ax-title\">" + t[e].title + " (" + t[e].duration + ")</span>");

                        if (sample_link && !this.tracks) {
                            html.push(" " + sample_link);
                        }
                        if (t[e].price && this.tracks) {
                            total_price += this.getPrice(t[e].price);
                            html.push("<span class=\"ax-buy-track\"><span id=\"ax-price-"+ p[i].id+":"+(e+1)+"\" class=\"ax-price\">"  + t[e].price + "</span>");
                            html.push("<a href=\"#\" class=\"ax-buy\" onclick=\"axt.add('" + p[i].id + "'," + (e+1) + "); return false;\">" + this.T['buy'] + "</a></span>");
                        }
                        html.push("</li>");
                    }
                    html.push("</ul>");
                }
                if (!this.tracks || i == p.length-1) {
                    if (p[i].release_in && p[i].type == 'MP3')
                        html.push("<div class=\"ax-info ax-unreleased\"><p>");
                    else 
                        html.push("<div class=\"ax-info\"><p>");

                    html.push("<span class=\"ax-type\">" + p[i].type + "</span>");
                    if (p[i].restriction)
                        html.push("<span class=\"ax-restriction\">" + p[i].restriction + "</span>");
                    if (p[i].release_in && p[i].type == 'MP3') {
                        html.push("<span class=\"ax-released\">" + this.T['released_in_1'] + p[i].release_in + this.T['released_in_2'] + "</span></p>");
                    } else {
                        if (p[i].release)
                            html.push("<span class=\"ax-released\">" + this.T['released'] + ": " + this.formatDate(p[i].release)  + "</span>");
                        if (this.tracks) {
                            var ids = [];
                            for (var y=0; y < p.length; y++)
                                ids.push(p[y].id);
                            if (total_price)
                                html.push("<span id=\"ax-price-"+ ids.join(",")+"\" class=\"ax-price\">" +  this.formatPrice(total_price) + " &euro; </span> ");
                            for (var y=0; y < ids.length; y++)
                                ids[y] = "'" + ids[y] + "'";
                            html.push("<a href=\"#\" class=\"ax-buy  ax-all\" onclick=\"axt.add([" + ids.join(',') + "]); return false;\">" + this.T['all'] + "</a></p>");
                        }
                        else {
                            html.push("<span id=\"ax-price-"+ p[i].id+"\" class=\"ax-price\">" + p[i].price + "</span> ");
                            html.push("<a href=\"#\" class=\"ax-buy\" onclick=\"axt.add('" + p[i].id + "'); return false;\">" + this.T['buy'] + "</a></p>");
                        }
                    }
                    
                    if (this._samples.length)
                        html.push(this._flash(this._samples[0]));
                    html.push("</div>");
                }
                html.push("</div></li>");
            }
            html.push("</ul>");
            this.logo.href = this.x + (data.artist ? data.artist.url : p[0].url);
        }
        return html.join("");
    },
    _f : {
        buy : "Osta",
        all : "Kaikki",
        add : "Lis&auml;&auml;",
        email : "S&auml;hk&ouml;postiosoite",
        play : "Kuuntele",
        pause : "Sammuta",
        products : "tuotteet",
        movie : "Leffa: ",
        total : "Yhteens&auml;",
        checkout : "Siirry kassalle",
        released : "ilmestyy",
        released_in_1 : "Viel&auml; ",
        released_in_2 : "",
        or_continue : "tai jatka ostoksia",
        add_reminder : "Ilmoita minulle kun %s tulee myyntiin Levykauppa &Auml;x&auml;&auml;n.",
        reminder_added : "Muistutus lis&auml;tty",
        adding_reminder_failed : "Valitettavasti muistutusta ei voitu lis&auml;t&auml;.", 
        x : "Levykauppa &Auml;x",
        cds : "CD:t Levykauppa &Auml;x:st&auml;",
        added : "Tuote lis&auml;tty ostoskassiin",
        powered : "Maksu suoritetaan Levykauppa &Auml;x:n sivuilla"
    }, 
    _e : {
        buy : "Buy",
        all : "All",
        add : "Add",
        play : "Play",
        email : "Email address",
        pause : "Pause",
        total : "Total",
        x : "Record Shop X",
        movie : "Movie: ",
        released : "release date",
        released_in_1 : "In ",
        released_in_2 : "",
        or_continue : "or continue shopping",
        checkout : "Proceed to Checkout",
        add_reminder : "Add a reminder for search: ",
        adding_reminder_failed : "Couldn't add that reminder.", 
        reminder_added : "Reminder added",
        cds : "CDs from Record Shop X",
        added : "Product added to your shopping cart",
        powered : "The payment is done on Levykauppa &Auml;x web site"
    }
};

