
//constant variables



var host_address_4			='http://www.tct.ir/home/fa';
var defOver_4				='#527089';
var defBack_4				='#dfe2e3';
var defBack2_4				='';
var mo_overCol_4				='#527089';
var mo_backCol_4				='#DDDDDD';
var offsete_menu_az_chap_4	=-260;
var offsete_menu_az_bala_4	=-8;
var fasele_beine_itemha_4	=0;
var ertefa_itemha_4			=20;
var arz_4					=20;











//end of constants

	function init_4() {
		//window.status='www.tct.ir';
		
		//alert('init');
		//self.moveTo(0,0);
		//self.resizeTo(screen.availWidth,(screen.availHeight));
		writeMennus_4();	
		//if(document.all.my3table){
		//	my3image.width=my3table.clientWidth;
		//}
	}
	
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef_4(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}
function getSty_4(id) {
	return (isNS4 ? getRef_4(id) : getRef_4(id).style);
} 

var popTimer_4 = 0;
var litNow_4 = new Array();
function popOver_4(mennu_4Num, itemNum){
	

	clearTimeout(popTimer_4);
	hideAllBut_4(mennu_4Num);
	litNow_4 = getTree_4(mennu_4Num, itemNum);
	changeCol_4(litNow_4, true);
	targetNum = mennu_4[mennu_4Num][itemNum].target;
	
	

	if (targetNum > 0) {
		thisX = parseInt(mennu_4[mennu_4Num][0].ref.left) + parseInt(mennu_4[mennu_4Num][itemNum].ref.left);
		thisY = parseInt(mennu_4[mennu_4Num][0].ref.top) + parseInt(mennu_4[mennu_4Num][itemNum].ref.top);

		
		with (mennu_4[targetNum][0].ref) {
			left = parseInt(thisX + mennu_4[targetNum][0].x);
			top = parseInt(thisY + mennu_4[targetNum][0].y);
			visibility = 'visible';
		}
	}
}
function popOut_4(mennu_4Num, itemNum) {

	if ((mennu_4Num == 0) && !mennu_4[mennu_4Num][itemNum].target)
		hideAllBut_4(0)
	else
		popTimer_4 = setTimeout('hideAllBut_4(0)', 500);
}
function getTree_4(mennu_4Num, itemNum) {
	itemArray = new Array(mennu_4.length);
	while(1) {
		itemArray[mennu_4Num] = itemNum;
		if (mennu_4Num == 0)
			return itemArray;
		itemNum = mennu_4[mennu_4Num][0].parentItem;
		mennu_4Num = mennu_4[mennu_4Num][0].parentMennu;
	  }
}

function changeCol_4(changeArray, isOver) {
	for (mennu_4Count = 0; mennu_4Count < changeArray.length; mennu_4Count++) {
		if (changeArray[mennu_4Count]) {
			newCol = isOver ? mennu_4[mennu_4Count][0].overCol : mennu_4[mennu_4Count][0].backCol;
			//link_color = isOver ? link_over_color_4 : link_out_color_4;

			myover=mennu_4[mennu_4Count][0].textOverCol;
			myback=mennu_4[mennu_4Count][0].textBackCol;
			
			link_color = isOver ? myover : myback;



			
			with (mennu_4[mennu_4Count][changeArray[mennu_4Count]].ref) {
				if (isNS4)
					bgColor = newCol;
				else{

					backgroundColor = newCol;
					
					
					
					var ii = 'mennu_4' + mennu_4Count + 'item' + changeArray[mennu_4Count];
					eval("oobj=document.all."+ii);
					oobj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.color=link_color;		
				
					
					
				}
		    }
		 }
	}
}
function hideAllBut_4(mennu_4Num) {
	var keepMennus = getTree_4(mennu_4Num, 1);
	for (count = 0; count < mennu_4.length; count++)
		if (!keepMennus[count])
	mennu_4[count][0].ref.visibility = 'hidden';
	changeCol_4(litNow_4, false);
}

function Mennu_4(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass,textOverCol,textBackCol,textalign) {
	this.isVert = isVert;
	this.popInd = popInd;
	this.x = x;//faseleh table as bala
	this.y = y;//faseleh table as chap
	this.width = width;//width of table
	this.overCol = overCol;//color of overing mouse.
	this.backCol = backCol;//background of td
	this.borderClass = borderClass;
	this.textClass = textClass;
	this.parentMennu = null;
	this.parentItem = null;
	this.ref = null;
	this.textOverCol = textOverCol;
	this.textBackCol = textBackCol;
	this.textalign   = textalign;
}

function Item_4(text, href, frame, length, spacing, target) {
	this.text = text;
	this.href = href;
	this.frame = frame;
	this.length = length;//height of one td
	this.spacing = spacing;
	this.target = target;
	this.ref = null;
}
function f_on_click(href){
	//alert(link);
	mo_href='';
	if(href!=''){
		http_index=href.indexOf('http:');
		mailto_index=href.indexOf('mailto:');
		if(http_index<0 && mailto_index<0)
			mo_href=host_address_1+'/'+href;
		else
			mo_href=href;
	}
	window.open(mo_href,'_self');	
}
function writeMennus_4() {
	
	if (!isDOM && !isIE4 && !isNS4) return;
	
	for (currMennu = 0; currMennu < mennu_4.length; currMennu++) with (mennu_4[currMennu][0]) {
		var str = '', itemX = 0, itemY = 0;
			
			for (currItem = 1; currItem < mennu_4[currMennu].length; currItem++) with (mennu_4[currMennu][currItem]) {
				var itemID = 'mennu_4' + currMennu + 'item' + currItem;
				var w = (isVert ? width : length);
				var h = (isVert ? length : width);

				if (isDOM || isIE4) {
					str += '<div  onclick=f_on_click("'+href+'");  id="' + itemID + '" style="cursor:hand;position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
					if (backCol) str += 'background: ' + backCol + '; ';
					str += '" ';
				}

				
				if (isNS4) {
					str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' +  w + '" height="' + h + '" visibility="inherit" ';
					if (backCol) str += 'bgcolor="' + backCol + '" ';
				}
				if (borderClass) str += 'class="' + borderClass + '" ';
				str += 'onMouseOver="popOver_4(' + currMennu + ',' + currItem + ')" onMouseOut="popOut_4(' + currMennu + ',' + currItem + ')">';
				
				
				
				
				mo_href="";
				if(href!=""){
					http_index=href.indexOf("http:");
					mailto_index=href.indexOf("mailto:");
					if(http_index<0 && mailto_index<0)
						mo_href=' href="'+host_address_4+'/'+href+'" ';
					else
						mo_href=' href="'+href+'" ';
				}
			
				//yalert(textClass);

				str += '<table width="' + w + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td  style="padding-right:5" align="'+textalign+'" height="' + (h - 7) + '" class="'+textClass+'" >' + '<a dir=rtl  style="color:'+textBackCol+';text-decoration:none;font-family:tahoma;font-size:8pt;font-weight:normal" '+mo_href+' ' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';
					
				if (target > 0) {
					mennu_4[target][0].parentMennu = currMennu;
					mennu_4[target][0].parentItem = currItem;
					if (popInd) str += '<td class="' + textClass + '" align="left">' + popInd + '</td>';
				}
				str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
				if (isVert) itemY += length + spacing;
				else itemX += length + spacing;
			}
			if (isDOM) {//alert("isDOM");
				var newDiv = document.createElement('div');
				//document.getElementsByTagName('body').item(0).appendChild(newDiv);
				td_menu_location_4.appendChild(newDiv);
				newDiv.innerHTML = str;
				//alert(str);
				//td_mennu_4_location.innerHTML = str;//alert(str);
				//alert(newDiv.style.posTop);
				ref = newDiv.style;
				// added by mohammad in: 1388-2-5
				if(ref.posTop==0)
					ref.position = 'absolute';
				else
					ref.position = 'relative';

				//ref.position = 'relative';
				ref.left =-100;//این کار برای اینه که وقتی اول منوها بصورت هیدن چاپ میشه اینقدر میاد سما راست که صفحه بیخودی اسکرول میکنه. برای اینکه هر چقدر عرض منوها و ساب منوها زیاد هم بشه و باعث بیرون اومدن از صفحه نشه من -100 میدم تا همه منوها و ساب منوها بیان وسط صفحه و صفحه الکی اسکرول نکنه.
				ref.visibility = 'hidden';
				ref.posTop=10;
				//alert(ref.color);
			}

			if (isIE4) {//alert("isIE4");
				document.body.insertAdjacentHTML('beforeEnd', '<div id="mennu_4' + currMennu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
				ref = getSty_4('mennu_4' + currMennu + 'div');
			}

			if (isNS4) {alert("isNS4");
				ref = new Layer(0);
				ref.document.write(str);
				ref.document.close();
			}

			for (currItem = 1; currItem < mennu_4[currMennu].length; currItem++) {
				itemName = 'mennu_4' + currMennu + 'item' + currItem;
				if (isDOM || isIE4) mennu_4[currMennu][currItem].ref = getSty_4(itemName);
				if (isNS4) mennu_4[currMennu][currItem].ref = ref.document[itemName];
			}
		}
		with(mennu_4[0][0]) {
			//x=50;y=50;
			//alert(x+","+y);
			ref.left = x;
			ref.top = y;
			ref.visibility = 'visible';
			
		}
}



	
	
	
	

	var xmenu_4=new Array();
	var mennu_4 = new Array();
	var xitem_4=new Array();
	mo_arrow="<img border=0 align=left src="+host_address_4+"/pictures/m10.gif>";
	mo_arrow2="<img border=0 align=left src="+host_address_4+"/pictures/m11.gif>";
	var defLength =ertefa_itemha_4;



 
//start of body

xmenu_4[0]=new Array('ادارات تابعه',86,0,'3');
xmenu_4[1]=new Array('جستجو',68,0,'http://www.tct.ir/home/fa/search.php');
xmenu_4[2]=new Array('تابلو اعلانات',89,0,'http://www.tct.ir/pagecontent.php?rqv==whqygdm3qdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfanzm3gdq6ugb0lgd');

xitem_4[0]=new Array();
xitem_4[0][0]=new Array('291',defOver_4,defBack_4);
xitem_4[0][1]=new Array('معاونت توسعه و مهندسی','http://www.tct.ir/tctftp/tarh',0);
xitem_4[0][2]=new Array('معاونت اداری و اقتصادی','',4);
xitem_4[0][3]=new Array('دفتر بازرسی، ارزيابی عملکرد و پاسخگویی به شکایات','http://www.tct.ir/bazrasi/global/index.php',0);
xitem_4[0][4]=new Array('دفتر حقوقي','http://www.tct.ir/pagecontent.php?rqv===afantmxqdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfaltozkdq6ugb0lgd',0);
xitem_4[0][5]=new Array('اداره كل شهرستانهاي استان تهران','http://province.tct.ir/portal/home',0);
xitem_4[0][6]=new Array('اداره كل رايانه','http://www.tct.ir/pagecontent.php?rqv==whq0cznxcdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfaltn3gdq6ugb0lgd',0);
xitem_4[0][7]=new Array('اداره كل نگهداري و پشتيباني فني ديتا','http://217.218.122.36/',0);
xitem_4[0][8]=new Array('كميسيون تحول اداري','http://www.tct.ir/pagecontent.php?rqv=8buo0utoyakoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfazjnzqdq6ugb0lgd',0);


xitem_4[3]=new Array();
xitem_4[3][0]=new Array('171',defOver_4,defBack_4);
xitem_4[3][1]=new Array('اداره كل امور بازرگاني','',5);
xitem_4[3][2]=new Array('اداره كل امور مالي','',6);
xitem_4[3][3]=new Array('اداره كل منابع انساني','',7);
xitem_4[3][4]=new Array('حوزه معاونت اداري و اقتصادي','',8);


xitem_4[4]=new Array();
xitem_4[4][0]=new Array('118',defOver_4,defBack_4);
xitem_4[4][1]=new Array('آگهي هاي مناقصه','http://www.tct.ir/pagecontent.php?rqv===afahzm1mdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfabdm1gdq6ugb0lgd',0);
xitem_4[4][2]=new Array('آگهي هاي مزايده','http://www.tct.ir/components1.php?rqv=8bemxakokleduvmchb3xmxhq4atmapdzj52bpr3yh9lz',0);
xitem_4[4][3]=new Array('آگهي هاي حراج','http://www.tct.ir/components1.php?rqv==whq5akokleduvmchb3xmxhq4atmapdzj52bpr3yh9lz',0);




xitem_4[5]=new Array();
xitem_4[5][0]=new Array('166',defOver_4,defBack_4);
xitem_4[5][1]=new Array('خزانه داری','http://www.tct.ir/pagecontent.php?rqv==whqzqdn0idq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfajdozkdq6ugb0lgd',0);
xitem_4[5][2]=new Array('پرداخت حقوق','http://www.tct.ir/pagecontent.php?rqv==whqxedn4mdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfandozkdq6ugb0lgd',0);
xitem_4[5][3]=new Array('کنترل صورتحساب تلفن','http://www.tct.ir/pagecontent.php?rqv==whqyadn2kdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfardozkdq6ugb0lgd',0);
xitem_4[5][4]=new Array('تمرکزحسابهاوصورتهای مالی','http://www.tct.ir/pagecontent.php?rqv==whq5ctn0cdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfavdozkdq6ugb0lgd',0);
xitem_4[5][5]=new Array('صورتحسابهای دیتا','http://www.tct.ir/pagecontent.php?rqv==whq4ydm1qdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfazdozkdq6ugb0lgd',0);
xitem_4[5][6]=new Array('ممیزی اسناد وکنترل مالی','http://www.tct.ir/pagecontent.php?rqv===afajtn2ydq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfaddozkdq6ugb0lgd',0);
xitem_4[5][7]=new Array('درآمدها','http://www.tct.ir/pagecontent.php?rqv==whqyeto5ydq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfahdozkdq6ugb0lgd',0);
xitem_4[5][8]=new Array('رايانه','http://www.tct.ir/pagecontent.php?rqv===afazto4udq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfabtozkdq6ugb0lgd',0);




xitem_4[6]=new Array();
xitem_4[6][0]=new Array('121',defOver_4,defBack_4);
xitem_4[6][1]=new Array('رفاه کارکنان','http://www.tct.ir/pagecontent.php?rqv=8bkn4gdo5akoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfafto0qdq6ugb0lgd',0);
xitem_4[6][2]=new Array('کارگزيني','http://www.tct.ir/pagecontent.php?rqv==whqwqdo4akoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfabdm1qdq6ugb0lgd',0);
xitem_4[6][3]=new Array('بازنشستگان','http://www.tct.ir/pagecontent.php?rqv=8buo4gtmyakoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfafdm1qdq6ugb0lgd',0);
xitem_4[6][4]=new Array('ارزشيابي','http://www.tct.ir/pagecontent.php?rqv=8bunxqzn5akoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfajdm1qdq6ugb0lgd',0);
xitem_4[6][5]=new Array('طبقه بندي مشاغل','http://www.tct.ir/pagecontent.php?rqv=8buo0mzn5akoyvmytvnbkluznfgc8bemaptzwlhv05wz052bjxhqwakolbxeuvmc1r3y1jhdzxhqwakolbxeurgbpzgfandm1qdq6ugb0lgd',0);




xitem_4[7]=new Array();
xitem_4[7][0]=new Array('108',defOver_4,defBack_4);
xitem_4[7][1]=new Array('آموزش و پژوهش','http://www.tct.ir/pagecontent.php?rqv==whq0etmxcdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfavjm3gdq6ugb0lgd',0);
xitem_4[7][2]=new Array('تربيت بدني','http://www.tct.ir/pagecontent.php?rqv===afazto2mdq6ixzi1wdurwsldwywxhqwakolbxeurnblrnbvngfabdq6ugc5rvzyvhdjvnc0nhfavdn2gdq6ugb0lgd',0);






xitem_4[1]=new Array();
xitem_4[1][0]=new Array('100',defOver_4,defBack_4);


xitem_4[2]=new Array();
xitem_4[2][0]=new Array('100',defOver_4,defBack_4);






//end of body



	

	

	mennu_4[0] 		= new Array();
	mennu_4[0][0] 	= new Mennu_4(false, '', offsete_menu_az_chap_4, offsete_menu_az_bala_4									, arz_4, mo_overCol_4,mo_backCol_4 , 'itemBorder', 'menuText','#ffffff','#000000','right');
	for(i=0;i<xmenu_4.length;i++){
		//alert(xmenu_4[i][0]);
		lable=xmenu_4[i][0];
		if(xitem_4[i].length>1)
			lable=mo_arrow2+lable;
		mennu_4[0][i+1]=new Item_4(lable,xmenu_4[i][3],'',xmenu_4[i][1],fasele_beine_itemha_4,i+1);
	}
	

	for(j=0;j<xitem_4.length;j++){//alert(xmenu_4.length);alert(j);
		
				width=xitem_4[j][0][0];
				if(j>=xmenu_4.length){
					width=xitem_4[j][0][0];
					xpos=0-width;
					ypos=0;
				}
				else{
					width=xitem_4[j][0][0];
					xpos=xmenu_4[j][1]-xitem_4[j][0][0];
					ypos=arz_4;
				}			
			
		mennu_4[j+1] = new Array();
		mennu_4[j+1][0] = new Mennu_4(true, '', xpos, ypos, width, xitem_4[j][0][1], xitem_4[j][0][2], 'itemBorder', 'itemText','#ffffff','#000000','right');
		for(i=1;i<(xitem_4[j].length);i++){
			xlable=xitem_4[j][i][0];
			//alert(xitem_4[j][i][2]);
			if(xitem_4[j][i][2]!=0)
				xlable=mo_arrow+xlable;
			mennu_4[j+1][i] = new Item_4(xlable,xitem_4[j][i][1], '', defLength, 0, xitem_4[j][i][2]);
		}
	}
	
	
	

