function logoff() {$.ajax({url: "/logoff/",success: function(out){FB.getLoginStatus(function(response) {	if (response.authResponse) { FB.logout(function(response) {window.location.reload();});}else {window.location.reload();}});}});}



function checkprocess(){
	id = $("#uploadIdentifier").val();
	
	$.getJSON('/uploadprogress.php?id='+ id, function(data) {
		checkprocess();
		speed =  Math.floor(data['speed_average'] / 1024)+'KB/s';
		percent = Math.floor(data['bytes_uploaded'] * 100 / data['bytes_total']);

		$("#progress").html(percent +"%");
		$('#uploadSpeed').html(speed);
	});


}


function fblogon() {

	FB.login(function(response) {
		if (response.authResponse) {
			window.location.reload();
		} else {
		}
	}, {});
}
