	//return to defualt
	var counter = 0;
	timeDisplay = null;
	function getTheLinks( lang, IndexOfLinks, obj , flag ) {
		if( !document.getElementById('subHeaderDis') ) {
			return;
		}
		mainLenght = 10
		subLength  = 15;
		//remove the classes from sub and main tabs
		for( i= 0 ; i < mainLenght ; i++ ) {
			if( !document.getElementById('main'+i) )
				break;
			document.getElementById('main'+i).className  = '';	
		}
		

		obj.className  = 'mbs-portal-book-root-menu-item-active';

		for( i= 0 ; i < subLength ; i++ ) {
			if( !document.getElementById('sub'+i) )
				break;
			document.getElementById('sub'+i).className  = '';	
		}
				
		indexForText = 1;

		LinksToDisplay = enLinks( IndexOfLinks );
		linksLength = LinksToDisplay.length;
		subHeaderHtml = '';
	
		for( i=0 ; i<linksLength; i++ ) {
		
		
		
				subHeaderHtml += '<li id="sub'+i+'"><a href="'+LinksToDisplay[i][2]+'.php'+'">';
		
			subHeaderHtml += LinksToDisplay[i][indexForText]+'</a></li>';
		}

		document.getElementById('subHeaderDis').innerHTML = subHeaderHtml;
	}
	

	function enLinks( IndexOfLinks ) {
		
				Links = new Array();
				Links[0] = new Array(); 
				Links[1] = new Array(); 
				Links[2] = new Array(); 
				Links[3] = new Array(); 
				Links[4] = new Array(); 
				Links[5] = new Array(); 
				Links[7] = new Array(); 
				Links[8] = new Array();
		
			
				Links[0][0] = new Array('My home','صفحتي','user_panel')
				Links[0][1] = new Array('My Profit','الصفحة الرئيسية','index')
				
				
				Links[1][0] = new Array('My search','بحثي','search_quick')  
				Links[1][1] = new Array('Who is online?','المتواجدون الأن','listOnlineMF') 
				Links[1][2] = new Array('Newest Members','أعضاء جدد','new_user_list') 
				Links[1][3] = new Array('Search By Tags','البحث بالسمات','more_tags') 
				Links[1][4] = new Array('Search By Country','البحث حسب المحافظات','more_by_country') 
				Links[1][5] = new Array('Banned users','الممنوعون من دخول الموقع','list_banned') 
				
				Links[2][0] = new Array('Inbox','البريد الوارد','inbox')
				Links[2][1] = new Array('Outbox','البريدالصادر','outbox')
				Links[2][2] = new Array('interset list','أعضاء في قائمة أهتماماتي','interset_list')
				Links[2][3] = new Array('order list','طلبات التواصل المرسلة','order_list')
				Links[2][4] = new Array('member join','أعضاء تريد التواصل معي','member_join')
				Links[2][5] = new Array('join now','أعضاء تستطيع التواصل معهم','join_now')

				Links[3][0] = new Array('Matchmaker','عرض قصص النجاح','success_stories')
				Links[3][1] = new Array('Who interested in me?',' قصة نجاح جديدة ','new_success_story')
		

		
	
		
				
				Links[4] = new Array();
		
				return Links[IndexOfLinks];
	}
	//timer
	function timeTest( flag ) {
		//increment the counter
		tabCount = document.getElementById( 'tabsCountForHead' );
		//if called new time the counter must be Zero again
		if( flag == '1' ) {
			tabCount.value = 0;	
		}		
		tabCountValue = tabCount.value;
		tabCount.value = parseInt( tabCountValue ) + 1;  
		if( tabCount.value < 15 ) {
			var timeDisplay = setTimeout( "timeTest( '0' )", 1000);
		} else {
			clearTimeout( timeDisplay );
			mainIndex = document.getElementById('mainSeletedItem');
			IndexOfLinks = 0;
			if( mainIndex ) {
				IndexOfLinks = mainIndex.value;
			}
			obj = document.getElementById('main'+IndexOfLinks);
		
			//get the sub title higlighted and solve the problem when the sub header is empty
			subIndex = 0;
			subIndexObj = document.getElementById('subHeaderSeleted');
			if( subIndexObj ) {
				subIndex = subIndexObj.value;
			}
			SubObj = document.getElementById('sub'+subIndex)
			if( SubObj && SubObj.className != 'mbs-portal-book-sub-menu-item-active' ) {
				SubObj.className  = 'mbs-portal-book-sub-menu-item-active';
			}
		}
	}
	

	
	                                 