/**
 * @package PHP-FUsion Content Management System
 * @copyright Copyright © 2002 - 2009 Nick Jones
 * @web http://www.php-fusion.co.uk
 * ----------------------------------------------+
 * @Author Abdullah Waheed (wadday)
 * @copyright 2009
 * @file fcom_mp3.js
 * @version 3.0
 * @web http://www.fuvahmulah.com
 * @license This Program is released as free software under the 
 Affero GPL license. You can redistribute it and/or modify it 
 under the terms of this license which you can read by viewing
 the included agpl.txt or online at www.gnu.or/licenses/agpl.html.
 removal of this copyright header is strictly prohibited without 
 written permission from the original author(s)
 */
 
function add_song() {
	var params = $("#sform").serialize();
	$('#loading').html('<img src="../mp3player_panel/images/loading.gif" alt="Adding.." />Adding to sql..wait..');
	$('#loading').css('padding:3px;');
	$.ajax({
		type: 'post',
		url: '../mp3player_panel/song_process.php',
		data: params,
		success: function(msg){
			$("#song_list").html(msg);
			$("#song_name").val('');
			$("#song_vocal").val('');
			$("#song_keywords").val('');
			$("#song_desc").val('');
		}
	});
}

function song_up() {
	var params = $("#eform").serialize();
	$('#loading').html('<img src="../mp3player_panel/images/loading.gif" alt="Updating.." /><br />Updating.. please wait..');
	$('#loading').css('padding:3px;');
	$.ajax({
		type: 'post',
		url: '../mp3player_panel/update_process.php',
		data: params,
		success: function(msg){
			$("#up_result").html(msg);
			$("#song_name").val('');
			$("#song_vocal").val('');
			$("#song_keywords").val('');
			$("#song_desc").val('');
		}
	});
}

function add_list(){
	var params = $("#lform").serialize();
	$('#user_list').html('<img src="infusions/mp3player_panel/images/loading.gif" alt="Please Wait.." />');
	$('#user_list').css('padding:2px;');
	$.ajax({
		type: 'post',
		url: 'infusions/mp3_playlist_panel/process.php',
		data: params,
		success: function(msg){
			$("#slist").html(msg);
			$("#list").val('');
			$("#desc").val('');
		}
	});
}    

function add_usong() {
	var host = $("#host").val();
	var params = $("#sf").serialize();
	$('#loading').html('<img src="'+host+'infusions/mp3player_panel/images/loading.gif" alt="Please Wait.."/>');
	$('#loading').css('padding:2px;');
	$.ajax({
		type: 'post',
		url: host+'infusions/mp3player_panel/addsong.php',
		data: params,
		success: function(msg){
			$("#sng").html(msg);
		}
	});
}

