var Registration = {
		checkBeforeSubmit: function() {
			
		},

		showProfile: function(id,title) {
			var params = {
					action: 'Plugins/Registration/index.php?view=client&form=profile&userId='+id,
					content: 'html',
					width: 600,
					height: 400,
					title: title
			};
			var light = new CalcunLightbox(params);
			light.show();
			$('.closeLightbox').live('click',function() {
				light.close();
			})	
		}
};

$(document).ready(function(){
	$('#forgot-password-link').click(function() {
		var params = {
			action: 'Plugins/Registration/index.php?view=client&form=forgotPassword',
			content: 'html',
			width: 370,
			height: 200,
			title: 'Elfelejtett jelszó',
			callback: function() {
				$('#forgotPassForm').validate();
				$('.CalcunLightbox').addClass('forgotPassword');
			}
		};
		var light = new CalcunLightbox(params);
		light.show();
		$('.closeLightbox').live('click',function() {
			light.close();
		})
		return false;
	});

	$('a.showProfile').die('click');
	$('a.showProfile').live('click',function() {
		var tempId = $(this).attr('id');
		var id = $(this).attr('id').split('-');
		id = tempId.replace(new RegExp("^"+id[0]+"\-", "i"),'');
		//id = id[id.length-1];
		var title = $(this).attr('title');
		Registration.showProfile(id,title);
		return false
	});
});
