var method="login";
var temp_buttons;
   function alertContents5(responseData) {
            result1 = responseData;
			if(method=="reg") {
			if(result1!='success!') {
			var errors=result1.split("<br />");
			for(var iji in errors) {
				if(errors[iji]!='') {
			splitted=errors[iji].split("|");
			theid=splitted[0];
			$("#for_"+theid).css('color',"red");
			$("#for_"+theid).html($("#for_"+theid).html()+'&nbsp;<img id="errs" border="0" src="http://'+Uhost+'/img/errs.png" title="'+splitted[1]+'" />');
			} }
			$("#fsbm").html(temp_buttons);
			}
			else {
			alert('Please check your spam folder for our activation email, if it doesn\'t arrive in your inbox folder (especially Gmail users).');
			$("#fsbm").html('<strong style="font-size:14px">Done! Check your mail to confirm your account.</strong>');
			setTimeout("redirecto('http://'+Uhost+'/member_cp/')",3000);
			} 
			}
			else if(method=="login") {
				taken=result1.split("<*>");
				result1=taken[0];
				if(result1=="ok") {
			$("#login_result").css('visibility','visible');
			$("#login_result").html(taken[1]);
			setTimeout("redirecto('http://'+Uhost+'/member_cp/')",3000);
				}
				else if(result1=="bad") {
				//taken2=taken[1].split("<#>");
				$("#login_result").css('visibility','visible');
				$("#login_result").html(taken[1]);
				$("#fsbm2").html(temp_buttons);
				}
				else if(result1=="not_activated") {
				$("#login_result").css('visibility','visible');
				$("#login_result").html(taken[1]);
				$("#fsbm2").html(temp_buttons);
				}
			}
			
			 //$("#fsbm").html('<input class="signup_button" id="submmiit" type="submit" value="Sign up!" name="zubmit" />');
  }
   
   function get5(obj,method2) {
	   var poststr;
	   
	   if(method2=="reg") {
		   method="reg";
	   var notif='yes';
	   temp_buttons=$("#fsbm").html();
	   $("#for_fullname").css('color',"black");
	   $("#for_fullname").html("Full name:");
	   $("#for_email").css('color',"black");
	   $("#for_email").html("Your e-mail:");
	   $("#for_pass").css('color',"black");
	   $("#for_pass").html("Password:");
	   $("#for_pass_2").css('color',"black");
	   $("#for_pass_2").html("Confirm password:");
	   $("#for_bio").css('color',"black");
	   $("#for_bio").html("Tell us something about you:");
	   $("#for_country").css('color',"black");
	   $("#for_country").html("Your country of residence:");
	   $("#fsbm").html('<img border="0" src="http://'+Uhost+'/img/loading2.gif" />');
	   if($("#recieve").attr('checked')==true) notif='yes'; else notif='';
	  $.post('http://'+Uhost+'/take_signup.php', { fullname: $("#fullname").attr("value"), email: $("#email").attr("value"), pass: $("#pass").attr("value"), pass2:$("#pass_2").attr("value"), author_info: $("#bio").attr("value"), n_letters: notif, country: $("#country").attr("value"), zubmit: "Signup" },
		  function(data){
			alertContents5(data);
		  }, "text");

	   }
	   else if(method2=="login") {
		   method="login";
		   temp_buttons=$("#fsbm2").html();
		   $("#login_result").css('visibility','hidden');
	   $("#fsbm2").html('<div style="height:30px;padding-top:10px;padding-left:40px"><img border="0" src="http://'+Uhost+'/img/loading2.gif" /></div>');
	   $.post('http://'+Uhost+'/login_member.php', { email2: $("#email2").attr("value"), pwd: $("#pwd").attr("value") },
		  function(data){
			alertContents5(data);
		  }, "text");
		
	   }
   }
function redirecto(url) {
window.location=url;
}