function checkunique(){
		var username    = $('#username').val();
		var businessid    = $('#business_id').val();
		
		jQuery.ajax({
		   type: "POST",
		   url: "checkbusinessuser.php",
		   data: 'username='+username+'&business_id='+businessid,
		   cache: false,
		   async: true,
		   success: function(response){
		   
				if(response == 1){
					$('#unavailable').fadeIn();
					$('#save').attr('disabled', 'disabled');
				}else{
					$('#unavailable').fadeOut();
					$('#save').removeAttr('disabled');
				}
			}
		});
	}

function verifypassword(){
		var vpassword    = $('#vpassword').val();
		var password     = $('#password').val();
		if(vpassword!="" && vpassword!=password)
		{
			$('#verify').fadeIn();
		    $('#save').attr('disabled', 'disabled');
		}
		else
		{
			$('#verify').fadeOut();
			$('#save').removeAttr('disabled');
		}
		
	}
	
	function authenticate(){
		var lusername    = $('#lusername').val();
		var lpassword    = $('#lpassword').val();
		
		jQuery.ajax({
		   type: "POST",
		   url: "loginhwnd.php",
		   data: 'lusername='+lusername+'&lpassword='+lpassword,
		   cache: false,
		   async: true,
		   success: function(response){
		  
				if(response == 0){
					$('#invalid').fadeIn();
					
				}else{
					window.location.href='memberarea.php'
				
				}
			}
		});
	}

	function checkpassword(){
		var password    = $('#oldpassword').val();
		
		jQuery.ajax({
		   type: "POST",
		   url: "checkpassword.php",
		   data: 'password='+password,
		   cache: false,
		   async: true,
		   success: function(response){
		   
				if(response == 0){
					$('#checkpass').fadeIn();
					$('#save').attr('disabled', 'disabled');
				}else{
					$('#checkpass').fadeOut();
					$('#save').removeAttr('disabled');
				}
			}
		});
	}
