var Progress = {
	show: function()
	{
		$('progress').update('<span class="infomsg">Odosielam fotografie na server...</span>');
	},
	hide: function()
	{
		$('progress').update('Kliknite na tlačidlo a <strong>vyberte fotografie</strong>, ktoré chcete pridať do inzerátu.');
	},
	update: function(bytesLoaded, bytesTotal)
	{
		var percentage = Math.round((100 / bytesTotal) * bytesLoaded);
		$('progress').update('<span class="infomsg">Odosielam fotografie na server... <strong>' + percentage + '%</strong> (čakajte, prosím)</span>');
	}
}

var AdminManager = {
	changeState: function(profileId, fromElement, toElement)
	{
		$('state-' + profileId + '-' + fromElement).hide();
		$('state-' + profileId + '-' + toElement).show();
	},
	remove: function(profileId)
	{
		$('profile-description-' + profileId).remove();
		$('profile-row-' + profileId).remove();
	},
	removePhoto: function(photoId)
	{
		$('photo-' + photoId).remove();
	},
	removeAdvert: function(advertId)
	{
		$('advert-item-' + advertId).remove();
	},
	changeAdvert: function(advertId, fromElement, toElement)
	{
		$('advert-' + advertId + '-' + fromElement).hide();
		$('advert-' + advertId + '-' + toElement).show();
	},
	removeReport: function(reportId)
	{
		$('report-item-' + reportId).remove();
	},
	verifyPhoto: function(photoId)
	{
		$('unverify-photo-' + photoId).show();
		$('verify-photo-' + photoId).hide();
	},
	unverifyPhoto: function(photoId)
	{
		$('unverify-photo-' + photoId).hide();
		$('verify-photo-' + photoId).show();
	},
}

var Preloader = {
	show: function()
	{
		if($('preloader')) {
			$('preloader').show();
		}
	},
	hide: function()
	{
		if($('preloader')) {
			$('preloader').hide();
		}
	}
}

var Reporter = {
	show: function()
	{
		$('report-link').hide();
		$('report-box').show();
		return false;
	},
	hide: function()
	{
		$('report-box').hide();
		$('report-link').show();
		return false;
	},
	message: function(msg)
	{
		alert(msg);
		$('reason').focus();
	},
	done: function(msg)
	{
		$('report-holder').remove();
		alert(msg);
	}
}