function check_ftp_server(host,user,pass)
{
$('ftp_loading_div').style.display = "inline";
var url="ajax.php?action=check_ftp_server&host="+host+"&user="+user+"&pass="+pass;
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('ftp_status_div').innerHTML=t.responseText;
$('ftp_loading_div').style.display = "none";
}
 }); 

}


function check_ftp_server_movies(host,user,pass)
{
$('movies_ftp_loading_div').style.display = "inline";
var url="ajax.php?action=check_ftp_server&host="+host+"&user="+user+"&pass="+pass;
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('movies_ftp_status_div').innerHTML=t.responseText;
$('movies_ftp_loading_div').style.display = "none";
}
 }); 

}

function check_warehouse_server(url,pass)
{
$('server_loading_div').style.display = "inline";
var url="ajax.php?action=locator_check_server&url="+url+"&pass="+pass;
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('server_status_div').innerHTML=t.responseText;
$('server_loading_div').style.display = "none";
}
 }); 

}



function check_warehouse_server_movies(url,pass)
{
$('movies_server_loading_div').style.display = "inline";
var url="ajax.php?action=locator_check_server&url="+url+"&pass="+pass;
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('movies_server_status_div').innerHTML=t.responseText;
$('movies_server_loading_div').style.display = "none";
}
 }); 

}
function locator_get_movies_cats(siteid)
{


$('ajax_loading').style.display = "inline";
var url="ajax.php?action=locator_get_movies_cats&siteid="+siteid;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('queue_movies_cat_select_div').innerHTML=t.responseText;
$('ajax_loading').style.display = "none";
}
 }); 

}


function locator_get_cats(siteid)
{


$('ajax_loading').style.display = "inline";
var url="ajax.php?action=locator_get_cats&siteid="+siteid;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('queue_singers_cat_select_div').innerHTML=t.responseText;
$('ajax_loading').style.display = "none";
}
 }); 

}

function locator_get_singers_albums(siteid,cat,singer)
{
$('ajax_loading').style.display = "inline";
var url="ajax.php?action=locator_get_singers_albums&siteid="+siteid+"&cat="+cat+"&singer="+singer;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('queue_singers_albums_select_div').innerHTML=t.responseText;
$('ajax_loading').style.display = "none";
}
 }); 

}

function get_singers_albums(cat,singer)
{
$('ajax_loading').style.display = "inline";
var url="ajax.php?action=get_singers_albums&cat="+cat+"&singer="+singer;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){$('singers_albums_select_div').innerHTML=t.responseText;
$('ajax_loading').style.display = "none";
}
 }); 

}

function importer_get_files(dir)
{
$('ajax_loading').style.display = "inline";
var url="ajax.php?action=importer_get_files&upload_folder="+dir;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('files_div').innerHTML=t.responseText;
$('ajax_loading').style.display = "none";
}
 }); 

}

function importer_import_file(url,dir)
{
$('uploading_div').style.display = "inline";
$('status_div').innerHTML= "";

var url="ajax.php?action=importer_import_file&url="+url+"&upload_folder="+dir;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){

$('status_div').innerHTML=t.responseText;
importer_get_files(dir);
$('uploading_div').style.display = "none";

}
 }); 

}

function get_server_files(dir)
{
var url="ajax.php?action=get_server_files&dir="+dir;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('server_files').innerHTML=t.responseText;},
onLoading: function(t){ $('server_files').innerHTML="<img src='images/loading.gif'>";}
 }); 

}

function upload_file(filename)
{
var url="ajax.php?action=upload_file&filename="+filename;

new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('upload_status').innerHTML=t.responseText;},
onLoading: function(t){ $('upload_status').innerHTML="<img src='images/loading.gif'>";}
 }); 

}


function get_movies_log_page()
{
$('loading_div').style.display = "inline";
var url="ajax.php?action=log_movies";
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('movies_log_div').innerHTML=t.responseText;
$('loading_div').style.display = "none";
}
 }); 

}


function get_movies_queue_page()
{
$('loading_div').style.display = "inline";
var url="ajax.php?action=queue_movies";
    
new Ajax.Request(url, {   
method: 'get',   
onSuccess: function(t){ $('movies_queue_div').innerHTML=t.responseText;
$('loading_div').style.display = "none";
}
 }); 

}