

//constant variables


var link_over_color_2='#000000';
var host_address_2='http://www.tct.ir/home/fa';
var link_out_color_2='#000000';
var defOver_2='#CFE5FD';
var defBack_2='#ABCDFA';
var defBack2_2='green';
var mo_overCol_2='#CFE5FD';
var mo_backCol_2='#ACCCFB';
var offsete_menu_az_chap_2=-410;
var offsete_menu_az_bala_2=0;
var fasele_beine_itemha_2=0;
var ertefa_itemha_2=20;
var arz_2=20;

//end of constants

	function init_2() {
		//window.status='www.tct.ir';
		
		//alert('init');
		//self.moveTo(0,0);
		//self.resizeTo(screen.availWidth,(screen.availHeight));
		writeMennus_2();	
		//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(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}
function getSty_2(id) {
	return (isNS4 ? getRef(id) : getRef(id).style);
} 

var popTimer_2 = 0;
var litNow_2 = new Array();
function popOver_2(mennu_2Num, itemNum) {
	

	
	clearTimeout(popTimer_2);
	hideAllBut_2(mennu_2Num);
	litNow_2 = getTree_2(mennu_2Num, itemNum);
	changeCol_2(litNow_2, true);
	targetNum = mennu_2[mennu_2Num][itemNum].target;
	
	

	if (targetNum > 0) {
		thisX = parseInt(mennu_2[mennu_2Num][0].ref.left) + parseInt(mennu_2[mennu_2Num][itemNum].ref.left);
		thisY = parseInt(mennu_2[mennu_2Num][0].ref.top) + parseInt(mennu_2[mennu_2Num][itemNum].ref.top);

		
		with (mennu_2[targetNum][0].ref) {
			left = parseInt(thisX + mennu_2[targetNum][0].x);
			top = parseInt(thisY + mennu_2[targetNum][0].y);
			visibility = 'visible';
		}
	}
}
function popOut_2(mennu_2Num, itemNum) {


	if ((mennu_2Num == 0) && !mennu_2[mennu_2Num][itemNum].target)
		hideAllBut_2(0)
	else
		popTimer_2 = setTimeout('hideAllBut_2(0)', 500);
}
function getTree_2(mennu_2Num, itemNum) {
	itemArray = new Array(mennu_2.length);
	while(1) {
		itemArray[mennu_2Num] = itemNum;
		if (mennu_2Num == 0)
			return itemArray;
		itemNum = mennu_2[mennu_2Num][0].parentItem;
		mennu_2Num = mennu_2[mennu_2Num][0].parentMennu;
	  }
}

function changeCol_2(changeArray, isOver) {
	for (mennu_2Count = 0; mennu_2Count < changeArray.length; mennu_2Count++) {
		if (changeArray[mennu_2Count]) {
			newCol = isOver ? mennu_2[mennu_2Count][0].overCol : mennu_2[mennu_2Count][0].backCol;
			link_color = isOver ? link_over_color_2 : link_out_color_2;


			
			with (mennu_2[mennu_2Count][changeArray[mennu_2Count]].ref) {
				if (isNS4)
					bgColor = newCol;
				else{

					backgroundColor = newCol;
					
					
					
					var ii = 'mennu_2' + mennu_2Count + 'item' + changeArray[mennu_2Count];
					eval("oobj=document.all."+ii);
					oobj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.color=link_color;		
				
					
					
				}
		    }
		 }
	}
}
function hideAllBut_2(mennu_2Num) {
	var keepMennus = getTree_2(mennu_2Num, 1);
	for (count = 0; count < mennu_2.length; count++)
		if (!keepMennus[count])
	mennu_2[count][0].ref.visibility = 'hidden';
	changeCol_2(litNow_2, false);
}

function Mennu_2(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
	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;
}

function Item_2(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 writeMennus_2() {
	
	if (!isDOM && !isIE4 && !isNS4) return;
	
	for (currMennu = 0; currMennu < mennu_2.length; currMennu++) with (mennu_2[currMennu][0]) {
		var str = '', itemX = 0, itemY = 0;
			
			for (currItem = 1; currItem < mennu_2[currMennu].length; currItem++) with (mennu_2[currMennu][currItem]) {
				var itemID = 'mennu_2' + currMennu + 'item' + currItem;
				var w = (isVert ? width : length);
				var h = (isVert ? length : width);

				if (isDOM || isIE4) {
					str += '<div  id="' + itemID + '" style="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_2(' + currMennu + ',' + currItem + ')" onMouseOut="popOut_2(' + 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_2+'/'+href+'" ';
					else
						mo_href=' href="'+href+'" ';
				}
			
				//yalert(textClass);

				str += '<table width="' + w + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td  align="right" height="' + (h - 7) + '" class="'+textClass+'" >' + '<a   style="text-decoration:none;color:'+link_out_color_2+';font-family:tahoma;font-size:8pt;font-weight:normal" '+mo_href+' ' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td><td width=5></td>';
					
				if (target > 0) {
					mennu_2[target][0].parentMennu = currMennu;
					mennu_2[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_2.appendChild(newDiv);
				newDiv.innerHTML = str;
				//alert(str);
				//td_mennu_2_location.innerHTML = str;//alert(str);
				//alert(newDiv.style.posTop);
				ref = newDiv.style;
				ref.position = 'absolute';
				//ref.left =-450;//این کار برای اینه که وقتی اول منوها بصورت هیدن چاپ میشه اینقدر میاد سما راست که صفحه بیخودی اسکرول میکنه. برای اینکه هر چقدر عرض منوها و ساب منوها زیاد هم بشه و باعث بیرون اومدن از صفحه نشه من -100 میدم تا همه منوها و ساب منوها بیان وسط صفحه و صفحه الکی اسکرول نکنه.
				ref.left =offsete_menu_az_chap_2;//این کار برای اینه که وقتی اول منوها بصورت هیدن چاپ میشه اینقدر میاد سما راست که صفحه بیخودی اسکرول میکنه. برای اینکه هر چقدر عرض منوها و ساب منوها زیاد هم بشه و باعث بیرون اومدن از صفحه نشه من -100 میدم تا همه منوها و ساب منوها بیان وسط صفحه و صفحه الکی اسکرول نکنه.
				ref.visibility = 'hidden';
				ref.posTop=10;
				//alert(ref.color);
			}

			if (isIE4) {//alert("isIE4");
				document.body.insertAdjacentHTML('beforeEnd', '<div id="mennu_2' + currMennu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
				ref = getSty_2('mennu_2' + currMennu + 'div');
			}

			if (isNS4) {alert("isNS4");
				ref = new Layer(0);
				ref.document.write(str);
				ref.document.close();
			}

			for (currItem = 1; currItem < mennu_2[currMennu].length; currItem++) {
				itemName = 'mennu_2' + currMennu + 'item' + currItem;
				if (isDOM || isIE4) mennu_2[currMennu][currItem].ref = getSty_2(itemName);
				if (isNS4) mennu_2[currMennu][currItem].ref = ref.document[itemName];
			}
		}
		with(mennu_2[0][0]) {
			//x=50;y=50;
			//alert(x+","+y);
			ref.left = x;
			ref.top = y;
			ref.visibility = 'visible';
			
		}
}



	
	
	




	
	
	
	

	var xmenu_2=new Array();
	var mennu_2 = new Array();
	var xitem_2=new Array();
	mo_arrow_left="<img border=0 align=left src="+host_address_2+"/pictures/m10.gif>";
	mo_arrow_bottom="<img border=0 align=left src="+host_address_2+"/pictures/m11.gif>";
	var defLength =ertefa_itemha_2;



 
//start of body

xmenu_2[2]=new Array('تابلو اعلانات',100,0,'http://www.tct.ir/pagecontent.php?rQV==wHQygDM3QDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfANzM3gDQ6UGb0lGd');
//xmenu_2[2]=new Array('تالار گفت و گو',100,0,'http://www.tct.ir/payam/fa/talar.php');
xmenu_2[1]=new Array('جستجو',90,0,'http://www.tct.ir/home/fa/search.php');
xmenu_2[0]=new Array('ادارات تابعه',90,0,'');
//xmenu_2[0]=new Array('خدمات اينترنتي',100,0,'http://www.tct.ir/pagecontent.php?rQV==wHQ3IzN1IDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAFTM5gDQ6UGb0lGd');

xitem_2[3]=new Array();
xitem_2[3][0]=new Array('100',defOver_2,defBack_2);


xitem_2[2]=new Array();
xitem_2[2][0]=new Array('100',defOver_2,defBack_2);

//edarate tabee:
xitem_2[0]=new Array();
xitem_2[0][0]=new Array('291',defOver_2,defBack_2);
xitem_2[0][1]=new Array('معاونت توسعه و مهندسي','http://www.tct.ir/tctftp/tarh',0);
xitem_2[0][2]=new Array('معاونت اداري و اقتصادي','',5);
xitem_2[0][3]=new Array('دفتر بازرسی، ارزيابی عملکرد و پاسخگویی به شکایات','http://www.tct.ir/bazrasi/global/index.php',0);
xitem_2[0][4]=new Array('دفتر حقوقي','http://www.tct.ir/pagecontent.php?rQV===AfANTMxQDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAlTOzkDQ6UGb0lGd',0);
xitem_2[0][5]=new Array('اداره كل شهرستانهاي استان تهران','http://province.tct.ir/portal/home',0);
xitem_2[0][6]=new Array('اداره كل رايانه','http://www.tct.ir/pagecontent.php?rQV==wHQ0czNxcDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAlTN3gDQ6UGb0lGd',0);
xitem_2[0][7]=new Array('اداره كل نگهداري و پشتيباني فني ديتا','http://217.218.122.36',0);
xitem_2[0][8]=new Array('كميسيون تحول اداري','http://www.tct.ir/pagecontent.php?rQV=8BUO0UTOyAkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfAZjNzQDQ6UGb0lGd',0);


xitem_2[4]=new Array();
xitem_2[4][0]=new Array('171',defOver_2,defBack_2);
xitem_2[4][1]=new Array('اداره كل امور بازرگاني','',7);
//xitem_2[4][2]=new Array('اداره كل امور مالي','http://www.tct.ir/pagecontent.php?rQV==wHQ5kjN5QDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAFDOzkDQ6UGb0lGd',0);
xitem_2[4][2]=new Array('اداره كل امور مالي','',9);
xitem_2[4][3]=new Array('اداره كل منابع انساني','',8);
xitem_2[4][4]=new Array('حوزه معاونت اداري و اقتصادي','',6);


xitem_2[5]=new Array();
xitem_2[5][0]=new Array('108',defOver_2,defBack_2);
xitem_2[5][1]=new Array('آموزش و پژوهش','http://www.tct.ir/pagecontent.php?rQV==wHQ0ETMxcDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAVjM3gDQ6UGb0lGd',0);
xitem_2[5][2]=new Array('تربيت بدني','http://www.tct.ir/pagecontent.php?rQV===AfAZTO2MDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAVDN2gDQ6UGb0lGd',0);


xitem_2[1]=new Array();
xitem_2[1][0]=new Array('100',defOver_2,defBack_2);


xitem_2[6]=new Array();
xitem_2[6][0]=new Array('120',defOver_2,defBack_2);
xitem_2[6][1]=new Array('آگهي هاي مناقصه','http://www.tct.ir/pagecontent.php?rQV===AfAhzM1MDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfABDM1gDQ6UGb0lGd',0);
xitem_2[6][2]=new Array('آگهي هاي مزايده','http://www.tct.ir/components1.php?rQV=8BEMxAkOklEduVmchB3XmxHQ4ATMApDZJ52bpR3Yh9lZ',0);
xitem_2[6][3]=new Array('آگهي هاي حراج','http://www.tct.ir/components1.php?rQV==wHQ5AkOklEduVmchB3XmxHQ4ATMApDZJ52bpR3Yh9lZ',0);


xitem_2[7]=new Array();
xitem_2[7][0]=new Array('120',defOver_2,defBack_2);
xitem_2[7][1]=new Array('رفاه کارکنان','http://www.tct.ir/pagecontent.php?rQV=8BkN4gDO5AkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfAFTO0QDQ6UGb0lGd',0);
xitem_2[7][2]=new Array('کارگزيني','http://www.tct.ir/pagecontent.php?rQV==wHQwQDO4AkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfABDM1QDQ6UGb0lGd',0);
xitem_2[7][3]=new Array('بازنشستگان','http://www.tct.ir/pagecontent.php?rQV=8BUO4gTMyAkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfAFDM1QDQ6UGb0lGd',0);
xitem_2[7][4]=new Array('ارزشيابي','http://www.tct.ir/pagecontent.php?rQV=8BUNxQzN5AkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfAJDM1QDQ6UGb0lGd',0);
xitem_2[7][5]=new Array('طبقه بندي مشاغل','http://www.tct.ir/pagecontent.php?rQV=8BUO0MzN5AkOyVmYtVnbklUZnFGc8BEMApTZwlHV05WZ052bjxHQwAkOlBXeUVmc1R3Y1JHdzxHQwAkOlBXeURGbpZGfANDM1QDQ6UGb0lGd',0);


xitem_2[8]=new Array();
xitem_2[8][0]=new Array('170',defOver_2,defBack_2);
xitem_2[8][1]=new Array('خزانه داری','http://www.tct.ir/pagecontent.php?rQV==wHQzQDN0IDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAJDOzkDQ6UGb0lGd',0);
xitem_2[8][2]=new Array('پرداخت حقوق','http://www.tct.ir/pagecontent.php?rQV==wHQxEDN4MDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfANDOzkDQ6UGb0lGd',0);
xitem_2[8][3]=new Array('کنترل صورتحساب تلفن','http://www.tct.ir/pagecontent.php?rQV==wHQyADN2kDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfARDOzkDQ6UGb0lGd',0);
xitem_2[8][4]=new Array('تمرکزحسابهاوصورتهای مالی','http://www.tct.ir/pagecontent.php?rQV==wHQ5cTN0cDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAVDOzkDQ6UGb0lGd',0);
xitem_2[8][5]=new Array('صورتحسابهای دیتا','http://www.tct.ir/pagecontent.php?rQV==wHQ4YDM1QDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAZDOzkDQ6UGb0lGd',0);
xitem_2[8][6]=new Array('ممیزی اسناد وکنترل مالی','http://www.tct.ir/pagecontent.php?rQV===AfAJTN2YDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAdDOzkDQ6UGb0lGd',0);
xitem_2[8][7]=new Array('درآمدها','http://www.tct.ir/pagecontent.php?rQV==wHQyETO5YDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfAhDOzkDQ6UGb0lGd',0);
xitem_2[8][8]=new Array('رايانه','http://www.tct.ir/pagecontent.php?rQV===AfAZTO4UDQ6IXZi1WduRWSldWYwxHQwAkOlBXeURnblRnbvNGfABDQ6UGc5RVZyVHdjVnc0NHfABTOzkDQ6UGb0lGd',0);









//end of body







	mennu_2[0] = new Array();
	mennu_2[0][0] = new Mennu_2(false, '', offsete_menu_az_chap_2, offsete_menu_az_bala_2, arz_2, mo_overCol_2,mo_backCol_2 , 'itemBorder', 'itemText');
	for(i=0;i<xmenu_2.length;i++){
		//alert(xmenu_2[i][0]);
		lable=xmenu_2[i][0];
		if(xitem_2[i].length>1)
			lable=mo_arrow_bottom+lable;
		//alert(lable);
		mennu_2[0][i+1]=new Item_2(lable,xmenu_2[i][3],'',xmenu_2[i][1],fasele_beine_itemha_2,i+1);
	}


	for(j=0;j<xitem_2.length;j++){//alert(xmenu_2.length);alert(j);
		
		width=xitem_2[j][0][0];

		//alert(width);
		//xpos=0-Number(width)+100;
		if(j>=xmenu_2.length){
			width=xitem_2[j][0][0];
			xpos=0-width;
			ypos=0;
		}
		else{
			width=xitem_2[j][0][0];
			xpos=xmenu_2[j][1]-xitem_2[j][0][0];
			ypos=20;
		}		
		
		//xpos=0;
		//xpos=xmenu_2[j][1]-xitem_2[j][0][0];
		
		//ypos=0;

		mennu_2[j+1] = new Array();
		mennu_2[j+1][0] = new Mennu_2(true, '', xpos, ypos, width, xitem_2[j][0][1], xitem_2[j][0][2], 'itemBorder', 'itemText');
		for(i=1;i<(xitem_2[j].length);i++){
			xlable=xitem_2[j][i][0];
			//alert(xitem_2[j][i][2]);
			if(xitem_2[j][i][2]!=0)
				xlable=mo_arrow_left+xlable;
			mennu_2[j+1][i] = new Item_2(xlable,xitem_2[j][i][1], '', defLength, 0, xitem_2[j][i][2]);
		}
	}
	









 