



/*
*/
/*
*/
var eddy; if (!eddy) eddy = {};
/*
*/
/**/
eddy.searchFocuses = {};
eddy.searchMouses = {};
eddy.focusSearchElement = function(e) {
eddy.searchFocuses[e.id] = true;
eddy.setSearchVisibility();
};
eddy.blurSearchElement = function(e) {
eddy.searchFocuses[e.id] = false;
eddy.setSearchVisibility();
};
eddy.focusSearchField = function(e) {
eddy.searchFocuses[e.id] = true;
eddy.clearSearch();
eddy.setSearchVisibility();
};
eddy.blurSearchField = function(e) {
eddy.searchFocuses[e.id] = false;
eddy.unclearSearch();
eddy.setSearchVisibility();
};
eddy.overSearch = function(e) {
eddy.searchMouses[e.id] = true;
eddy.setSearchVisibility();
};
eddy.outSearch = function(e) {
eddy.searchMouses[e.id] = false;
eddy.setSearchVisibility();
};
eddy.setSearchVisibility = function(e) {
var visible = false;
for(var k in eddy.searchMouses) {
if(eddy.searchMouses[k]) {
visible = true;
break;
}
}
if(!visible) {
for(k in eddy.searchFocuses) {
if(eddy.searchFocuses[k]) {
visible = true;
break;
}
}
}
eddy.e('searchFor').style.display = visible ? 'block' : 'none';
};
eddy.initializeSearch = function() {
};
/**/
eddy.jqInit = [];
if(typeof($) == "undefined") {
$ = function(a) {
if(a == "document") {
return {"ready": $};
} else if(typeof(a) == "function") {
eddy.jqInit.push(a);
}
};
}
/*
*/
/*
*/
eddy.terminator = false; /*  */
eddy.initializePage = function() {
eddy.showBasketValue();
if (eddy.loggedIn()) {
var pref = eddy.cookieValue('pref');
if (pref && pref.indexOf(":p=t:") != -1) {
eddy._isBandManager = true;
if(eddy.e('thisIsTheOldPage')) eddy.e('projectslink').style.display = 'block';
}
}
if(eddy.e('thisIsTheOldPage')) {
if (eddy.loggedIn()) {
eddy.e('loggedin').style.display = 'block';
eddy.e('loggedin2').style.display = 'block';
} else {
eddy.e('notloggedin').style.display = 'block';
}
eddy.e('navi').style.visibility = 'visible';
} else if(eddy.e('thisIsTheNewPage')) { /*  */
eddy.e('profilelisthover').onmouseover = eddy.profilelisthover;
eddy.showLoginName();
eddy.initializeSearch();
if(eddy.loggedIn()) {
$('li.notloggedin').css('display', 'none');
$('li.loggedin').css('display', 'block');
}
}
for (var n in eddy.scrollbars)
eddy.scrollbars[n].startscroll();
eddy.initGalleryChannels();
if (eddy.initialize) eddy.initialize();
eddy._initStarted = true;
for(n in eddy._initers)
eddy._initers[n]();
eddy._initEnded = true;
/*   */
var poll_dynamic_js = false;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/ed/js/terminator.js';
document.getElementsByTagName('head')[0].appendChild(script);
poll_dynamic_js = true;
if(poll_dynamic_js)
eddy.pollDynamicJS();
};
eddy.profilelisthover = function() {
var profilelistElement = this;
var addProfilesToList = function() {
/**/
if(eddy.e('profilelistwait')) { //do this only if the waiting text exists still
eddy.e('profilelistwait').parentNode.removeChild(eddy.e('profilelistwait'));
for(var i in eddy.profiles) {
var profile = eddy.profiles[i];
$("#profilelist").append("<li><a href='/" + profile.url + "'>" + profile.name + "</a></li>");
}
}
profilelistElement.onmouseover = null;
};
if(!eddy.profiles)
eddy.loadProfiles(addProfilesToList);
else
addProfilesToList();
};
eddy.loadProfiles = function(cb) {
eddy.asyncJson("/ed/profile/get_list", function(response) {
eddy.profiles = response.profiles;
if(cb)
cb();
});
};
/*  */
/*
*/
eddy.pollDynamicJS = function() {
if(!eddy.terminator) {
setTimeout("eddy.pollDynamicJS()", parseInt('50'));
} else {
for(var i in eddy.jqInit) {
eddy.jqInit[i]();
}
}
};
/**/
eddy.logError = function(msg) {
}
/**/
eddy.msgHttp='http://fi.equaldreams.com';
eddy.msgHttps='https://fi.equaldreams.com';
/**/
eddy.getPosition = function(it) {
var x=0, y=0;
while (it.offsetParent) {
x += it.offsetLeft;
y += it.offsetTop;
it = it.offsetParent;
}
if (it.offsetLeft && it.offsetTop) {
x += it.offsetLeft;
y += it.offsetTop;
}
return {x:x,y:y};
};
/*  */
eddy.getWindowWidth = function() {
var x = 0;
if (self.innerWidth)
x = self.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
x = document.documentElement.clientWidth;
else if (document.body)
x = document.body.clientWidth;
return x;
};
/*  */
eddy.getWindowHeight = function() {
var y = 0;
if (self.innerHeight)
y = self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
y = document.documentElement.clientHeight;
else if (document.body)
y = document.body.clientHeight;
return y;
};
eddy.node = function(s, n) {
var x = s.getElementsByTagName(n);
if (!x) return null;
x = x[0];
if (!x) return null;
x = x.firstChild;
if (!x) return null;
return x.nodeValue;
};
eddy.setdescr = function(id, x) {
eddy.e(id).innerHTML = x;
};
eddy.adddescr = function(id, x) {
eddy.e(id).innerHTML += x;
};
eddy.addescr = eddy.adddescr; /*  */
eddy.reAmp = /&/g;
eddy.reLt = /</g;
eddy.reGt = />/g;
eddy.reQuot = /"/g;
eddy.reAllSpace = /^\s*$/;
/**/
eddy.escapeHtml = function(s) {
/*  */
s = "" + s;
if (!s) return "";
s = s.replace(eddy.reAmp, "&amp;");
s = s.replace(eddy.reLt, "&lt;");
s = s.replace(eddy.reGt, "&gt;");
/*  */
s = s.replace(eddy.reQuot, "&quot;");
return s;
};
eddy.cookieValue = function(name) {
if (!document.cookie) return;
var cookies = document.cookie.split(';');
var nameeq = name + "=";
for (var n in cookies) {
var cookie = cookies[n];
while (cookie.charAt(0) == ' ')
cookie = cookie.substring(1, cookie.length);
if (cookie.indexOf(nameeq) == 0)
return cookie.substring(nameeq.length, cookie.length);
}
return null;
};
eddy.urlAnchor = function(url) {
url = ""+url;
if(!url || url.length <= 0 || url.indexOf("#") < 0)
return;
return url.substring(url.indexOf("#")+1);
};
eddy.anchor = function() {
if(!window || !window.location)
return;
return eddy.urlAnchor("" + window.location);
};
/**/
/*  */
eddy.e = function(n) {
return document.getElementById(n);
};
/*  */
eddy.query = function(expression, context) {
var results = [];
jQuery(expression, context).each(function() {
results.push(this);
});
if(results.length > 1) {
eddy.logError("wtf: more than 1 result in eddy.query, expr = \"" + expression + "\"\n\nreturning null");
return null;
} else if(results.length == 1) {
return results[0];
} else {
return null;
}
};
/*  */
eddy.queryMulti = function(expression, context) {
var results = [];
jQuery(expression, context).each(function() {
results.push(this);
});
return results;
};
/*  */
eddy.parentSearch = function(domNode, searchClass, tagName) {
if(!domNode) return;
domNode = domNode.parentNode;
while(domNode &&                                                                        
((searchClass && (" " + domNode.className + " ").indexOf(" " + searchClass + " ") == -1) || 
(tagName && domNode.tagName != tagName)))                                      
domNode = domNode.parentNode;
return domNode;
};
/**/
eddy.getElementsByClass = function(searchClass, domNode, tagName) {
if (domNode == null) domNode = document;
if (tagName == null) tagName = '*';
var el = new Array();
var tags = domNode.getElementsByTagName(tagName);
var tcl = " "+searchClass+" ";
var i,j;
for(i=0,j=0; i<tags.length; i++) {
var test = " " + tags[i].className + " ";
if (test.indexOf(tcl) != -1)
el[j++] = tags[i];
}
return el;
};
/**/
eddy.clearHint = function(f, v) {
if (f.value == v) f.value = '';
}
/*  */
eddy.clearHint2 = function(f, v, o) {
if (f.value == v) {
f.value = '';
if(!f.onblur) {
f.onblur = function() {
eddy.unclearHint2(f, v, o);
}
}
}
};
eddy.unclearHint2 = function(f, v, o) {
if (eddy.isEmpty(f.value)) {
f.value = v;
if(!f.onfocus) {
f.onfocus = function() {
eddy.clearHint2(f, v);
};
}
}
};
/*  */
eddy.onFocusClearHint = function(element, hint) {
if(hint == null)
hint = element.value;
var oldOnFocus = element.onfocus;
element.onfocus = function() {
if(element.value == hint)
element.value = '';
if(oldOnFocus) {
element.onfocus = oldOnFocus;
oldOnFocus();
} else {
element.onfocus = null;
}
};
};
/**/
eddy.submitform = function(fid, actName, actVal) {
if (actName) {
var actDom = eddy.e(fid + "action");
actDom.name = actName;
if(actVal) actDom.value = actVal;
}
eddy.e(fid).submit();
};
eddy.submitformdom = function(form, actDom, actName, actVal) {
if (actDom && actName) {
actDom.name = actName;
if(actVal) actDom.value = actVal;
}
form.submit();
};
/*  */
eddy.submitajahform = function(e, fid, actName, actVal) {
if(actName) eddy.submitajahformdom(e, eddy.e(fid), eddy.e(fid + "action"), actName, actVal);
else eddy.submitajahformdom(e, eddy.e(fid));
};
/*  */
eddy.submitajahformdom = function(e, f, actDom, actName, actVal) {
if (actDom && actName) {
actDom.name = actName;
if(actVal) actDom.value = actVal;
}
if(typeof(e) == "string")
e = eddy.e(e);
/*  */
var postdata = jQuery(f).serialize();
var url = f.action;
if(f.method.toUpperCase() == "GET") {
if(url.indexOf("?") == -1)
url = url + "?" + postdata;
else
url = url + "&" + postdata;
postdata = null;
} else if(f.method.toUpperCase() == "POST") {
/*  */
} else {
eddy.logError("wtf: form has unsupported method: \"" + f.method);
}
eddy.async(url, postdata, f.method, function(response) {
e.innerHTML = response.responseText;
});
};
/*  */
eddy.submitvalueform = function(fid, val) {
if (val) eddy.e(fid + "action").value = val;
eddy.e(fid).submit();
};
/*  */
eddy.submitvalue2form = function(fid, val1, val2) {
if (val1) eddy.e(fid + "action").value = val1;
if (val2) eddy.e(fid + "action2").value = val2;
eddy.e(fid).submit();
};
eddy.clearForm = function(form) {
if(typeof(form) == "string")
form = eddy.e(form);
var list = form.getElementsByTagName('input');
var e, n;
for (n = 0; e = list.item(n++); ) {
if (e.getAttribute('type') == 'text')
e.value = '';
else if (e.getAttribute('type') == 'checkbox')
e.checked = false;
}
list = form.getElementsByTagName('select');
for (n = 0; e = list.item(n++); )
e.options.selectedIndex = 0;
};
/**/
/*  */
eddy.slideToggle = function(element)
{
if(eddy.isShown(element))
eddy.slideUp(element);
else
eddy.slideDown(element);
}
eddy.slideUp = function(element)
{
if(typeof(element) == "string")
element = eddy.e(element);
$(element).slideUp(150);
}
eddy.slideDown = function(element)
{
if(typeof(element) == "string")
element = eddy.e(element);
$(element).slideDown(150);
}
eddy.hide = function(element)
{
if(typeof(element) == "string")
element = eddy.e(element);
$(element).hide();
}
eddy.show = function(element)
{
if(typeof(element) == "string")
element = eddy.e(element);
$(element).show();
}
eddy.isShown = function(element)
{
if(typeof(element) == "string")
element = eddy.e(element);
return $(element).is(":visible");
}
/**/
eddy.orange = function(a, b) {
return '<span class="orange">'+eddy.escapeHtml(a)+'</span> '+eddy.escapeHtml(b)+'<br/>';
};
/**/
eddy.cloneAssociativeArray = function(ar) {
var key, result = new Object();
for (key in ar) result[key] = ar[key];
return result;
};
eddy.reTrim = /^\s*(.*)\s*$/g;
eddy.trim = function(s) {
return s.replace(eddy.reTrim, "$1");
};
eddy.isEmpty = function(s) {
if (!s) return true;
return eddy.reAllSpace.test(s);
};
eddy.reSpaceS = /^\s+/;
eddy.reSpaceE = /\s+$/;
eddy.reSpaceM = /\s+/g;
eddy.simplifySpaces = function(s) {
if (!s) return s;
s = s.replace(eddy.reSpaceS, "");
s = s.replace(eddy.reSpaceE, "");
s = s.replace(eddy.reSpaceM, " ");
return s;
};
eddy.startsWith = function(s, p) {
if(!p) return false; /*  */
var m = p.length;
if (!s || s.length < m) return false;
for (var n = 0; n < m; n++)
if (s.charAt(n) != p.charAt(n))
return false;
return true;
};
eddy.removeKnownPrefix = function(s, p) {
if(!eddy.startsWith(s, p))
eddy.logError("The following string:\n" + s + "\ndoes not start with:\n" + p);
return s.substring(p.length);
};
eddy.removePrefix = function(s, p) {
if(eddy.startsWith(s, p))
return s.substring(p.length);
else
return s;
};
/**/
eddy.addEvent = function(obj, type, func, useCapture) {
if (obj.addEventListener) {
obj.addEventListener(type, func, useCapture);
return true;
}
if (obj.attachEvent)
return obj.attachEvent("on" + type, func);
obj["on" + type] = func;
};
/**/
eddy.doReorderAlbums = function(band, order, wait, ok, fail) {
var reqUrl = eddy.params("/ed/reorderalbums.txt", {"artist": band, "order": order, "playlist": "albums"});
eddy.asyncTx("ajat_reorder_albums", reqUrl, function(response) {
var reply = eddy.trim(response.responseText);
if (eddy.latestAlbumOrder == order) {
eddy.albumReordering = false;
if (reply == "success") ok(); else fail();
} else {
eddy.doReorderAlbums(band, eddy.latestAlbumOrder, wait, ok, fail);
}
});
};
eddy.doReorderSeeAlso = function(band, order, wait, ok, fail) {
var reqUrl = eddy.params("/ed/reorderalbums.txt", {"artist": band, "order": order, "playlist": "seeAlso"});
eddy.asyncTx("ajat_reorder_albums", reqUrl, function(response) {
var reply = eddy.trim(response.responseText);
if (eddy.latestSeeAlsoOrder == order) {
eddy.seeAlsoReordering = false;
if (reply == "success") ok(); else fail();
} else {
eddy.doReorderSeeAlso(band, eddy.latestSeeAlsoOrder, wait, ok, fail);
}
});
};
eddy.albumReordering = false;
eddy.seeAlsoReordering = false;
eddy.latestAlbumOrder = "";
eddy.latestSeeAlsoOrder = "";
eddy.reorderAlbums = function(band, order, wait, ok, fail) {
eddy.latestAlbumOrder = order;
if (eddy.albumReordering) return;
eddy.albumReordering = true;
wait();
eddy.doReorderAlbums(band, order, wait, ok, fail);
};
eddy.reorderSeeAlso = function(band, order, wait, ok, fail) {
eddy.latestSeeAlsoOrder = order;
if (eddy.seeAlsoReordering) return;
eddy.seeAlsoReordering = true;
wait();
eddy.doReorderSeeAlso(band, order, wait, ok, fail);
};
/**/
eddy.clearLogin = function() {
var name = eddy.e("menuloginname");
if (name.value == 'käyttäjänimi') {
name.value = '';
eddy.e("menupassword").value = '';
}
};
eddy.unclearLogin = function() {
eddy.e("menuloginname").value = 'käyttäjänimi';
eddy.e("menupassword").value = 'pass';
};
eddy.clearSearch = function() {
eddy.clearHint2(eddy.e('searchbar'), 'Etsi');
};
eddy.unclearSearch = function() {
eddy.unclearHint2(eddy.e('searchbar'), 'Etsi');
};
/**/
/*  */
eddy.addRecommend = function(song_id, album_id, artist_id) {
var url = "/ed/addrecommend.txt?song=" + song_id + "&album=" + album_id + "&artist=" + artist_id;
eddy.asyncTx("ajat_add_recommend", url, function(response) {
var reply = eddy.trim(response.responseText);
var msg;
/*  */
if (reply == 'login')
msg = '<a href="https://fi.equaldreams.com/ed/login.html">Kirjaudu</a> ensin palveluun.<br/>';
else if (reply == 'ok')
msg = 'Lisätty.<br/>';
else if (reply == 'okprivate')
msg = 'Lisätty.<br /><br />Sinulla ei ole julkista profiilia, joten muut palvelun käyttäjät eivät näe suosituksiasi. <a href="/ed/home_edit_public.html">Luo julkinen profiili</a>, jos haluat suosituksiesi näkyvän muille.<br/>';
else if (reply == 'duplicate')
msg = 'Olet jo suositellut tätä laulua.<br/>';
else if (reply == 'full')
msg = 'Sinulla on maksimimäärä suositeltuja lauluja. Voit <a href="http://blackbox.eddy.fi/ed/home_edit_recommendations.html">muokata suosituslistaasi</a> poistaaksesi suosituksiasi.<br/>';
else if (reply == 'unknown')
msg = 'Tapahtui tuntematon virhe. Yritä uudestaan vähän ajan päästä.<br/>';
else
msg = 'Tapahtui tuntematon virhe. Yritä uudestaan vähän ajan päästä.<br/>';
if (song_id)
eddy.e('recommendadded' + song_id).innerHTML = msg;
else if (album_id)
eddy.e('recommendadded' + album_id).innerHTML = msg;
else if (artist_id)
eddy.e('recommendadded' + artist_id).innerHTML = msg;
});
};
/**/
eddy.addToShop = function(profile_id, id, message_div, product) {
eddy.asyncTx("ajat_add_to_shop", eddy.params("/ed/addtoshop", product ? {profile: profile_id, product: id} : {profile: profile_id, album: id}), function(response) {
var reply = eddy.trim(response.responseText);
if(reply == "ok") {
if(message_div)
eddy.e(message_div).innerHML = "Added to shop"; //FIXME translate
}
});
};
eddy.removeFromShop = function(profile_id, id, message_div, product) {
eddy.asyncTx("ajat_add_to_shop", eddy.params("/ed/addtoshop?delete=true", product ? {profile: profile_id, product: id} : {profile: profile_id, album: id}), function(response) {
var reply = eddy.trim(response.responseText);
if(reply == "ok") {
if(message_div)
eddy.e(message_div).innerHML = "Removed"; //FIXME translate
}
eddy.showAlbums();
});
};
/**/
eddy.loadCharityProjects = function(org) {
var proj = eddy.e("charityproject");
while (proj.hasChildNodes())
proj.removeChild(proj.firstChild);
eddy.asyncJson("/ed/charityprojects.json?organization=" + org, function(response) {
var menu = eddy.e("charityproject");
var option = document.createElement("option");
option.setAttribute("value", "0");
option.appendChild(document.createTextNode("-"));
menu.appendChild(option);
for (var n in response.projects) {
var project = response.projects[n];
option = document.createElement("option");
option.value = project.id;
option.appendChild(document.createTextNode(project.name));
menu.appendChild(option);
}
});
};
/**/
eddy.bookmarkOkMessage = function(html, divid) {
if (!divid) divid = "okmessage";
eddy.e(divid).innerHTML = html;
};
eddy.addBookmark = function(what, id, divid) {
if (!eddy.loggedIn()) {
eddy.bookmarkOkMessage('<a href="https://fi.equaldreams.com/ed/login.html">Kirjaudu</a> ensin palveluun.', divid);
return;
}
var url = what == "user" ?
"/ed/bookmarkuser.txt?user=" + id :
"/ed/bookmarkband.txt?band=" + id;
var purpose = what == "user" ?
"ajat_bookmark_user" :
"ajat_bookmark_band";
eddy.asyncTx(purpose, url,
function(response) {
var reply = eddy.trim(response.responseText);
if (reply == "full")
eddy.bookmarkOkMessage('Liian monta kirjanmerkkiä.', divid);
else if (reply == "ok")
eddy.bookmarkOkMessage('Kirjanmerkki lisätty.', divid);
});
};
/**/
eddy.fanClubMessage = function(html, divid) {
if (!divid) divid = "fanclubmessage";
eddy.e(divid).innerHTML = html;
};
eddy.joinFanClub = function(id,fanclubSizeId,sizeMsg,divid) {
if (!eddy.loggedIn()) {
eddy.fanClubMessage('<a href="https://fi.equaldreams.com/ed/login.html">Kirjaudu</a> ensin palveluun.', divid);
return;
}
var url = "/ed/joinfanclub.txt?band=" + id;
var purpose = "ajat_join_fan_club";
eddy.asyncTx(purpose, url,
function(response) {
var reply = eddy.trim(response.responseText);
if (reply == "full")
eddy.fanClubMessage('Olet liian monen profiilin fani.', divid);
else if (reply == "duplicate")
eddy.fanClubMessage('Olet jo fani.', divid);
else if (reply == "ok") {
eddy.fanClubMessage('Olet nyt fani.', divid);
if (sizeMsg != null && sizeMsg != "" && fanclubSizeId != null && fanclubSizeId != "")
eddy.setdescr(fanclubSizeId, sizeMsg);
}
});
};
/*  */
eddy.leaveFanclub = function(band, itemid) {
var reqUrl = "/ed/leavefanclub.txt?band=" + encodeURIComponent(band);
eddy.asyncTx("ajat_leave_fan_club", reqUrl, function(response) {
var reply = eddy.trim(response.responseText);
if(reply == 'ok') {
var child = eddy.e(itemid);
child.parentNode.removeChild(child);
}
});
};
/**/
eddy.showsong = function(id, song, image, see_also) {
if (image) {
var i = eddy.e("songimage");
if (i) i.src = "/ed/images/" + image + ".jpg";
}
eddy.asyncdescr(id, "/ed/songdetails.html?song=" + song + (see_also?"&seealso=1":""));
};
eddy.showalsosong = function(id, song, image) { eddy.showsong(id, song, image, true); };
eddy.showcharity = function(id, song, see_also) {
eddy.asyncdescr(id, "/ed/songcharity.html?song=" + song + (see_also?"&seealso=1":""));
};
eddy.showcharitydetails = function(id, token) {
eddy.asyncdescr(id, "/ed/charitydetails.html?token=" + token);
};
eddy.showpreorder = function(id, preorder, see_also) {
eddy.asyncdescr(id, "/ed/preorderdetails.html?preorder=" + preorder + (see_also?"&seealso=1":""));
};
eddy.showAlbumSong = function(div1, div2, songid, image, album, band, url) {
eddy.e(div1).innerHTML =
'<div class="aInfo rList1">' +
'<a href="/' + url + '">' +
'<span class="orange">Artisti:</span> ' + band + '</a><br />' +
'<a href="/' + url + '">' +
'<span class="orange">Albumi:</span> ' + album + '</a><br />' +
'<a href="/' + url + '">' +
'<img src="/ed/images/' + image + '.jpg" /></a></div>';
eddy.showsong(div2, songid, 0);
};
/**/
eddy.visibleConcert = 0;
eddy.concertDetails = function(concert) {
var d;
if (eddy.visibleConcert != 0) {
d = eddy.e("concertdetails" + eddy.visibleConcert);
d.innerHTML = "";
d.style.height = "";
d.style.display = "none";
}
if (concert == eddy.visibleConcert) {
eddy.visibleConcert = 0;
return;
}
eddy.visibleConcert = 0;
var url = "/ed/concertdetails.html?concert=" + concert;
eddy.async(url, function(response) {
eddy.visibleConcert = concert;
d = eddy.e("concertdetails" + concert);
d.style.display = "block";
d.innerHTML = response.responseText;
d.style.height = Math.ceil(d.clientHeight / 18) * 18 + "px";
});
};
/**/
eddy.currentGalleryChannel = [];
eddy.nextGalleryChannel = function(ch, dir) {
var n = eddy.currentGalleryChannel[ch];
n = (n ? n : 0) + dir;
var img = eddy.galleryChannel[ch];
if (n < 0 || n >= img.length - 1) return;
eddy.currentGalleryChannel[ch] = n;
eddy.e("galleryImage" + ch).src = "/ed/images/" + img[n] + ".jpg";
eddy.e("galleryCaption" + ch).innerHTML = eddy.escapeHtml(eddy.galleryCaption[ch][n]);
eddy.e("arrowup_ch" + ch).src = n == 0 ?
"/ed/images/arrow_up_grey.gif" :
"/ed/images/arrow_up_orange.gif";
eddy.e("arrowdown_ch" + ch).src = n == img.length - 2 ?
"/ed/images/arrow_down_grey.gif" :
"/ed/images/arrow_down_orange.gif";
};
eddy.initGalleryChannels = function() {
var list = eddy.galleryChannel;
if (!list) return;
for (var n in list) {
if (list[n].length > 2)
eddy.e("arrowdown_ch" + n).src = "/ed/images/arrow_down_orange.gif";
}
};
/**/
/**/
eddy.samplePlayIcon = '/ed/i/iconPlaySmall.png';
eddy.sampleStopIcon = '/ed/i/iconStopSmall.png';
eddy.playImgType = '';
eddy.sampleNext = function(clip) {
if (eddy.nowPlaying) {
var img = eddy.e(eddy.nowPlayingImg);
if (img) img.src = eddy.samplePlayIcon;
}
var imgname = 'playimg' + eddy.playImgType + clip;
eddy.nowPlaying = clip;
eddy.nowPlayingImg = imgname;
var i = eddy.e(imgname);
i.src = eddy.sampleStopIcon;
};
eddy.sampleDone = function() {
var player = eddy.e('playerdiv');
if (!player) return;
player.innerHTML = '';
player.parentNode.removeChild(player);
if (eddy.nowPlaying) {
var img = eddy.e(eddy.nowPlayingImg);
if (img) img.src = eddy.samplePlayIcon;
}
eddy.nowPlaying = null;
eddy.nowPlayingImg = null;
};
eddy.sampleHasFlash = function() {
var playerVersion = swfobject.getFlashPlayerVersion();
return playerVersion.major >= 4;
};
eddy.sampleHidePlayAll = function(id) {
if (!eddy.sampleHasFlash())
eddy.e(id).style.display = "none";
};
eddy.sample = function(clip, imgname, imgtype) {
var song = clip.indexOf(",") == -1 ? clip : clip.split(",")[0];
if (!eddy.sampleHasFlash()) {
eddy.newTx('asyncmulti_sample', function(txid) {
window.location = eddy.params('/ed/songclip.mp3', {'song': song, 'txid': txid});
});
return;
}
if (!imgtype) imgtype = ''; /*  */
eddy.playImgType = imgtype;
if (!imgname) imgname = 'playimg' + eddy.playImgType + song;
var end = imgname == eddy.nowPlayingImg;
eddy.sampleDone();
if (end) {
eddy.nowPlaying = null;
eddy.nowPlayingImg = null;
return;
}
eddy.nowPlaying = song;
eddy.nowPlayingImg = imgname;
var img = eddy.e(imgname);
img.src = eddy.sampleStopIcon;
eddy.newTx('asyncmulti_sample', function(txid) {
var url = "/ed/songclip.mp3?txid=" + txid + "&song=";
var flashvars = 'url=' + encodeURIComponent(url) + '&song=' + clip;
var html =
'<object style="vertical-align: bottom; margin-right: 0.2em" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' +
' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
' width="1" height="1" align="middle">' +
'<param name="allowScriptAccess" value="sameDomain" />' +
'<param name="flashVars" value="' + flashvars + '" />' +
'<param name="movie" value="/ed/player.swf" /><param name="quality" value="high" />' +
'<embed style="vertical-align: bottom; margin-right: 0.2em" src="/ed/player.swf" flashVars="' + flashvars + '"' +
' quality="high" width="1" height="1" name="player"' +
' align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"' +
' pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
'</object>';
var player = document.createElement('div');
player.id = 'playerdiv';
player.innerHTML = html;
var playerdivparent = eddy.e('playerdivparent');
if(!playerdivparent)
playerdivparent = img.parentNode;
playerdivparent.appendChild(player);
});
};
/*  */
eddy.player = function(url, profile) {
var params = {'album': url};
if(profile)
params.profile = profile;
url = eddy.params(eddy.msgHttp + "/ed/player.html", params);
var w = window.open(url, "ED", "width=844,height=330,location=no,menubar=no,resizable=no,scrollbars=1,status=0,toolbar=no");
if (window.focus) w.focus();
};
/**/
eddy.languageRedirect = function(http, url) {
eddy.newTx('async_language_redirect', function(txid) {
window.location = eddy.params(http + '/ed/languageredirect', {'txid': txid, 'url': url});
});
};
eddy.loggedIn = function() {
var id = eddy.cookieValue('id');
return id && id.charAt(0) == 'a';
};
eddy.showLoginName = function() {
if(!eddy.loggedIn()) {
eddy.e('loginInfoGuest').style.display = 'block';
return;
}
var pref = eddy.cookieValue('pref');
if (!pref) return;
var start, end;
if ((start = pref.indexOf(":l=")) != -1 &&
(end = pref.indexOf(":", start + 1)) != -1) {
value = pref.substring(start + 3, end);
if(!eddy.e('thisIsTheOldPage'))
eddy.e("usernamelink").innerHTML = eddy.escapeHtml(value);
eddy.e("loginInfoUser").style.display = 'block';
}
};
eddy.showBasketValue = function() {
var pref = eddy.cookieValue('pref');
if(!eddy.e("basketvalue")) return;
if (!pref) {
eddy.e("basketvalue").innerHTML = "0.00 &#8364;";
return;
}
var start, end;
if ((start = pref.indexOf(":b=")) != -1 &&
(end = pref.indexOf(":", start + 1)) != -1) {
value = pref.substring(start + 3, end);
eddy.e("basketvalue").innerHTML = value + " &#8364;";
}
if ((start = pref.indexOf(":a=")) != -1 &&
(end = pref.indexOf(":", start + 1)) != -1) {
value = pref.substring(start + 3, end);
//eddy.e("accountbalance").innerHTML = value + " &#8364;"; FIXME element doesn't exist in new version
}
};
eddy.albumImg = function(url) {
url = eddy.msgHttp + "/ed/images/" + url + ".jpg";
var w = window.open(url, "ED", "width=320,height=330,location=no,menubar=no,resizable=no,scrollbars=1,status=0,toolbar=no");
if (window.focus) w.focus();
};
eddy.agreement = function(dbkey, version) {
var url = eddy.msgHttp + "/ed/agreement.html?popup=1&dbkey=" + encodeURIComponent(dbkey) + "&version=" + encodeURIComponent(version);
var w = window.open(url, "EDagreement", "width=536,height=561,location=no,menubar=no,resizable=no,scrollbars=1,status=0,toolbar=no");
if (window.focus) w.focus();
};
eddy._isBandManager = false;
eddy.isBandManager = function() {
return eddy._isBandManager;
};
eddy.help = function(url) {
url = eddy.msgHttp + "/ed/help/" + url + ".html";
var w = window.open(url, "ED", "width=536,height=561,location=no,menubar=no,resizable=no,scrollbars=1,status=0,toolbar=no");
if (window.focus) w.focus();
};
/*  */
eddy.buy = function(type, id, infodiv, add_cb, duplicate_cb) {
eddy.profileBuy(0, type, id, infodiv, add_cb, duplicate_cb);
};
eddy.profileBuy = function(profile, type, id, infodiv, add_cb, duplicate_cb) {
var params = {};
params[type] = id;
if(profile) params["profile"] = profile;
var url = eddy.params("/ed/addbasket.txt", params);
eddy.asyncTx("ajat_add_basket", url, function(response) {
var reply = eddy.trim(response.responseText);
var html;
if (reply == "duplicate") {
html = '' +
"<div class='infonotice'><p>" + (type == 'album' ? 'Albumi on jo ostoskorissa.' : 'Kappale on jo ostoskorissa.') +
'</p><p><a href="/ed/home_basket.html">Ostoskoriin</a></p></div>';
if (infodiv) eddy.setdescr(infodiv, html);
if (duplicate_cb) duplicate_cb();
return;
}
var pos = reply.indexOf(';');
if (pos == -1) return;
var code = reply.substring(0, pos);
if (code == "ok" || code == "ok-again") {
var type_text = type == 'album' ? 'Albumi' : 'Kappale';
if(type == 'product')
type_text = '';
html = '' +
"<div class='infook'><p>" + type_text +
' "' + eddy.escapeHtml(reply.substring(pos + 1)) +
'" lisätty ostoskoriin';
if (code == "ok-again")
html += '<br/>(' +
(type == "album" ? "Olet ostanut albumin aiemmin ja voit edelleen ladata sen." : "Olet ostanut kappaleen aiemmin ja voit edelleen ladata sen.") + ')';
html += '</p><p><a href="/ed/home_basket.html">Ostoskoriin</a></p></div>';
if (infodiv) eddy.setdescr(infodiv, html);
eddy.showBasketValue();
if (add_cb) add_cb();
}
});
};
/**/
eddy.showMore = function(elementId,url,params,cb) {
params = eddy.cloneAssociativeArray(params);
params.next = eddy.nextPage;
eddy.asyncJson(eddy.params(url, params), function(response) {
if(typeof(response.pager.nextPage) != "undefined")
eddy.nextPage = response.pager.nextPage;
else
eddy.e('showmore').style.display = 'none';
eddy.e(elementId).innerHTML += response.html;
if(cb) {
cb();
}
});
};
/**/
eddy.scrollbars = new Array();
eddy.Scrollbar = function(step, speed, scroller_name, property) {
this.pos = 0;
this.target = 0;
this.dir = 0;
this.step = step;
this.speed = speed;
this.property = property;
this.scroller = eddy.e(scroller_name);
if (!this.scroller) return;
this.scroller.style.overflow = "hidden";
this.scroller.style.position = "absolute";
eddy.Scrollbar.getSizes(this);
eddy.scrollbars.push(this);
};
eddy.Scrollbar.getSizes = function(s) {
if (s.property == "left") {
s.content_size = s.scroller.scrollWidth;
s.size = s.scroller.parentNode.clientWidth;
} else {
s.content_size = s.scroller.scrollHeight;
s.size = Math.floor(0.9 * s.scroller.parentNode.clientHeight);
}
};
eddy.Scrollbar.prototype.contentUpdated = function() {
this.pos = 0;
this.target = 0;
this.dir = 0;
eddy.Scrollbar.getSizes(this);
this.startscroll();
this.scrollit();
};
eddy.Scrollbar.prototype.setImages = function(leftArrow, leftActive, leftInactive,
rightArrow, rightActive, rightInactive) {
this.leftArrow = leftArrow;
this.leftActive = leftActive;
this.leftInactive = leftInactive;
this.rightArrow = rightArrow;
this.rightActive = rightActive;
this.rightInactive = rightInactive;
this.startscroll = function() {
var arrow;
if (this.leftArrow) {
arrow = eddy.e(this.leftArrow);
if (arrow) arrow.src = this.pos == 0 ? this.leftInactive : this.leftActive;
}
if (this.rightArrow) {
arrow = eddy.e(this.rightArrow);
if (arrow) arrow.src = this.size - this.pos >= this.content_size ? this.rightInactive : this.rightActive;
}
}
this.endscroll = this.startscroll;
};
eddy.Scrollbar.prototype.scroll = function(dir) {
if (this.initscroll) {
this.initscroll();
this.initscroll = null;
}
if (this.content_size <= this.size) return;
this.dir = dir;
this.target = this.pos + dir * this.size;
if (this.target > 0) {
this.target = 0;
} else {
var max = this.size - this.content_size;
if (this.target < max) this.target = max;
}
if (this.pos != this.target) {
this.scrollit();
this.startscroll();
}
};
eddy.Scrollbar.prototype.scrollit = function() {
this.pos += this.dir * this.step;
var done = false;
if (this.dir > 0 ? this.pos > this.target : this.pos < this.target) {
this.pos = this.target;
done = true;
}
this.scroller.style[this.property] = this.pos + "px";
if (done) {
if (this.endscroll) this.endscroll();
} else {
var thiz = this;
setTimeout(function() {thiz.scrollit();}, this.speed);
}
};
eddy.chartScroll = function(name) {
var s = new eddy.Scrollbar(15, 30, "scroll_" + name, "top");
s.setImages(
"arrowup_" + name, "/ed/images/arrow_up_orange.gif", "/ed/images/arrow_up_grey.gif",
"arrowdown_" + name, "/ed/images/arrow_down_orange.gif", "/ed/images/arrow_down_grey.gif");
return s;
};
eddy.scrollAlbum = function(album, band, url, thumb) {
return '<td><div class="slide_box_div"><div class="slide_box_album"><a href="/' +
eddy.escapeHtml(url) + '"><img src="/ed/images/' + thumb +
'.jpg" alt="" /></a></div><p class="songtitle"><a href="/' + eddy.escapeHtml(url) +
'" title="' + eddy.escapeHtml(album) + '">' + eddy.escapeHtml(album) +
'</a></p><p class="bandname"><a href="/' + eddy.escapeHtml(url) + '">' +
eddy.escapeHtml(band) + '</a></p></div></td>\n';
};
/**/
eddy.post = function(url) {
window.location = "/ed/postitem.html?url="+encodeURIComponent(url);
};
eddy.vote = function(topic, vote) {
var url = "/ed/voteitem.txt?topic=" + topic + "&vote=" + vote;
eddy.asyncTx("ajat_vote", url, function(response) {
var up = eddy.e("voteup"+topic);
var down = eddy.e("votedown"+topic);
var change;
if (response.responseText == "1") {
up.src = "/ed/images/voteup.gif";
down.src = "/ed/images/votedowngrey.gif";
change = 1;
} else if (response.responseText == "-1") {
up.src = "/ed/images/voteupgrey.gif";
down.src = "/ed/images/votedown.gif";
change = -1;
} else if (response.responseText == "LOGIN") {
window.location = "https://fi.equaldreams.com/ed/login.html?login_redirect=%2Fed%2Findex.html";
return;
} else {
return;
}
eddy.e("vote_span"+topic).innerHTML = parseInt(eddy.e('vote_span_original'+topic).innerHTML)+change;
});
};
eddy.showInPostArea = function(url, active_tab) {
eddy.e('post_area').innerHTML = '<div><br /><img src="/ed/i/loading-icon.gif" alt="Ladataan..." /></div>';
eddy.async(url, function(response) {
eddy.e('post_area').innerHTML = response.responseText;
/*  */
});
if (active_tab) {
eddy.e("popular_tab").className = "iconLink";
eddy.e("new_tab").className = "iconLink";
eddy.e(active_tab).className = "current iconLink";
}
};
/**/
/*  */
eddy.async = function(url,postdata,method,cb) { eddy.callUrl(url,true,postdata,method,cb); };
eddy.sync = function(url,postdata,method,cb) { return eddy.callUrl(url,false,postdata,method,cb); };
eddy.callUrl = function(url,async,postdata,method,cb) {
/*  */
if(typeof(postdata) == "function") {
cb = postdata;
postdata = null;
} else if(typeof(method) == "function") {
cb = method;
method = null;
}
if(!method)
method = "POST"; /*  */
var r = eddy.createRequest();
if (!r) return;
if (cb && async)
r.onreadystatechange = function() {
if (r.readyState == 4 && r.status == 200)
cb(r);
};
r.open(method, url, async);
if(method.toUpperCase() == "POST") {
r.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=utf-8');
if(postdata)
r.send(postdata);
else
r.send('');
} else {
r.send(null);
}
if(!async && r.readyState == 4 && r.status == 200) {
if(cb)
cb(r);
return r;
}
};
/*  */
eddy.asyncdescr = function(id, url, postdata, method, action) {
if(action == 2 && eddy.isShown(id))
eddy.hide(id);
else if(action == 3 && eddy.isShown(id))
eddy.hide(id);
else {
if(action != 1)
eddy.setdescr(id, '<img src="/ed/i/loading-icon.gif" alt="..." />');
if(action == 2)
eddy.show(id);
else if(action == 3)
eddy.show(id);
eddy.async(url, postdata, method, function(response) {
eddy.setdescr(id, response.responseText);
if(action == 2)
eddy.show(id);
else if(action == 3)
eddy.show(id);
});
}
};
/*  */
eddy.asyncdescrbot = function(id, url, postdata, method) { eddy.asyncdescr(id, url, postdata, method, 1); };
eddy.asyncdescrslide = function(id, url, postdata, method) { eddy.asyncdescr(id, url, postdata, method, 2); };
eddy.asyncdescrtoggle = function(id, url, postdata, method) { eddy.asyncdescr(id, url, postdata, method, 3); };
eddy.createRequest = function() {
if (window.XMLHttpRequest) {
try{return new XMLHttpRequest(); } catch(e){}
}
if (window.ActiveXObject) {
try{return new ActiveXObject("Msxml2.XMLHTTP");} catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");} catch(e){}
}
return null;
};
/*  */
eddy.decodeJson = function(str) {
/*  */
if(eddy.startsWith(str, "//"))
str = str.substring(2);
return jsonParse(eddy.trim(str));
};
/*
*/
eddy.encodeJson = function(val) {
return JSON.stringify(val);
};
/*  */
/*  */
eddy.params = function(url, m) {
/*  */
if(m == null) {
m = url;
url = null;
}
/*  */
var param_string = jQuery.param(m);
if(url == null)
return param_string;
else if(url.indexOf("?") == -1)
return url + "?" + param_string;
else
return url + "&" + param_string;
}
/*  */
eddy.newTx = function(purpose, async, cb) {
if(typeof(async) == "function" && cb == null) {
cb = async;
async = true;
}
var url = eddy.params('/ed/newtransaction.txt', {'purpose': purpose});
if(async) {
eddy.async(url, function(r) {
cb(eddy.trim(r.responseText));
});
} else {
var r = eddy.sync(url);
if(!r)
return null;
var txid = eddy.trim(r.responseText);
if(cb)
cb(txid);
return txid;
}
};
eddy.asyncTx = function(purpose, url, postdata, method, cb) {
eddy.newTx(purpose, function(txid) {
eddy.async(eddy.params(url, {"txid": txid}), postdata, method, cb);
});
};
/*  */
eddy.asyncJsonTx = function(purpose, url, postdata, cb) {
/*  */
if(typeof postdata == "function") {
cb = postdata;
postdata = null;
}
eddy.asyncTx(purpose, url, postdata, "POST", function(response) {
var trimmed = eddy.trim(response.responseText);
if(trimmed)
cb(eddy.decodeJson(trimmed));
});
};
eddy.asyncJson = function(url, postdata, cb) {
/*  */
if(typeof postdata == "function") {
cb = postdata;
postdata = null;
}
eddy.async(url, postdata, "POST", function(response) {
var trimmed = eddy.trim(response.responseText);
if(trimmed)
cb(eddy.decodeJson(trimmed));
});
};
/**/
eddy.AutoComplete = function(boxid, param) {
this.box = eddy.e(boxid);
this.div = document.createElement("div");
document.body.appendChild(this.div);
this.param = param;
this.box.AutoComplete = this;
this.box.onkeyup = eddy.AutoComplete.prototype.onTextChange;
this.box.onblur = eddy.AutoComplete.prototype.onTextBlur;
this.box.setAttribute("autocomplete", "off");
this.state = 1;
};
eddy.AutoComplete.prototype.onTextBlur = function()
{
this.AutoComplete.onblur();
}
eddy.AutoComplete.prototype.onblur = function()
{
this.div.style.display = "none";
this.state = 1; /*  */
}
eddy.AutoComplete.prototype.onTextChange = function()
{
this.AutoComplete.onchange();
}
eddy.AutoComplete.prototype.onchange = function()
{
var thisBox = this.box;
var thisObject = this;
var thisDiv = this.div;
if(thisObject.state != 1) /*  */
return;
thisObject.state = 2;
setTimeout(function() {
if(thisObject.state != 2)
return; /*  */
if(thisBox.value.length < parseInt('3')) {
thisDiv.innerHTML = ""; /*  */
thisDiv.style.display = "none";
thisObject.state = 1;
return;
}
thisObject.state = 3;
var uri = "/ed/autocomplete.json?" +  encodeURIComponent(thisObject.param) + "=" + encodeURIComponent(thisBox.value);
eddy.asyncJson(uri, function(resp) {
if(thisObject.state != 3)
return; /*  */
thisObject.state = 1;
/*  */
thisDiv.innerHTML = ""; /*  */
var ok = false;
for(var i in resp.strings) {
var choicediv = document.createElement('div');
choicediv.appendChild(document.createTextNode(resp.strings[i]));
choicediv.onmousedown = eddy.AutoComplete.prototype.onDivMouseDown;
choicediv.onmouseover = eddy.AutoComplete.prototype.onDivMouseOver;
choicediv.onmouseout = eddy.AutoComplete.prototype.onDivMouseOut;
choicediv.AutoComplete = thisObject;
thisDiv.appendChild(choicediv);
ok = true;
}
if(ok) {
thisDiv.className = 'autocomplete';
thisDiv.style.left = eddy.getPosition(thisBox).x + 'px';
thisDiv.style.top = (eddy.getPosition(thisBox).y+thisBox.offsetHeight) + 'px';
thisDiv.style.width = thisBox.offsetWidth + 'px'; /*  */
thisDiv.style.width = thisBox.offsetWidth - (thisDiv.offsetWidth - thisBox.offsetWidth) + 'px'; /*  */
thisDiv.style.display = "block";
} else {
thisDiv.style.display = "none";
}
});
}, 333);
}
eddy.AutoComplete.prototype.onDivMouseDown = function()
{
this.AutoComplete.box.value = this.firstChild.nodeValue; /*  */
}
eddy.AutoComplete.prototype.onDivMouseOver = function()
{
this.className = "hilite";
}
eddy.AutoComplete.prototype.onDivMouseOut = function()
{
this.className = "bg";
}
/**/
eddy.FormSaveProgress = function(button_id, form_id) {
this.button = button_id;
this.form = form_id;
};
eddy.FormSaveProgress.prototype.start = function(text) {
if(this.form)
$(":input", eddy.e(this.form)).attr("disabled", true);
this.orig_button_text = $(eddy.e(this.button)).text();
if(text)
$(eddy.e(this.button)).text(text);
else
$(eddy.e(this.button)).text("Tallennetaan");
};
eddy.FormSaveProgress.prototype.end = function() {
if(this.form) {
$(":input", eddy.e(this.form)).attr("disabled", false);
}
$(eddy.e(this.button)).text(this.orig_button_text);
};
eddy.FormSaveProgress.prototype.showError = function(message) {
if(this.form) {
this.messageDiv = document.createElement("div");
$(eddy.e(this.form)).prepend($(this.messageDiv).addClass("infoerror").html(message));
}
};
eddy.FormSaveProgress.prototype.showMessage = function(message) {
if(this.form) {
this.messageDiv = document.createElement("div");
$(eddy.e(this.form)).prepend($(this.messageDiv).addClass("infonotice").text(message));
}
};
eddy.Notification = function(params) {
if(params)
this.p = params;
else
this.p = {};
/*  if(!this.p.timeout)
this.p.timeout = 0;*/
if(typeof(this.p.oneTime) == "undefined")
this.p.oneTime = true;
};
eddy.Notification.prototype.show = function(message, x, y) {
if(this.p.oneTime && this.isShown)
return;
if(!message)
message = "Loading...<br/><img src='/ed/i/loading-icon.gif' alt=''/>";
if(this.isShowing) {
$(this.note_div).html(message);
}
this.isShowing = true;
var offset = {};
if(this.p.element) {
var elem = $(this.p.element);
offset.left = elem.offset().left + elem.width();
offset.top = elem.offset().top + elem.height();
}
else {
offset.top = document.body.clientHeight / 2;
offset.left = document.body.clientWidth / 2;
}
if(typeof(x) != "undefined" && typeof(y) != "undefined") {
offset.left = x;
offset.right = y;
}
this.note_div = document.createElement("div");
$(this.note_div).addClass("notificationFloat")
.css({"top": offset.top, "left": offset.left, "display": "none", position: this.p.elem ? "absolute" : "fixed"})
.html(message);
$("body").prepend(this.note_div);
$(this.note_div).show();
var this_notification = this;
$(this.note_div).click(function() { this_notification.dismiss(); });
if(this.p.timeout) {
var t = setTimeout(function() {
this_notification.dismiss(1000);
clearTimeout(t);
}, this.p.timeout);
}
this.isShown = true;
};
eddy.Notification.prototype.dismiss = function(fadeout) {
if(!fadeout)
fadeout = 0;
$(this.note_div).hide(fadeout);
$(this.note_div).remove();
this.isShowing = false;
};
eddy.deleteEvent = function(event, event_element) {
$(eddy.e(event_element)).hide();
eddy.asyncTx("ajat_delete_event", eddy.params("/ed/event/delete", {profile: eddy.profileId, event: parseInt(event)}), function(data) {
if(data.responseText != "success") {
$(eddy.e(event_element)).show();
}
});
};
