function loginFormBlur(inp,oldVal)
{
	if(inp.value=='')
	{
		inp.value=oldVal;
	}
}

function loginFormFocus(inp,oldVal)
{
	if(inp.value==oldVal)
	{
		inp.value='';
	}
}

function authExit()
{
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'exit'
	 		    
			}, function(data)		
			{
				
				
			   
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail","");
			    	location.href=lloc;
			 
			});	
}

function authClick()
{
	var isRemember=0;
	if($('#rememberChb').attr('checked'))
	{
		isRemember=1;
	}
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'auth',
	 			 email: $("#authEmail").val(),
	 			 passwd: $("#authPassword").val(),
	 			 remember: isRemember
	 		    
			}, function(data)		
			{
				
			    if(data=='authError')
			    {
			    	$('#authErrorDiv').css('display','block');
			    }
			    else
			    {
			    	$('#authErrorDiv').css('display','none');
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail","");
			    	//location.href=lloc;
			    	window.location.reload();
			    }
			});
}
function authClick2()
{
	var isRemember=0;
	if($('#rememberChb2').attr('checked'))
	{
		isRemember=1;
	}
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'auth',
	 			 email: $("#authEmail2").val(),
	 			 passwd: $("#authPassword2").val(),
	 			 remember: isRemember
	 		    
			}, function(data)		
			{
			    if(data=='authError')
			    {
			    	$('#authErrorDiv2').css('display','block');
			    }
			    else
			    {
			    	$('#authErrorDiv2').css('display','none');
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail2","");
			    	//location.href=lloc;
			    	window.location.reload();
			    }
			});
}
function authClick3()
{
	var isRemember=0;
	if($('#rememberChb3').attr('checked'))
	{
		isRemember=1;
	}
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'auth',
	 			 email: $("#authEmail3").val(),
	 			 passwd: $("#authPassword3").val(),
	 			 remember: isRemember
	 		    
			}, function(data)		
			{
			    if(data=='authError')
			    {
			    	$('#authErrorDiv3').css('display','block');
			    }
			    else
			    {
			    	$('#authErrorDiv3').css('display','none');
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail3","");
			    	//location.href=lloc;
			    	window.location.reload();
			    }
			});
}
function authClick5()
{
	var isRemember=0;
	if($('#rememberChb5').attr('checked'))
	{
		isRemember=1;
	}
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'auth',
	 			 email: $("#authEmail5").val(),
	 			 passwd: $("#authPassword5").val(),
	 			 remember: isRemember
	 		    
			}, function(data)		
			{
			    if(data=='authError')
			    {
			    	$('#authErrorDiv5').css('display','block');
			    }
			    else
			    {
			    	$('#authErrorDiv5').css('display','none');
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail5","");
			    	user_auth = true;
					document.getElementById('i_in_photo_mess').style.display='none';
					document.getElementById('comment_reg_div').style.display='none';
			    	location.href="index.php?o=viq_in";
			    	//window.location.reload();
			    }
			});
}
function authClick6()
{
	var isRemember=0;
	if($('#rememberChb6').attr('checked'))
	{
		isRemember=1;
	}
	$.post("/ajax/ajaxRegister.php", 
			{
	 			 o: 'auth',
	 			 email: $("#authEmail6").val(),
	 			 passwd: $("#authPassword6").val(),
	 			 remember: isRemember
	 		    
			}, function(data)		
			{
			    if(data=='authError')
			    {
			    	$('#authErrorDiv6').css('display','block');
			    }
			    else
			    {
			    	$('#authErrorDiv3').css('display','none');
			    	var lloc=location.href;
			    	lloc=lloc.replace("#authEmail6","");
			    	//location.href=lloc;
			    	//window.location.reload();
			    	user_auth = true;
					document.getElementById('i_in_photo_mess').style.display='none';
					document.getElementById('comment_reg_div').style.display='none';
			    	add_question();
			    	
			    }
			});
}
