var key ="81eeba970660ebe5d204a9a1f11ac5e2"; var video_list = ""; var r_video_list = ""; var shuffle = 0; var list_i = 50; // ---------------------------------------- Player Functions ------------------------------------------------------------------ function add_play_song( song_key, song_title, song_duration ){ loadNewVideo(song_key, 0); add_song( song_key, song_title, song_duration ); } function youtube_play( song ){ loadNewVideo( song, 0 ); } function change_skin(btn){ // Reset button skin ... document.getElementById('play').src = 'img/play.jpg'; document.getElementById('stop').src = 'img/stop.jpg'; document.getElementById('pause').src = 'img/pause.jpg'; document.getElementById('next').src = 'img/next.jpg'; document.getElementById('prev').src = 'img/previous.jpg'; switch(btn){ case "play" : document.getElementById('play').src = 'img/playon.jpg'; break; case "stop" : document.getElementById('stop').src = 'img/stopon.jpg'; break; case "pause" : document.getElementById('pause').src = 'img/pauseon.jpg'; break; case "next" : document.getElementById('next').src = 'img/nexton.jpg'; break; case "prior" : document.getElementById('prev').src = 'img/previouson.jpg'; break; } } // --------------------------------------------------------------------------------------------------------------------------------------------- function show_loading(id){ $('#'+id).html("


"); } function refresh(){ $.ajax({ type: 'GET', url: 'engine.php?r=91&k='+key, data: '', success: function(message) { $('#plist').html(message); list_config(); } }); } function list_config(){ $("#t-list").sortable({ handle : '.handle', update : function () { var order = $('#t-list').sortable('serialize'); $.get("engine.php?proc=list_order&"+order); } }); } function add_song(song){ show_loading('plist'); $.ajax({ type: 'GET', url: 'engine.php?r=612', data: 'proc=add_song&song='+song+'&k='+key, success: function(message) { $('#plist').html(message); list_config(); // refresh(); } }); } function add_all(ids, start, end){ show_loading('plist'); $.ajax({ type: 'GET', url: 'engine.php?r=782', data: 'proc=add_all&keyword='+ids+'&start=' + start + '&end=' + end + '&k='+key, success: function(message) { $('#plist').html(message); list_config(); // refresh(); } }); } function clear_all( ){ show_loading('plist'); $.ajax({ type: 'GET', url: 'engine.php?r=254', data: 'proc=clear_list&k='+key, success: function(message) { $('#plist').html(message); list_config(); // create_select(); } }); } function add_list(){ list = $('#list_name').val(); if( list == "" ){ alert("Please, enter list name !"); $('#list_name').focus(); return false; } else{ $.ajax({ type: 'GET', url: 'engine.php?r=726&k='+key, data: 'proc=add_list&list='+list, success: function(message) { $('#uyeol').html(message); refresh(); create_select(); } }); } } function search_song(keyword, start, end){ $('#keyword').val( keyword ); show_loading('list'); $.ajax({ type: 'GET', url: 'engine.php?r=593', data: 'proc=search_song&keyword='+keyword+'&start='+start+'&last='+end+'&k='+key, success: function(message) { $('#list').html(message); get_similar(keyword); $('#list_bt').show(); $('#all_link').attr('onclick', "add_all( '"+keyword+"', "+start+", "+end+" )"); } }); } function song_delete(list_id, song_id){ $('#listItem_'+song_id).hide("slow"); $.ajax({ type: 'GET', url: 'engine.php?r=784', data: 'proc=song_delete&list_id='+list_id+'&song_id='+song_id+'&k='+key, success: function(message) { // $('#plist').html(message); } }); stop(); } function list_delete(id){ $.ajax({ type: 'GET', url: 'engine.php?r=3', data: 'proc=list_delete&list_id='+id+'&k='+key, success: function(message) { $('#uyeol').html(message); refresh(); create_select(); } }); } function get_list(list_id){ show_loading('plist'); $.ajax({ type: 'GET', url: 'engine.php?r=574', data: 'proc=get_list&list_id='+list_id+'&k='+key, success: function(message) { $('#plist').html(message); list_config(); // create_select(); } }); } function create_select(){ $.ajax({ type: 'GET', url: 'engine.php?r=440&k='+key, data: 'proc=create_list', success: function(message) { $('#selectbox').html(message); $('#list_items').selectbox({ }); } }); } function save_list(list){ if(list == ""){ var MsgBox = new MessageBox(); MsgBox.show(200, 150, 'Alert', "

enter_list_name


","Close",407,307); return false; } $.ajax({ type: 'GET', url: 'engine.php?r=320', data: 'proc=add_list&list='+list+'&k='+key, success: function(message) { $('#manager_list').html(message); create_select(); refresh(); } }); } function show_list_manager(){ $.ajax({ type: 'GET', url: 'engine.php?r=85&k='+key, data: 'proc=show_manager', success: function(message) { var MsgBox = new MessageBox(); MsgBox.show(285, 150, ' : : lists', message, 'Close',407,332); } }); } function get_similar(key_text){ $.ajax({ type: 'GET', url: 'engine.php?r=765', data: 'proc=show_similar&keyword='+key_text+'&k='+key, success: function(message) { $('#similar').html(message); $('#mycarousel').jcarousel({ }); // refresh(); } }); } function set_song_info(title, img, id){ var url = "AMAZON_URI"; var buy_url = url.replace("%title%", title) var shr = "http://www.facebook.com/sharer.php?u=http://www.youtube.com/watch?v="+id+"&t="+"college site "+title; $('#buy_btn').attr('href', buy_url); $('#shr_btn').attr('href', shr); $('#artist_pic').attr('src', img ); $('#player_text').html(title); } function set_lister( songs ){ song_list = songs; } function next_video(){ var next = 0; if( shuffle ){ next = Math.floor( Math.random() * video_list.length ); return video_list[next]; } for ( var i in video_list ) { if( next ){ return video_list[i]; } if( active_video == video_list[i] ){ next = 1; } else { next = 0; } } return video_list[0]; } function prior_video(){ var next = 0; if( shuffle ){ next = Math.floor( Math.random() * r_video_list.length ); return r_video_list[next]; } for ( var i in r_video_list ) { if( next ){ return r_video_list[i]; } if( active_video == r_video_list[i] ){ next = 1; } else { next = 0; } } return video_list[0]; } function add_for_play(list_id){ $.ajax({ type: 'GET', url: 'engine.php?r=487&list_id='+list_id, data: 'proc=add_for_play', success: function(message) { $('#plist').html(message); } }); } function load_for_play(list_id){ $.ajax({ type: 'GET', url: 'engine.php?r=421&list_id='+list_id, data: 'proc=load_for_play', success: function(message) { $('#plist').html(message); } }); } function select_menu(tab){ show_loading("m1"); $.ajax({ type: 'GET', url: 'engine.php?r=821&tab='+tab, data: 'proc=menu', success: function(message) { $('#m1').html(message); } }); } function set_list_vars( arr ){ video_list = arr; } function register(){ var uname = $('#user_name').val(); var upass = $('#user_pass').val(); var umail = $('#user_mail').val(); var verify = $('#re-user_pass').val(); if( uname == "" || upass == "" || umail == "" ){ alert("Please, enter all fields ."); return false; } else{ $.ajax({ type: 'POST', url: 'engine.php?r=663', data: 'proc=register&user_name='+uname+'&user_pass='+upass+'&user_mail='+umail+'&verify='+verify, success: function(message) { if( message == "1" ){ alert("You are successfully registered"); window.location.reload(); } else{ alert(message); } } }); } } function login(){ var umail = $('#user_mail').val(); var upass = $('#user_pass').val(); if( umail == "" || upass == "" ){ alert("Please, enter all fields ."); return false; } else{ $.ajax({ type: 'POST', url: 'engine.php?r=338', data: 'proc=login&user_mail='+umail+'&user_pass='+upass, success: function(message) { if( message == "1" ){ window.location.reload(); } else{ alert(message); } } }); } } function set_shuffle(){ if( shuffle == 0 ) { shuffle = 1; $('#shuffle').attr('src', 'images/plc2on.gif' ); } else{ shuffle = 0; $('#shuffle').attr('src', 'images/plc2.gif' ); } } function scroll_position(){ var keyword = $('#keyword').val(); var end = 20; if( keyword ){ var dpos = $('#list').scrollTop(); var hg = $('#list')[0].scrollHeight; var dif = hg - dpos; var start = list_i; if( dif < 350 && start < 220 ){ list_i = list_i + end; $('#loading').show(); $.ajax({ type: 'GET', url: 'engine.php?r=259', data: 'proc=search_append&keyword='+keyword+'&start='+start+'&last='+end+'&k='+key, success: function(message) { $('#for_append').append(message); $('#loading').hide(); } }); } } } function share_list(){ var uname = $('#user_name').val(); var umail = $('#user_mail').val(); var desc = $('#your_msg').val(); var data = $('#data').val(); if( umail == "" || uname == "" || desc == "" ){ alert("Please, enter all fields ."); return false; } else{ // send shared list $.ajax({ type: 'POST', url: 'engine.php?r=832', data: 'proc=share_list&user_name='+uname+'&user_mail='+umail+'&desc='+desc+'&data='+data, success: function(message) { if( message == "1" ){ alert("Your list successfull sent.") } else{ alert(message); } } }); } } function rate( datas ){ $.ajax({ type: 'POST', url: 'engine.php?r=399', data: 'proc=rate_list&data='+datas, success: function(message) { if( message == 1 ) alert("Thank you for your rating"); } }); }