
$("#userlogin_submit").live("click",function(e)
{e.preventDefault();var str=$("#camguard_login").serialize();$.ajax({type:"POST",url:"process.php",data:str,dataType:"json",async:false,error:function(XMLHttpRequest,textStatus,errorThrown)
{$("#login_error_txt").html("Fejl. Kontakt Camguard.");},success:function(data,textStatus,XMLHttpRequest)
{if(data.ret_code==-1)
{alert(data.errMsg);$('#mask-pop').hide();$('.window-pop').hide();}
else if(data.ret_code==0)
{$("#login_error_txt").html(data.errMsg);$("#token_login").val(data.token);if(data.u_err>0)
{$("#account").css({"background-color":"red","color":"white"});}
else if(data.p_err>0)
{$("#pswd").css({"background-color":"red","color":"white"});}}
else
{location.replace(data.url);}}});});$("#userlogin_reset").live("click",function(e)
{e.preventDefault();var str=$("#camguard_reset_login").serialize();$.ajax({type:"POST",url:"process.php",data:str,dataType:"json",async:false,error:function(XMLHttpRequest,textStatus,errorThrown)
{$("#camguard_reset_login_error").html("Fejl. Kontakt Camguard.");},success:function(data,textStatus,XMLHttpRequest)
{if(data.ret_code==-1)
{alert(data.errMsg);$('.window-pop_ontop').hide();$('#camguard_login_pop').show();}
else if(data.ret_code==0)
{$("#camguard_reset_login_error").html(data.errMsg);$("#token_reset").val(data.token);if(data.u_err>0)
{$("#account_reset").css({"background-color":"red","color":"white"});}}
else
{$("#camguard_reset_login_error").html("");$("#account_reset").css({"background-color":"","color":""});$('.window-pop_ontop').hide();$('#camguard_login_pop').show();}
$("#token_reset").val(data.token);}});});
