( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/../js/engine.js
 var AppNo = "00000";
var mimiServer = "https://www.thebrand.ai/real/";
 var Server = "https://www.thebrand.ai/";

 //var mimiServer = "https://www.thebrand.ai/real/";
 //var Server = "https://www.thebrand.ai/";


 function reloadText(){
                  	  	 loading_show();
		var updateUrl = $("#updateUrl").val();	 
		 var themeid = $(this).attr("id"); 
		 var update = $("#update").val();
		  
		 var setFontSize = $("#setFontSize").val();
		var layerid = $("#level").val(); 
		var removelayerid = $("#level").val();
		var removelayerid = removelayerid-1;
		var setLineHeight = $("#setLineHeight").val();
		 var setHAlignment = $("#setHAlignment").val();
		 var opacity = $("#opacity").val();
		 var setPadding = $("#setPadding").val();
		 
		 var setWidth = $("#setWidth").val();
		 var text_color = $("#text_color").val();
		 var text_color = text_color.replace("#", "");
		 var positionx = $("#position-xa").val();
		 var positiony = $("#position-ya").val();
		 $("#pozx").val(positionx);
		 $("#pozy").val(positiony);
		 var font_Text = $("#myFont").val();
		 
		  $("#check").html("Updating Text Layer "+layerid+"...");
		 var level= encodeURI(document.getElementById('level').value); 
	 
		 full && full.bringFront($(this).parents('tr').data(level));
		 full && full.removeLayer($(this).parents('tr').data(level));
 			 
		full && full.addLayer('processFont.php?route=theUpdate&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
			rotation: 0,
			positionX:$("#pozx").val(),
			positionY: positiony,
			 
			category: "0",
			opacity:opacity
		})
   
	 
		loading_hide(); $("#check").html("Successfully updated");return;
	  
                }
                
				
				

     function loading_show(){
                    $('#loadingReportaM').html("").fadeIn('slow');
                }
                
				
				function loading_hide(){
                    $('#loadingReportaM').fadeOut('slow');
                }
				
    




function highlightStar(obj,id) {
	removeHighlight(id);		
	$('.demo-table #tutorial-'+id+' li').each(function(index) {
		$(this).addClass('highlight');
		if(index == $('.demo-table #tutorial-'+id+' li').index(obj)) {
			return false;	
		}
	});
}

function removeHighlight(id) {
	$('.demo-table #tutorial-'+id+' li').removeClass('selected');
	$('.demo-table #tutorial-'+id+' li').removeClass('highlight');
}

function addRating(obj,id,qn) {
	
	
	$('.demo-table #tutorial-'+id+' li').each(function(index) {
		$(this).addClass('selected');
		$('#tutorial-'+id+' #rating').val((index+1));
		if(index == $('.demo-table #tutorial-'+id+' li').index(obj)) {
			return false;	
		}
	});
	
  
 
 var rating = $('#tutorial-'+id+' #rating').val();	

loading_show();	
 	
$.post(Server+'ezikiframework.php?mode=rate&rate='+rating+'&qn='+id+'&theid='+qn+'',  function(data) {
var returnValue = data;

loading_hide();	 
 });
 

}
function eventRating(obj,id,qn) {

	
	$('.demo-table #tutorial-'+id+' li').each(function(index) {
		$(this).addClass('selected');
		$('#tutorial-'+id+' #rating').val((index+1));
		$('#title-'+id).html(index+1);
		if(index == $('.demo-table #tutorial-'+id+' li').index(obj)) {
			return false;	
		}
	});
	
  
 
 var rating = $('#tutorial-'+id+' #rating').val();	

loading_show();	
 	
$.post(Server+'ezikiframework.php?mode=eventRate&rate='+rating+'&qn='+id+'&theid='+qn+'',  function(data) {
var returnValue = data;

loading_hide();	 
 });
 

}

function resetRating(id) {
	if($('#tutorial-'+id+' #rating').val() != 0) {
		$('.demo-table #tutorial-'+id+' li').each(function(index) {
			$(this).addClass('selected');
			if((index+1) == $('#tutorial-'+id+' #rating').val()) {
				return false;	
			}
		});
	}
} 
function updateConnecta(id) {
 loading_show();
	var description = document.getElementById("description").value;
var time = document.getElementById("time").value;
var id = id;
 var when = document.getElementById("when").value;	
 	
  var where = document.getElementById("where").value;	
   
	  var yanani = document.getElementById("yanani").value;	
 var catalogid = document.getElementById("catalogid").value;
 
 if($.trim(where).length==0 || $.trim(description).length==0 || $.trim(time).length==0 || $.trim(where).length==0 || $.trim(when).length==0)
{
alert("Please Enter all "+type+" Details");

loading_hide();
return;
}
 

$.post(Server+'ezikiframework.php?mode=updateConnecta&time='+time+'&where='+where+'&when='+when+'&catalogid='+catalogid+'&yanani='+yanani+'&description='+description+'',  function(data) {
var returnValue = data;

if(1 == returnValue){
	$('#notice2').show();
  $('#notice3').hide();
   $('#notice4').show();
  $('#details').slideUp("slow");
 $('#notice').html(type+' Request Successfully Updated!');
 }
 
 
  
 loading_hide();
/* $("#notice",form).attr("disabled","disabled"); */
 
 });


 }	
function Connecta() {
 loading_show();
	var description = document.getElementById("description").value;
var time = document.getElementById("time").value;
 var when = document.getElementById("when").value;	
 	
  var where = document.getElementById("where").value;	
    var type = document.getElementById("type").value;
	var offer = document.getElementById("offer").value;
	var counteroffer = document.getElementById("counteroffer").value;
	var finaloffer = document.getElementById("finaloffer").value;	
	var deal = document.getElementById("deal").value;
	  var yanani = document.getElementById("yanani").value;	
 var catalogid = document.getElementById("catalogid").value;
 
 if($.trim(where).length==0 || $.trim(description).length==0 || $.trim(time).length==0 || $.trim(where).length==0 || $.trim(when).length==0)
{
alert("Please Enter all "+type+" Details");

loading_hide();
return;
}
 

$.post(Server+'ezikiframework.php?mode=connect&deal='+deal+'&time='+time+'&finaloffer='+finaloffer+'&counteroffer='+counteroffer+'&offer='+offer+'&type='+type+'&where='+where+'&when='+when+'&catalogid='+catalogid+'&yanani='+yanani+'&description='+description+'',  function(data) {
var returnValue = data;

if(1 == returnValue){
	$('#notice2').show();
  $('#notice3').hide();
   $('#notice4').show();
  $('#details').slideUp("slow");
 $('#notice').html(type+' Request Successfully Sent!');
 }
else
if(0 == returnValue){
	$('#notice4').show();
  $('#details').slideUp("slow");
$('#notice').html('You have already sent a '+type+' Request to this outlet');} 
else
{
$('#notice').html('Error Occured');
 }
 
  
 loading_hide();
/* $("#notice",form).attr("disabled","disabled"); */
 
 });


 }	
function ReplyToConnection() {
 loading_show();
	var amount = document.getElementById("amount").value;
var reaction = document.getElementById("reaction").value;
var effecto = document.getElementById("effecto").value;
var id = document.getElementById("id").value;
  var yanani = document.getElementById("yanani").value;	
 var catalogid = document.getElementById("catalogid").value;	

 if($.trim(amount).length==0)
{
alert("Please Enter Amount");

loading_hide();
return;
}
$.post(Server+'ezikiframework.php?mode=ReplyToConnection&catalogid='+catalogid+'&yanani='+yanani+'&id='+id+'&amount='+amount+'&reaction='+reaction+'&effecto='+effecto+'',  function(data) {
var returnValue = data;
 
window.location = "indexAlone.php?mode=connectme&connections=1&min=yes&msg="+type+"+Reply+Successfully+Sent!";
if(1 == returnValue){
	
  $('#detail'+effecto).slideUp("slow");
   $('#notice'+effecto).show();
  $('#notice'+effecto).html(type+' Reply Successfully Sent!');
 }
else
if(0 == returnValue){
	$('#notice'+effecto).show();
  $('#reply'+effecto).slideUp("slow");
$('#notice'+effecto).html('You have already sent a '+type+' Reply to this outlet');} 
else
{
$('#notice'+effecto).html('Error Occured');
 }
 
  
 loading_hide();
/* $("#notice",form).attr("disabled","disabled"); */
 
 });


 }	
function ReplyConnecta(value) {
 loading_show();
 var trigger = value;
 $('#reply'+value).fadeIn("slow");
$('#effecto').val(value);
 loading_hide();
}

function Deal(value) {
 loading_show();
 var trigger = value;
 var effecto = 7;
var id = document.getElementById("id").value;
  var yanani = document.getElementById("yanani").value;	
 var catalogid = document.getElementById("catalogid").value;
 
  var who = document.getElementById("who").value; 

 
 $.post(Server+'ezikiframework.php?mode=Deal&catalogid='+catalogid+'&yanani='+yanani+'&id='+id+'',  function(data) {
var returnValue = data;	 
$('#pay').fadeIn("slow");
$('#effecto').val(value);
$('#noticeme').html('<strong> Congratulations  '+who+'</strong>  has been Notified of the deal! <br>Proceed below to finish this deal');
 loading_hide(); 
	 
	  });


}

		




 




 function menuIn()
  {
 var $body = document.body;
	/* $body.className = ( $body.className == 'menu-active' )? '' : 'menu-active';*/
	
	$('#nav2').css('margin-bottom', '0');
	
  }
	
	 
  function menuOut()
  {
 
	 
	$('.header-contX3').css('display', 'block');
	$('.header-contX2').css('margin-top', '-100px');
	$('.header-contX').css('margin-top', '-100px');
$('#nav2').css('margin-bottom', '-45px');
  }

 
   

// Load More
function getFollowers(action) {
	var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();
var meX = $("#meX", form).val();		
var youX = $("#youX", form).val();
var catalogid5 = myaccount;
var me =  myaccount;
var meX =  meX;
var youX =  youX;

 //autoload comments 
var ID = $('.total').attr("id");	

if(action ==1){
var choice =  "friend_one";	
 }
if(action ==2){
var choice =  "friend_two";	
} 
$('#liveupdate').load(mimiServer+"service/social/loadFriend.php?push="+ID+"&catalogid5="+youX+"&me="+meX+"&action="+choice+"&trigger=1").fadeIn("slow");

	
}
function powerUp(){
	
		
		
/*loading_show();*/
 

 
	 
	 
/*$('#nav2').css('margin-bottom', '-45px');*/
 
 
<!--$('#nav2').css('margin-bottom', '-45px');-->
 
 





/*  noticeShow("Merry Christmas to you...");	
var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	
   $.ajax
                    ({
                        type: "GET",
                       url: Server+'processMag.php?execute=yes&AppNo='+AppNo+'&mag=yes&gratitude=xmas&filter=xmas&nani='+ myaccount,
                        data: "AppNo="+AppNo,
                        success: function(msg)
                        {
                            $("#notice").ajaxComplete(function(event, request, settings)
                            {
                                  
                               
							
                            });
                        }
                    });
 
 noticeShow("Xmas Card Complete");*/


/*  noticeShow("Happy Birthday to you...");	
var form = $("#engineX");  
$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	
   $.ajax
                    ({
                        type: "GET",
                       url: Server+'processMag.php?execute=yes&AppNo='+AppNo+'&mag=yes&gratitude=hbd&filter=hbd&nani='+ myaccount,
                        data: "AppNo="+AppNo,
                        success: function(msg)
                        {
                            $("#notice").ajaxComplete(function(event, request, settings)
                            {
                                  
                               
							
                            });
                        }
                    });
 
 noticeShow("Your Birthday Card Complete");
*/









/*
  noticeShow("Making Tshirt. Please Wait...");	
var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	
   $.ajax
                    ({
                        type: "GET",
                       url: Server+'processMag.php?execute=yes&mag=yes&gratitude=tshirt&filter=tshirt&nani='+ myaccount,
                        data: "page="+AppNo,
                        success: function(msg)
                        {
                            $("#notice").ajaxComplete(function(event, request, settings)
                            {
                                  
                               
							
                            });
                        }
                    });
 
 noticeShow("Tshirt Complete. Complete");
*/



var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();
var meX = $("#meX", form).val();		
var youX = $("#youX", form).val();
	var showPic = $("#showPic", form).val(); 
var catalogid5 = myaccount;
var me =  myaccount;
var meX =  meX;
var youX =  youX;
var ID = 0;

$.ajax({
type: "POST",
url: mimiServer+"service/social/loadSocial2.php?AppNo="+AppNo+"&meX="+meX+"&youX="+youX+"&push="+ID+"&noti=0&catalogid5="+catalogid5+"&showPic="+showPic+"&me="+me+"",
data: "&lajstid="+ ID, 
cache: true,
beforeSend: function(){
loading_show();
},
success: function(html){
 
	
$("div#liveupdate").append(html);

var hastheme = $("#hastheme", form).val();
if(0 == hastheme){

 	
/*
loading_show();
	var dataString = "duplicateTheme:yes";
	$("#check").html("<i class='icon-bell text-danger'></i> Adding default theme to your account..." );
	var ID="X";
	var  catalogid="X";
	var picture="X";
	var who =meX;
	var action = "&getPoster=yes";	
	var url = Server+"v/uploadParameters.php?themeid="+ID+"&catalogid="+catalogid+"&who="+who+"&pic="+picture+"&duplicateTheme=yes"+action+"";
	var url = url.replace("&amp;", "&");	
 
	

		$.ajax({
					type: "POST",
					url: url,
					data: dataString,
					cache: false,
					success: function(html){
			 
				window.location = "indexAlone.php?mode=startags";
				
				loading_hide();

					 }
					 });*/	
	 
}



loading_hide();

}
});



return false;
	

};
function defaultTheme()


{
	alert();
	
	if(1 == returnValue){
	
 
 noticeShow("We could not find that email in our records. Kindly check and try again");

}
else
if(0 == returnValue){
	
 

  noticeShow("We successfully sent you your pwd to that email/phone");


	
} 
	
	
	
	}

/// Load More

function notifications(){
	
 var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();
var meX = $("#meX", form).val();		
var youX = $("#youX", form).val();
var catalogid5 = myaccount;
var me =  myaccount;
var meX =  meX;
var youX =  youX;
var ID = 0;
 
$.ajax({
type: "POST",
url: mimiServer+"service/social/loadSocial2.php?AppNo="+AppNo+"&meX="+meX+"&youX="+youX+"&push="+ID+"&noti=2&catalogid5="+catalogid5+"&me="+me+"",
data: "&lajstid="+ ID, 
cache: true,
beforeSend: function(){
loading_show();
},
success: function(html){
 
	
$("div#liveupdate").append(html);

loading_hide();

}
});



return false;
	


} 

/// Load More

function tafuta(){

	
 var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();
var meX = $("#meX", form).val();		
var youX = $("#youX", form).val();
var catalogid5 = myaccount;
var me =  myaccount;
var meX =  meX;
var youX =  youX;
var ID = 0;
 var searchme = $("#tafuta", form).val();	
$.ajax({
type: "POST",
url: mimiServer+"service/social/loadSociale2.php?AppNo="+AppNo+"&push="+ID+"&noti=5&searchme="+searchme+"&catalogid5="+catalogid5+"&me="+me+"",
data: "&lajstid="+ ID, 
cache: true,
beforeSend: function(){
loading_show();
},
success: function(html){
 
	
$("div#liveupdate").append(html);

loading_hide();

}
});



return false;
	


} 



function searchme(){
 	
 

 
loading_show();
var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	
var searchme = $("#searchme", form).val();	
 
var catalogid5 = myaccount;
var me =  myaccount;
var ID = 0;
 
$.ajax({
type: "POST",
url: mimiServer+"service/social/loadSocial2.php?AppNo="+AppNo+"&push="+ID+"&noti=5&searchme="+searchme+"&catalogid5="+catalogid5+"&me="+me+"",
data: "&lajstid="+ ID, 
cache: true,
beforeSend: function(){
loading_show();
},
success: function(html){

	
$("div#liveupdate").append(html);

loading_hide();

}
});



return false;
};






	
 function deleteExtra() {

	 

	 
	var form = $("#captionForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


	var description = $("#description", form).val();
     var tags = $("#tags", form).val();	
 var msg_id = $("#msg_id", form).val();
 var picha = $("#picha", form).val();	
 localStorage.setItem('msg_id', msg_id);
 localStorage.setItem('picha', picha)
loading_show();	
 	
$.get(mimiServer+'service/account/account.php?delete=delete&picha='+picha+'&msg_id='+msg_id+'', formData, function(data) {
var returnValue = data;
 
 $('#notice').html('Successfully Deleted!');
 window.location = "profile.html";
 }, 'html');
 

 }	


    
 function deleteMain() {

	 

	 
	var form = $("#captionMain");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


	var description = $("#description", form).val();
     var tags = $("#tags", form).val();	
 var msg_id = $("#msg_id", form).val();
  var msg_id2 = $("#msg_id2", form).val();
 var picha = $("#picha", form).val();	
 localStorage.setItem('msg_id', msg_id);
 localStorage.setItem('picha', picha)
loading_show();	
 	
$.get(mimiServer+'service/account/account.php?delete=delete&picha='+picha+'&msg_id='+msg_id+'', formData, function(data) {
var returnValue = data;
  $('#msg_id').val(msg_id2);
  getPhoto2PreviewAjx(msg_id2);
  
 $('#notice').html('Successfully Deleted!');
 /*window.location = "profile.html";*/
 }, 'html');
 

 }	

 	

 function captionExtra() {

	 loading_show();
 $("#check").html("Publishing..."); 

	var form = $("#captionForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


	var description = $("#description", form).val();
     var tags = $("#tags", form).val();	
 var msg_id = $("#msg_id", form).val();
 var picha = $("#picha", form).val();	
 localStorage.setItem('msg_id', msg_id);
 localStorage.setItem('picha', picha)
loading_show();	
 	
$.get(mimiServer+'service/account/account.php?caption=caption&description='+description+'&tags='+tags+'&msg_id='+msg_id+'', formData, function(data) {
var returnValue = data;
var msg_id = localStorage.getItem('msg_id');
var picha = localStorage.getItem('picha');		
 /*closePhoto3Preview(); 
 getPhoto3PreviewAjx(task);	


*/ 
 loading_hide();  
 $('#notice').html('Successfully Edited!');
<!-- window.location = "coversEffect.html";-->

window.location = "profile.html";
 }, 'html');
 

 }	
	



 
 function captionPhoto() {

	loading_show(); 

	 
	var form = $("#captionMain");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


	var description = $("#description", form).val();
     var tags = $("#tags", form).val();	
 var msg_id = $("#msg_id", form).val();
 var picha = $("#picha", form).val();	
 localStorage.setItem('msg_id', msg_id);
 localStorage.setItem('picha', picha)
loading_show();	
 	
$.get(mimiServer+'service/account/account.php?caption=caption&description='+description+'&tags='+tags+'&msg_id='+msg_id+'', formData, function(data) {
var returnValue = data;
var msg_id = localStorage.getItem('msg_id');
var picha = localStorage.getItem('picha');		
 /*closePhoto3Preview(); 
 getPhoto3PreviewAjx(task);	


*/ 
 
 $('#notice').html('Successfully Edited!');
<!-- window.location = "coversEffect.html";-->
 loading_hide();
 window.location = "profile.html";
 }, 'html');
 

 }	
	

 	
	
	 function forgot() {
 var form = $("#forgotForm");  



  //$("#doLogin",form).attr("disabled","disabled");
  
var formData = form.serialize();



	
	
 	$('#notice').html('Checking your username...');
 
$.get(mimiServer+'service/account/account.php?forgot='+forgot+'&username='+username+'', formData, function(data) {
var returnValue = data;



if(1 == returnValue){
	
 
 noticeShow("We could not find that email in our records. Kindly check and try again");

}
else
if(0 == returnValue){
	
 

  noticeShow("We successfully sent you your pwd to that email/phone");


	
} 
else
{
 
	
 noticeShow("Error Occured");
 

 
	
	
}
}, 'html');
 


	 }

//end the best forgot
	
	
    function loginFB() {
        openFB.login(
                function(response) {
                    if(response.status == 'connected') {
                        alert('Facebook login succeeded, got access token: ' + response.authResponse.token);
						/*$('#notice').html('Successfully Connected to Facebook');	*/
                        
						
                    } else {
						$('#notice').html('Facebook login failed: ' + response.error);
                       
                    }
                }, {scope: 'email,read_stream,publish_stream'});
    }
 
  
  
  function moveCart(dest) {
    $('#photo_preview').hide();
    $('#photo_preview .pleft').html('empty');
    $('#photo_preview .pright').html('empty');
	 window.location = dest;
	 
};

	
	
	function logOutX() {
	$('#notice').html('Loggin Out...');	 
	window.localStorage.removeItem('username');
window.localStorage.removeItem('pwd');
window.localStorage.removeItem('myaccount');
/*  openFB.logout(
                function() {
                    alert('Logout successful');
                },
                errorHandler);
*/

window.location = "start.html";
}
 
	
	function goHome() {
	
window.location = "index.html";
}
 
		 
  

 function checkPreAuth() {
/*	$('#notice').html('Auto Sign in...');*/	 
	var form = $("#loginForm");
    if(window.localStorage["username"] != undefined && window.localStorage["pwd"] != undefined) {
	
        $("#username", form).val(window.localStorage["username"]);
        $("#pwd", form).val(window.localStorage["pwd"]);
		 
		
	   LoginExtra();
    }
}
 

 function noticeHide() {

  $('#noticeMain').fadeOut('slow');
               
 }
 
  function noticeShow(msg) {
	  
	   $('#msg').html(msg);
 $('#noticeMain').fadeIn('slow');
	 
 }

 

 


 function LoginExtra() {

	

	 
	var form = $("#loginForm");  

var formData = form.serialize();
  var user_name = localStorage.getItem('user_name');
	
     var pwd = $("#pwd", form).val();	
 var doLogin = $("#doLogin", form).val();
 
 

 if($.trim($("#pwd").val()).length==0)
{
 noticeShow("Please Enter Code");	
return;
}
 
 
 loading_show();	
 
 	
$.get(mimiServer+'service/account/account.php?AppNo='+AppNo+'&doLogin='+doLogin+'&user_name='+user_name+'&pwd='+pwd+'', formData, function(data) {
var returnValue = data;



if(5 == returnValue){

// $("#doLogin").removeAttr("disabled");
$('#msg2').html("<span style='color:#FC0'>Oops! Sign in failed.</span>  Check your phone and code combination. ");	
loading_hide();
return;

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});


} else {
	
 
				 
localStorage.setItem('myaccount', returnValue);
localStorage.setItem('user_name', user_name);
localStorage.setItem('pwd', pwd);
 
 
 
if(window.localStorage["user_name"] != undefined && window.localStorage["myaccount"] != undefined) {
	window.location = "index.html";
        
    } 
	else
	{
		window.location = "profile3.html";
	}
 
 
 
 
 
 
 
 
 
 
 
 

loading_hide();
	 
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }




function JoinExtraX() {
	 
	 

	 
	var form = $("#loginForm");  

var formData = form.serialize();
 
 var user_name = $("#user_name", form).val();
	 
    
 
 
 if($.trim($("#user_name").val()).length==0)
{
	
 noticeShow("Please Enter Phone");


	
return;
}
 
 
loading_show();	
 
$.get(mimiServer+'service/account/account.php?sendSMS=trt&AppNo='+AppNo+'&tel='+user_name+'&pwd='+pwd+'', formData, function(data) {
var returnValue = data;

if(7 == returnValue){

// $("#doLogin").removeAttr("disabled");	
 
 
localStorage.setItem('user_name', user_name);

$('#noticeMain').fadeOut('slow');
$('#one').fadeOut('fast');
$('#two').fadeIn('slow');	
$('#three').fadeIn('slow');	

localStorage.setItem('quick', 'yes');

$.get(mimiServer+'service/account/account.php?getuser='+user_name+'', formData, function(datax) {
var returnValuex = datax;

 $('#msg2').html("<span style='color:#FC0'>Welcome Back, "+returnValuex+"! </span> <br>We just sent you an SMS with a code to verify this phone.");
 
 
 }, 'html');






 loading_hide();
return;

} 
if(6 == returnValue){
  
$('#msg2').html("Sorry. Your account has been deactivated for 2 weeks.");
 $('#one').fadeOut('fast');
$('#two').fadeOut('slow');
 
 loading_hide();
 return;
 

} if(9 == returnValue){
$('#msg2').html(returnValue);	
localStorage.setItem('myaccount', returnValue);
localStorage.setItem('user_name', user_name);
 
$('#noticeMain').fadeOut('slow');
$('#one').fadeOut('fast');
$('#two').fadeIn('slow');	
$('#msg2').html("<span style='color:#FC0'>Thank you for Joining .</span> <br>We just sent you an SMS with a code to verify this phone.");
loading_hide();
 
/*window.location = "profile3.html";*/

 return;
  
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }











 function JoinExtra() {
	 
	 

	 
	var form = $("#joinForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


//check if stored already
/* if(window.localStorage["username"] != undefined && window.localStorage["pwd"] != undefined) {
	 
	 
	  $("#username", form).val(window.localStorage["username"]);
        $("#pwd", form).val(window.localStorage["pwd"]);
 
        
    }
	else
	{
	var u = $("#username", form).val();
     var p = $("#pwd", form).val();	
	}*/

	
	var user_name = $("#user_name", form).val();
	 var tel = $("#tel", form).val();	
     var pwd = $("#pwd", form).val();	
 var Join = $("#Join", form).val();
 
 
 if($.trim($("#user_name").val()).length==0)
{
	
 noticeShow("Please Enter Some Text");


	
return;
}
 if($.trim($("#pwd").val()).length==0)
{
	
noticeShow("Please Enter Some Text");	
	
return;
} 
 
 
 
loading_show();	
 
$.get(mimiServer+'service/account/account.php?Join='+Join+'&user_name='+user_name+'&AppNo='+AppNo+'&tel='+tel+'&pwd='+pwd+'', formData, function(data) {
var returnValue = data;
 
if(5 == returnValue){

// $("#doLogin").removeAttr("disabled");	
	
 
 noticeShow("That username already exists. ");
//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});
loading_hide();
return;

} 
if(6 == returnValue){

// $("#doLogin").removeAttr("disabled");	
	
 
 noticeShow("That phone number already exists.");
//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});
loading_hide();
return;

} else {
$('#notice').html(returnValue);	
localStorage.setItem('myaccount', returnValue);
localStorage.setItem('tel', tel);
localStorage.setItem('pwd', pwd);

if(window.localStorage["user_name"] != undefined && window.localStorage["myaccount"] != undefined) {
	window.location = "index.html";
        
    } 
	else
	{
		window.location = "profile3.html";
	}
 
 
 
	        
/*$.mobile.changePage("index.html");	*/			


/*alert("Successfully, Logged in. My Account No is: "+returnValue);				// 
*/				//window.location = "panel.htm";
				
		//$('#login').html('');
	
//$('#loginForm input[name*="pe"]').val('');
//window.location = "panel.htm";	
	
	 
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }





 function updateProfile() {
	 
	var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	 

	 
	var form = $("#updateForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


//check if stored already
/* if(window.localStorage["username"] != undefined && window.localStorage["pwd"] != undefined) {
	 
	 
	  $("#username", form).val(window.localStorage["username"]);
        $("#pwd", form).val(window.localStorage["pwd"]);
 
        
    }
	else
	{
	var u = $("#username", form).val();
     var p = $("#pwd", form).val();	
	}*/

	
	
	var username = $("#name", form).val();
     var email = $("#email", form).val();	
 var tel = $("#tel", form).val();
 
  var catalogname = $("#catalogname", form).val();
 
  
  
 if($.trim($("#email").val()).length==0)
{
	
$('#notice').html('Please Enter Some Text');	
	
return;
}
  
  
loading_show();	

$.get(mimiServer+'service/account/account.php?update=update&username='+username+'&email='+email+'&tel='+tel+'&myaccount='+myaccount+'&catalogname='+catalogname+'', formData, function(data) {
var returnValue = data;



if(0 == returnValue){

// $("#doLogin").removeAttr("disabled");	
	
 $('#notice').html('That phone number already exists.');
 loading_hide();
 

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});

return
}
if(2 == returnValue){

// $("#doLogin").removeAttr("disabled");	
	
 $('#notice').html('That username already exists.');

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});

return
}
if(3 == returnValue){

// $("#doLogin").removeAttr("disabled");	
 noticeShow("That  email already exists.");	
 

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});

return
}
else {
 $('#notice').html(returnValue);	

 




	window.location = "profile.html"; 






/*	 

        
$.mobile.changePage("index.html");	*/			


/*alert("Successfully, Logged in. My Account No is: "+returnValue);				// 
*/				//window.location = "panel.htm";
				
		//$('#login').html('');
	
//$('#loginForm input[name*="pe"]').val('');
//window.location = "panel.htm";	
	
	 
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }

function updateFinish() {
	 
	 

	 
	var form = $("#updateForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


//check if stored already
/* if(window.localStorage["username"] != undefined && window.localStorage["pwd"] != undefined) {
	 
	 
	  $("#username", form).val(window.localStorage["username"]);
        $("#pwd", form).val(window.localStorage["pwd"]);
 
        
    }
	else
	{
	var u = $("#username", form).val();
     var p = $("#pwd", form).val();	
	}*/
	
	
	
	
	
	
 var name = $("#name", form).val();
 
	var day = $("#day", form).val();
	var month = $("#month", form).val();
     var year = $("#year", form).val();	
 var gender = $("#gender", form).val();
  var user_name = $("#user_name", form).val();
 var myaccount = localStorage.getItem('myaccount');
/*  var country = $("#country", form).val();*/
 
  var country = "kenya";
  
  
  
  if($.trim($("#gender").val()).length==0)
{
	
 noticeShow("Please Enter Gender"); 
	
return;
}
  
   
 if($.trim($("#user_name").val()).length==0)
{
	
 noticeShow("Please Enter Username"); 
	
return;
}
  
 
  if($.trim($("#name").val()).length==0)
{
	
noticeShow("Please Enter Your Name"); 	
return;
}
  

 
 
 
   noticeShow("Sending Invitation. Please Wait...");	
var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	
   $.ajax
                    ({
                        type: "GET",
                       url: Server+'processMag.php?mag=no&execute=yes&gratitude=start&AppNo='+AppNo+'&filter=gratitude&nani='+myaccount+'',
                        data: "page="+AppNo,
                        success: function(msg)
                        {
                            $("#notice").ajaxComplete(function(event, request, settings)
                            {
                                  
                               noticeShow("Sending Invitation. Complete");
							
                            });
                        }
                    });
 
 
 
 
 
 noticeShow("Updating Profile: Please Wait...");	
 
$.get(mimiServer+'service/account/account.php?updateFinish=update&AppNo='+AppNo+'&name='+name+'&user_name='+user_name+'&day='+day+'&month='+month+'&year='+year+'&gender='+gender+'&myaccount='+myaccount+'', formData, function(data) {
var returnValue = data;
 

if(0 == returnValue){ 

// $("#doLogin").removeAttr("disabled");	
	
 noticeShow("That Username is taken.");

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});

return
}
if(2 == returnValue){ 

// $("#doLogin").removeAttr("disabled");	
	
 noticeShow("That Display Name is taken.");

//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});

return
}
if(1 == returnValue){ 
 
 
 window.location = "index.html";
 	 
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }



 function updateName() {
	 
	 

	 
	var form = $("#updateForm");  

var formData = form.serialize();

  //$("#doLogin",form).attr("disabled","disabled");


//check if stored already
/* if(window.localStorage["username"] != undefined && window.localStorage["pwd"] != undefined) {
	 
	 
	  $("#username", form).val(window.localStorage["username"]);
        $("#pwd", form).val(window.localStorage["pwd"]);
 
        
    }
	else
	{
	var u = $("#username", form).val();
     var p = $("#pwd", form).val();	
	}*/

	
	var username = $("#username", form).val();
	var name = $("#name", form).val();
     var email = $("#email", form).val();	
 var tel = $("#tel", form).val();
 
  var catalogname = $("#catalogname", form).val();
   var description = $("#description", form).val();
var form = $("#engineX");  
//$("#doLogin",form).attr("disabled","disabled");
var myaccount = $("#myaccountX", form).val();
var AppNo = $("#AppNoX", form).val();	

 
loading_show();	

$.get(mimiServer+'service/account/account.php?captionName=catalogname&username='+username+'&email='+email+'&name='+name+'&description='+description+'&tel='+tel+'&myaccount='+myaccount+'&catalogname='+catalogname+'', formData, function(data) {
var returnValue = data;



if(0 == returnValue){

// $("#doLogin").removeAttr("disabled");	
	
 
 noticeShow("That phone number/email already exists.");
//navigator.notification.alert("Your login failed Check your email and pwd combination", function() {});
loading_hide();
return;

} else {
 $('#notice').html(returnValue);	
closePhoto4Preview();
 
/*window.location = "profile.html";*/

 
	        
/*$.mobile.changePage("index.html");	*/			


/*alert("Successfully, Logged in. My Account No is: "+returnValue);				// 
*/				//window.location = "panel.htm";
				
		//$('#login').html('');
	
//$('#loginForm input[name*="pe"]').val('');
//window.location = "panel.htm";	
	
	 
 
}//end else 
}, 'html');
		
	 
	 
	 
	 
	 
	 
 }