var menu = new Array();
function initMenu() {
 //function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
//Writing tree for 11234
menu[0] = new Array();
menu[0][0] = new Menu(false, '',15, 74, 20, '', '', '', /* v2*/ 'wht11pxb');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[0][1] = new Item('AIA Home ', '/index.html', '', 135, 0, 0);
menu[0][2] = new Item('| About Us ', '/AIA/aiaindex.html', '', 62, 0, getIndex(5345));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=12
menu[0][3] = new Item('| Members ', '/MEM/indexmem.html', '', 62, 0, getIndex(2790));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=12
menu[0][4] = new Item('| Automation Events ', '/EVE/indexeve.html', '', 110, 0, getIndex(5571));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=7
menu[0][5] = new Item('| Publications ', '/PUB/indexpub.html', '', 80, 0, getIndex(11000));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=18
menu[0][6] = new Item('| Contact us ', '/CUS/indexcus.html', '', 70, 0, getIndex(4865));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=9
menu[0][7] = new Item('| Learning Zone ', '/LRZ/indexlearn.html', '', 90, 0, getIndex(21366));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=2
menu[0][8] = new Item('| Media Room ', '/MED/index.html', '', 90, 0, getIndex(4));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=6
//menu[0][9] = new Item('| Resources ', '/templates/resources.html?id=6070', '', 70, 0, getIndex(6070));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=8
//menu[0][10] = new Item('| Groups & Forums', '/templates/groupsforums.html?id=6149', '', 110, 0, getIndex(6149));
//TypeName=NS - LandingPage
//adding that in queue; indent=0;children=5

/**************************************************/
//Writing tree for 5345
menu[1] = new Array();
menu[1][0] = new Menu(true, '',3, 23, 125, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[1][1] = new Items(' About AIA-India ','/AIA/aiaaboutus.html', '', 20,125, 0, getIndex(25974));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[1][2] = new Items(' Mission & Vision ','/AIA/aiamission.html', '', 20,125, 0, getIndex(5358));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=2
menu[1][3] = new Items(' Objectives ','/AIA/aiaobjectives.html', '', 20,125, 0, getIndex(25979));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=3
menu[1][4] = new Items(' Activities ','/AIA/aiaactivities.html', '', 20,125, 0, getIndex(5346));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=11
menu[1][5] = new Items(' Presidents Message ','/AIA/aiaprezmsg.html', '', 20,125, 0, getIndex(26005));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[1][6] = new Items(' Executive Council ','/AIA/aiaexeccncl.html', '', 20,125, 0, getIndex(5376));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=9
menu[1][7] = new Items(' Past President ','/AIA/aiapastprez.html', '', 20,125, 0, getIndex(26006));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
//menu[1][8] = new Items(' Forums ','/AIA/aiaforums.html', '', 20,125, 0, getIndex(26008));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
//menu[1][9] = new Items(' Membership ','/AIA/aiamembers.html', '', 20,125, 0, getIndex(26010));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[1][8] = new Items(' Whats New ','/AIA/aiawhatsnew.html', '', 20,125, 0, getIndex(5366));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=4
//menu[1][11] = new Items('  ','/templates/NormalPage.aspx?', '', 20,125, 0, getIndex(26004));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
//menu[1][12] = new Items('  ','/templates/LandingPage.aspx', '', 20,125, 0, getIndex(46987));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=4

/**************************************************/
//Writing tree for 2790
menu[2] = new Array();
menu[2][0] = new Menu(true, '',3, 23, 120, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[2][1] = new Items(' Members Login ','/MEM/memlogin.html', '', 20,120, 0, getIndex(28816));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=0
menu[2][2] = new Items(' Categories ','/MEM/memcat.html', '', 20,120, 0, getIndex(4730));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=8
menu[2][3] = new Items(' Benefits ','/MEM/membnfts.html', '', 20,120, 0, getIndex(2793));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5
menu[2][4] = new Items(' How to Join? ','/MEM/memjoin.html', '', 20,120, 0, getIndex(4739));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[2][5] = new Items(' Current Members ','/MEM/memcrnt.html', '', 20,120, 0, getIndex(28613));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=11
menu[2][6] = new Items(' Member News ','/MEM/memnews.html', '', 20,120, 0, getIndex(1592));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=470
menu[2][7] = new Items(' Members Zone ','/MEM/memlogin.html', '', 20,120, 0, getIndex(48258));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=2
menu[2][8] = new Items(' Post Query ','/MEM/memquery.html', '', 20,120, 0, getIndex(27204));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[2][9] = new Items(' FAQs ','/MEM/memfaqs.html', '', 20,120, 0, getIndex(2724));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1

/**************************************************/
//Writing tree for 5571
menu[3] = new Array();
menu[3][0] = new Menu(true, '',3, 23, 160, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[3][1] = new Items(' Automation Events ','/EVE/indexeve.html', '', 20,160, 0, getIndex(5572));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5
menu[3][2] = new Items(' Current Events-Overview ','/EVE/AutomationTech2009/at2009report.html', '', 20,160, 0, getIndex(5714));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=6
menu[3][3] = new Items(' Registration ','/EVE/everegn.htm', '', 20,160, 0, getIndex(5721));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=6
menu[3][4] = new Items(' Sponsors ','/EVE/evesponsor.html', '', 20,160, 0, getIndex(5794));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5
menu[3][5] = new Items(' Future Events ','/EVE/evefuture.htm', '', 20,160, 0, getIndex(5713));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5
menu[3][6] = new Items(' Past Events ','/EVE/evepast.html', '', 20,160, 0, getIndex(5894));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5

/**************************************************/
//Writing tree for 11000
menu[4] = new Array();
menu[4][0] = new Menu(true, '',3, 23, 117, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[4][1] = new Items(' Newsletters ','/PUB/pubnewslet.html', '', 20,117, 0, getIndex(11004));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=8
//menu[4][2] = new Items(' White Papers ','/PUB/pubwppr.html', '', 20,117, 0, getIndex(11186));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=0
menu[4][2] = new Items(' Members Mailers ','/PUB/pubmailers.html', '', 20,117, 0, getIndex(11070));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
menu[4][3] = new Items(' Articles ','/PUB/pubarticles.html', '', 20,117, 0, getIndex(11101));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=2
menu[4][4] = new Items(' Archives ','/PUB/pubarchives.html', '', 20,117, 0, getIndex(11165));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=2
//menu[4][6] = new Items(' Archives ','/templates/LandingPage.aspx?id=28533', '', 20,117, 0, getIndex(11166));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=0
//menu[4][7] = new Items(' ','/templates/LandingPage.aspx?id=49513', '', 20,117, 0, getIndex(49512));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1

/**************************************************/
//Writing tree for 4865
menu[5] = new Array();
menu[5][0] = new Menu(true, '',3, 23, 100, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[5][1] = new Items(' Action Cell ','/CUS/cussect.html', '', 20,100, 0, getIndex(4997));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=14
menu[5][2] = new Items(' Editorial Team ','/CUS/cuseditor.html', '', 20,100, 0, getIndex(4946));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=22
menu[5][3] = new Items(' Media Team ','/CUS/cusmedia.html', '', 20,100, 0, getIndex(4866));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=2
//menu[5][4] = new Items(' for Press Kit ','/CUS/cuspresskit.html?id=4940', '', 20,100, 0, getIndex(24858));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
//menu[5][5] = new Items('  ','../templates/NormalPage.aspx?id=4941', '', 20,100, 0, getIndex(24859));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1
//menu[5][6] = new Items(' ','../templates/LandingPage.aspx?id=4942', '', 20,100, 0, getIndex(4942));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=3

/**************************************************/
//Writing tree for Learning Zone
menu[6] = new Array();
menu[6][0] = new Menu(true, '',3, 23, 120, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[6][1] = new Items(' About Automation ','/LRZ/lrzautomation.html', '', 20,120, 0, getIndex(61));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0
menu[6][2] = new Items(' Glossary','/LRZ/lrzglossary.html', '', 20,120, 0, getIndex(62));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0
menu[6][3] = new Items(' Training','/LRZ/Training/index.html', '', 20,120, 0, getIndex(63));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=1
menu[6][4] = new Items(' Faculty','/LRZ/Training/Faculty/index.html', '', 20,120, 0, getIndex(64));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0
menu[6][5] = new Items(' Blogs','/LRZ/Blogs/index.html', '', 20,120, 0, getIndex(65));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0
menu[6][6] = new Items(' Links','/LRZ/Links/index.html', '', 20,120, 0, getIndex(66));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0
menu[6][7] = new Items(' CampusConnect','/LRZ/CampusConnect/index.html', '', 20,120, 0, getIndex(67));
//TypeName=NS - EventMaster Landing
//adding that in queue; indent=1;children=0

/**************************************************/
//Writing tree for 4
menu[7] = new Array();
menu[7][0] = new Menu(true, '',3, 23, 98, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[7][1] = new Items(' Print ','/MED/indexprint.html', '', 20,98, 0, getIndex(2399));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=55
menu[7][2] = new Items(' Electronics ','/MED/indexelectronics.html', '', 20,98, 0, getIndex(467));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=610
//menu[7][3] = new Items(' Web','/templates/LandingPage.aspx?id=2174', '', 20,98, 0, getIndex(2174));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=29
//menu[7][4] = new Items('   ','/templates/LandingPage.aspx?id=2368', '', 20,98, 0, getIndex(2368));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=4

/**************************************************/
//Writing tree for 6070
menu[8] = new Array();
menu[8][0] = new Menu(true, '',3, 23, 100, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[8][1] = new Items(' Technology','/templates/LandingPage.aspx?id=6074', '', 20,100, 0, getIndex(6074));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=33
menu[8][2] = new Items(' People	','/templates/LandingPage.aspx?id=6071', '', 20,100, 0, getIndex(6071));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=6
menu[8][3] = new Items(' Products ','/templates/LandingPage.aspx?id=26018', '', 20,100, 0, getIndex(26018));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=9
menu[8][4] = new Items(' Links ','/templates/LandingPage.aspx?id=26056', '', 20,100, 0, getIndex(26056));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=10
//menu[8][5] = new Items('   ','/templates/LandingPage.aspx?id=26017', '', 20,100, 0, getIndex(26017));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=17
//menu[8][6] = new Items('  ','/templates/LandingPage.aspx?id=11232', '', 20,100, 0, getIndex(11232));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=20
//menu[8][7] = new Items(' ','/templates/LandingPage.aspx?id=26013', '', 20,100, 0, getIndex(26013));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=3
//menu[8][8] = new Items('  ','/templates/LandingPage.aspx?id=28440', '', 20,100, 0, getIndex(28440));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=7

/**************************************************/
//Writing tree for 6149
menu[9] = new Array();
menu[9][0] = new Menu(true, '',3, 23, 145, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {
menu[9][1] = new Items(' Why AIA-India','/templates/NormalPage.aspx?id=6311', '', 20,145, 0, getIndex(6309));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=7
menu[9][2] = new Items(' Infrastrucutre Scenario','/templates/NormalPage.aspx?id=6301', '', 20,145, 0, getIndex(6292));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=5
menu[9][3] = new Items(' Business In India','/templates/LandingPage.aspx?id=6177', '', 20,145, 0, getIndex(6177));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=7
menu[9][4] = new Items(' Government Policies','/templates/NormalPage.aspx?id=6169', '', 20,145, 0, getIndex(6155));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=11
menu[9][5] = new Items(' Testimonials','/templates/NormalPage.aspx?id=24860', '', 20,145, 0, getIndex(24861));
//TypeName=NS - LandingPage
//adding that in queue; indent=1;children=1

/**************************************************/
//Writing tree for 25974
menu[10] = new Array();
menu[10][0] = new Menu(true, '',0, 0, 0, '#E0E0E0', '#cccccc', 'itemBorder', 'inneritemTextsm');
//function Item(text, href, frame, length, spacing, target) {
//function Items(text, href, frame, length,width, spacing, target) {

/**************************************************/
}
var menu_ref = new Array(11234,5345,2790,5571,11000,4865,21366,4,6070,6149,25974,0);


function getIndex(f)
{
	
	var i=0;
	var rt=0;
	for(i=0; i<menu_ref.length; i++)
		if(menu_ref[i] == f)
		{
			rt = i;
			break
		}
	return rt;
}

/*Top nav roll over   */
var isDOM1 = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM1) ? true : false);
var isNS4 = (document.layers ? true : false);
var menu
function getRef(id) {
	if (isDOM1) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}
function getSty(id) {
	return (isNS4 ? getRef(id) : getRef(id).style);
} 

// Hide timeout.
var popTimer = 0;
// Array showing highlighted menu items.
var litNow = new Array();
function popOver(menuNum, itemNum) {
	clearTimeout(popTimer);
	hideAllBut(menuNum);
	litNow = getTree(menuNum, itemNum);
	changeCol(litNow, true);
	targetNum = menu[menuNum][itemNum].target;
	if (targetNum > 0) {
		thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
		thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
		with (menu[targetNum][0].ref) {
			left = parseInt(thisX + menu[targetNum][0].x);
			top = parseInt(thisY + menu[targetNum][0].y);
			visibility = 'visible';
		}
   }
}

function popOut(menuNum, itemNum) {
	if ((menuNum == 0) && !menu[menuNum][itemNum].target)
		hideAllBut(0)
	else
		popTimer = setTimeout('hideAllBut(0)', 500);
}
function getTree(menuNum, itemNum) {

	// Array index is the menu number. The contents are null (if that menu is not a parent)
	// or the item number in that menu that is an ancestor (to light it up).
	itemArray = new Array(menu.length);

	while(1) {
		itemArray[menuNum] = itemNum;
		// If we've reached the top of the hierarchy, return.
		if (menuNum == 0) return itemArray;
		itemNum = menu[menuNum][0].parentItem;
		menuNum = menu[menuNum][0].parentMenu;
	}
}

// Pass an array and a boolean to specify colour change, true = over colour.
function changeCol(changeArray, isOver) {
	for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
		if (changeArray[menuCount]) {
			newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
			// Change the colours of the div/layer background.
			with (menu[menuCount][changeArray[menuCount]].ref) {
				if (isNS4) bgColor = newCol;
				else backgroundColor = newCol;
			}
		}
	}
}
function hideAllBut(menuNum) {
	var keepMenus = getTree(menuNum, 1);
	for (count = 0; count < menu.length; count++)
		if (!keepMenus[count])
			menu[count][0].ref.visibility = 'hidden';
		changeCol(litNow, false);
}

// *** MENU CONSTRUCTION FUNCTIONS ***

function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
	// True or false - a vertical menu?
	this.isVert = isVert;
	// The popout indicator used (if any) for this menu.
	this.popInd = popInd
	// Position and size settings.
	this.x = x;
	this.y = y;
	this.width = width;
	// Colours of menu and items.
	this.overCol = overCol;
	this.backCol = backCol;
	// The stylesheet class used for item borders and the text within items.
	this.borderClass = borderClass;
	this.textClass = textClass;
	// Parent menu and item numbers, indexed later.
	this.parentMenu = null;
	this.parentItem = null;
	// Reference to the object's style properties (set later).
	this.ref = null;
}

function Item(text, href, frame, length, spacing, target) {
	this.text = text;
	this.href = href;
	this.frame = frame;
	this.length = length;
	this.spacing = spacing;
	this.target = target;
	// Reference to the object's style properties (set later).
	this.ref = null;
}

function Items(text, href, frame, length,width, spacing, target) {
	this.text = text;
	this.href = href;
	this.frame = frame;
	
	var ss1 = document.cookie.split(";");
	var UT=0;
	var i=0;
	for(i=0; i<ss1.length; i++)
	{
		var cset = " " + ss1[i];
		var ss2 = cset.split("=");
		if(cset.indexOf(" UT=")!=-1)
		{
			UT = parseInt("0" + ss2[1]);
		}
	}
	
	if(text.indexOf(" Members Login")!=-1 && UT>0)
	{
		//alert(document.cookie);	
		this.length = 0;
	}
	else
		this.length = length;
		
	this.width= width;
	this.spacing = spacing;
	this.target = target;
	// Reference to the object's style properties (set later).
	this.ref = null;
}

function writeMenus() {

	if (!isDOM1 && !isIE4 && !isNS4)
		return;
	//initScroller();
	for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
		// Variable for holding HTML for items and positions of next item.
		var str = '', itemX = 0, itemY = 0;

		// Remember, items start from 1 in the array (0 is menu object itself, above).
		// Also use properties of each item nested in the other with() for construction.
		left_itemX = 0;
		for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
			var itemID = 'menu' + currMenu + 'item' + currItem;

			// The width and height of the menu item - dependent on orientation!
			var w = (isVert ? width : length);
			var h = (isVert ? length : width);

			// Create a div or layer text string with appropriate styles/properties.
			// Thanks to Paul Maden (www.paulmaden.com) for helping debug this in IE4, apparently
			// the width must be a miniumum of 3 for it to work in that browser.
			if(currMenu==0)
			    left_itemX = itemX;
			else
			    left_itemX = itemX;
			
			if (isDOM1 || isIE4) {
				str += '<' + '!-- itemX=' + itemX + ' left_itemX=' + left_itemX + ',isDOM1=' + isDOM1 + ' --><div id="' + itemID + '" style="position: absolute; left: ' + left_itemX + 'px; top: ' + itemY + 'px; width: ' + w + 'px; height: ' + h + 'px; 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 + '" ';

			// Add mouseover handlers and finish div/layer.
			str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';

			// Add contents of item (default: table with link inside).
			// In IE/NS6+, add padding if there's a border to emulate NS4's layer padding.
			// If a target frame is specified, also add that to the <a> tag.

			<!--str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td align="left" height="' + (h - 7) + '">' + '<a class="' + textClass + '" href="' + href + '"' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';-->
			if(text==" Membership Form")
			{
			frame="_blank";
			}
			
			href="http://www.aia-india.org" + href;
			
			str += '<table style="z-index:1" width="' + (w - 1) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td align="left" height="' + (h - 1) + '">' + '<a class="' + textClass + '" href="' + href + '"' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';
			
			if (target > 0) {

				// Set target's parents to this menu item.
				menu[target][0].parentMenu = currMenu;
				menu[target][0].parentItem = currItem;
				
				

				// Add a popout indicator.
				//if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
				if (popInd)
					str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
			}
			str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
			if (isVert) itemY += length + spacing;
			else itemX += length + spacing;
		}
		if (isDOM1) {
			var newDiv = document.createElement('div');
			//document.getElementsByTagName('body').item(0).appendChild(newDiv);
			var ii=document.getElementById("HoldMe");
			ii.appendChild(newDiv);
			newDiv.innerHTML = str;
			ref = newDiv.style;
			ref.position = 'absolute';
			ref.visibility = 'hidden';
		}

		// Insert a div tag to the end of the BODY with menu HTML in place for IE4.
		if (isIE4) {
			document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
			ref = getSty('menu' + currMenu + 'div');
		}

		// In NS4, create a reference to a new layer and write the items to it.
		if (isNS4) {
			ref = new Layer(0);
			ref.document.write(str);
			ref.document.close();
		}

		for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
			itemName = 'menu' + currMenu + 'item' + currItem;
			if (isDOM1 || isIE4) menu[currMenu][currItem].ref = getSty(itemName);
			if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
		}
	}
	
	
	with(menu[0][0]) {
		ref.left = x + 'px';
		ref.top = y + 'px';
		ref.visibility = 'visible';
	}
}

// *** OPTIONAL CODE FROM HERE DOWN ***

// These two lines handle the window resize bug in NS4. See <body onResize="...">.
// I recommend you leave this here as otherwise when you resize NS4's width menus are hidden.

var popOldWidth = window.innerWidth;
nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');


// This is a quick snippet that captures all clicks on the document and hides the menus
// every time you click. Use if you want.

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;

function clickHandle(evt)
{
 if (isNS4) document.routeEvent(evt);
 hideAllBut(0);
}


// This is just the moving command for the example.

//function moveRoot()
//{
 //with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
//}
//  End -->

initMenu();
function dropMenu()
{
}

/* movingtext.js */
var arURL = new Array();
var arTXT = new Array();
function addElementTXT(i,TXTVAL)
{		
	arTXT[i]=TXTVAL;
	
}
function addElementURL(j,URLVAL)
{	
	arURL[j]=URLVAL;			
		
}
prefix=' ';

NS4=(document.layers);IE4=(document.all);isDOM=((document.getElementById)&&(!IE4))?true:false;
isOP=(navigator.userAgent.indexOf('Opera') != -1)?true:false;

	if (arTXT.length<=1)
		interval=80;
	else 
		interval=120;

	increment=2;
	pause=2250;
	bannerColor="#ffffff";
	leftPadding=15;
	topPadding=-15;
	maxLoops=5000;
	target=' TARGET="_top" '
	classid=' CLASS="blk11B" '
	numheadlines=40;
	isMac=(navigator.userAgent.indexOf('Mac') != -1)?true:false;

	isMac=(navigator.userAgent.indexOf('Mac') != -1)?true:false;

	function reDo(){window.location.reload();}

	function getObj(i){
	if (isDOM) {
		obj=document.getElementById("msg"+i).style;
	}else{
		obj=eval("msg"+i+((IE4)?".style":""));
	}
	return obj;
	}

	function showMsg(n,show){
	var theEl=getObj(n);
	if(theEl)
		theEl.visibility=(show)?"visible":"hidden";
	}

	function nextMsg(){
	var fm=current;
	current=(fm==ar.length-1)?0:fm+1;
	if(current==1)loopCount++;
	if(finite&&(loopCount>=maxLoops))return;
	scrollBnr(fm,current);
	}

	// mouseover/out new 010222 - abk

	function SCRLmouseover() {
		clearInterval(intervalID);
		clearTimeout(timeoutID);
	}

	function SCRLmouseout() {
		intervalID=setInterval("moveUp()",interval);
	}

	function moveUp(){
	if (isDOM) {
			var inttoeltopdec = parseInt(toEl.top)-increment;
			fmEl.top=parseInt(fmEl.top) - increment; // + "px" not nec
		if(inttoeltopdec<=toElTarget){
			toEl.top=toElTarget;
			clearInterval(intervalID);
			fmEl.visibility="hidden";
			timeoutID=setTimeout("nextMsg()",pause);
		}else{
			toEl.top=inttoeltopdec; // no px
		}
	}else{
		if(NS4){
			var inttoeltopdec = toEl.top-increment;
			fmEl.top-=increment;
			if(inttoeltopdec<=toElTarget){
				toEl.top=toElTarget;
				clearInterval(intervalID);
				fmEl.visibility="hidden";
				timeoutID=setTimeout("nextMsg()",pause);
			}else{
				toEl.top=inttoeltopdec;
			}
		}else{
			var inttoeltopdec = toEl.pixelTop-increment;
			fmEl.pixelTop-=increment;
			if(inttoeltopdec<=toElTarget){
				toEl.pixelTop=toElTarget;
				clearInterval(intervalID);
				fmEl.visibility="hidden";
				timeoutID=setTimeout("nextMsg()",pause);
			}else{
				toEl.pixelTop=inttoeltopdec;
			}
		}
	}
	}

	function scrollBnr(fm,to){
	fmEl=getObj(fm);
	toEl=getObj(to);
	if(fmEl==null)
	{fmEl=1;}
	if(toEl==null)
	{toEl=1;}
	if (isDOM) {
		toElTarget=parseInt(fmEl.top);        // save one parseInt 010224
		toEl.top=(toElTarget+bnrHit) + "px"; 
	//      toEl.top=(parseInt(fmEl.top)+bnrHit) + "px";
	//      toElTarget=parseInt(fmEl.top);
	}else{
		if(NS4){
			toEl.top=fmEl.top+bnrHit;
			toElTarget=fmEl.top;
		}else{
			toEl.pixelTop=fmEl.pixelTop+bnrHit;
			toElTarget=fmEl.pixelTop;
		}
	}
	showMsg(to,true);
	intervalID=setInterval("moveUp()",interval);
		// can use setTimeout for evengreater speed - abk 010227
	}

	function moveIE(lPos,tPos){this.style.pixelLeft=lPos;this.style.pixelTop=tPos;}
	function moveDOM(lPos,tPos){this.style.left=lPos+"px";this.style.top=tPos+"px";}

	function makeIE(){
		var text='<DIV ID="bnr" STYLE="position:absolute;overflow:hidden;top:'+bnrTop+';left:'+bnrLft +';width:'+bnrWid+';height:'+bnrHit+'">';
		msgWid=bnrWid-leftPadding;
		for(var i=ar.length-1;i>=0;i--){
			text+='<DIV ID="msg'+i+'" STYLE="position:absolute;overflow:hidden;visibility:hidden;top:'+ topPadding +';left:'+leftPadding+';width:'+msgWid+'"><\/DIV>';
		}
		text+='<\/DIV>';	
		document.body.insertAdjacentHTML("BeforeEnd",text);
		
	//	bnr.onmouseover=SCRLmouseover;
	//	bnr.onmouseout=SCRLmouseout;
		for(j=0;j<100;j++){
		for(i=0;i<ar.length;i++){
			var scroller = eval("msg"+i);
			scroller.moveTo=moveIE;
		}
		}
	}

	function makeDOM(){
		var elmParentDiv;
	   
		elmParentDiv = document.createElement('div');
		elmParentDiv.id = 'bnr';
		elmParentDiv.style.position = 'absolute';
		elmParentDiv.style.overflow = 'hidden';
		elmParentDiv.style.top = bnrTop + 'px';
		elmParentDiv.style.left = bnrLft + 'px';
		elmParentDiv.style.width = bnrWid + 'px';
		elmParentDiv.style.height = bnrHit + 'px';
		
	//	elmParentDiv.onmouseover = SCRLmouseover;
	//	elmParentDiv.onmouseout  = SCRLmouseout;

		var elmChildDiv;
		var i;

		msgWid=bnrWid-leftPadding;

	for (i = ar.length - 1; i >= 0; i--)
	{
		elmChildDiv = document.createElement('div');
		elmChildDiv.id = 'msg' + i;
		elmChildDiv.style.position = 'absolute';
		elmChildDiv.style.visibility = 'hidden';
		elmChildDiv.style.overflow = 'hidden';
		elmChildDiv.style.top = topPadding + 'px';
		elmChildDiv.style.left = leftPadding + 'px';
		elmChildDiv.style.width = msgWid + 'px';

		elmParentDiv.appendChild(elmChildDiv);
	       
		elmChildDiv.moveTo=moveDOM;
	}
	   
	document.body.appendChild(elmParentDiv);
	}

	function makeNS(){
	bnr=new Layer(bnrWid);
	with(bnr){
		clip.right=bnrWid;
		clip.bottom=bnrHit;
		moveTo(bnrLft,bnrTop);
		visibility="show";
	}	
	//	bnr.onmouseover = SCRLmouseover;
	//	bnr.onmouseout  = SCRLmouseout;

	for(var i=0;i<ar.length;i++){
		eval("msg"+i+"="+"new Layer(bnrWid-leftPadding,bnr)");
		with(eval("msg"+i)){
			moveTo(leftPadding,topPadding);
		}
	}
	}

	function fillBnr(){
		var theEl;
	var newsCount=0, newsStr=""; 
	   
	for(i=0;i<ar.length;i++){newsStr="<br>"

		if (isDOM){
			theEl=document.getElementById("msg"+i);
	        
		}else{
			theEl=eval("msg"+i);
	         
		}
		//newsStr="<A target=_blank class=scrolltext"+target+classid+
				" HREF="+ar[newsCount][0]+">"+ar[newsCount][1]+"<\/A> ";

	if (ar.length<=1) 
		{clientcnt = ar.length;}
		   
		else
	   		{clientcnt = 1;}
		for (j=1;j<=clientcnt;j++) {

		newsStr=newsStr+ "<A  class=scrolltext"+target+classid+
				" HREF="+ar[newsCount][0]+">"+ar[newsCount][1]+"<\/A> <br><br/>";
		newsCount++;if(newsCount==ar.length)newsCount=0;
		}

		if(NS4){
			with(theEl.document){write(newsStr);close();}
		}else{
			theEl.innerHTML=newsStr;
		}
		//newsCount++;if(newsCount==ar.length)newsCount=0;
	}
	}

	function startBnr(){
	if (isDOM){makeDOM();}
		else{(NS4)?makeNS():makeIE();}
	fillBnr();

	showMsg(0,true);
	current=0;
	window.onresize=reDo;
	timeoutID=setTimeout("nextMsg()",pause);
	}

function initScroller(bw,bnrW,bnrH) {
	
	finite=(maxLoops>0);
	
	ar=[];
	if(!window.arURL) return;
	if(arURL.length==0) return;
	if(arURL.length<numheadlines){numheadlines=arURL.length;}
	for(i=0;i<numheadlines;i++){ar[i]=[prefix+arURL[i],arTXT[i]];}
	newsCount=0;
	if(finite){loopCount=0;}
	ispaused=0;
	    
	bnrWid=250;
	bnrHit=50;
	bnrTop=bnrLft=0;

	if (document.getElementById){
		pHT=document.getElementById('newsBox');
	}else{
		pHT=document.images['newsBox'];
	}
	if(pHT){
	
		bnrWid=bnrW;
		bnrHit=bnrH;
		
		bnrOffsetLeft=((parseInt(pHT.width)-bnrWid) / 2)-15;
		bnrOffsetTop=((parseInt(pHT.height)-bnrHit) / 2);
		pHT.style.border = "solid "+ bw +"px #E4E4E4";

		if(document.getElementById){
			bnrTop=((isMac)&&(IE4))?pHT.clientTop:pHT.offsetTop;
			bnrLft=((isMac)&&(IE4))?pHT.clientLeft:pHT.offsetLeft;
			tEl=pHT;
			while(tEl.offsetParent != null) {
				tEl=tEl.offsetParent;
				bnrTop+=((isMac)&&(IE4))?tEl.clientTop:tEl.offsetTop;
				bnrLft+=((isMac)&&(IE4))?tEl.clientLeft:tEl.offsetLeft;
			}
		}else{
			if (IE4) {
				arPH=[level1,level2,level3,level4,level5];
				bnrTop=bnrLft=0;
				for(i=0;i<arPH.length;i++){
				tEl = arPH[i];
				bnrTop+=tEl.offsetTop;
				bnrLft+=tEl.offsetLeft;
				}
			}else{
				bnrTop = pHT.y;
				bnrLft = pHT.x;
			}
		}
		bnrLft+=bnrOffsetLeft;
		bnrTop+=bnrOffsetTop;
		startBnr();
	}
}

