/**
 * Webfolio CMS
 *
 * Copyright (C) 2009 Nikola Posa (http://www.nikolaposa.in.rs)
 *
 * This file is part of Webfolio CMS.
 *
 * Webfolio CMS is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * Webfolio CMS is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with Webfolio CMS. If not, see <http://www.gnu.org/licenses/>.
 */

function reloadCaptcha(image) {
	$('#' + image).attr('src', 'front-end/captcha.php?rand=' + Math.random());
}

function displayMessage(element, msg, status) {
	if (element == null) {
		element = 'message';
	}
	
	var classColor = 'green';
	if (status == false) {
		classColor = 'red';
	}
	
	var element = '#' + element;
	
	$(element).show();
	$(element).html('<p class = "message_' + classColor + '">' + msg + '</p>');
	setTimeout('$(\'' + element + '\').hide(\'slow\');', 2000);
}