/*****************************************************************\
|*  In the name of Allah, The Most Gracious, The Most Merciful   *|
|*****************************************************************|
|*          ####  #     ####  ####  ####  ####  ####             *|
|*          #  #  #     #     #  #  #  #  #  #  #                *|
|*          ####  #     ###   ####  ####  #  #  ####             *|
|*          #  #  #     #     #     #     #  #     #             *|
|*    www.  #  #  ####  ####  #     #     ####  ####  .net       *|
|*****************************************************************|
|*  aleppos version 1.0.0
|*****************************************************************|
|* Copyright ©2005–2006 Aleppos Network Ltd. All Rights Reserved *|
|*This file may not be redistributed in whole or significant part*|
|* http://www.aleppos.net           ALEPPOS IS NOT FREE SOFTWARE *|
\*****************************************************************/

var tab_list = new Array();
tab_list = [
	['الرئيسية', 'almenu1', 80, [
		['الصفحة الرئيسية', 'http://www.aleppos.net/index.php', "window.location='http://eyoon.com/goto/24904'; return false;", ''],
		['التسجيل', 'http://www.aleppos.net/forum/register.php', '', 'vb_out'],
		['إسترجاع كلمة المرور', 'http://www.aleppos.net/forum/login.php?do=lostpw', '', 'vb_out'],
		['إرسال كود التفعيل', 'http://www.aleppos.net/forum/register.php?do=requestemail', '', 'vb_act'],
		['لوحة التحكم', 'http://www.aleppos.net/forum/usercp.php', '', 'vb_in'],
		['الرسائل الخاصة', 'http://www.aleppos.net/forum/private.php', '', 'vb_in'],
		['قائمة الأعضاء', 'http://www.aleppos.net/forum/memberlist.php', '', 'vb_admin'],
		['التقويم', 'http://www.aleppos.net/forum/calendar.php', '', ''],
		['الأوسمة', 'http://www.aleppos.net/forum/awards.php', '', ''],
		['الأسئلة الشائعة', 'http://www.aleppos.net/forum/faq.php', '', ''],
		['تسجيل الخروج', 'http://www.aleppos.net/forum/login.php?do=logout', "return log_out('هل أنت متأكد أنك تريد تسجيل الخروج؟')", 'vb_in'],
	]],
	['الإستضافة', 'almenu2', 80, [
		['حلبيات لحلول الإستضافة', 'http://www.alepposhost.com', '', ''],
	]],
	['البريد', 'almenu3', 80, [
		['الرئيسية', 'http://www.aleppos.net/mail/index.php', '', ''],
		['إرسال رسالة جديدة', 'http://www.aleppos.net/mail/compose.email.php', '', 'mail_in'],
		['دفتر العناوين', 'http://www.aleppos.net/mail/addressbook.view.php', '', 'mail_in'],
		['الإعدادات', 'http://www.aleppos.net/mail/options.menu.php', '', 'mail_in'],
		['البحث', 'http://www.aleppos.net/mail/search.intro.php', '', 'mail_in'],
		['الخروج من البريد', 'http://www.aleppos.net/mail/user.logout.php', '', 'mail_in'],
	]],
	['المنتديات', 'almenu4', 80, [
		['الرئيسية', 'http://www.aleppos.net/forum/index.php', '', ''],
		['المشاركات الجديدة', 'http://www.aleppos.net/forum/search.php?do=getnew', '', 'vb_in'],
		['مشاركات اليوم', 'http://www.aleppos.net/forum/search.php?do=getdaily', '', 'vb_out'],
		['البحث', 'http://www.aleppos.net/forum/search.php', '', ''],
		['جعل المنتديات كمقرؤة', 'http://www.aleppos.net/forum/forumdisplay.php?do=markread', '', ''],
		['المواضيع المشترك بها', 'http://www.aleppos.net/forum/subscription.php', '', 'vb_in'],
		['الأخبار المحلية والعالمية', 'http://www.aleppos.net/forum/forumdisplay.php?f=55', '', ''],
	]],
	['التحميلات', 'almenu5', 80, [
		['الرئيسية', 'http://www.aleppos.net/programs/index.php', '', ''],
		['الإعدادت', 'http://www.aleppos.net/programs/filecpl.php?action=modifyoptions', '', 'vb_in'],
		['البحث', 'http://www.aleppos.net/programs/search.php?do=getdaily', '', ''],
		['حالة التحميل', 'http://www.aleppos.net/programs/filecpl.php?action=showstatus', '', 'vb_in'],
	]],
	['البوم الصور', 'almenu6', 80, [
		['الرئيسية', 'http://www.aleppos.net/gallery/index.php', '', ''],
		['الصور الجديدة', 'http://www.aleppos.net/gallery/browseimages.php?do=newimages&cutoffdate=lastvisit', '', ''],
		['الأكثر شهرة', 'http://www.aleppos.net/gallery/browseimages.php?do=popimages&orderby=views', '', ''],
		['رفع صور', 'http://www.aleppos.net/gallery/upload.php', '', ''],
		['البحث', 'http://www.aleppos.net/gallery/search.php', '', ''],
	]],
	['الترفيه', 'almenu7', 80, [
		['الدردشة', 'http://www.chat.aleppos.net', '', ''],
		['مركز الألعاب', 'http://www.aleppos.net/forum/arcade.php', '', ''],
	]],
	['الدعم الفني', 'almenu8', 80, [
		['الرئيسية', 'http://www.support.alepposhost.com/index.php', '', ''],
		['إرسال تذكرة دعم فني', 'http://www.support.alepposhost.com/index.php?_m=tickets&_a=submit', '', ''],
		['مركز الدروس', 'http://www.support.alepposhost.com/index.php?_m=knowledgebase&_a=view', '', ''],
		['الإتصال بنا', 'http://www.support.alepposhost.com/index.php?_m=tickets&_a=submit', '', ''],
	]],
	['من نحن', 'almenu9', 80, [
		['قريباً', '', '', ''],
		['طاقم الإدارة', 'http://www.aleppos.net/forum/showgroups.php', '', ''],
		['الاشتراك بالعضوية الذهبية', 'http://www.aleppos.net/index.php?pageid=reg', '', ''],
		['الإتصال بنا', 'http://www.support.alepposhost.com/index.php?_m=tickets&_a=submit', '', ''],
	]],

];

var tab_className = 'almenu';

var CLEARIMAGE = 'http://www.aleppos.net/forum/clear.gif';

var border1 = '#414142';
var border2 = '#A5A2A5';
var mborder = '#C6C3C6';
var m_bg = '#F0F0F0';

var tab_html = new Array();
var tab_obj = null;
var tabtimer = null;

function get_object(idname)
{
	if (document.getElementById)
	{
		return document.getElementById(idname);
	}
	else if (document.all)
	{
		return document.all[idname];
	}
	else if (document.layers)
	{
		return document.layers[idname];
	}
	else
	{
		return null;
	}
}

function check_group(group, haystack)
{
	if (!group)
	{
		return true;
	}

	for (var i in haystack)
	{
		if (haystack[i] == group)
		{
			return true;
		}
	}

	return false;
}

function switch_tab(obj, tab_id)
{
	if (tab_obj)
	{
		tab_obj.className = tab_className;
	}
	obj.className = tab_list[tab_id][1] + '_hilite';

	get_object('menu_line').className = tab_list[tab_id][1] + '_line';
	get_object('menu_links').className = tab_list[tab_id][1] + '_links';
	get_object('menu_links').innerHTML = tab_html[tab_id];
	tab_obj = obj;
}

function tab_def(tab_id)
{
	tabtimer = setTimeout("switch_tab(get_object('default_tab'), " + tab_id + ");", 10000);
}

function tab_menu_build(tab_id, groups)
{
	colspan = (tab_list.length * 3) + 1;

	document.write('<table class="altmenu" width="100%" border="0" cellspacing="0" cellpadding="0" onmouseover="clearTimeout(tabtimer);" onmouseout="tab_def(' + tab_id + ');"><tr>');
	document.write('<tr><td style="background-color:' + mborder + '" colspan="' + colspan + '"><img src="' + CLEARIMAGE + '" height="1" alt="" /></td></tr>');
	document.write('<tr><td style="background-color:' + m_bg + '" colspan="' + colspan + '"><img src="' + CLEARIMAGE + '" height="5" alt="" /></td></tr>');
	for (var i in tab_list)
	{
		tab_html[i] = '<ul>';
		for (var n in tab_list[i][3])
		{
			if (check_group(tab_list[i][3][n][3], groups))
			{
				tab_html[i] = tab_html[i] + '<li><a ' + (tab_list[i][3][n][1] ? 'href="' + tab_list[i][3][n][1] + '" ' : '') + (tab_list[i][3][n][2] ? 'onclick="' + tab_list[i][3][n][2] + '" ' : '') + '>' + tab_list[i][3][n][0] + '<a></li>';
			}
		}
		tab_html[i] = tab_html[i] + '</ul>';

		document.write('<td ' + (i == tab_id ? 'id="default_tab" ' : '') + 'width="' + tab_list[i][2] + '" class="' + tab_className + '" onmouseover="switch_tab(this, ' + i + ')" align="center" nowrap="nowrap">');
				document.write(tab_list[i][0] + '</td>');
		document.write('<td style="background-color:' + border1 + '"><img src="' + CLEARIMAGE + '" width="1" alt="" /></td>');
		document.write('<td style="background-color:' + border2 + '"><img src="' + CLEARIMAGE + '" width="1" alt="" /></td>');
	}
	document.write('<td class="' + tab_className + '" width="100%"><img src="' + CLEARIMAGE + '" height="21" alt="" /></td></tr>');
	document.write('<tr><td id="menu_line" colspan="' + colspan + '"><img src="' + CLEARIMAGE + '" height="5" alt="" /></td></tr>');
	document.write('<tr><td height="21" id="menu_links" colspan="' + colspan + '">Loading</td></tr>');
	document.write('<tr><td style="background-color:' + mborder + '" colspan="' + colspan + '"><img src="' + CLEARIMAGE + '" height="1" alt="" /></td></tr></table>');

	switch_tab(get_object('default_tab'), tab_id);
}

/*****************************************************************\
|*  CVS: $RCSfile: tab_menu.js,v $ - $Revision: 1.0 $
\*****************************************************************/