diff --git a/admin.php b/admin.php
index 23d8f37..57878ad 100644
--- a/admin.php
+++ b/admin.php
@@ -1658,24 +1658,17 @@ return $strng;
 }
 
 function func_main($info,$u_tab) {
-func_gallery_reorder($_SESSION['m_id']);
-func_page_reorder($_SESSION['m_id']);
-
-
-
-if ($u_tab=="member_notes_add"){
-
-func_draw_head(7);
-
-} else {
-
-func_draw_head();
-
-}
+	func_gallery_reorder($_SESSION['m_id']);
+	func_page_reorder($_SESSION['m_id']);
 
+	if ($u_tab=="member_notes_add"){
+		func_draw_head(7);
+	} else {
+		func_draw_head();
+	}
 
-if ($u_tab == "" && !isset($_SESSION['r_id'])) {
-  func_draw_title("Welcome to your HWD: Client Admin Panel");
+	if ($u_tab == "" && !isset($_SESSION['r_id'])) {
+		func_draw_title("Welcome to your HWD: Client Admin Panel");
  ?>
    <br>
  <ul>
@@ -1685,82 +1678,80 @@ if ($u_tab == "" && !isset($_SESSION['r_id'])) {
  </li>
 
  <?php
+	}
 
-}
-
-$mytabs = array();
-$u_tabby=0;
-$u_tabz=0;
-//echo '<div id="dhtmlgoodies_tabView1">';
-
-if (strlen($info)>0){ echo '<font face="arial" size="2" color="#ff0000"><b>'.$info.'</b></font><br><br>'; }
-if ( $u_tab == "gallery" || (($userdata['s_gallery_edit']==1) || ($_SESSION['r_id'] > 0) )){
-//echo '	<div class="dhtmlgoodies_aTab">';
-
-$counting_gallery = 0;
-//echo '<a name="galleries"></a>';
-$query_add = "";
-if ($_GET['type'] == "video") {
-func_draw_title($_SESSION['label']['gallery_video_manage'.'_'.$_GET['series']]);
-$query_add = " and video=1";
-} elseif ($_GET['type'] == "product") {
-func_draw_title($_SESSION['label']['gallery_product_manage'.'_'.$_GET['series']]);
-$query_add = " and product=1";
-} elseif ($_GET['type'] == "paypal") {
-func_draw_title($_SESSION['label']['gallery_paypal_manage'.'_'.$_GET['series']]);
-$query_add = " and paypal=1";
-} elseif ($_GET['type'] == "wip") {
-func_draw_title($_SESSION['label']['gallery_wip_manage'.'_'.$_GET['series']]);
-$query_add = " and wip=1";
-} elseif ($_GET['type'] == "slideshow") {
-func_draw_title($_SESSION['label']['gallery_slideshow_manage'.'_'.$_GET['series']]);
-$query_add = " and slideshow=1";
-} else {
-func_draw_title($_SESSION['label']['gallery_gallery_manage'.'_'.$_GET['series']]);
-$query_add = " and video=0 and paypal=0 and product=0 and wip=0 and slideshow=0";
-}
-
-func_draw_top("View","Edit Details",1,"Delete");
-if (isset($_SESSION['r_id'])){
-$submembra = $_SESSION['r_id'];
-} else {
-$submembra = 0;
-}
+	$mytabs = array();
+	$u_tabby=0;
+	$u_tabz=0;
+	//echo '<div id="dhtmlgoodies_tabView1">';
+
+	if (strlen($info)>0){ echo '<font face="arial" size="2" color="#ff0000"><b>'.$info.'</b></font><br><br>'; }
+	if ( $u_tab == "gallery" || (($userdata['s_gallery_edit']==1) || ($_SESSION['r_id'] > 0) )){
+	//echo '	<div class="dhtmlgoodies_aTab">';
+
+	$counting_gallery = 0;
+	//echo '<a name="galleries"></a>';
+	$query_add = "";
+	if ($_GET['type'] == "video") {
+		func_draw_title($_SESSION['label']['gallery_video_manage'.'_'.$_GET['series']]);
+		$query_add = " and video=1";
+	} elseif ($_GET['type'] == "product") {
+		func_draw_title($_SESSION['label']['gallery_product_manage'.'_'.$_GET['series']]);
+		$query_add = " and product=1";
+	} elseif ($_GET['type'] == "paypal") {
+		func_draw_title($_SESSION['label']['gallery_paypal_manage'.'_'.$_GET['series']]);
+		$query_add = " and paypal=1";
+	} elseif ($_GET['type'] == "wip") {
+		func_draw_title($_SESSION['label']['gallery_wip_manage'.'_'.$_GET['series']]);
+		$query_add = " and wip=1";
+	} elseif ($_GET['type'] == "slideshow") {
+		func_draw_title($_SESSION['label']['gallery_slideshow_manage'.'_'.$_GET['series']]);
+		$query_add = " and slideshow=1";
+	} else {
+		func_draw_title($_SESSION['label']['gallery_gallery_manage'.'_'.$_GET['series']]);
+		$query_add = " and video=0 and paypal=0 and product=0 and wip=0 and slideshow=0";
+	}
 
-$query="SELECT * FROM galleries where series=".$_GET['series']." and client=".$_SESSION['m_id']." and submember=".$submembra.$query_add." order by ordering ASC";
+	func_draw_top("View","Edit Details",1,"Delete");
+	if (isset($_SESSION['r_id'])){
+		$submembra = $_SESSION['r_id'];
+	} else {
+		$submembra = 0;
+	}
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_gallery=$num;
-$mytabs[] = "Your Galleries (".$num.")";
+	$query="SELECT * FROM galleries where series=".$_GET['series']." and client=".$_SESSION['m_id']." and submember=".$submembra.$query_add." order by ordering ASC";
 
-if ($u_tab=="gallery") { $u_tabz = $u_tabby; }
-$u_tabby++;
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_gallery=$num;
+	$mytabs[] = "Your Galleries (".$num.")";
 
-while ($i < $num) {
+	if ($u_tab=="gallery") { $u_tabz = $u_tabby; }
+	$u_tabby++;
 
-$result_title=mysql_result($result,$i,"title");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
-func_draw_item("gallery","gallery_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details",$result_title,$result_id,$i,$num,"gallery_move",0,0,$result_approval);
+	while ($i < $num) {
+		$result_title=mysql_result($result,$i,"title");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
+		func_draw_item("gallery","gallery_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details",$result_title,$result_id,$i,$num,"gallery_move",0,0,$result_approval);
 
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
+	func_draw_bottom();
 
-func_draw_galleries_links();
-//echo '</div>';
-}
-if ( $u_tab == "category" || (($userdata['s_gallery_edit']==1) && ($_SESSION['r_id'] == 0 ) )){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	func_draw_galleries_links();
+	//echo '</div>';
+	}
+	if ( $u_tab == "category" || (($userdata['s_gallery_edit']==1) && ($_SESSION['r_id'] == 0 ) )){
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_page = 0;
-//echo '<a name="pages"></a>';
-func_draw_title("Manage Your Categories",2);
+	$counting_page = 0;
+	//echo '<a name="pages"></a>';
+	func_draw_title("Manage Your Categories",2);
 
 ?>
 <script type="text/javascript" src="ajax/prototype.js"></script>
@@ -1783,35 +1774,35 @@ margin-left: 0;
 <?php
 //func_draw_top("Page Name","Edit Page",1,"Delete");
 
-if ($_SESSION['m_id']==1) { $outputty = 12; }
-else { $outputty = $_SESSION['m_id']; }
+	if ($_SESSION['m_id']==1) { $outputty = 12; }
+	else { $outputty = $_SESSION['m_id']; }
 
 
-$query="SELECT * FROM gallery_category where series=".$_GET['series']." and client=".$outputty ." order by ordering ASC";
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_page = $num;
-$mytabs[] = "Your Categories (".$num.")";
-if ($u_tab=="category") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$query="SELECT * FROM gallery_category where series=".$_GET['series']." and client=".$outputty ." order by ordering ASC";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_page = $num;
+	$mytabs[] = "Your Categories (".$num.")";
+	if ($u_tab=="category") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-//$result_type=mysql_result($result,$i,"type");
-//$result_filename=mysql_result($result,$i,"file_path");
-$result_id=mysql_result($result,$i,"id");
-//$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		//$result_type=mysql_result($result,$i,"type");
+		//$result_filename=mysql_result($result,$i,"file_path");
+		$result_id=mysql_result($result,$i,"id");
+		//$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+		//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
 
-//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
-//else { $result_extras = ""; }
+		//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
+		//else { $result_extras = ""; }
 
-func_draw_item("category","category_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"category_move",0,0,$result_approval);
+		func_draw_item("category","category_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"category_move",0,0,$result_approval);
 
-$i++;
-}
+		$i++;
+	}
 
 ?>
 
@@ -1838,11 +1829,11 @@ new Ajax.Request('categories_reorder.php', options);
 //echo '</div>';
 }
 if ( $u_tab == "attributes"){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_page = 0;
-//echo '<a name="pages"></a>';
-func_draw_title("Manage Your Attributes",2);
+	$counting_page = 0;
+	//echo '<a name="pages"></a>';
+	func_draw_title("Manage Your Attributes",2);
 
 
 ?>
@@ -1866,70 +1857,70 @@ margin-left: 0;
 
 
 <?php
-//func_draw_top("View","Edit Details",1,"Delete");
-//func_draw_top("Page Name","Edit Page",1,"Delete");
+	//func_draw_top("View","Edit Details",1,"Delete");
+	//func_draw_top("Page Name","Edit Page",1,"Delete");
 
-if ($_SESSION['m_id']==1) { $outputty = 12; }
-else { $outputty = $_SESSION['m_id']; }
+	if ($_SESSION['m_id']==1) { $outputty = 12; }
+	else { $outputty = $_SESSION['m_id']; }
 
 
-$query="SELECT * FROM attributes where client=".$_SESSION['m_id'] ." order by ordering ASC";
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_page = $num;
-$mytabs[] = "Your Attributes (".$num.")";
-if ($u_tab=="attributes") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$query="SELECT * FROM attributes where client=".$_SESSION['m_id'] ." order by ordering ASC";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_page = $num;
+	$mytabs[] = "Your Attributes (".$num.")";
+	if ($u_tab=="attributes") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"attribute");
-$result_value=mysql_result($result,$i,"default_value");
-//$result_filename=mysql_result($result,$i,"file_path");
-$result_id=mysql_result($result,$i,"id");
-//$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"attribute");
+		$result_value=mysql_result($result,$i,"default_value");
+		//$result_filename=mysql_result($result,$i,"file_path");
+		$result_id=mysql_result($result,$i,"id");
+		//$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+		//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
 
-//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
-//else { $result_extras = ""; }
+		//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
+		//else { $result_extras = ""; }
 
-func_draw_item("attribute","attribute_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"attribute_move",0,0,$result_approval);
+		func_draw_item("attribute","attribute_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"attribute_move",0,0,$result_approval);
 
-$i++;
-}
+		$i++;
+	}
 
 ?>
 
 </ul></center>
 
-<script type="text/javascript">
+	<script type="text/javascript">
 
 
-Sortable.create('item_list', {constraint:'vertical', onUpdate : updateOrder});
+	Sortable.create('item_list', {constraint:'vertical', onUpdate : updateOrder});
 
 
-function updateOrder(){
-  var options = {
-    method : 'post',
-    parameters : Sortable.serialize('item_list')
-  };
-new Ajax.Request('attribute_reorder.php', options);
-}
-</script>
+	function updateOrder(){
+		var options = {
+			method : 'post',
+				parameters : Sortable.serialize('item_list')
+		};
+		new Ajax.Request('attribute_reorder.php', options);
+	}
+	</script>
 
 
 <?php
-func_draw_bottom();
-//echo '</div>';
+	func_draw_bottom();
+	//echo '</div>';
 }
 
 if ( $u_tab == "comments"){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_page = 0;
-//echo '<a name="pages"></a>';
-func_draw_title("Manage Your Comments",2);
+	$counting_page = 0;
+	//echo '<a name="pages"></a>';
+	func_draw_title("Manage Your Comments",2);
 
 
 ?>
@@ -1953,74 +1944,74 @@ margin-left: 0;
 
 
 <?php
-//func_draw_top("View","Edit Details",1,"Delete");
-//func_draw_top("Page Name","Edit Page",1,"Delete");
+	//func_draw_top("View","Edit Details",1,"Delete");
+	//func_draw_top("Page Name","Edit Page",1,"Delete");
 
 
-$query="SELECT * FROM comments where client=".$_SESSION['m_id'] ." order by `comment_date` DESC";
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_page = $num;
-$mytabs[] = "Your Comments (".$num.")";
-if ($u_tab=="comments") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$query="SELECT * FROM comments where client=".$_SESSION['m_id'] ." order by `comment_date` DESC";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_page = $num;
+	$mytabs[] = "Your Comments (".$num.")";
+	if ($u_tab=="comments") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_id=mysql_result($result,$i,"id");
-$result_article=mysql_result($result,$i,"article");
-$result_title=mysql_result($result,$i,"comment_name");
-$result_value=mysql_result($result,$i,"comment_body");
-$result_page=func_page_array($result_article);
+		$result_id=mysql_result($result,$i,"id");
+		$result_article=mysql_result($result,$i,"article");
+		$result_title=mysql_result($result,$i,"comment_name");
+		$result_value=mysql_result($result,$i,"comment_body");
+		$result_page=func_page_array($result_article);
 
-$article_name=$result_page['s_title'];
+		$article_name=$result_page['s_title'];
 
-//$result_filename=mysql_result($result,$i,"file_path");
+		//$result_filename=mysql_result($result,$i,"file_path");
 
-//$result_approval=mysql_result($result,$i,"approval");
+		//$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+		//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
 
-//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
-//else { $result_extras = ""; }
+		//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
+		//else { $result_extras = ""; }
 
-func_draw_item("comments","comments_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title." (".$article_name.")",$result_id, '',$num ,"comments_move",0,0,"");
+		func_draw_item("comments","comments_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title." (".$article_name.")",$result_id, '',$num ,"comments_move",0,0,"");
 
-$i++;
-}
+		$i++;
+	}
 
 ?>
 
 </ul></center>
 
-<script type="text/javascript">
+	<script type="text/javascript">
 
 
-Sortable.create('item_list', {constraint:'vertical', onUpdate : updateOrder});
+	Sortable.create('item_list', {constraint:'vertical', onUpdate : updateOrder});
 
 
-function updateOrder(){
-  var options = {
-    method : 'post',
-    parameters : Sortable.serialize('item_list')
-  };
-new Ajax.Request('comments_reorder.php', options);
-}
+	function updateOrder(){
+		var options = {
+			method : 'post',
+				parameters : Sortable.serialize('item_list')
+		};
+		new Ajax.Request('comments_reorder.php', options);
+	}
 
-</script>
+	</script>
 
 
 <?php
-func_draw_bottom();
-//echo '</div>';
+	func_draw_bottom();
+	//echo '</div>';
 }
 
 if ( $u_tab == "page" || (($userdata['s_page_edit']==1) && ($_SESSION['r_id'] == 0 ) )){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_page = 0;
-//echo '<a name="pages"></a>';
-func_draw_title($_SESSION['label']['page_manage'.'_'.$_GET['series']],2);
+	$counting_page = 0;
+	//echo '<a name="pages"></a>';
+	func_draw_title($_SESSION['label']['page_manage'.'_'.$_GET['series']],2);
 
 ?>
 <script type="text/javascript" src="ajax/prototype.js"></script>
@@ -2057,72 +2048,72 @@ if ($u_tab=="page") { $u_tabz = $u_tabby; }
 $u_tabby++;
 while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_type=mysql_result($result,$i,"type");
-$result_filename=mysql_result($result,$i,"file_path");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+	$result_title=mysql_result($result,$i,"title");
+	$result_type=mysql_result($result,$i,"type");
+	$result_filename=mysql_result($result,$i,"file_path");
+	$result_id=mysql_result($result,$i,"id");
+	$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+	//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
 
-if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
-else { $result_extras = ""; }
+	if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
+	else { $result_extras = ""; }
 
-func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"page_move",0,0,$result_approval);
+	func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"page_move",0,0,$result_approval);
 
 
-    $querys="SELECT * FROM pages where series=".$_GET['series']." and (type=0 or type=1) and parent=".$result_id." and client=".$outputty ." order by ordering ASC";
-$results=mysql_query($querys);
-$nums=mysql_numrows($results);
-$is=0;
+	$querys="SELECT * FROM pages where series=".$_GET['series']." and (type=0 or type=1) and parent=".$result_id." and client=".$outputty ." order by ordering ASC";
+	$results=mysql_query($querys);
+	$nums=mysql_numrows($results);
+	$is=0;
 
-while ($is < $nums) {
+	while ($is < $nums) {
 
-$results_title=mysql_result($results,$is,"title");
-$results_type=mysql_result($results,$is,"type");
-$results_filename=mysql_result($results,$is,"file_path");
-$results_id=mysql_result($results,$is,"id");
-$results_approval=mysql_result($results,$is,"approval");
+		$results_title=mysql_result($results,$is,"title");
+		$results_type=mysql_result($results,$is,"type");
+		$results_filename=mysql_result($results,$is,"file_path");
+		$results_id=mysql_result($results,$is,"id");
+		$results_approval=mysql_result($results,$is,"approval");
 
-if ($results_type==1) { $results_extras = " (".$results_filename.")"; }
-else { $results_extras = ""; }
+		if ($results_type==1) { $results_extras = " (".$results_filename.")"; }
+		else { $results_extras = ""; }
 
-func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit"," -----> ".$results_title.$results_extras,$results_id, '',$nums ,"page_move",0,0,$results_approval);
+		func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit"," -----> ".$results_title.$results_extras,$results_id, '',$nums ,"page_move",0,0,$results_approval);
 
 
-$queryz="SELECT * FROM pages where series=".$_GET['series']." and (type=0 or type=1) and parent=".$results_id." and client=".$outputty ." order by ordering ASC";
-$resultz=mysql_query($queryz);
-$numz=mysql_numrows($resultz);
-$iz=0;
+		$queryz="SELECT * FROM pages where series=".$_GET['series']." and (type=0 or type=1) and parent=".$results_id." and client=".$outputty ." order by ordering ASC";
+		$resultz=mysql_query($queryz);
+		$numz=mysql_numrows($resultz);
+		$iz=0;
 
-while ($iz < $numz) {
+		while ($iz < $numz) {
 
-$resultz_title=mysql_result($resultz,$iz,"title");
-$resultz_type=mysql_result($resultz,$iz,"type");
-$resultz_filename=mysql_result($resultz,$iz,"file_path");
-$resultz_id=mysql_result($resultz,$iz,"id");
-$resultz_approval=mysql_result($resultz,$iz,"approval");
+			$resultz_title=mysql_result($resultz,$iz,"title");
+			$resultz_type=mysql_result($resultz,$iz,"type");
+			$resultz_filename=mysql_result($resultz,$iz,"file_path");
+			$resultz_id=mysql_result($resultz,$iz,"id");
+			$resultz_approval=mysql_result($resultz,$iz,"approval");
 
-if ($resultz_type==1) { $resultz_extras = " (".$resultz_filename.")"; }
-else { $resultz_extras = ""; }
+			if ($resultz_type==1) { $resultz_extras = " (".$resultz_filename.")"; }
+			else { $resultz_extras = ""; }
 
-func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit"," ----------> ".$resultz_title.$resultz_extras,$resultz_id, '',$numz ,"page_move",0,0,$resultz_approval);
+			func_draw_item("page","page_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit"," ----------> ".$resultz_title.$resultz_extras,$resultz_id, '',$numz ,"page_move",0,0,$resultz_approval);
 
-$iz++;
+			$iz++;
 
-}
+		}
 
 
 
-$is++;
+		$is++;
 
-}
+	}
 
 
 
 
 
-$i++;
+	$i++;
 }
 
 ?>
@@ -2148,22 +2139,22 @@ new Ajax.Request('pages_reorder.php', options);
 <?php
 //func_draw_bottom();
 //echo '</div>';
-}
+} // u_tab == 'page'
 
 
 if ( $u_tab == "article" || ($userdata['s_article_edit']==1  && ($_SESSION['r_id'] == 0 ) )) {
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_articles = 0;
-//echo '<a name="articles"></a>';
-func_draw_title($_SESSION['label']['article_manage'.'_'.$_GET['series']],2);
-//if ($userdata['s_page_edit']==0) {
-if (5==5){
+	$counting_articles = 0;
+	//echo '<a name="articles"></a>';
+	func_draw_title($_SESSION['label']['article_manage'.'_'.$_GET['series']],2);
+	//if ($userdata['s_page_edit']==0) {
+	if (5==5){
 ?>
 <script type="text/javascript" src="ajax/prototype.js"></script>
 <script type="text/javascript" src="ajax/scriptaculous.js"></script>
 <?php
-}
+	}
 ?>
 
 <style type="text/css">
@@ -2183,38 +2174,38 @@ margin-left: 0;
 <?php
 
 
-if ($_SESSION['m_id']==1) { $outputty = 12; }
-else { $outputty = $_SESSION['m_id']; }
-//func_draw_top("Article Title","Edit Article",1,"Delete");
+	if ($_SESSION['m_id']==1) { $outputty = 12; }
+	else { $outputty = $_SESSION['m_id']; }
+	//func_draw_top("Article Title","Edit Article",1,"Delete");
 
 
-$query="SELECT * FROM pages where series=".$_GET['series']." and type=2 and client=".$outputty ." order by ordering ASC";
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_article = $num;
-$mytabs[] = "Your Articles (".$num.")";
-if ($u_tab=="article") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$query="SELECT * FROM pages where series=".$_GET['series']." and type=2 and client=".$outputty ." order by ordering ASC";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_article = $num;
+	$mytabs[] = "Your Articles (".$num.")";
+	if ($u_tab=="article") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_type=mysql_result($result,$i,"type");
-$result_filename=mysql_result($result,$i,"file_path");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		$result_type=mysql_result($result,$i,"type");
+		$result_filename=mysql_result($result,$i,"file_path");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
-$better_date = explode(" ", mysql_result($result,$i,"article_date"));
+		//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+		$better_date = explode(" ", mysql_result($result,$i,"article_date"));
 
 
- $result_extras = " (".$better_date[0]." ".$better_date[1]." ".$better_date[2].")";
+		$result_extras = " (".$better_date[0]." ".$better_date[1]." ".$better_date[2].")";
 
 
-func_draw_item("article","article_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"article_move",0,0,$result_approval);
+		func_draw_item("article","article_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title.$result_extras,$result_id, '',$num ,"article_move",0,0,$result_approval);
 
-$i++;
-}
+		$i++;
+	}
 
 ?>
 </ul></center>
@@ -2236,22 +2227,22 @@ new Ajax.Request('articles_reorder.php', optionsB);
 <?php
 //func_draw_bottom();
 //echo "</div>";
-}
+} // u_tab == 'article'
 
 
 if ( $u_tab == "menu" || ($userdata['s_menu_edit']==1  && ($_SESSION['r_id'] == 0 ) )) {
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_menus = 0;
-//echo '<a name="menus"></a>';
-func_draw_title($_SESSION['label']['menu_manage'.'_'.$_GET['series']],2);
-//if ($userdata['s_page_edit']==0) {
-if (5==5){
+	$counting_menus = 0;
+	//echo '<a name="menus"></a>';
+	func_draw_title($_SESSION['label']['menu_manage'.'_'.$_GET['series']],2);
+	//if ($userdata['s_page_edit']==0) {
+	if (5==5){
 ?>
 <script type="text/javascript" src="ajax/prototype.js"></script>
 <script type="text/javascript" src="ajax/scriptaculous.js"></script>
 <?php
-}
+	}
 ?>
 
 <style type="text/css">
@@ -2271,36 +2262,36 @@ margin-left: 0;
 <?php
 
 
-if ($_SESSION['m_id']==1) { $outputty = 12; }
-else { $outputty = $_SESSION['m_id']; }
-//func_draw_top("Article Title","Edit Article",1,"Delete");
+	if ($_SESSION['m_id']==1) { $outputty = 12; }
+	else { $outputty = $_SESSION['m_id']; }
+	//func_draw_top("Article Title","Edit Article",1,"Delete");
 
 
-$query="SELECT * FROM menus where series=".$_GET['series']." and client=".$outputty ." order by ordering ASC";
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_menu = $num;
-$mytabs[] = "Your Menu (".$num." items)";
-if ($u_tab=="menu") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$query="SELECT * FROM menus where series=".$_GET['series']." and client=".$outputty ." order by ordering ASC";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_menu = $num;
+	$mytabs[] = "Your Menu (".$num." items)";
+	if ($u_tab=="menu") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_type=mysql_result($result,$i,"type");
-//$result_filename=mysql_result($result,$i,"file_path");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		$result_type=mysql_result($result,$i,"type");
+		//$result_filename=mysql_result($result,$i,"file_path");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
 
-//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
+		//<a href="?task=gallery_edit_deletephoto&item='.$id.'&gallery='.$gallery.'&confirm=1" onclick="'."return confirm('Are you sure you want to delete?')".'"><font face="arial" size="2" color="#ff0000">[delete]</font></a>
 
-//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
-//else { $result_extras = ""; }
+		//if ($result_type==1) { $result_extras = " (".$result_filename.")"; }
+		//else { $result_extras = ""; }
 
-func_draw_item("menu","menu_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title,$result_id, '',$num ,"menu_move",0,0,$result_approval);
+		func_draw_item("menu","menu_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit",$result_title,$result_id, '',$num ,"menu_move",0,0,$result_approval);
 
-$i++;
-}
+		$i++;
+	}
 
 ?>
 </ul></center>
@@ -2322,368 +2313,373 @@ new Ajax.Request('menus_reorder.php', optionsC);
 <?php
 //func_draw_bottom();
 //echo "</div>";
-}
+} // u_tab == 'menu'
 
 
 
 if ( $u_tab == "sidebar" || (($userdata['s_sidebar_edit']==1)  && ($_SESSION['r_id'] == 0 ))  ){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_sidebar = 0;
-//echo '<a name="sidebars"></a>';
-func_draw_title($_SESSION['label']['sidebar_manage'.'_'.$_GET['series']]);
-func_draw_top("Click to Change Images ","Edit Sidebar Title/Settings",3);
+	$counting_sidebar = 0;
+	//echo '<a name="sidebars"></a>';
+	func_draw_title($_SESSION['label']['sidebar_manage'.'_'.$_GET['series']]);
+	func_draw_top("Click to Change Images ","Edit Sidebar Title/Settings",3);
 
-$query="SELECT * FROM sidebars where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by primary_site ASC";
+	$query="SELECT * FROM sidebars where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by primary_site ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_sidebar = $num;
-$mytabs[] = "Your Sidebars (".$num.")";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_sidebar = $num;
+	$mytabs[] = "Your Sidebars (".$num.")";
 
-if ($u_tab=="sidebar") { $u_tabz = $u_tabby; }
-$u_tabby++;
+	if ($u_tab=="sidebar") { $u_tabz = $u_tabby; }
+	$u_tabby++;
 
-while ($i < $num) {
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_description=mysql_result($result,$i,"description");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		$result_description=mysql_result($result,$i,"description");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
 
-func_draw_item("sidebar","sidebar_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Sidebar Title/Settings","<b>".$result_title."</b>",$result_id);
+		func_draw_item("sidebar","sidebar_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Sidebar Title/Settings","<b>".$result_title."</b>",$result_id);
 
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+	func_draw_bottom();
+	//echo "</div>";
 }
 
 
 
 if ( $u_tab == "header" || (($userdata['s_header_edit']==1)  && ($_SESSION['r_id'] == 0 ) )){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_header = 0;
-//echo '<a name="headers"></a>';
-func_draw_title($_SESSION['label']['header_manage'.'_'.$_GET['series']]);
-func_draw_top("Header Title","Edit Header & Details",3);
+	$counting_header = 0;
+	//echo '<a name="headers"></a>';
+	func_draw_title($_SESSION['label']['header_manage'.'_'.$_GET['series']]);
+	func_draw_top("Header Title","Edit Header & Details",3);
 
-$query="SELECT * FROM headers where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by title ASC";
+	$query="SELECT * FROM headers where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by title ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_header = $num;
-$mytabs[] = "Your Headers (".$num.")";
-if ($u_tab=="header") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_header = $num;
+	$mytabs[] = "Your Headers (".$num.")";
+	if ($u_tab=="header") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
 
-func_draw_item("header","header_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Header & Details","".$result_title."",$result_id);
+		func_draw_item("header","header_edit",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Header & Details","".$result_title."",$result_id);
 
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+	func_draw_bottom();
+	//echo "</div>";
 }
 
 if ( $u_tab == "note" || (($userdata['s_note_edit']==1)  && ($_SESSION['r_id'] == 0 )) ){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_note = 0;
-//echo '<a name="notes"></a>';
-func_draw_title($_SESSION['label']['note_manage'.'_'.$_GET['series']]);
-func_draw_top("Note Title","View Entire Note/Responses",3);
+	$counting_note = 0;
+	//echo '<a name="notes"></a>';
+	func_draw_title($_SESSION['label']['note_manage'.'_'.$_GET['series']]);
+	func_draw_top("Note Title","View Entire Note/Responses",3);
 
-$query="SELECT * FROM notes where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by timestamp ASC";
+	$query="SELECT * FROM notes where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by timestamp ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_note = $num;
-$mytabs[] = "Your Notes (".$num.")";
-if ($u_tab=="note") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_note = $num;
+	$mytabs[] = "Your Notes (".$num.")";
+	if ($u_tab=="note") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_id=mysql_result($result,$i,"id");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_title=mysql_result($result,$i,"title");
+		$result_id=mysql_result($result,$i,"id");
+		$result_approval=mysql_result($result,$i,"approval");
 
-func_draw_item("note","note_edit","View Note/Response","".$result_title."",$result_id);
+		func_draw_item("note","note_edit","View Note/Response","".$result_title."",$result_id);
 
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+	func_draw_bottom();
+	//echo "</div>";
 }
 
 
 if ( $u_tab == "member_notes" && ($_SESSION['m_id']==12 || $_SESSION['m_id']==1) ) {
-if ($_SESSION['m_id']==12) { $outputty = 1; }
-else { $outputty = $_SESSION['m_id']; }
- func_draw_title("Manage Notes");
- func_draw_top("Account","",2);
-$query="SELECT * FROM members where unreal like '0' and owner=".$outputty." and notes_flag=1 order by start_date, full_name ASC";
+	if ($_SESSION['m_id']==12) { $outputty = 1; }
+	else { $outputty = $_SESSION['m_id']; }
+	func_draw_title("Manage Notes");
+	func_draw_top("Account","",2);
+	$query="SELECT * FROM members where unreal like '0' and owner=".$outputty." and notes_flag=1 order by start_date, full_name ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_member = $num;
-$mytabs[] = "Your Members Notes (".$num.")";
-if ($u_tab=="member_notes") { $u_tabz = $u_tabby; }
-$u_tabby++;
-$old_start_date="";
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_member = $num;
+	$mytabs[] = "Your Members Notes (".$num.")";
+	if ($u_tab=="member_notes") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	$old_start_date="";
 
-while ($i < $num) {
+	while ($i < $num) {
 
-$result_site=mysql_result($result,$i,"primary_site");
-$result_web=mysql_result($result,$i,"root_web");
-$result_name=mysql_result($result,$i,"full_name");
-$result_approval=mysql_result($result,$i,"approval");
-$result_start_date=mysql_result($result,$i,"start_date");
-$better_date = explode(" ", $result_start_date);
-$result_extras = "".$better_date[0]." ".$better_date[1]." ".$better_date[2]."";
-$result_start_date = $result_extras;
-if ($result_start_date == $old_start_date) {
+		$result_site=mysql_result($result,$i,"primary_site");
+		$result_web=mysql_result($result,$i,"root_web");
+		$result_name=mysql_result($result,$i,"full_name");
+		$result_approval=mysql_result($result,$i,"approval");
+		$result_start_date=mysql_result($result,$i,"start_date");
+		$better_date = explode(" ", $result_start_date);
+		$result_extras = "".$better_date[0]." ".$better_date[1]." ".$better_date[2]."";
+		$result_start_date = $result_extras;
+		if ($result_start_date == $old_start_date) {
 
-} else {
-//$old_start_date = $result_start_date;
-$better_date = explode(" ", $result_start_date);
-$result_extras = "".$better_date[0]." ".$better_date[1]." ".$better_date[2]."";
-$old_start_date = $result_extras;
+		} else {
+			//$old_start_date = $result_start_date;
+			$better_date = explode(" ", $result_start_date);
+			$result_extras = "".$better_date[0]." ".$better_date[1]." ".$better_date[2]."";
+			$old_start_date = $result_extras;
 
-echo '</table><table border=0 class="standard-table"><tr><td><b>'.$result_extras.'</b></td></tr></table><table border=0 class="standard-table">';
-}
+			echo '</table><table border=0 class="standard-table"><tr><td><b>'.$result_extras.'</b></td></tr></table><table border=0 class="standard-table">';
+		}
 
-$result_id=mysql_result($result,$i,"id");
-//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
-if ($result_name=="") {
-$selected_title = $result_site;
-} else {
-$selected_title = $result_name;
-}
+		$result_id=mysql_result($result,$i,"id");
+		//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
+		if ($result_name=="") {
+			$selected_title = $result_site;
+		} else {
+			$selected_title = $result_name;
+		}
 
-func_draw_item("member_notes","member_edit_notes",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Notes",$selected_title,$result_id,"","","","","",$result_approval);
-//}
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		func_draw_item("member_notes","member_edit_notes",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Notes",$selected_title,$result_id,"","","","","",$result_approval);
+		//}
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
+	func_draw_bottom();
 
-}
+} // member_notes
 
 if ( $u_tab == "member_notes_add" && ($_SESSION['m_id']==12 || $_SESSION['m_id']==1) ) {
-if ($_SESSION['m_id']==12) { $outputty = 1; }
-else { $outputty = $_SESSION['m_id']; }
+	if ($_SESSION['m_id']==12) { $outputty = 1; }
+	else { $outputty = $_SESSION['m_id']; }
 
 
-$query="SELECT * FROM members where unreal like '0' and owner=".$outputty." order by full_name ASC";
+	$query="SELECT * FROM members where unreal like '0' and owner=".$outputty." order by full_name ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_member = $num;
-$mytabs[] = "Your Members Notes (".$num.")";
-if ($u_tab=="member_notes") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_member = $num;
+	$mytabs[] = "Your Members Notes (".$num.")";
+	if ($u_tab=="member_notes") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_site=mysql_result($result,$i,"primary_site");
-$result_web=mysql_result($result,$i,"root_web");
-$result_name=mysql_result($result,$i,"full_name");
-$result_approval=mysql_result($result,$i,"approval");
-$result_flag=mysql_result($result,$i,"notes_flag");
+		$result_site=mysql_result($result,$i,"primary_site");
+		$result_web=mysql_result($result,$i,"root_web");
+		$result_name=mysql_result($result,$i,"full_name");
+		$result_approval=mysql_result($result,$i,"approval");
+		$result_flag=mysql_result($result,$i,"notes_flag");
 
-$result_id=mysql_result($result,$i,"id");
-//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
-//func_draw_item("member_notes","member_edit_notes",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Notes","<b>".$result_site."</b>&nbsp; -&nbsp; ".$result_name,$result_id,"","","","","",$result_approval);
-//$member_notes .= '<option value="'.$result_id.'';
-//if($result_flag==1) {
-//
-// $member_notes .= ' (already added)" disabled="disabled"';
-//} else {
-//
-//$member_notes .= '"';
+		$result_id=mysql_result($result,$i,"id");
+		//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
+		//func_draw_item("member_notes","member_edit_notes",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Notes","<b>".$result_site."</b>&nbsp; -&nbsp; ".$result_name,$result_id,"","","","","",$result_approval);
+		//$member_notes .= '<option value="'.$result_id.'';
+		//if($result_flag==1) {
+		//
+		// $member_notes .= ' (already added)" disabled="disabled"';
+		//} else {
+		//
+		//$member_notes .= '"';
 
-//}
-//$member_notes .= '>'.$result_site.'</option>';
+		//}
+		//$member_notes .= '>'.$result_site.'</option>';
 
-$member_notes .= '<option value="admin.php?task=member_edit_notes&item='.$result_id.'&series=1">';
-$member_notes .= $result_name.'</option>';
+		$member_notes .= '<option value="admin.php?task=member_edit_notes&item='.$result_id.'&series=1">';
+		$member_notes .= $result_name.'</option>';
 
 
-//}
-$i++;
-}
+		//}
+		$i++;
+	}
 
 
-$userdata=func_user_array($item);
+	$userdata=func_user_array($item);
 
- func_draw_title("Add Notes");
-func_draw_form_top("admin.php","post",400);
-func_draw_form_field("hidden","task","","member_edit_notes",125,'');
-func_draw_form_field("hidden","confirm","","1",125,'');
+	func_draw_title("Add Notes");
+	func_draw_form_top("admin.php","post",400);
+	func_draw_form_field("hidden","task","","member_edit_notes",125,'');
+	func_draw_form_field("hidden","confirm","","1",125,'');
 
-echo '<tr><td height="50">Member</td><td><select name="choose" onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;"><option selected="selected">Select a member...</option>'.$member_notes.'</select></td></tr>';
+	echo '<tr><td height="50">Member</td><td><select name="choose" onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;"><option selected="selected">Select a member...</option>'.$member_notes.'</select></td></tr>';
 
-//func_draw_form_field("hidden","notes_flag","","on",125,'');
+	//func_draw_form_field("hidden","notes_flag","","on",125,'');
 
-echo "</table>";
+	echo "</table>";
 
-//include_once ('editor_filez/config.php');
-//include_once ('editor_filez/editor_class.php');
-//$editor = new wysiwygPro();
-//$editor->set_name('description');
-//$editor->set_code($gallery_info['s_description']);
-//$editor->print_editor(600, 240);
+	//include_once ('editor_filez/config.php');
+	//include_once ('editor_filez/editor_class.php');
+	//$editor = new wysiwygPro();
+	//$editor->set_name('description');
+	//$editor->set_code($gallery_info['s_description']);
+	//$editor->print_editor(600, 240);
 
-//draw_editor_htmlarea('notes',$userdata['s_notes']);
+	//draw_editor_htmlarea('notes',$userdata['s_notes']);
 
-echo "<table border=0 width=300>";
-func_draw_form_spacer(" "," ",15);
-//func_draw_form_submit("Add Notes");
-func_draw_form_bottom();
+	echo "<table border=0 width=300>";
+	func_draw_form_spacer(" "," ",15);
+	//func_draw_form_submit("Add Notes");
+	func_draw_form_bottom();
 
 
-}
+} // member_notes_add
 
 
 if ( $u_tab == "member" || ($userdata['s_member_edit']==1  && ($_SESSION['r_id'] == 0 )) ){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_member = 0;
-//echo '<a name="members"></a>';
-func_draw_title($_SESSION['label']['member_manage'.'_'.$_GET['series']]);
-func_draw_top("Login to Account","Edit Details/Configs",2);
+	$counting_member = 0;
+	//echo '<a name="members"></a>';
+	func_draw_title($_SESSION['label']['member_manage'.'_'.$_GET['series']]);
+	func_draw_top("Login to Account","Edit Details/Configs",2);
 
-if ($_SESSION['m_id']==12) { $outputty = 1; }
-else { $outputty = $_SESSION['m_id']; }
+	if ($_SESSION['m_id']==12) { $outputty = 1; }
+	else { $outputty = $_SESSION['m_id']; }
 
-$query="SELECT * FROM members where series=".$_GET['series']." and unreal like '0' and owner=".$outputty." order by full_name ASC";
+	$query="SELECT * FROM members where series=".$_GET['series']." and unreal like '0' and owner=".$outputty." order by full_name ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_member = $num;
-$mytabs[] = "Your Members (".$num.")";
-if ($u_tab=="member") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_member = $num;
+	$mytabs[] = "Your Members (".$num.")";
+	if ($u_tab=="member") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_site=mysql_result($result,$i,"primary_site");
-$result_web=mysql_result($result,$i,"root_web");
-$result_name=mysql_result($result,$i,"full_name");
-$result_approval=mysql_result($result,$i,"approval");
+		$result_site=mysql_result($result,$i,"primary_site");
+		$result_web=mysql_result($result,$i,"root_web");
+		$result_name=mysql_result($result,$i,"full_name");
+		$result_approval=mysql_result($result,$i,"approval");
 
-$result_id=mysql_result($result,$i,"id");
-//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
+		$result_id=mysql_result($result,$i,"id");
+		//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
 
-if ($result_name=="") {
-$selected_title = $result_site;
-} else {
-$selected_title = $result_name;
-}
+		if ($result_name=="") {
+			$selected_title = $result_site;
+		} else {
+			$selected_title = $result_name;
+		}
 
-func_draw_item("member","member_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details",$selected_title,$result_id,"","","","","",$result_approval);
-//}
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		func_draw_item("member","member_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details",$selected_title,$result_id,"","","","","",$result_approval);
+		//}
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+	func_draw_bottom();
+	//echo "</div>";
 }
 
 
 if ( $u_tab == "submember" || ($userdata['s_submember_edit']==1 )){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_submember = 0;
-//echo '<a name="submembers"></a>';
-func_draw_title($_SESSION['label']['submember_manage'.'_'.$_GET['series']]);
-func_draw_top("Login to Account","Edit Details",2);
+	$counting_submember = 0;
+	//echo '<a name="submembers"></a>';
+	func_draw_title($_SESSION['label']['submember_manage'.'_'.$_GET['series']]);
+	func_draw_top("Login to Account","Edit Details",2);
 
- $outputty = $_SESSION['m_id'];
+	$outputty = $_SESSION['m_id'];
 
-$query="SELECT * FROM submembers where series=".$_GET['series']." and unreal like '0' and owner=".$outputty." order by full_name ASC";
+	$query="SELECT * FROM submembers where series=".$_GET['series']." and unreal like '0' and owner=".$outputty." order by full_name ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_submember = $num;
-$mytabs[] = "Your Submembers (".$num.")";
-if ($u_tab=="submember") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_submember = $num;
+	$mytabs[] = "Your Submembers (".$num.")";
+	if ($u_tab=="submember") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_name=mysql_result($result,$i,"full_name");
+		$result_name=mysql_result($result,$i,"full_name");
 
-$result_id=mysql_result($result,$i,"id");
+		$result_id=mysql_result($result,$i,"id");
 
-//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
-func_draw_item("submember","submember_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details","<b>".$result_name."</b>",$result_id,"","","","","",$result_approval);
-//}
-$i++;
-}
-func_draw_spacer();
-func_draw_spacer();
+		//if (($result_id==$_SESSION['m_able']) || ($result_id==$_SESSION['m_id'])) { } else {
+		func_draw_item("submember","submember_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Details","<b>".$result_name."</b>",$result_id,"","","","","",$result_approval);
+		//}
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+	func_draw_bottom();
+	//echo "</div>";
 }
 
 
 if ( $u_tab == "paypal" || ($userdata['s_paypal_edit']==1  && ($_SESSION['r_id'] == 0 ) )){
-//echo '	<div class="dhtmlgoodies_aTab">';
+	//echo '	<div class="dhtmlgoodies_aTab">';
 
-$counting_paypal = 0;
-//echo '<a name="paypal"></a>';
-func_draw_title($_SESSION['label']['paypal_manage'.'_'.$_GET['series']]);
-func_draw_top("Paypal Config","Edit Config",2);
+	$counting_paypal = 0;
+	//echo '<a name="paypal"></a>';
+	func_draw_title($_SESSION['label']['paypal_manage'.'_'.$_GET['series']]);
+	func_draw_top("Paypal Config","Edit Config",2);
 
-$query="SELECT * FROM paypal_details where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by type ASC";
+	$query="SELECT * FROM paypal_details where series=".$_GET['series']." and client=".$_SESSION['m_id']." order by type ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
-$counting_paypal = $num;
-$mytabs[] = "Your Paypal Configs (".$num.")";
-if ($u_tab=="paypal") { $u_tabz = $u_tabby; }
-$u_tabby++;
-while ($i < $num) {
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
+	$i=0;
+	$counting_paypal = $num;
+	$mytabs[] = "Your Paypal Configs (".$num.")";
+	if ($u_tab=="paypal") { $u_tabz = $u_tabby; }
+	$u_tabby++;
+	while ($i < $num) {
 
-$result_title=mysql_result($result,$i,"title");
-$result_id=mysql_result($result,$i,"id");
+		$result_title=mysql_result($result,$i,"title");
+		$result_id=mysql_result($result,$i,"id");
 
-if (($result_id==$_SESSION['m_ble']) || ($result_id==$_SESSION['m_id'])) { } else {
-func_draw_item("paypal","paypal_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Config","<b>".$result_title."</b>",$result_id,"","","","","",1);
-}
-$i++;
+		if (($result_id==$_SESSION['m_ble']) || ($result_id==$_SESSION['m_id'])) { } else {
+			func_draw_item("paypal","paypal_edit_details",'<img src="mini_icons/page_edit.gif">&nbsp;'."Edit Config","<b>".$result_title."</b>",$result_id,"","","","","",1);
+		}
+		$i++;
+	}
+	func_draw_spacer();
+	func_draw_spacer();
+
+	func_draw_bottom();
+	//echo "</div>";
 }
-func_draw_spacer();
-func_draw_spacer();
 
-func_draw_bottom();
-//echo "</div>";
+if($u_tab == "awstats") {
+	func_draw_title('Statistics');
+	echo '<iframe width="770" height="700" src="awstatsproxy.php"></iframe>';
 }
 
 
@@ -2693,16 +2689,16 @@ $tab_count = 0;
 $tab_array = "Array(";
 $tab_array2 = "Array(";
 foreach ($mytabs as $tabby) {
-$tab_count++;
-$tab_array .= "'".$tabby."'";
-$tab_array2 .= "true";
-if ($tab_count !== count($mytabs)) {
-$tab_array .= ",";
-$tab_array2 .= ",";
-} else {
-$tab_array .= ")";
-$tab_array2 .= ")";
-}
+	$tab_count++;
+	$tab_array .= "'".$tabby."'";
+	$tab_array2 .= "true";
+	if ($tab_count !== count($mytabs)) {
+		$tab_array .= ",";
+		$tab_array2 .= ",";
+	} else {
+		$tab_array .= ")";
+		$tab_array2 .= ")";
+	}
 }
 
 
@@ -8656,18 +8652,14 @@ echo '<body>';
   $side_menu = "";
 
 if ($_SESSION['m_id']==12 || $_SESSION['m_id']==1){
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=member_notes">Manage Notes</a></td></tr></table></dt>';
-$side_menu .= '<dd><a href="?task=main&tab=member_notes_add">Add Notes</a></dd>';
-
+	$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=member_notes">Manage Notes</a></td></tr></table></dt>';
+	$side_menu .= '<dd><a href="?task=main&tab=member_notes_add">Add Notes</a></dd>';
 }
 
-
-
-
 if ($_SESSION['r_id']>0){
-$subuser = func_subuser_array($_SESSION['r_id']);
-//func_draw_title("Managing Submember: ".$subuser['s_full_name']);
-echo "<b>Managing Submember: </b><br>".$subuser['s_full_name']."<br><br>".'<a href="admin.php?task=submember&item=0">Back to Client List</a>';
+	$subuser = func_subuser_array($_SESSION['r_id']);
+	//func_draw_title("Managing Submember: ".$subuser['s_full_name']);
+	echo "<b>Managing Submember: </b><br>".$subuser['s_full_name']."<br><br>".'<a href="admin.php?task=submember&item=0">Back to Client List</a>';
 } else {
 //func_draw_title("Admin Your Site");
 }
@@ -8684,26 +8676,26 @@ $series_counter = func_series_count($_SESSION['m_id']);
 $i=1;
 while($i <= $series_counter['gallery_count']) {
 
-if ($userdata['s_gallery_edit']==1 || $_SESSION['r_id'] > 0 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=gallery&series='.$i.'">'.$_SESSION['label']['gallery_gallery_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_add']==1) || $_SESSION['r_id'] > 0 || ($userdata['s_gallery_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&series='.$i.'">'.$_SESSION['label']['gallery_gallery_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	if ($userdata['s_gallery_edit']==1 || $_SESSION['r_id'] > 0 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=gallery&series='.$i.'">'.$_SESSION['label']['gallery_gallery_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_add']==1) || $_SESSION['r_id'] > 0 || ($userdata['s_gallery_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&series='.$i.'">'.$_SESSION['label']['gallery_gallery_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 
 
 if ($userdata['s_attribute_edit']==1) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=attributes&series=1">Manage Attributes</a></td></tr></table></dt>';
+	$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=attributes&series=1">Manage Attributes</a></td></tr></table></dt>';
 
 }
 if ($userdata['s_attribute_add']==1) {
-$side_menu .= '<dd><a href="?task=attribute_add&series=1">Add Attribute</a></dd>';
-$added_option=1;
+	$side_menu .= '<dd><a href="?task=attribute_add&series=1">Add Attribute</a></dd>';
+	$added_option=1;
 }
 
 
@@ -8712,87 +8704,87 @@ $added_option=1;
 $i=1;
 while($i <= $series_counter['gallery_video_count']) {
 
-//video
-if ($userdata['s_gallery_video_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=video&series='.$i.'">'.$_SESSION['label']['gallery_video_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_video_add']==1) || ($userdata['s_gallery_video_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&type=video&series='.$i.'">'.$_SESSION['label']['gallery_video_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	//video
+	if ($userdata['s_gallery_video_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=video&series='.$i.'">'.$_SESSION['label']['gallery_video_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_video_add']==1) || ($userdata['s_gallery_video_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&type=video&series='.$i.'">'.$_SESSION['label']['gallery_video_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 $i=1;
 while($i <= $series_counter['gallery_product_count']) {
 
-//product
-if ($userdata['s_gallery_product_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=product&series='.$i.'">'.$_SESSION['label']['gallery_product_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_product_add']==1) || ($userdata['s_gallery_product_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&type=product&series='.$i.'">'.$_SESSION['label']['gallery_product_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	//product
+	if ($userdata['s_gallery_product_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=product&series='.$i.'">'.$_SESSION['label']['gallery_product_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_product_add']==1) || ($userdata['s_gallery_product_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&type=product&series='.$i.'">'.$_SESSION['label']['gallery_product_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 $i=1;
 while($i <= $series_counter['gallery_paypal_count']) {
 
-//paypal
-if ($userdata['s_gallery_paypal_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=paypal&series='.$i.'">'.$_SESSION['label']['gallery_paypal_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_paypal_add']==1) || ($userdata['s_gallery_paypal_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&type=paypal&series='.$i.'">'.$_SESSION['label']['gallery_paypal_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	//paypal
+	if ($userdata['s_gallery_paypal_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=paypal&series='.$i.'">'.$_SESSION['label']['gallery_paypal_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_paypal_add']==1) || ($userdata['s_gallery_paypal_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&type=paypal&series='.$i.'">'.$_SESSION['label']['gallery_paypal_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 $i=1;
 while($i <= $series_counter['gallery_wip_count']) {
 
-//wip
-if ($userdata['s_gallery_wip_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=wip&series='.$i.'">'.$_SESSION['label']['gallery_wip_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_wip_add']==1)   || ($userdata['s_gallery_wip_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&type=wip&series='.$i.'">'.$_SESSION['label']['gallery_wip_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	//wip
+	if ($userdata['s_gallery_wip_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=wip&series='.$i.'">'.$_SESSION['label']['gallery_wip_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_wip_add']==1)   || ($userdata['s_gallery_wip_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&type=wip&series='.$i.'">'.$_SESSION['label']['gallery_wip_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 $i=1;
 while($i <= $series_counter['gallery_slideshow_count']) {
 
-//slideshow
-if ($userdata['s_gallery_slideshow_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=slideshow&series='.$i.'">'.$_SESSION['label']['gallery_slideshow_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
-if (($userdata['s_gallery_slideshow_add']==1) || ($userdata['s_gallery_slideshow_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-$side_menu .= '<dd><a href="?task=gallery_add&type=slideshow&series='.$i.'">'.$_SESSION['label']['gallery_slideshow_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+	//slideshow
+	if ($userdata['s_gallery_slideshow_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=gallery&type=slideshow&series='.$i.'">'.$_SESSION['label']['gallery_slideshow_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
+	if (($userdata['s_gallery_slideshow_add']==1) || ($userdata['s_gallery_slideshow_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+		$side_menu .= '<dd><a href="?task=gallery_add&type=slideshow&series='.$i.'">'.$_SESSION['label']['gallery_slideshow_add'.'_'.$i].'</a></dd>';
+		$added_option=1;
+	}
 
-$i++;
+	$i++;
 }
 
 $i=1;
 while($i <= $series_counter['category_count']) {
 
 
-if ($userdata['s_category_edit']==1 ) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=category&series='.$i.'">'.$_SESSION['label']['category_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
+	if ($userdata['s_category_edit']==1 ) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=top><td valign=middle><a href="?task=main&tab=category&series='.$i.'">'.$_SESSION['label']['category_manage'.'_'.$i].'</a></td></tr></table></dt>';
+	}
 
- $i++;
+	$i++;
 }
 
 if ( $_SESSION['r_id'] == 0 ) {
@@ -8800,209 +8792,211 @@ if ( $_SESSION['r_id'] == 0 ) {
 
 
 
-$i=1;
-while($i <= $series_counter['page_count']) {
+	$i=1;
+	while($i <= $series_counter['page_count']) {
 
 
- if ($userdata['s_page_edit']==1 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=page">Manage Pages</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=page&series='.$i.'">'.$_SESSION['label']['page_manage'.'_'.$i].'</a></td></tr></table></dt>';
-}
+		if ($userdata['s_page_edit']==1 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=page">Manage Pages</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=page&series='.$i.'">'.$_SESSION['label']['page_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		}
 
 
 
-if (($userdata['s_page_add']==1) || ($userdata['s_page_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-//if ($added_option==1) { echo " | "; }
-$side_menu .= '<dd><a href="?task=content_add&series='.$i.'">'.$_SESSION['label']['page_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+		if (($userdata['s_page_add']==1) || ($userdata['s_page_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+			//if ($added_option==1) { echo " | "; }
+			$side_menu .= '<dd><a href="?task=content_add&series='.$i.'">'.$_SESSION['label']['page_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['article_count']) {
+	$i=1;
+	while($i <= $series_counter['article_count']) {
 
 
- if ($userdata['s_article_edit']==1 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=gallery">Manage Articles</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=article&series='.$i.'">'.$_SESSION['label']['article_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		if ($userdata['s_article_edit']==1 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=gallery">Manage Articles</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=article&series='.$i.'">'.$_SESSION['label']['article_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
-}
-if (($userdata['s_article_add']==1) || ($userdata['s_article_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )){
-//if ($added_option==1) { echo " | "; }
+		}
+		if (($userdata['s_article_add']==1) || ($userdata['s_article_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )){
+			//if ($added_option==1) { echo " | "; }
 
-$side_menu .= '<dd><a href="?task=article_add&series='.$i.'">'.$_SESSION['label']['article_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+			$side_menu .= '<dd><a href="?task=article_add&series='.$i.'">'.$_SESSION['label']['article_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
 
-$i++;
-}
+		$i++;
+	}
 
-if ($userdata['s_comments_edit']==1) {
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=comments&series=1">Manage Comments</a></td></tr></table></dt>';
+	if ($userdata['s_comments_edit']==1) {
+		$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=comments&series=1">Manage Comments</a></td></tr></table></dt>';
 
-}
+	}
 
 
-$i=1;
-while($i <= $series_counter['member_count']) {
+	$i=1;
+	while($i <= $series_counter['member_count']) {
 
- if ($userdata['s_member_edit']==1 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=member">Manage Members</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=member&series='.$i.'">'.$_SESSION['label']['member_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		if ($userdata['s_member_edit']==1 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=member">Manage Members</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=member&series='.$i.'">'.$_SESSION['label']['member_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
 
-}
+		}
 
-if (($userdata['s_member_add']==1) || ($userdata['s_member_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ) {
-//if ($added_option==1) { echo " | "; }
-$side_menu .= '<dd><a href="?task=member_add&series='.$i.'">'.$_SESSION['label']['member_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+		if (($userdata['s_member_add']==1) || ($userdata['s_member_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ) {
+			//if ($added_option==1) { echo " | "; }
+			$side_menu .= '<dd><a href="?task=member_add&series='.$i.'">'.$_SESSION['label']['member_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['menu_count']) {
+	$i=1;
+	while($i <= $series_counter['menu_count']) {
 
- if ($userdata['s_menu_edit']==1  ) {
-//$side_menu .= '<dt><a href="?task=main&tab=menu">Manage Menu</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=menu&series='.$i.'">'.$_SESSION['label']['menu_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		if ($userdata['s_menu_edit']==1  ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=menu">Manage Menu</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=menu&series='.$i.'">'.$_SESSION['label']['menu_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
 
-}
-if (($userdata['s_menu_add']==1) || ($userdata['s_menu_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )) {
-//if ($added_option==1) { echo " | "; }
+		}
+		if (($userdata['s_menu_add']==1) || ($userdata['s_menu_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )) {
+			//if ($added_option==1) { echo " | "; }
 
-$side_menu .= '<dd><a href="?task=menu_add&series='.$i.'">'.$_SESSION['label']['menu_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+			$side_menu .= '<dd><a href="?task=menu_add&series='.$i.'">'.$_SESSION['label']['menu_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['submember_count']) {
+	$i=1;
+	while($i <= $series_counter['submember_count']) {
 
- if ($userdata['s_submember_edit']==1  || $_SESSION['r_id'] > 0 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=submember">Manage Submembers</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=submember&series='.$i.'">'.$_SESSION['label']['submember_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		if ($userdata['s_submember_edit']==1  || $_SESSION['r_id'] > 0 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=submember">Manage Submembers</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=submember&series='.$i.'">'.$_SESSION['label']['submember_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
-}
-if (($userdata['s_submember_add']==1) || $_SESSION['r_id'] > 0 || ($userdata['s_submember_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )) {
-//if ($added_option==1) { echo " | "; }
-$side_menu .= '<dd><a href="?task=submember_add&series='.$i.'">'.$_SESSION['label']['submember_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+		}
+		if (($userdata['s_submember_add']==1) || $_SESSION['r_id'] > 0 || ($userdata['s_submember_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )) {
+			//if ($added_option==1) { echo " | "; }
+			$side_menu .= '<dd><a href="?task=submember_add&series='.$i.'">'.$_SESSION['label']['submember_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
 
-if (($userdata['s_submember_edit']==1 && ($_SESSION['r_id'] > 0 || $_GET['tab']=="submember")) || $_SESSION['r_id'] > 0) {
+		if (($userdata['s_submember_edit']==1 && ($_SESSION['r_id'] > 0 || $_GET['tab']=="submember")) || $_SESSION['r_id'] > 0) {
 
-$query="SELECT * FROM submembers where series=".$_GET['series']." and unreal like '0' and owner=".$_SESSION['m_id']." order by full_name ASC";
+			$query="SELECT * FROM submembers where series=".$_GET['series']." and unreal like '0' and owner=".$_SESSION['m_id']." order by full_name ASC";
 
-$result=mysql_query($query);
-$num=mysql_numrows($result);
-$i=0;
+			$result=mysql_query($query);
+			$num=mysql_numrows($result);
+			$i=0;
 
-while ($i < $num) {
+			while ($i < $num) {
 
-$result_name=mysql_result($result,$i,"full_name");
-$result_id=mysql_result($result,$i,"id");
+				$result_name=mysql_result($result,$i,"full_name");
+				$result_id=mysql_result($result,$i,"id");
 
-$side_menu .= '<dd><a href="?task=submember&item='.$result_id.'">'.$result_name.'</a></dd>';
+				$side_menu .= '<dd><a href="?task=submember&item='.$result_id.'">'.$result_name.'</a></dd>';
 
-$i++;
-}
+				$i++;
+			}
 
-}
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['header_count']) {
+	$i=1;
+	while($i <= $series_counter['header_count']) {
 
 
-//   || ($_SESSION['m_able']==1 || $_SESSION['m_able']==12)
+		//   || ($_SESSION['m_able']==1 || $_SESSION['m_able']==12)
 
-if ($userdata['s_header_edit']==1  ) {
-//$side_menu .= '<dt><a href="?task=main&tab=header">Manage Headers</a></dt>';
+		if ($userdata['s_header_edit']==1  ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=header">Manage Headers</a></dt>';
 
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=header&series='.$i.'">'.$_SESSION['label']['header_manage'.'_'.$i].'</a></td></tr></table></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=header&series='.$i.'">'.$_SESSION['label']['header_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
-}
-if (($userdata['s_header_add']==1)  || ($userdata['s_header_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-//if ($added_option==1) { echo " | "; }
-$side_menu .= '<dd><a href="?task=header_add&series='.$i.'">'.$_SESSION['label']['header_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+		}
+		if (($userdata['s_header_add']==1)  || ($userdata['s_header_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+			//if ($added_option==1) { echo " | "; }
+			$side_menu .= '<dd><a href="?task=header_add&series='.$i.'">'.$_SESSION['label']['header_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['sidebar_count']) {
+	$i=1;
+	while($i <= $series_counter['sidebar_count']) {
 
 
-  if ($userdata['s_sidebar_edit']==1 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=sidebar">Manage Sidebars</a></dt>';
+		if ($userdata['s_sidebar_edit']==1 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=sidebar">Manage Sidebars</a></dt>';
 
-  $side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=sidebar&series='.$i.'">'.$_SESSION['label']['sidebar_manage'.'_'.$i].'</a></td></tr></table></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=sidebar&series='.$i.'">'.$_SESSION['label']['sidebar_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
-}
+		}
 
-if (($userdata['s_sidebar_add']==1)  || ($userdata['s_sidebar_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
-//if ($added_option==1) { echo " | "; }
-$side_menu .= '<dd><a href="?task=sidebar_add&series='.$i.'">'.$_SESSION['label']['sidebar_add'.'_'.$i].'</a></dd>';
+		if (($userdata['s_sidebar_add']==1)  || ($userdata['s_sidebar_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) ) ){
+			//if ($added_option==1) { echo " | "; }
+			$side_menu .= '<dd><a href="?task=sidebar_add&series='.$i.'">'.$_SESSION['label']['sidebar_add'.'_'.$i].'</a></dd>';
 
 
-$added_option=1;
-}
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['note_count']) {
+	$i=1;
+	while($i <= $series_counter['note_count']) {
 
- if ($userdata['s_note_edit']==1 ) {
-//$side_menu .= '<dt><a href="?task=main&tab=note">Manage Notes</a></dt>';
+		if ($userdata['s_note_edit']==1 ) {
+			//$side_menu .= '<dt><a href="?task=main&tab=note">Manage Notes</a></dt>';
 
-    $side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=note&series='.$i.'">'.$_SESSION['label']['note_manage'.'_'.$i].'</a></td></tr></table></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=note&series='.$i.'">'.$_SESSION['label']['note_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
 
-}
+		}
 
-if (($userdata['s_note_add']==1) || ($userdata['s_note_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )  ){
-//if ($added_option==1) { echo " | "; }
+		if (($userdata['s_note_add']==1) || ($userdata['s_note_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )  ){
+			//if ($added_option==1) { echo " | "; }
 
-$side_menu .= '<dd><a href="?task=note_add&series='.$i.'">'.$_SESSION['label']['note_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
+			$side_menu .= '<dd><a href="?task=note_add&series='.$i.'">'.$_SESSION['label']['note_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
 
-$i++;
-}
+		$i++;
+	}
 
-$i=1;
-while($i <= $series_counter['paypal_count']) {
+	$i=1;
+	while($i <= $series_counter['paypal_count']) {
 
- if ($userdata['s_paypal_edit']==1) {
-//$side_menu .= '<dt><a href="?task=main&tab=paypal">Manage Paypal</a></dt>';
-$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=paypal&series='.$i.'">'.$_SESSION['label']['paypal_manage'.'_'.$i].'</a></td></tr></table></dt>';
+		if ($userdata['s_paypal_edit']==1) {
+			//$side_menu .= '<dt><a href="?task=main&tab=paypal">Manage Paypal</a></dt>';
+			$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=paypal&series='.$i.'">'.$_SESSION['label']['paypal_manage'.'_'.$i].'</a></td></tr></table></dt>';
 
-}
-if (($userdata['s_paypal_add']==1) || ($userdata['s_paypal_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )  ){
-//if ($added_option==1) { echo " | "; }
+		}
+		if (($userdata['s_paypal_add']==1) || ($userdata['s_paypal_edit']==1 && ($_SESSION['m_able']==1 || $_SESSION['m_able']==12) )  ){
+			//if ($added_option==1) { echo " | "; }
 
-$side_menu .= '<dd><a href="?task=paypal_add&series='.$i.'">'.$_SESSION['label']['paypal_add'.'_'.$i].'</a></dd>';
-$added_option=1;
-}
-$i++;
-}
+			$side_menu .= '<dd><a href="?task=paypal_add&series='.$i.'">'.$_SESSION['label']['paypal_add'.'_'.$i].'</a></dd>';
+			$added_option=1;
+		}
+		$i++;
+	}
 }
+
+$side_menu .= '<dt><table border=0 height="40"><tr><td valign=middle><a href="?task=main&tab=awstats">Statistics</a></td></tr></table></dt>';
 //if ($added_option==1) {
 //$side_menu .= '<br><br>';
 //}
@@ -10970,359 +10964,358 @@ if (file_exists($filename)) {
 }
 
 
-     function func_set_labels($item) {
+function func_set_labels($item) {
 
-$series_counter = func_series_count($item);
+	$series_counter = func_series_count($item);
 
-$i=1;
-while($i <= $series_counter['gallery_count']) {
+	$i=1;
+	while($i <= $series_counter['gallery_count']) {
 
-$revive_array = func_special_label_array($item,"gallery",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_gallery_manage_'.$i] = "Manage Galleries";
-$_SESSION['label']['gallery_gallery_add_'.$i] = "Add Gallery";
-} else {
-$_SESSION['label']['gallery_gallery_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_gallery_add_'.$i] = $revive_array['add'];
-}
-$revive_array = func_special_label_array($item,"photo",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_add_'.$i] = "Add Image";
-} else {
-$_SESSION['label']['photo_add_'.$i] = $revive_array['add'];
-}
-
-$i++;
-}
+		$revive_array = func_special_label_array($item,"gallery",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_gallery_manage_'.$i] = "Manage Galleries";
+			$_SESSION['label']['gallery_gallery_add_'.$i] = "Add Gallery";
+		} else {
+			$_SESSION['label']['gallery_gallery_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_gallery_add_'.$i] = $revive_array['add'];
+		}
+		$revive_array = func_special_label_array($item,"photo",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_add_'.$i] = "Add Image";
+		} else {
+			$_SESSION['label']['photo_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['gallery_video_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"gallery_video",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_video_manage_'.$i] = "Manage Video Galleries";
-$_SESSION['label']['gallery_video_add_'.$i] = "Add Video Gallery";
-} else {
-$_SESSION['label']['gallery_video_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_video_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['gallery_video_count']) {
 
-$revive_array = func_special_label_array($item,"photo_video",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_video_add_'.$i] = "Add Video";
-} else {
-$_SESSION['label']['photo_video_add_'.$i] = $revive_array['add'];
-}
+		$revive_array = func_special_label_array($item,"gallery_video",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_video_manage_'.$i] = "Manage Video Galleries";
+			$_SESSION['label']['gallery_video_add_'.$i] = "Add Video Gallery";
+		} else {
+			$_SESSION['label']['gallery_video_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_video_add_'.$i] = $revive_array['add'];
+		}
 
-$i++;
-}
+		$revive_array = func_special_label_array($item,"photo_video",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_video_add_'.$i] = "Add Video";
+		} else {
+			$_SESSION['label']['photo_video_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['gallery_product_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"gallery_product",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_product_manage_'.$i] = "Manage Product Galleries";
-$_SESSION['label']['gallery_product_add_'.$i] = "Add Product Gallery";
-} else {
-$_SESSION['label']['gallery_product_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_product_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['gallery_product_count']) {
 
-$revive_array = func_special_label_array($item,"photo_product",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_product_add_'.$i] = "Add Product";
-} else {
-$_SESSION['label']['photo_product_add_'.$i] = $revive_array['add'];
-}
+		$revive_array = func_special_label_array($item,"gallery_product",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_product_manage_'.$i] = "Manage Product Galleries";
+			$_SESSION['label']['gallery_product_add_'.$i] = "Add Product Gallery";
+		} else {
+			$_SESSION['label']['gallery_product_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_product_add_'.$i] = $revive_array['add'];
+		}
 
-$i++;
-}
+		$revive_array = func_special_label_array($item,"photo_product",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_product_add_'.$i] = "Add Product";
+		} else {
+			$_SESSION['label']['photo_product_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['gallery_wip_count']) {
+		$i++;
+	}
 
+	$i=1;
+	while($i <= $series_counter['gallery_wip_count']) {
 
 
-$revive_array = func_special_label_array($item,"gallery_wip",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_wip_manage_'.$i] = "Manage Work in Progress Galleries";
-$_SESSION['label']['gallery_wip_add_'.$i] = "Add Work in Progress Gallery";
-} else {
-$_SESSION['label']['gallery_wip_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_wip_add_'.$i] = $revive_array['add'];
-}
 
-$revive_array = func_special_label_array($item,"photo_wip",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_wip_add_'.$i] = "Add Work in Progress";
-} else {
-$_SESSION['label']['photo_wip_add_'.$i] = $revive_array['add'];
-}
+		$revive_array = func_special_label_array($item,"gallery_wip",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_wip_manage_'.$i] = "Manage Work in Progress Galleries";
+			$_SESSION['label']['gallery_wip_add_'.$i] = "Add Work in Progress Gallery";
+		} else {
+			$_SESSION['label']['gallery_wip_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_wip_add_'.$i] = $revive_array['add'];
+		}
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"photo_wip",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_wip_add_'.$i] = "Add Work in Progress";
+		} else {
+			$_SESSION['label']['photo_wip_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['gallery_paypal_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"gallery_paypal",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_paypal_manage_'.$i] = "Manage Paypal Galleries";
-$_SESSION['label']['gallery_paypal_add_'.$i] = "Add Paypal Gallery";
-} else {
-$_SESSION['label']['gallery_paypal_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_paypal_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['gallery_paypal_count']) {
 
-$revive_array = func_special_label_array($item,"photo_paypal",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_paypal_add_'.$i] = "Add Paypal Item";
-} else {
-$_SESSION['label']['photo_paypal_add_'.$i] = $revive_array['add'];
-}
- $i++;
-}
+		$revive_array = func_special_label_array($item,"gallery_paypal",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_paypal_manage_'.$i] = "Manage Paypal Galleries";
+			$_SESSION['label']['gallery_paypal_add_'.$i] = "Add Paypal Gallery";
+		} else {
+			$_SESSION['label']['gallery_paypal_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_paypal_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['gallery_slideshow_count']) {
+		$revive_array = func_special_label_array($item,"photo_paypal",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_paypal_add_'.$i] = "Add Paypal Item";
+		} else {
+			$_SESSION['label']['photo_paypal_add_'.$i] = $revive_array['add'];
+		}
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"gallery_slideshow",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['gallery_slideshow_manage_'.$i] = "Manage Slideshow Galleries";
-$_SESSION['label']['gallery_slideshow_add_'.$i] = "Add Slideshow Gallery";
-} else {
-$_SESSION['label']['gallery_slideshow_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['gallery_slideshow_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['gallery_slideshow_count']) {
 
-$revive_array = func_special_label_array($item,"photo_slideshow",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['photo_slideshow_add_'.$i] = "Add Slideshow Picture";
-} else {
-$_SESSION['label']['photo_slideshow_add_'.$i] = $revive_array['add'];
-}
+		$revive_array = func_special_label_array($item,"gallery_slideshow",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['gallery_slideshow_manage_'.$i] = "Manage Slideshow Galleries";
+			$_SESSION['label']['gallery_slideshow_add_'.$i] = "Add Slideshow Gallery";
+		} else {
+			$_SESSION['label']['gallery_slideshow_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['gallery_slideshow_add_'.$i] = $revive_array['add'];
+		}
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"photo_slideshow",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['photo_slideshow_add_'.$i] = "Add Slideshow Picture";
+		} else {
+			$_SESSION['label']['photo_slideshow_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['page_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"page",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['page_manage_'.$i] = "Manage Pages";
-$_SESSION['label']['page_add_'.$i] = "Add Page";
-} else {
-$_SESSION['label']['page_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['page_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['page_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"page",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['page_manage_'.$i] = "Manage Pages";
+			$_SESSION['label']['page_add_'.$i] = "Add Page";
+		} else {
+			$_SESSION['label']['page_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['page_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['menu_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"menu",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['menu_manage_'.$i] = "Manage Menu";
-$_SESSION['label']['menu_add_'.$i] = "Add Menu Item";
-} else {
-$_SESSION['label']['menu_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['menu_add_'.$i] = $revive_array['add'];
-}
- $i++;
-}
+	$i=1;
+	while($i <= $series_counter['menu_count']) {
 
-$i=1;
-while($i <= $series_counter['member_count']) {
+		$revive_array = func_special_label_array($item,"menu",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['menu_manage_'.$i] = "Manage Menu";
+			$_SESSION['label']['menu_add_'.$i] = "Add Menu Item";
+		} else {
+			$_SESSION['label']['menu_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['menu_add_'.$i] = $revive_array['add'];
+		}
+		$i++;
+	}
 
+	$i=1;
+	while($i <= $series_counter['member_count']) {
 
-$revive_array = func_special_label_array($item,"member",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['member_manage_'.$i] = "Manage Members";
-$_SESSION['label']['member_add_'.$i] = "Add Member";
-} else {
-$_SESSION['label']['member_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['member_add_'.$i] = $revive_array['add'];
-}
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"member",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['member_manage_'.$i] = "Manage Members";
+			$_SESSION['label']['member_add_'.$i] = "Add Member";
+		} else {
+			$_SESSION['label']['member_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['member_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['sidebar_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"sidebar",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['sidebar_manage_'.$i] = "Manage Sidebars";
-$_SESSION['label']['sidebar_add_'.$i] = "Add Sidebar";
-} else {
-$_SESSION['label']['sidebar_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['sidebar_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['sidebar_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"sidebar",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['sidebar_manage_'.$i] = "Manage Sidebars";
+			$_SESSION['label']['sidebar_add_'.$i] = "Add Sidebar";
+		} else {
+			$_SESSION['label']['sidebar_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['sidebar_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['sidebar_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"sidebar_photo",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['sidebar_photo_manage_'.$i] = "Manage Sidebar Photos";
-$_SESSION['label']['sidebar_photo_add_'.$i] = "Add Sidebar Photo";
-} else {
-$_SESSION['label']['sidebar_photo_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['sidebar_photo_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['sidebar_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"sidebar_photo",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['sidebar_photo_manage_'.$i] = "Manage Sidebar Photos";
+			$_SESSION['label']['sidebar_photo_add_'.$i] = "Add Sidebar Photo";
+		} else {
+			$_SESSION['label']['sidebar_photo_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['sidebar_photo_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['header_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"header",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['header_manage_'.$i] = "Manage Headers";
-$_SESSION['label']['header_add_'.$i] = "Add Header";
-} else {
-$_SESSION['label']['header_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['header_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['header_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"header",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['header_manage_'.$i] = "Manage Headers";
+			$_SESSION['label']['header_add_'.$i] = "Add Header";
+		} else {
+			$_SESSION['label']['header_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['header_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['note_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"note",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['note_manage_'.$i] = "Manage Notes";
-$_SESSION['label']['note_add_'.$i] = "Add Note";
-} else {
-$_SESSION['label']['note_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['note_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['note_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"note",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['note_manage_'.$i] = "Manage Notes";
+			$_SESSION['label']['note_add_'.$i] = "Add Note";
+		} else {
+			$_SESSION['label']['note_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['note_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['paypal_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"paypal",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['paypal_manage_'.$i] = "Manage Paypal Configurations";
-$_SESSION['label']['paypal_add_'.$i] = "Add Paypal Configurations";
-} else {
-$_SESSION['label']['paypal_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['paypal_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['paypal_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"paypal",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['paypal_manage_'.$i] = "Manage Paypal Configurations";
+			$_SESSION['label']['paypal_add_'.$i] = "Add Paypal Configurations";
+		} else {
+			$_SESSION['label']['paypal_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['paypal_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['article_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"article",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['article_manage_'.$i] = "Manage Articles";
-$_SESSION['label']['article_add_'.$i] = "Add Article";
-} else {
-$_SESSION['label']['article_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['article_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['article_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"article",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['article_manage_'.$i] = "Manage Articles";
+			$_SESSION['label']['article_add_'.$i] = "Add Article";
+		} else {
+			$_SESSION['label']['article_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['article_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['submember_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"submember",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['submember_manage_'.$i] = "Manage Submembers";
-$_SESSION['label']['submember_add_'.$i] = "Add Submember";
-} else {
-$_SESSION['label']['submember_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['submember_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['submember_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"submember",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['submember_manage_'.$i] = "Manage Submembers";
+			$_SESSION['label']['submember_add_'.$i] = "Add Submember";
+		} else {
+			$_SESSION['label']['submember_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['submember_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['event_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"event",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['event_manage_'.$i] = "Manage Events";
-$_SESSION['label']['event_add_'.$i] = "Add Event";
-} else {
-$_SESSION['label']['event_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['event_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['event_count']) {
 
- $i++;
-}
+		$revive_array = func_special_label_array($item,"event",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['event_manage_'.$i] = "Manage Events";
+			$_SESSION['label']['event_add_'.$i] = "Add Event";
+		} else {
+			$_SESSION['label']['event_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['event_add_'.$i] = $revive_array['add'];
+		}
 
-$i=1;
-while($i <= $series_counter['category_count']) {
+		$i++;
+	}
 
-$revive_array = func_special_label_array($item,"category",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['category_manage_'.$i] = "Manage Categories";
-$_SESSION['label']['category_add_'.$i] = "Add Categories";
-} else {
-$_SESSION['label']['category_manage_'.$i] = $revive_array['manage'];
-$_SESSION['label']['category_add_'.$i] = $revive_array['add'];
-}
-$revive_array = func_special_label_array($item,"category_assign",$i);
-if ($revive_array['num']==0) {
-$_SESSION['label']['category_assign_manage_'.$i] = "Manage Category Assignments";
-$_SESSION['label']['category_assign_add_'.$i] = "Add Category Assignment";
-} else {
-$_SESSION['label']['category_assign_manage'] = $revive_array['manage'];
-$_SESSION['label']['category_assign_add_'.$i] = $revive_array['add'];
-}
+	$i=1;
+	while($i <= $series_counter['category_count']) {
 
-$i++;
-}
+		$revive_array = func_special_label_array($item,"category",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['category_manage_'.$i] = "Manage Categories";
+			$_SESSION['label']['category_add_'.$i] = "Add Categories";
+		} else {
+			$_SESSION['label']['category_manage_'.$i] = $revive_array['manage'];
+			$_SESSION['label']['category_add_'.$i] = $revive_array['add'];
+		}
+		$revive_array = func_special_label_array($item,"category_assign",$i);
+		if ($revive_array['num']==0) {
+			$_SESSION['label']['category_assign_manage_'.$i] = "Manage Category Assignments";
+			$_SESSION['label']['category_assign_add_'.$i] = "Add Category Assignment";
+		} else {
+			$_SESSION['label']['category_assign_manage'] = $revive_array['manage'];
+			$_SESSION['label']['category_assign_add_'.$i] = $revive_array['add'];
+		}
 
+		$i++;
+	}
 }
 
 
 function func_series_count($client) {
-$query="SELECT * FROM members where id=".$client;
-$result=mysql_query($query);
-$num=mysql_numrows($result);
+	$query="SELECT * FROM members where id=".$client;
+	$result=mysql_query($query);
+	$num=mysql_numrows($result);
 
-$return_truth['gallery_count']=mysql_result($result,0,"gallery_count");
-$return_truth['gallery_video_count']=mysql_result($result,0,"gallery_video_count");
-$return_truth['gallery_product_count']=mysql_result($result,0,"gallery_product_count");
-$return_truth['gallery_paypal_count']=mysql_result($result,0,"gallery_paypal_count");
-$return_truth['gallery_wip_count']=mysql_result($result,0,"gallery_wip_count");
-$return_truth['gallery_slideshow_count']=mysql_result($result,0,"gallery_slideshow_count");
-$return_truth['page_count']=mysql_result($result,0,"page_count");
-$return_truth['article_count']=mysql_result($result,0,"article_count");
-$return_truth['sidebar_count']=mysql_result($result,0,"sidebar_count");
-$return_truth['header_count']=mysql_result($result,0,"header_count");
-$return_truth['note_count']=mysql_result($result,0,"note_count");
-$return_truth['paypal_count']=mysql_result($result,0,"paypal_count");
-$return_truth['event_count']=mysql_result($result,0,"event_count");
-$return_truth['menu_count']=mysql_result($result,0,"menu_count");
-$return_truth['category_count']=mysql_result($result,0,"category_count");
-$return_truth['member_count']=mysql_result($result,0,"member_count");
-$return_truth['submember_count']=mysql_result($result,0,"submember_count");
+	$return_truth['gallery_count']=mysql_result($result,0,"gallery_count");
+	$return_truth['gallery_video_count']=mysql_result($result,0,"gallery_video_count");
+	$return_truth['gallery_product_count']=mysql_result($result,0,"gallery_product_count");
+	$return_truth['gallery_paypal_count']=mysql_result($result,0,"gallery_paypal_count");
+	$return_truth['gallery_wip_count']=mysql_result($result,0,"gallery_wip_count");
+	$return_truth['gallery_slideshow_count']=mysql_result($result,0,"gallery_slideshow_count");
+	$return_truth['page_count']=mysql_result($result,0,"page_count");
+	$return_truth['article_count']=mysql_result($result,0,"article_count");
+	$return_truth['sidebar_count']=mysql_result($result,0,"sidebar_count");
+	$return_truth['header_count']=mysql_result($result,0,"header_count");
+	$return_truth['note_count']=mysql_result($result,0,"note_count");
+	$return_truth['paypal_count']=mysql_result($result,0,"paypal_count");
+	$return_truth['event_count']=mysql_result($result,0,"event_count");
+	$return_truth['menu_count']=mysql_result($result,0,"menu_count");
+	$return_truth['category_count']=mysql_result($result,0,"category_count");
+	$return_truth['member_count']=mysql_result($result,0,"member_count");
+	$return_truth['submember_count']=mysql_result($result,0,"submember_count");
 
 
 
-return $return_truth;
+	return $return_truth;
 }
 
 function get_mime_type($filename, $mimePath = '/etc') {
diff --git a/awstatsproxy.php b/awstatsproxy.php
new file mode 100644
index 0000000..59862df
--- /dev/null
+++ b/awstatsproxy.php
@@ -0,0 +1,56 @@
+<?php
+require_once('user.php');
+session_start();
+$user = get_unix_user_info();
+putenv('AWSTATS_USERDIR='. $user['dir'] .'/tmp/awstats/');
+
+if($_GET['output'])
+{
+	$output = '-output=' .escapeshellarg($_GET['output']);
+}
+else
+{
+	$output = '-output';
+}
+
+if($_GET['lang'])
+{
+	$lang = '-lang=' . escapeshellarg($_GET['lang']);
+}
+else
+{
+	$lang = '-lang=en';
+}
+
+$month_ago = time() - 24 * 3600 * 30;
+
+if($_GET['month'])
+{
+	$month = '-month=' . (int)$_GET['month'];
+}
+else
+{
+	$month = '-month=' . date('m', $month_ago);;
+}
+
+if($_GET['year'])
+{
+	$year = '-year=' . (int)$_GET['year'];
+}
+else
+{
+	$year = '-year=' . date('Y', $month_ago);
+}
+
+
+ob_start();
+system('/usr/local/cpanel/3rdparty/bin/awstats.hwd.pl -config=' . $user['domain'] . ' ' . $output . ' ' . $lang . ' ' . $month . ' ' . $year);
+$html = ob_get_contents();
+ob_end_clean();
+
+$html = preg_replace('#/tmp/awstats/[^\?]+#', '', $html);
+$html = preg_replace('#target="awstatsbis"#', '', $html);
+$html = preg_replace('#Update now#', '', $html);
+echo $html;
+//echo '<pre>'; print_r($_SESSION); echo '</pre>';
+?>
diff --git a/files/general_structure.css b/files/general_structure.css
index 54bf9cc..ddb1eba 100644
--- a/files/general_structure.css
+++ b/files/general_structure.css
@@ -10,7 +10,7 @@ body {text-align: center; margin: 10px; background: #2E4C6B;}
 /////////////////////////////////////////////////////*/
 
 div.wrapper
-{width: 965px; margin: 10 auto 10 auto; background: #FFF; border: 10px solid #253E57;
+{width: 1015px; margin: 10 auto 10 auto; background: #FFF; border: 10px solid #253E57;
 
 
 }
@@ -83,7 +83,7 @@ div.wrapper
 /////////////////////////////////////////////////////*/
 
 		div.wrapper div.content blockquote.leftContent
-		{width: 200px; margin: 0 15px 0 0; text-align: left; float: left; border: 0;}
+		{width: 170px; margin: 0 15px 0 0; text-align: left; float: left; border: 0;}
 
 			div.wrapper div.content blockquote.leftContent img
 			{ margin: 0;}
diff --git a/user.php b/user.php
index 106f5eb..dee6ab0 100644
--- a/user.php
+++ b/user.php
@@ -1,4 +1,18 @@
 <?php
+require_once('tasks.php');
+
+function get_unix_user_info($domain=NULL)
+{
+	if(!$domain)
+	{
+		$domain = preg_replace('#http://(www\.)?#', '', $_SESSION['root_web']);
+		$domain = preg_replace('#([^/]+)/.*#', '\\1', $domain);
+	}
+	$user = get_username_for_domain($domain);
+	$info = posix_getpwnam($user);
+	$info['domain'] = $domain;
+	return $info;
+}
 
 /* TODO: make it proper - store unix username in db*/
 function get_current_username()
