jQuery.fn.inputHints=function(){
	$(this).each(function(i){$(this).val($(this).attr('title')).addClass('hint')})
	return $(this).focus(function(){
		if($(this).val()==$(this).attr('title')){
			$(this).val('').removeClass('hint')
		}
	}).blur(function(){
		if($(this).val()==''){
			$(this).val($(this).attr('title')).addClass('hint')
		}
	})
}

setTimeout(function(){$('#message').fadeOut('slow')},3600)

var VS = VS||{};
(function(){

	VS.Forgot={
		
		init:function(){

		},

		send:function(){
			var val=$('#acc_email').val()
			if(val.indexOf('@')==-1 || val.indexOf('.')==-1 || val.length<6){
				$('#fgt_error').html('A megadott e-mail cím nem található!')
				return
			}
			var cod=$('#captcha').val()
			if(cod.length!=5){
				$('#fgt_error').html('A megadott ellenőrző kód hibás!')
				return
			}
			var that=this
			$.ajax({
				url:'/account/forgot_password',
				data:{preview:'ajax',acc_email:val,captcha:cod},
				type:'post',
				dataType:'json',
				success:$.proxy(function(d){
					if(d){
						if(d.success){
							parent.self.location='/'
						}else{
							$('#fgt_error').html('A megadott e-mail cím nem található vagy az ellenőrző kód hibás!')
						}
					}
					that.ready=true
				})
			})
		}

	}
	$($.proxy(VS.Forgot.init,VS.Forgot))
})()
