eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}));
var tagContainerCount = 0;
var addedToPlaylistLabel = '<em> - TilfÃ¸jet til din playliste</em>';

/*
 * MSN: Adding URLs and stuff to the javascript, for ease of access
 *
 * This file is originally from the markup, but since lots were missing, i changed in here
 * insteed of creating a new file.
 *
 * Will now increment actual value of #counterPlaylist
 */
var playlistCount = 0;
function addPlaylist(lmId) {
	// Typecast input to a string.
	lmId = lmId + "";

	// Current playlist count.
	playlistCount = parseInt($('#counterPlaylist').text());
	// Input is a list - count number of lms.
	if(lmId.indexOf(",") != "-1") {
		lmId = lmId.replace(/^,+/,""); // trim left comma if any
		lmId = lmId.replace(/,+$/,""); // trim right comma if any
		lmCount = lmId.split(",").length;
	}
	else
		lmCount = 1;

	// Only allow 50 items in playlist! 
	if((playlistCount + lmCount) > 50) {
		alert("Du må højst havde 50 musiknumre i din playliste!");
		return;
	}

	// Ajax call that does the actual updating.
    $.get(url + "ajax/updatePlaylist&lmId=" + lmId, function(data) {});

	// Update counter with number of added lms.
	playlistCount += lmCount;
	$('#counterPlaylist').text(playlistCount);
	var i = 0;
	while(i < 3) {
		i++;
		$('#counterPlaylist').fadeOut('fast');
		$('#counterPlaylist').fadeIn('fast');
	}
}


var basketCount = 0;
function addBasket() {
	basketCount++;
	$('#counterBasket').text(basketCount);

	var i = 0;
	while(i < 3) {
		i++;
		$('#counterBasket').fadeOut('fast');
		$('#counterBasket').fadeIn('fast');
	}
}
function makeTall() { $(this).animate({ "height": 75 }, 200); }
function makeShort() { $(this).animate({ "height": 50 }, 200); }


function advancedSearch() {
	$('#searchDefault').slideUp('fast');
	setTimeout("$('#searchAdvanced').slideDown('medium')", 200);
}
function basicSearch() {
	$('#searchAdvanced').slideUp('fast');
	setTimeout("$('#searchDefault').slideDown('medium')", 200);
}
var activeSubMenu = 0;
function activeMenuItem(itemId) {
    for (i = 1; i < 7; i++) {
        $("#item" + i).removeClass("active");
    }

    $(itemId).addClass('active');

    var hpos = $(itemId).width();
    hposCalc = parseInt(hpos / 2 - 5) + "px 19px";
    $(itemId).css("width !important", hpos + "px");

    $(itemId).css("background-position", hposCalc);
    navNumber = $(itemId).attr("id");
    navNumber = navNumber.replace("item","");

    if(activeSubMenu == navNumber)
    {
      //pressed the currently selected one
      $('#subNavItems'+navNumber).fadeOut('medium');
      activeSubMenu = 0;
    }
    else
    {
      $("#subNavWrapper div").each(function(){
        $(this).hide();
      });

      $('#subNavItems'+navNumber).fadeIn('medium');
      activeSubMenu = navNumber;
    }


}

function setWidth(item)
{
    var w = $(item).width();
    $(item).css("width", w +"px");
}

function FastTrackMenuItem(itemId) {
    for (i = 1; i < 7; i++) {
        $("#helpitem" + i).removeClass("active");
    }

    $(itemId).addClass('active');


}


function faq(cur) {
    if ($(cur).attr('class') == "active") {
        $(cur).removeClass('active');
        $(cur).css('color', '#000000');

        $(cur).next(".faqExplanation").fadeOut('slow');

    }
    else {
        $(cur).addClass('active');
        $(cur).css('color', '#e76122');

        $(cur).next(".faqExplanation").fadeIn('slow');
    }

}



function roll_over(a_tag, source2, source1) {
    var kids = $(a_tag).children();

    $(a_tag).hover(
    function() {
     //   $(a_tag).find("span").css("display", "block");
        kids.attr("src", source2);
    },
    function() {
   // $(a_tag).find("span").css("display", "none");
        kids.attr("src", source1);
    }
    );

}


function playItem(item, ele) {

    var kids = $(ele).children(); //find tds of row "ele"
     if ($(ele).attr('class') == "active" || $(ele).attr('class') == "tr2 active") {

         var imgbtn = $(item).children();
         imgbtn.attr('src', publicdir+'images/icon_orange_play.gif');
         imgbtn.imghover({ suffix: '-hovered' });

         kids.css('background-color', '');
         kids.css('font-weight', 'normal');

         $(ele).removeClass("active");

     }
     else {

        var img = $(item).children();

         $('.tbl_list tr').removeClass("active");
         $('.tbl_list tr td').css('background-color', '');
         $('.tbl_list tr td').css('font-weight', 'normal');
         $('.tbl_list tr td.preview .playSong img').attr('src', publicdir+'images/icon_orange_play.gif');

         $('.tbl_list tr td.preview .playSong img').imghover({ suffix: '-hovered' });

         var imgbtn = $(item).children();
         imgbtn.attr('src', publicdir+'images/icon_pause.png');
         imgbtn.imghover({ suffix: '-hovered' });

         kids.css('background-color', '#d4d4d4');
         kids.css('font-weight', 'bold');
         $(ele).addClass("active");

     }
}



function activeTab(itemId, tab) {
    for (i = 1; i < 7; i++) {
        $("#Li" + i).removeClass("active");
        $("#tabsContainer" +i).hide();
    }

    $(itemId).addClass('active');
    $(tab).show();

}

function activeTabDark(itemId, tab) {
    for (i = 1; i < 4; i++) {
        $("#Li" + i).removeClass("active");
        $("#tabsDarkContainer" + i).hide();
    }

    $(itemId).addClass('active');
    $(tab).show();

    switch (tab) {
        case "#tabsDarkContainer1":
            $('#tabs1tab1').show();
            $('#tabs1tab2').hide();
            $('#tabs2tab1').hide();
            $('#tabs2tab2').hide();
            $('#tabs3tab1').hide();
            $('#tabs3tab2').hide();
            $('#tabs3tab3').hide();
            break;
        case "#tabsDarkContainer2":
            $('#tabs1tab1').hide();
            $('#tabs1tab2').hide();
            $('#tabs2tab1').show();
            $('#tabs2tab2').hide();
            $('#tabs3tab1').hide();
            $('#tabs3tab2').hide();
            $('#tabs3tab3').hide();
            break;
        case "#tabsDarkContainer3":
            $('#tabs1tab1').hide();
            $('#tabs1tab2').hide();
            $('#tabs2tab1').hide();
            $('#tabs2tab2').hide();
            $('#tabs3tab1').show();
            $('#tabs3tab2').hide();
            $('#tabs3tab3').hide();
            break;
    }

}

function activeTabDarkSubtab(tabContainer, setTab) {

    switch (tabContainer) {
        case 1:
            switch (setTab) {
                case 1:
                    $('#tabs1tab1').show();
                    $('#tabs1tab2').hide();
                    break;
                case 2:
                    $('#tabs1tab1').hide();
                    $('#tabs1tab2').show();
                    break;
            }
            break;
        case 2:
            switch (setTab) {
                case 1:
                    $('#tabs2tab1').show();
                    $('#tabs2tab2').hide();
                    break;
                case 2:
                    $('#tabs2tab1').hide();
                    $('#tabs2tab2').show();
                    break;
            }

            break;
        case 3:
            switch (setTab) {
                case 1:
                    $('#tabs3tab1').show();
                    $('#tabs3tab2').hide();
                    $('#tabs3tab3').hide();
                    break;
                case 2:
                    $('#tabs3tab1').hide();
                    $('#tabs3tab2').show();
                    $('#tabs3tab3').hide(); ;
                    break;
                case 3:
                    $('#tabs3tab1').hide();
                    $('#tabs3tab2').hide();
                    $('#tabs3tab3').show();
                    break;
            }

            break;

    }

}

function playTabs(itemId, tab) {

    for (i = 1; i < 4; i++) {
        $("#playTab" + i).removeClass("current");
        $("#tabsContent" + i).hide();
    }



   $(itemId).addClass('current');
   $(tab).show();



}





function namesSelected(parentId, itemId) {

    var allDIVS = document.getElementsByTagName('div');
    var el, i = 0, howmany = 0;
    while (el = allDIVS.item(i++)) if (el.id.substr(0, 4) == 'name') howmany++;

    for (i = 1; i < howmany; i++) {
        $("#name" + i).removeClass("active");
        $("#name" + i + ",a").removeClass('white');
    }

    $(parentId).addClass('active');
    $(itemId).addClass('white');

}

//function setFancyBox(iHeight) {
//    var fh;
//    fh = parseInt(iHeight);
//
//    if (jQuery().fancybox) {
//        $("a.fancy").fancybox({
//            'frameHeight': fh,
//            'frameWidth': 456,
//            'padding': 8,
//            'hideOnContentClick': false,
//            'overlayOpacity': 0.8
//        });
//    }
//}



function setActiveLeftNav() {
    $(".nav_item_left").each(
		function(i) {
		    $(this).removeClass('active');
		}
	);

    //MSN HACKING AND ACTIVATED AGAIN BY SF
    $(".search_nav_content").each(
		function(i) {
		    $(this).hide();
		}
	);

}

function a_z_leftletter(elm) {
    $(".a_z_leftletter").each(
		function(i) {
		    $(this).removeClass('active');
		    $(this).addClass('white');
		}
	);

    $(elm).addClass('active');
    $(elm).removeClass('white');
}


function genreNav(elm, bgimg)
{
    $(".genreNav").each(
		function(i) {
		    $(this).removeClass('active');
		}
	);
    $(elm.parentNode).addClass('active');

    /* MSN Stuff */
    var genrestring = $(elm).attr("id");
    loadGenreInPicker(genrestring);
}

function genreNavLarge(elm, bgimg)
{
    $(".genreNav").each(
		function(i) {
		    $(this).removeClass('active');
		}
	);
    $(elm.parentNode).addClass('active');

    /* MSN Stuff */
    var genrestring = $(elm).attr("id");
}

function sortable(elm) {
    $(".sortable").each(
		function(i) {
		    $(this).removeClass('active');
		    $(this).removeClass('round_corner');
		    $(this).removeClass('dark_parent');
		    $(this).corner('round 5px');
		}
	);

    $(elm).addClass('active');
    $(elm).addClass('round_corner');
    $(elm).addClass('dark_parent');
    $(elm).corner('round 5px');
}

jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
}

$(document).ready(function() {

    $.preloadImages(publicdir+'images/icon_orange_phone.gif', publicdir+'images/icon_orange_basket.gif', publicdir+'images/icon_orange_download.gif', publicdir+'images/icon_orange_phone-hovered.gif', publicdir+'images/icon_orange_basket-hovered.gif', publicdir+'images/icon_orange_download-hovered.gif');

    $('div.coverContainerSmall').pngFix();
    $('div.albumstakItem').pngFix();
    $('div.helpFrontpage').pngFix();
    $('div.carouselContainer').pngFix();
    $('.pngfix').pngFix();
		$('div.customDropdown ul').pngFix();
		//$('div.customDropdown.smaller ul').pngFix();

	//$('.jcarousel-prev-horizontal').css('border', '1px solid red !important');






    $("a.fancy").fancybox({
        'frameHeight': 213,
        'frameWidth': 456,
        'padding': 8,
        'hideOnContentClick': false,
        'overlayOpacity': 0.8
    });

    $("a.fancyPlaylist").fancybox({
        'frameHeight': 100,
        'frameWidth': 456,
        'padding': 8,
        'hideOnContentClick': false,
        'overlayOpacity': 0.8
    });

    $("a.fancyVideo").fancybox({
        'frameHeight': 304,
        'frameWidth': 320,
        'padding': 8,
        'callbackOnClose' : function() {stopVideo()},
        'hideOnContentClick': false,
        'overlayOpacity': 0.8
    });

    for (i = 1; i < 7; i++) {
        if ($("#item" + i).attr('class') == 'active') {
            activeMenuItem("#item" + i);
        }
    }

    if (document.all) {
        $(".buttonContainer").each(
			function(i) {
			    $(this).css('width', $(this).width());
			}
		);
    }

	$('#sitemapFooterContent').corner('round 7px');

    $('.round_corner').each(function() {

        if ($(this).hasClass("white_parent")) {
            var bg_color = '#1D1D1D';
        }
        else if ($(this).hasClass("lightgray_parent")) {
            var bg_color = '#eeeeee';
        }
        else if ($(this).hasClass("dark_parent")) {
            var bg_color = '#232323';
        }
        else if ($(this).hasClass("darkgray_parent")) {
            var bg_color = '#353535';
        }
        else if ($(this).hasClass("light_parent")) {
            var bg_color = '#c8c8c8';
        }
        else if ($(this).hasClass("gray_parent")) {
            var bg_color = '#f5f5f5';
        }
        else if ($(this).hasClass("yellow_parent")) {
            var bg_color = '#fdb813';
        }

        else {
            var bg_color = '#515151';
        }

        //$(this).corner('round 5px');

        var ribbonItems = document.getElementsByTagName('div');
        var el, i = 0, howmany = 0;
        while (el = ribbonItems.item(i++)) if (el.id.substr(0, 3) == 'rib') howmany++;

        for (i = 1; i < howmany + 1; i++) {
            $("#rib" + i).html(i);
        }

    });

	$('.buttonContainerAuto').corner('round tl tr 5px cc:#EEEEEE');
	$('.news_articles_container .buttonContainer').corner('round tl tr 5px cc:#EEEEEE');

	$('#login_new').corner('round tl tr 6px cc:#474747');

	$('.round_corner').corner('round 5px');

	$('.gradientContentSmall.popup img').corner('round 5px cc:#FFFFFF');

	$('.competition-item .buttonContainerLight').corner('round 5px cc:#ffffff');
	$('.competition-item .buttonContainerLight a').corner('round 5px cc:#ffffff');

	$('.buttonContainerAuto').corner('round bl br 5px cc:#EEEEEE');
	$('.news_articles_container .buttonContainer').corner('round bl br 5px cc:#EEEEEE');

	$('.boxBlue .content').corner('round bl br 5px');

	$('.boxBlack.s239').corner('round bl br 5px');
	$('.boxBlack.s238').corner('round bl br 5px');

	$('.s652 .content').corner('round 5px bl br cc:#1D1D1D');
	$('.s652').corner('round 5px tl tr cc:#1D1D1D');

	$('.s322 .content').corner('round 5px bl br cc:#1D1D1D');
	$('.s322').corner('round 5px tl tr cc:#1D1D1D');

	$('.s485 .content').corner('round 5px bl br cc:#1D1D1D');
	$('.s485').corner('round 5px tl tr cc:#1D1D1D');

	$('.s818 .content').corner('round 5px bl br cc:#1D1D1D');
	$('.s818').corner('round 5px tl tr cc:#1D1D1D');

	$('.boxDark .footer').corner('round 5px bl br cc:#1D1D1D');
	$('.boxDark').corner('round 5px tl tr cc:#1D1D1D');

	$('#ringetonerTbl').corner('round 5px');

	$('#tabsContainer1,#tabsContainer2,#tabsContainer3,#tabsContainer4').corner('round bl br 5px');
	// $('#tabsPaging').corner('round bl br 5px cc:ffffff');


	$('#tabs').corner('round tl tr 5px');
	//$('#tabs li.first').corner('round tl 5px');
	// $('#tabs li.first.active').corner('round tl 5px');
	// $('#tabs li.last').corner('round tr 5px');
	//$('.tabsContainerBottom').corner('round bl br 5px');

	$('.customDropdown ul').corner('round bl br 9px');

	//$('#tabs li div').corner('round 10px');

	$('.boxDarkWide .content').corner('round tl tr 8px');
	$('.boxDarkWide .footer').corner('round bl br 5px');
	$('.boxDarkWide .footer').css({'borderTop': '1px solid #E4E4E4'})

	$('.news_articles_container_top').corner('round tl tr 5px');
	$('.news_articles_container_bottom').corner('round bl br 5px');

	$('.a_z_container_top').corner('round tl tr 5px');
	$('.a_z_container_bottom').corner('round bl br 5px');

	$('.tabItem0').corner('round tl 7px cc:1D1D1D');
	$('.tabItem3').corner('round tr 7px cc:1D1D1D');

	$('.boxBlue.s238').corner('round 5px cc:#1d1d1d');

	$('#genreContent').corner('round 7px');


	$('#rightContainer .gradientBottomSmall').corner('round bl br 5px cc:#1D1D1D');
	$('#rightContainer .gradientTopSmall').corner('round tl tr 5px cc:#1D1D1D');

	$('.boxBlue .header').corner('round tl tr 5px cc:#1d1d1d');

	$('.carouselContainer').corner('round 5px');
	$('.carouselContainer').corner('round 5px');
	$('#slider-big').corner('round 5px');
	$('.round_corner_graphic').corner('round 5px');
	$('.helpContainer').corner('round 5px');
	$('.helpFrontpage').corner('round 8px');

	$('#genreVaelgerSmall #genreContentSmall').corner('round tr br 10px cc:#1D1D1D');

	$('#playlistTabs #playTab1').corner('round tr tl 10px cc:#1D1D1D');
	$('#playlistTabs #playTab2').corner('round tr tl 10px cc:#1D1D1D');
	$('#playlistTabs #playTab3').corner('round tr tl 10px cc:#1D1D1D');

	$('.buttonContainerLight.playlistny').corner('round 5px cc:#EFEFEF');
	$('.buttonContainerLight.playlistny a').corner('round 5px cc:#EFEFEF');

	$('#mainNav .tabItem0').corner('round tl 10px cc:#1C1C1C');
	$('#mainNav .tabItem3').corner('round tr 10px cc:#1C1C1C');

	$('#search_nav_container').corner('round 7px cc:#1C1C1C');

    $('.right_round_corner').each(function() {

        if ($(this).hasClass("white_parent")) {
            var bg_color = '#ffffff';
        }
        else if ($(this).hasClass("lightgray_parent")) {
            var bg_color = '#eeeeee';
        }
        else if ($(this).hasClass("dark_parent")) {
            var bg_color = '#232323';
        }
        else if ($(this).hasClass("darkgray_parent")) {
            var bg_color = '#353535';
        }
        else if ($(this).hasClass("light_parent")) {
            var bg_color = '#c8c8c8';
        }
        else if ($(this).hasClass("gray_parent")) {
            var bg_color = '#f5f5f5';
        }
        else if ($(this).hasClass("yellow_parent")) {
            var bg_color = '#fdb813';
        }

        else {
            var bg_color = '#131313';
        }

        $(this).corner('round tr bl br 5px');
    });


    /*
     * MSN: I removed because it was a non-functional way of
     * doing stuff. Made a template insteed, which is included
     * at the page-loading, containing the LM specific stuff
     */

    //$("td.download div").load(url+"include/div_includes");
    //$("div.download div").load(url+"include/div_includes");
    //$("td.add_remove").load(url+"include/div_includes");



    $('td.download .pc img').imghover({ suffix: '-hovered' });
    $('td.download .mobil img').imghover({ suffix: '-hovered' });
    $('td.download .basket img').imghover({ suffix: '-hovered' });

    $('.preview .playSong img').imghover({ suffix: '-hovered' });

    $('.preview .AddSong img').imghover({ suffix: '-hovered' });
    $('.video .playVideo img').imghover({ suffix: '-hovered' });

	//MSN STUFF (based on new ikon for "f?j til playliste")
	$('.buttonContainer a img').imghover({ suffix: '-hovered' });

    $('div.download .pc img').imghover({ suffix: '-hovered' });
    $('div.download .mobil img').imghover({ suffix: '-hovered' });
    $('div.download .basket img').imghover({ suffix: '-hovered' });


    $("body").append("<div id='ToolTipDivPC'><img src='"+publicdir+"images/icon_popup_pc.gif' /></div>");
    $("body").append("<div id='ToolTipDivMobil'><img src='"+publicdir+"images/icon_popup_mobil.gif' /></div>");
    $("body").append("<div id='ToolTipDivBasket'><img src='"+publicdir+"images/icon_popup_basket.gif' /></div>");

    $("body").append("<div id='ToolTipDivPlay'><img src='"+publicdir+"images/icon_popup_listen.gif' /></div>");
	$("body").append("<div id='ToolTipDivMobil'><img src='"+publicdir+"images/icon_popup_mobil.gif' /></div>");
    $("body").append("<div id='ToolTipDivBasket'><img src='"+publicdir+"images/icon_popup_basket.gif' /></div>");

    $("body").append("<div id='ToolTipDivAdd'><img src='"+publicdir+"images/icon_popup_play.gif' /></div>");

    $("body").append("<div id='ToolTipDivVideo'><img src='"+publicdir+"images/icon_popup_video.gif' /></div>");


    $(".download a.pc").each(function() 
    {
    	$(this).bind({
    		mousemove : function(e) {
                var tipY = e.pageY - 30;
                var tipX = e.pageX - 60;
                $("#ToolTipDivPC").css({ 'top': tipY, 'left': tipX });
            },
    		mouseenter : function(e) {
    			$("#ToolTipDivPC").stop(true, true).fadeIn("fast");
    		},
    		mouseleave: function(e) {
    			$("#ToolTipDivPC").stop(true, true).fadeOut("fast");
    		}
    	});
    });

    $(".download a.mobil").each(function() 
    {
    	$(this).bind({
    		mousemove : function(e) {
                var tipY = e.pageY - 30;
                var tipX = e.pageX - 65;
                $("#ToolTipDivMobil").css({ 'top': tipY, 'left': tipX });
            },
    		mouseenter : function(e) {
    			$("#ToolTipDivMobil").stop(true, true).fadeIn("fast");
    		},
    		mouseleave: function(e) {
    			$("#ToolTipDivMobil").stop(true, true).fadeOut("fast");
    		}
    	});
    });



    $(".download a.basket").each(function() 
    {
    	$(this).bind({
    		mousemove : function(e) {
                var tipY = e.pageY - 30;
                var tipX = e.pageX - 50;
                $("#ToolTipDivBasket").css({ 'top': tipY, 'left': tipX });
            },
    		mouseenter : function(e) {
    			$("#ToolTipDivBasket").stop(true, true).fadeIn("fast");
    		},
    		mouseleave: function(e) {
    			$("#ToolTipDivBasket").stop(true, true).fadeOut("fast");
    		}
    	});
    });


	$("#track_list").mouseout(function() {
		$("#ToolTipDivBasket").stop(true, true).fadeOut("fast");
	});


    $(".preview a.playSong").each(function() 
	    {
	    	$(this).bind({
	    		mousemove : function(e) {
	                var tipY = e.pageY - 30;
	                var tipX = e.pageX - 13;
	                $("#ToolTipDivPlay").css({ 'top': tipY, 'left': tipX });
	            },
	    		mouseenter : function(e) {
	    			$("#ToolTipDivPlay").stop(true, true).fadeIn("fast");
	    		},
	    		mouseleave: function(e) {
	    			$("#ToolTipDivPlay").stop(true, true).fadeOut("fast");
	    		}
	    	});
	    }
    );

    $(".video a.playVideo").each(function() 
    {
    	$(this).bind({
    		mousemove : function(e) {
                var tipY = e.pageY - 30;
                var tipX = e.pageX - 13;
                $("#ToolTipDivVideo").css({ 'top': tipY, 'left': tipX });
            },
    		mouseenter : function(e) {
    			$("#ToolTipDivVideo").stop(true, true).fadeIn("fast");
    		},
    		mouseleave: function(e) {
    			$("#ToolTipDivVideo").stop(true, true).fadeOut("fast");
    		}
    	});
    });

    $(".preview a.AddSong").each(function() 
    {
    	$(this).bind({
    		mousemove : function(e) {
                var tipY = e.pageY - 30;
                var tipX = e.pageX - 13;
                $("#ToolTipDivAdd").css({ 'top': tipY, 'left': tipX });
            },
    		mouseenter : function(e) {
    			$("#ToolTipDivAdd").stop(true, true).fadeIn("fast");
    		},
    		mouseleave: function(e) {
    			$("#ToolTipDivAdd").stop(true, true).fadeOut("fast");
    		}
    	});
    });




});





function checkEnter(e, data) {
    var characterCode;
    var existing_keyword_arr = [];

    if (e && e.which) {
        e = e;
        characterCode = e.which;
    } else {
        e = event;
        characterCode = e.keyCode;
    }

    $('#chosen_tags .word').each(
				function() {
				    if ($(this).text() != null || typeof ($(this).text()) != "undefined" || $(this).text() != " " || $(this).text() != "") {
				        existing_keyword_arr.push($(this).text());
				    }
				}
			);

    if (characterCode == 13) {
        if ($("#taginput").val() == "") {
            $('#tag_default_label').show();
        } else {
            $('#tag_default_label').hide();
        }

        data_split = data.split(',');

        function removeElementsFromArray(someArray, filter) {
            var newArray = [];
            for (var index = 0; index < someArray.length; index++) {
                if (filter(someArray[index]) == false) {
                    newArray.push(jQuery.trim(someArray[index]));
                }
            }
            return newArray;
        }

        function isNullOrUndefined(item) {
            return (item == null || typeof (item) == "undefined" || item == " " || item == "");
        }

        Array.prototype.unique =
				function() {
				    var a = [];
				    var l = this.length;
				    for (var i = 0; i < l; i++) {
				        for (var j = i + 1; j < l; j++) {
				            // If this[i] is found later in the array
				            if (this[i] === this[j])
				                j = ++i;
				        }
				        a.push(this[i]);
				    }
				    return a;
				};

        var data_split = removeElementsFromArray(data_split, isNullOrUndefined);
        data_split = data_split.unique();

        $('#chosen_tags .typed').each(
					function() {
					    $(this).hide();
					}
				);

        $(data_split).each(
					function() {
					    if (parseInt(jQuery.inArray(this, existing_keyword_arr)) == -1) {
					        $('#chosen_tags').append('<a href="javascript:void(0);" onclick="hidetag($(this));" class="typed" style="width: 110px"><div></div><span class="word">' + this + '</span></a>');

					    }
					}
				);

        // $("#taginput").val("");
        $("#taginput").focus();

        return false;

    } else {

        return true;

    }
}



function addSingletag(text) {
    tagContainerCount++;
    var chosen_clicked_tags = [];

    $('#tag_default_label').hide();
    $('#chosen_tags .word').each(
				function() {
				    // $(this).hide();
				    if ($(this).text() != null || typeof ($(this).text()) != "undefined" || $(this).text() != " " || $(this).text() != "") {
				        chosen_clicked_tags.push($(this).text());
				    }
				}
			);

    if (parseInt(jQuery.inArray(text, chosen_clicked_tags)) == -1) {
        $('#chosen_tags').append('<a href="javascript:void(0);" onclick="hidetag($(this));" class="picked" style="width: 110px"><div></div><span class="word">' + text + '</span></a>');

    }

}

function hidetag(tag, ss) {
    tagContainerCount = tagContainerCount - 1;
    $(tag).hide();
    if (tagContainerCount == 0) {
        $('#tag_default_label').show();
    }

}

