var mozaike=function(){var a={appendOk:'<img class="notok" src="/site_media/img/ok.gif" title="Alright!" alt="Alright!" />',appendFail:'<img class="notok" src="/site_media/img/error.gif" title="Error!" alt="Error!" />',appendLoading:'<img class="notok" src="/site_media/img/load_22px.gif" title="Loading!" alt="Loading!" />',lastUsernameCheck:!1,totalCheck:{},usernameCheck:function(){var b=$(this),c=$(this).val();if(c.toLowerCase()==a.lastUsernameCheck)return!1;else a.lastUsernameCheck=c.toLowerCase();
b.val(c.toLowerCase());if(c.length>20||c.length<5)return b.parent().find("b").html(a.appendFail),a.totalCheck.username=0,!1;/^[a-z]{1}[a-z0-9_\-]+$/.test(c.toLowerCase())?$.ajax({url:"/account/ajax/seekuser/?q="+c,beforeSend:function(){b.parent().find("b").html(a.appendLoading);a.totalCheck.username=0},success:function(c){c=="ok"?(b.parent().find("img").attr({src:"/site_media/img/ok.gif",alt:"Alright!",title:"Alright!"}),a.totalCheck.username=1):(b.parent().find("img").attr({src:"/site_media/img/error.gif",
alt:"Error!",title:"Error!"}),a.totalCheck.username=0)},error:function(){b.parent().find("img").attr({src:"/site_media/img/error.gif",alt:"Error!",title:"Error!"});a.totalCheck.username=0}}):(b.parent().find("b").html(a.appendFail),a.totalCheck.username=0);return!1},fullnameCheck:function(){$(this).val().replace(" ","").length>2?($(this).parent().find("b").html(a.appendOk),a.totalCheck.fullname=1):($(this).parent().find("b").html(a.appendFail),a.totalCheck.fullname=0)},passwordCheck:function(){$(this).val().length>
5?($(this).parent().find("b").html(a.appendOk),a.totalCheck.password=1):($(this).parent().find("b").html(a.appendFail),a.totalCheck.password=0)},password2Check:function(){a.totalCheck.password?$(this).val()==$("#f_password").val()?($(this).parent().find("b").html(a.appendOk),a.totalCheck.password2=1):($(this).parent().find("b").html(a.appendFail),a.totalCheck.password2=0):($(this).parent().find("b").html(a.appendFail),a.totalCheck.password2=0)},ready:function(){$("#f_username").live("blur",a.usernameCheck);
$("#f_fullname").live("blur",a.fullnameCheck);$("#f_password").live("blur",a.passwordCheck);$("#f_password2").live("blur",a.password2Check);$("#b_submit").live("click",function(){$("#f_username").trigger("blur");$("#f_fullname").trigger("blur");$("#f_password").trigger("blur");$("#f_password2").trigger("blur");if(a.totalCheck.username*a.totalCheck.fullname*a.totalCheck.password*a.totalCheck.password2!=1){var b=[];b.push('<strong class="f22"><img class="icoalert" src="/site_media/img/alert.gif" alt="Alert!" /> Try to fill all fields correctly.</strong>');
b.push('<center><img src="/site_media/img/separador.gif" alt="-----" class="sep-home"/></center>');$("#messages").html(b.join(""));return!1}})}};return{ready:function(){a.ready()}}}();
