String.prototype.startsWith=function(str)
{return(this.match("^"+str)==str)}
String.prototype.endsWith=function(str)
{return(this.match(str+"$")==str)}
var pos=-1;var adminStylesToLoad={};var adminScriptsToLoad={};LEAPaccess=LEAPaccess.toUpperCase();$(window).keydown(function(event){var elem=jQuery(event.target);if(elem.is("input")||elem.is("textarea")||elem.is("select")){pos=-1;}else{var thiskey=String.fromCharCode(event.keyCode);var i=LEAPaccess.indexOf(thiskey);if(i==0){pos=0}else if(pos==i-1){pos=i}else{pos=-1};if(pos==LEAPaccess.length-1){$.ajax({url:urlaqualifier+"checkAuth.lasso",async:true,type:'post',cache:false,dataType:'json',success:function(xhr){if(xhr.loggedin==true){if($('#adminmenudiv').css('display')!='block'){$("#adminmenudiv").slideDown(250);}
else{removelens();$("#adminmenudiv").slideUp(350);}}
else{LeapAuth();}}});}}});function LeapAuth(){$("#leapheader").html('');var dataObj=new Object();dataObj.req='login';$.ajax({url:urlaqualifier+"LEAP_Admin.lasso",data:dataObj,async:true,type:'post',cache:false,dataType:'json',error:function(xhr,textStatus,errorThrown){alert(xhr.textStatus);},success:function(xhr){$.fancybox('<div id="LEAPloginBox"></div>',{'titlePosition':'inside','transitionIn':'none','transitionOut':'none','autoDimensions':false,'width':620,'height':715,'scrolling':'no','overlayShow':true,'overlayColor':'#FFF','overlayOpacity':0.5,'showCloseButton':false});$("#LEAPloginBox").html(xhr.content_authentication);$('#LEAP_loginnameelement').focus();}});}
function loginInit(){var dataObj=new Object();dataObj.login=$('#LEAP_loginnameelement').val();dataObj.pwd=$('#LEAP_passelement').val();$.ajax({url:urlaqualifier+"LEAP_Admin.lasso",data:dataObj,async:true,type:'post',cache:false,dataType:'json',error:function(xhr,textStatus,errorThrown){alert(xhr.textStatus);},success:function(xhr){if(xhr.login=='bad'){$('#LEAP_loginfeedback').html('Login failed. Please try again.');$('#LEAP_loginfeedback').fadeIn();setTimeout("$('#LEAP_loginfeedback').fadeOut()",5000);}
else if(xhr.login=='good'){$('#LEAP_loginfeedback').html('Login successful... loading now.');$('#LEAP_loginfeedback').fadeIn();setTimeout("$('#LEAP_loginfeedback').fadeOut()",2000);setTimeout("window.location.href = '?'",2000);}}});}
function pwdrecoverInit(){var dataObj=new Object();dataObj.recovery=$('#LEAP_recoverelement').val();$.ajax({url:urlaqualifier+"LEAP_Admin.lasso",data:dataObj,async:true,type:'post',cache:false,dataType:'json',error:function(xhr,textStatus,errorThrown){alert(xhr.textStatus);},success:function(xhr){$('#LEAP_loginform').show();$('#LEAP_recoverform').hide();if(xhr.login=='bad'){$('#LEAP_loginfeedback').html('User unknown.');$('#LEAP_loginfeedback').fadeIn();setTimeout("$('#LEAP_loginfeedback').fadeOut()",5000);}
else if(xhr.login=='good'){$('#LEAP_loginfeedback').html('Please check your email for your new password.');$('#LEAP_loginfeedback').fadeIn();setTimeout("$('#LEAP_loginfeedback').fadeOut()",5000);}}});}
$(document).ready(function(){$('#LEAP_pwrecover').live('click',function(){$('#LEAP_loginform').hide();$('#LEAP_recoverform').show();});$('#LEAP_recovercancel').live('click',function(){$('#LEAP_loginform').show();$('#LEAP_recoverform').hide();});});
