submitComment = function(gal_id, img_id, author, comment)
{
	var err = '';
	$('author_name').className = 'input_border';
	$('comment').className = 'input_border';
	
	if (author == '' || comment == '')
	{
		if (author == '')
		{
			$('author_name').className = 'input_border_error';
			err = 'Fill the author field<br />';
		}
		if (comment == '')
		{
			$('comment').className = 'input_border_error';
			err += 'Fill the comment field';
		}
		
		$('submitcomment_error').show();
		$('submitcomment_error').innerHTML = err;
		
		return false;
	}
	
	var url = wd_const.get( 'WD_USER_TPL_PATH' ) + '/content/software/gallery/ajax/save_comment.ajax.php';
	new Ajax.Request( url, { 
		method: 'post', 
		parameters: { img_id: img_id, author: author, comment: comment },
		onComplete: function(transport) {
			window.location = wd_const.get( 'WD_USER_PATH' ) + '/gallery/image/' + gal_id + '/'+ img_id;
		}
	});
}

update_image_visit_count = function(f) 
{
	var url = wd_const.get( 'WD_USER_TPL_PATH' ) + '/content/software/gallery/ajax/update_image_visit_count.ajax.php';
	new Ajax.Request( url, { 
			method: 'post', 
			parameters: { imglink: f } 
		});	
}

fileLoadingImageFunc = function()
{
	return wd_const.get( 'WD_USER_TPL_PATH' ) + '/img/lightbox/loading.gif';
}

fileBottomNavCloseImageFunc = function()
{
	return wd_const.get( 'WD_USER_TPL_PATH' ) + '/img/lightbox/closelabel.gif';
}