function format(modus) { if(modus == 1) { $('#formatIOS').css('background-color','#212121').css('color','#e2e5ec'); $('#formatMP3').css('background-color','').css('color',''); $('#actionframe').attr("src","setformat.php?m=1"); } else { $('#formatMP3').css('background-color','#212121').css('color','#e2e5ec'); $('#formatIOS').css('background-color','').css('color',''); $('#actionframe').attr("src","setformat.php?m=2"); } } function download(id) { $('#actionframe').attr("src","download/?id="+id); } function preview(nr) { var previewurlCrypted = $('#coverbild'+nr).attr('preview'); var previewurlDecrypted = decode_base64(previewurlCrypted); $('#actionframe').attr("src","content/player.swf?autostart=true&file="+previewurlDecrypted); $('#play1,#play2,#play3,#play4,#play5').fadeOut(); $('#play'+nr).fadeIn(); } function getMusic() { $('#logo').html('ringeltone.com...'); $('#play1,#play2,#play3,#play4,#play5').fadeOut(); var query = $('#query').val(); if(query.length > 0) { $('#startscreen').fadeOut('fast'); } $.get('brain/fetch.php?q='+query, function(vorschlaege){ var vorschlag = jQuery.parseJSON(vorschlaege); var id1 = vorschlag.id1; var id2 = vorschlag.id2; var id3 = vorschlag.id3; var id4 = vorschlag.id4; var id5 = vorschlag.id5; var titel1 = vorschlag.track1; var titel2 = vorschlag.track2; var titel3 = vorschlag.track3; var titel4 = vorschlag.track4; var titel5 = vorschlag.track5; var preview1 = vorschlag.preview1; var preview2 = vorschlag.preview2; var preview3 = vorschlag.preview3; var preview4 = vorschlag.preview4; var preview5 = vorschlag.preview5; var cover1 = vorschlag.cover1; var cover2 = vorschlag.cover2; var cover3 = vorschlag.cover3; var cover4 = vorschlag.cover4; var cover5 = vorschlag.cover5; if(id1) { $('#music1').fadeIn(); $('#itemTitle1').html(urldecode(titel1)); $('#cover1').attr('src',decode_base64(cover1)); $('#itemDL1').attr('onclick','download("'+id1+'")'); $('#coverbild1').attr('preview',preview1); } if(!id1) { $('#music1').fadeOut(); } // NEXT if(id2) { $('#music2').fadeIn(); $('#itemTitle2').html(urldecode(titel2)); $('#cover2').attr('src',decode_base64(cover2)); $('#itemDL2').attr('onclick','download("'+id2+'")'); $('#coverbild2').attr('preview',preview2); } if(!id2) { $('#music1').fadeOut(); } // NEXT if(id3) { $('#music3').fadeIn(); $('#itemTitle3').html(urldecode(titel3)); $('#cover3').attr('src',decode_base64(cover3)); $('#itemDL3').attr('onclick','download("'+id3+'")'); $('#coverbild3').attr('preview',preview3); } if(!id3) { $('#music1').fadeOut(); } // NEXT if(id4) { $('#music4').fadeIn(); $('#itemTitle4').html(urldecode(titel4)); $('#cover4').attr('src',decode_base64(cover4)); $('#itemDL4').attr('onclick','download("'+id4+'")'); $('#coverbild4').attr('preview',preview4); } if(!id4) { $('#music1').fadeOut(); } // NEXT if(id5) { $('#music5').fadeIn(); $('#itemTitle5').html(urldecode(titel5)); $('#cover5').attr('src',decode_base64(cover5)); $('#itemDL5').attr('onclick','download("'+id5+'")'); $('#coverbild5').attr('preview',preview5); } if(!id5) { $('#music5').fadeOut(); } if(query.length == 0) { $('#music1,#music2,#music3,#music4,#music5').fadeOut(); $('#startscreen').fadeIn('fast'); } $('#logo').html('ringeltone.com'); }); } function urldecode(str) { return decodeURIComponent((str + '').replace(/\+/g, '%20')); } function decode_base64(s) { var e={},i,k,v=[],r='',w=String.fromCharCode; var n=[[65,91],[97,123],[48,58],[43,44],[47,48]]; for(z in n){for(i=n[z][0];i=8){r+=w((b>>>(l-=8))%256);} } } return r; } function imp(modus) { if(!modus) { $('#ausblenden,#impressum').fadeIn(); } else {$('#ausblenden,#impressum').fadeOut();} }