frasePrivacy = '';
$(document).ready(function() {

	
	$('.reg_agenzia1 #form').submit(function(){
		if(!checkFields('form'))
			return false;
		
		if($('#idaccept').attr('checked') == false){
			alert(frasePrivacy);
			return false;
		}
		
		return true;
	});
	$('#formlogin').submit(function(){
		$.post('/agenzie?action=login&modejs=1&' + $(this).serialize(),
		function(data){
			if(data==''){
				location.reload();
			}
			else{
				$('#badlogin').show();
			}
		}
		);
		return false;
	});
	$('#logout').click(function(){
		$.get('/agenzie?action=logout&modejs=1',function(data){location.reload();});
		return false;
	});
	
	$('#lostpwd,.lostpwd').click(function(){
		$('#resetpwd').show();
	});
	
	$('#resetpwd .close').click(function(){
		$('#resetpwd').hide();
	});
	$('#formpwd').submit(function(){
		$.post('/agenzie?action=recpwd&modejs=1&' + $(this).serialize(),
		function(data){
			if(data==''){
				$('#resetpwd .error').hide();
				$('#resetpwd .success').show();
			}
			else{
				$('#resetpwd .success').hide();
				$('#resetpwd .error').show();
			}
		});
		return false;
	});
	$('#ricercaEsperienza input.notlogged').click(function(){
		$('#ricercaEsperienza p.notlogged').show();
		return false;
	});
		
	$('select.modepag').change(function(){
		if($(this).val()==1)
			$('span.modepag').show();
		else
			$('span.modepag').hide();
	});
  
    
}); // --- Fine Document.Ready --- JQuery



