	function tp_login(){ }

    tp_login.prototype.init = function() {
	  try{
		  this.login      = $('txtUserName');
		  this.pwd        = $('txtPassword');
		  this.rememberMe = $('cbRememberMe');
	  } catch(e){}
    }	
    
	tp_login.prototype.ParseResponse = function(stream){
	  this.init();
	  try {
	    str = new String(unescape(stream));
	    str.evalScripts();
	  } catch (e){}	
	}
	
	tp_login.prototype.Login = function(){
	  this.init();
	  try {
		  if(this.login.value==""||this.pwd.value==""){alert("Please enter your email address and password.");}
		  else{
			  var args="l="+this.login.value+"&p="+this.pwd.value+"&r="+this.rememberMe.checked;
 			  PostURL("/community/app/nf/callback/loginajax.aspx",args,0,'tp_userLogin.ParseResponse')
 			  //var myAjax = new Ajax.Request("/community/app/nf/callback/loginajax.aspx",{method: 'post', postBody: args, onComplete: this.ParseResponse.bind(this)});

 			  }
	  } catch (e){}	
	}
	
	tp_login.prototype.Register = function(){
	  this.init();
	  try {
		  location.href='/community/app/reg/wiz/userreg.aspx'
	  } catch (e){}	
	}
 	
	tp_login.prototype.EmailMe = function(){
	  this.init();
	  try {
		  if(this.login.value==""){alert("Please enter your email address.");}
		  else{
			  var args="em="+this.login.value+'&action=send';
 			  PostURL('/community/app/nf/callback/loginajax.aspx',args,0,'tp_userLogin.ParseResponse')
 			  }
	  } catch (e){}	
	}
	
	tp_login.prototype.RemindMe = function(){
	  this.init();
	  try {
		  if(this.login.value==""){alert("Please enter your email address.");}
		  else{
			  var args="em="+this.login.value+'&action=remind';
 			  PostURL('/community/app/nf/callback/loginajax.aspx',args,0,'tp_userLogin.ParseResponse')
 			  }
      } catch (e){}	
	}
	
	tp_login.prototype.Logout = function(){
	  this.init();
	  try {
		  if (confirm("Are you sure you wish to log out?")==true){
			  //removeCookie("PermUID");
			  //removeCookie("SID");
			  //location.href='http://'+window.location.host+window.location.pathname;
			  location.href="/editor/app/logout.aspx"
			  }
	  } catch (e){}	
	}
		
    tp_login.prototype.ResetPwd = function(){
	  this.init();
	  try {
		  if(this.login.value==""){alert("Please enter your email address.");}
		  else{
			  var args="rs=1&em="+this.login.value;
 			  PostURL('/community/app/nf/callback/loginajax.aspx',args,0,'tp_userLogin.ParseResponse')
 			  }
	  } catch (e){}	
	}
 

  