function Mobile_Button_add_user()
{
	CloseMenu();
	Button_add_user();
}
function Mobile_Button_get_all_user()
{
	CloseMenu();
	Button_get_all_user();
}
function Mobile_Button_Add_New_Reseller()
{
	CloseMenu();
	Button_Add_New_Reseller();
}
function Mobile_Button_get_reseller()
{
	CloseMenu();
	Button_get_reseller();
}



function CloseMenu() {
	
	var y=document.getElementById("triplebar");
	y.classList.toggle("change");
	var x = document.getElementById("ezcontent");
	if (x.style.display === "block") {
		x.style.display = "none";
	} else {
		x.style.display = "block";
	}
 }
function mySetting(y) {
	y.classList.toggle("change");
	var x = document.getElementById("ezcontent");
	if (x.style.display === "block") {
		x.style.display = "none";
	} else {
		x.style.display = "block";
	}
	
	 if (g_user_level==3)
	{
		
		document.getElementById("reseller_button").style.display = "none";
		
	}
	
}
function Init_Config()
{
  var login_status = document.getElementById("login_status");
  var iconwidth=25;
  var iconheight=25;

   if (xmlHttp.readyState == 4) {
   if (xmlHttp.status == 200)
   {
	var response= xmlHttp.responseText.split("\r\n");
    	var main_screen= document.getElementById("main_screen");
	var str;
	str='';
	str+='<div id="eztitle">';
	str+='<table align="center" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
	str+='<tr>';
	str+='<td>';
	str+='<p align="left" style="margin-left: 15; margin-top: 0; margin-bottom: 0">';
	str+='<font face="Arial"  color="#ffffff" size="6">Ezserver v7.0</font>';
	str+='</p>';
	str+='</td>';
	

	if(bMobileDevice){
		
		str+='<td width=50% id=credit_no>';
		str+='<p align="center" style="margin-left: 0; margin-top: 0; margin-bottom: 0">';
		str+='<font face="Arial" size="6" color="#ffffff"><b></b></font>';
		str+='</p>';
		str+='</td>';
		str+='<td>';
		str+='<div class="menucontainer" id=triplebar onclick="mySetting(this)">';
		  str+='<div class="bar1"></div>';
		  str+='<div class="bar2"></div>';
		  str+='<div class="bar3"></div>';
		str+='</div>';
		str+='<a style="margin-left:100;" href="javascript:logout()"><img border="0"  style="margin-right: 30;" src="/admin/logout.png" width="'+70+'" height="'+60+'"></a>';
		
	}else
	{
		str+='<td width=60% id=credit_no>';
		str+='<p align="center" style="margin-left: 0; margin-top: 0; margin-bottom: 0">';
		str+='<font face="Arial" size="6" color="#ffffff"><b></b></font>';
		str+='</p>';
		str+='</td>';
		str+='<td width=20%>';
		str+='<p align="right" style="margin-right: 15; margin-top: 0; margin-bottom: 0">';
		str+='<a href="javascript:logout()"><img border="0"  style="margin-right: 30;" src="logout.png" width="'+iconwidth+'" height="'+iconheight+'"></a>';
		str+='</p>';
	}
	
	
	str+='</td>';
	str+='</tr>';
	str+='</table>';
	str+='</div>';
	
	str+='<div id="ezcontent">';
	if(bMobileDevice){
		
		
		  str+='<nav class="navigation">';
		  str+='<ul class="mainmenu">';
		    str+='<li><a href="javascript:Mobile_callServer_System_Inquery()">DASHBOARD</a></li>';
		    
		    str+='<li><a href="javascript:void(0)">USERS</a>';
		      str+='<ul class="submenu">';
			 str+='<li><a href="javascript:Mobile_Button_add_user()">Add User</a></li>';
		         str+='<li><a href="javascript:Mobile_Button_get_all_user()">Manage Users</a></li>';
		      str+='</ul>';
		    str+='</li>';
		   
		    str+='<li id=reseller_button><a href="javascript:void(0)">RESELLER</a>';
		      str+='<ul class="submenu">';
		         str+='<li><a href="javascript:Mobile_Button_Add_New_Reseller()">Add Subreseller</a></li>';
		         str+='<li><a href="javascript:Mobile_Button_get_reseller()">Manage Subresellers</a></li>';
		      str+='</ul>';
		      
		    str+='</li>';
		   
	    
		  str+='</ul>';
		str+='</nav>';
		
		
	}else
	{
		str+='<div class="navbar" style="padding-left: 100px;">';
		// Dashboard
		str+='<div class="menudropdown">';
		    str+='<button class="dropbtn" onclick="callServer_System_Inquery()" ><img  src="home.PNG" align="texttop"  width=25 height=25></img> DashBoard '; 
		    str+='</button>';
		str+='</div>'; 
		// User
		str+='<div class="menudropdown">';
		    str+='<button class="dropbtn"><img src="user.PNG" align="texttop" width=25 height=25></img> Users '; 
		    str+='<i class="fa fa-caret-down"></i>';
		    str+='</button>';
		    str+='<div class="menudropdown-content">';
		      str+='<a href="javascript:Button_add_user()">Add User</a>';
		      str+='<a href="javascript:Button_get_all_user()">Manage Users</a>';
		    str+='</div>';
		str+='</div>'; 
		str+='<div id=reseller_button class="menudropdown">';
		    str+='<button class="dropbtn"><img src="reseller.PNG" align="texttop" width=25 height=25></img> Reseller '; 
		    str+='<i class="fa fa-caret-down"></i>';
		    str+='</button>';
		    str+='<div class="menudropdown-content">';
		      str+='<a href="javascript:Button_Add_New_Reseller()">Add Subreseller</a>';
		      str+='<a href="javascript:Button_get_reseller()">Manage Subresellers</a>';
		    str+='</div>';
		str+='</div>'; 
		
	} 
		
	str+='</div>';
	
	if(bMobileDevice){
		str+='<div id="ezhead" style=" padding-left: 0px;background-color:#F5F6F8"><font size=4><b>Dashboard</b></font>';
		str+='</div>';                              	
		str+='<div id="content" style=" padding-left: 0px; padding-right: 120px;background-color:#F5F6F8">';
		str+='</div>';  
		str+='<div id="eontent" style=" height:100%;">';
		str+='</div>';    
	}else
	{  
		str+='<div id="ezhead" style=" padding-left: 120px;background-color:#F5F6F8"><font size=4><b>Dashboard</b></font>';
		str+='</div>';                              	
		str+='<div id="content" style=" padding-left: 120px; padding-right: 120px;background-color:#F5F6F8">';
		str+='</div>';  
		str+='<div id="eontent" style=" height:80%;">';
		str+='</div>';    
	}
	                         
	str+='</div>';   
	main_screen.innerHTML=str;
	if(bMobileDevice){
       		document.getElementById("ezcontent").style.display = "none";
       		document.getElementById("eztitle").style.height="160";
       }
	
/*	
	str+='<div id="ezmenu">';
	str+='<div style="border: 1px solid #DFDFDF; width:99%; height:50%;">';
	str+='<table align="center" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
			
	
	str+='<tr id="user_button" style="cursor: pointer;" onmouseover="ChangeMenuBackgroundColor(this)" onmouseout="RestoreMenuBackgroundColor(this)" onclick="Button_get_all_user()">';
	str+='<td>';
	str+='<p align="left" style="margin-left: 15; margin-top: 0; margin-bottom: 0"><img border="0" src="user.PNG" width="18" height="18" align="absmiddle">&nbsp;';
        str+='<font face="Arial" size="2"><b>Users</b></font>';
      	str+='</td>';
	str+='</tr>';
	
	str+='<tr id="add_user_button" style="cursor: pointer;" onmouseover="ChangeMenuBackgroundColor(this)" onmouseout="RestoreMenuBackgroundColor(this)" onclick="open_modal()">';
	str+='<td>';
	str+='<p align="left" style="margin-left: 60; margin-top: 0; margin-bottom: 0">';
        str+='<font face="Arial" size="5"><b>+</b></font><font face="Arial" size="2"><b>&nbsp;&nbsp;Add User</b></font>';
      	str+='</td>';
	str+='</tr>';

	str+='<tr id="del_user_button" style="cursor: pointer;" onmouseover="ChangeMenuBackgroundColor(this)" onmouseout="RestoreMenuBackgroundColor(this)" onclick="callezserver_delete_selected_user()">';
	str+='<td>';
	str+='<p align="left" style="margin-left: 60; margin-top: 0; margin-bottom: 0">';
        str+='<font face="Arial" size="6"><b>-</b><font face="Arial" size="2"><b>&nbsp;&nbsp;Delete Users</b></font>';
      	str+='</td>';
	str+='</tr>';

	
	str+='<tr id="reseller_button" style="cursor: pointer;" onmouseover="ChangeMenuBackgroundColor(this)" onmouseout="RestoreMenuBackgroundColor(this)" onclick="Button_get_reseller()">';
	str+='<td id=reseller_icon>';
      	str+='</td>';
	str+='</tr>';

	str+='<tr id="add_reseller_button" style="cursor: pointer;" onmouseover="ChangeMenuBackgroundColor(this)" onmouseout="RestoreMenuBackgroundColor(this)" onclick="open_modal_Reseller()">';
	str+='<td id=add_reseller_icon>';
      	str+='</td>';
	str+='</tr>';
	
	
		
	str+='</table></div></div>';
	str+='<div id="ezcontent">';
	str+='<div id="content">';
//	str+='<table align="center" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
//	str+='<tr>';
//	str+='<td id=content height="100%" style="overflow:hidden;">';
//	str+='</td>';
//	str+='</tr>';
//	str+='</table></div>';
	str+='</div>';
	main_screen.innerHTML=str;
	*/
	if (location.protocol == 'https:') {
		g_api_httpport=response[26];
		g_httpport=response[27];
	}else if (location.protocol == 'http:') {
		g_api_httpport=response[1];
		g_httpport=response[2];
		
	}
	//g_httpport=response[0];
	call_user_authorization_mode();
   }else
   {
   	login_status.innerHTML='<p style="margin-left: 25; margin-top: 0"><font face="Arial" size="2" color="#ff0000"><b>Illegal administrator user.</b></font>';
   }
 
  }
}