//$(function() {
$(document).ready(function() {

	if (($.cookie('showhelp')) !== 'nope') {
		if ($("#myNotice").length > 0 ) {
			$("#myNotice").slideDown(1250);
			for (i=0; i<2; i++) {
				$("#myNotice").fadeTo(500, 0.3);
				$("#myNotice").fadeTo(500, 1.0);
			}
		}
	}

	$("#closeBtn").click(function () {
		$("#myNotice").slideUp(200);
		$.cookie('showhelp', 'nope', { path: '/', expires: 60 });
	});

    $("#entrys .entry").each(function() {
        var d = $(this).find("li.name a").text();
        var e = this;
        $.getJSON("remote.php", {
            method: "track.search",
            track: d
        },
        function(b) {
            if (b.results.trackmatches.track == undefined || b.results.trackmatches.track[0] == undefined) return $(e).find(".picture img").remove();
            var c = b.results.trackmatches.track[0].artist;
            $.getJSON("remote.php", {
                method: "artist.getinfo",
                artist: c
            },
            function(a) {
                if (a.error || a.artist.image[2]["#text"] == "") return $(e).find(".picture img").remove();
                $(e).find(".picture img").attr("src", a.artist.image[2]["#text"]).removeClass("loading")
            })
        })
    })

	$('.kwicks').kwicks({
		max : 596,
		spacing : 5
	});
	
	$('.video_tut').smart_modal(); 

});

function setBookmark (where) { 
	burl = encodeURIComponent(location.href); 
	btitle = encodeURIComponent(document.title); 
	switch(where) { 
		case 'Delicious': window.open('http://del.icio.us/post?url='+burl+'&title='+btitle); break; 
		case 'Digg': window.open('http://digg.com/submit?phase=2&url='+burl+'&title='+btitle); break; 
		case 'Mrwong': window.open('http://www.mister-wong.de/index.php?action=addurl&bm_url='+burl+'&bm_notice=&bm_description='+btitle); break;
		case 'Google': window.open('http://www.google.com/bookmarks/mark?op=add&bkmk='+burl+'&title='+btitle); break; 
		case 'Yigg': window.open('http://yigg.de/neu?exturl='+burl); break; 
	} 
}