<!--
function checkforframe() {
    if (top != self ) {
       top.location.href = self.location.href;
    }
}
<!--- Global Variables --->
var menuTable;
var selectedMain, selectedSub1, selectedSub2;
var currentMain, currentSub1, currentSub2;
var editContext, lastPage, lastURLArgs, addURLArgs, pageToOpen, forwardToPage;
var targetMainMenu, targetSubMenu;
var isIE;
var weeks = "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"; 
var months = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"; 
var weekArray = weeks.split( "," );
var monthArray = months.split( "," );
if(navigator.appName=='Microsoft Internet Explorer')
{
	isIE = true;
}
else
{
	isIE = false;
}


function createArray(num) {
	for (var i=0; i < num; i++)
		this[i] = "";
	this.length = num;
}
function extractElement(list,num,ch) {
	var results = new createArray(num);
	var first = 0;
	var last = 0;
	for (var i = 0; i < num; i ++) {
		first = (i == 0) ? 0 : last+1;
		last = (i == num-1) ? list.length : list.indexOf(ch,first);
		results[i] = list.substring(first,last);
	}
	return results;
}
function menu( MainIntName, Sub1IntName, Sub2IntName, MainItem, Sub1Item, Sub2Item, LinkThrough, MainWebTitle, Sub2WebTitle )
{
	this.mainIntName = MainIntName.toLowerCase();
	this.sub1IntName = Sub1IntName.toLowerCase();
	this.sub2IntName = Sub2IntName.toLowerCase();
	this.mainItem = MainItem;
	this.sub1Item = Sub1Item;
	this.sub2Item = Sub2Item;
	this.linkThrough = LinkThrough;
	this.mainTitle = MainWebTitle;
	this.sub2Title = Sub2WebTitle;
}
function initMenuTable(arg)
{
	var i,j,k,l;

	var l = 0;
	while( arg.indexOf("*") > 0 )
	{
		pos = arg.indexOf("*");
		temp1 = extractElement( arg.substring( 0, pos), 10, "|" );
		temp2 = extractElement( temp1[0], 3, "-" );
		i = temp2[0];
		j = temp2[1];
		k = temp2[2];
		this[i+","+j+","+k] = new menu( temp1[1], temp1[2], temp1[3], temp1[4], temp1[5], temp1[6], temp1[7], temp1[8], temp1[9] );
		arg = arg.substring( pos+1, arg.length );
		l++;
	}
	this.length = l;
}
function initContent(url)
{
	if(ParseQuery( url, "ToggleEditMode" ) != null)
	{
		if( editContext == "" )
		{
			editContext = "PageEdit";
		}
		else
		{
			editContext = "";
		}
	}
	else if(ParseQuery( url, "Language") != null)
	{
		// Do nothing
	}
	else if(ParseQuery( url, "RefreshMailbanner" ) != null)
	{
		lastPage  = "VisionIndexDetails";
		s = url.split( "?" );
		lastURLArgs  = s[1].substr(s[1].search( "=" )+1);
	}
	else if(ParseQuery( url, "AddURLArgs" ) != null)
	{
		s = url.split( "?" );
		lastURLArgs  = s[2];
		lastPage  = "";
	}
	else
	{
		lastPage  = "";
		lastURLArgs = "";
	}
	
	if( editContext == null )
	{
		editContext = "";
	}
	if( lastURLArgs == null )
	{
		lastURLArgs = "";
	}
	if( lastPage == null )
	{
		lastPage = "";
	}
}
function updatePageToOpen()
{
	if( currentSub1 != "" && currentSub2 != "")
	{
		if( lastPage != "" )
		{
			pageToOpen = currentMain + "/" + currentSub1 + "/" + lastPage;
		}
		else
		{
			pageToOpen = currentMain + "/" + currentSub1 + "/" + currentSub2;
		}
	}
	else
	{
//		if( currentMain == "libarchive" )
//		{
//			pageToOpen = "libarchive/LibMenu1/FolioStart";
//		}
//		else
//		{
			pageToOpen = currentMain + "/Welcome" + currentMain;
//		}

	}
	if( forwardToPage != "" )
	{
		pageToOpen = forwardToPage;
	}
}
function openPage()
{
	updatePageToOpen();
	if( editContext != "" )
	{
		loc = "/edit/trans/dePage.cfm?Page=" + pageToOpen;
	}
	else
	{
		if( forwardToPage != "" )
		{
			loc = pageToOpen;
		}
		else
		{
			if( lastURLArgs != "" )
			{
				loc = pageToOpen + ".cfm?" + lastURLArgs;
			}
			else
			{
				loc = pageToOpen + ".cfm";
			}
		}
	}
	if( isIE )
	{
		document.frames["Content"].frames["Page"].location = loc
		document.frames["Content"].frames["MailBanner"].location = "MailBanner.cfm?Page="+ pageToOpen;
	}
	else
	{
		window.frames["Content"].frames["Page"].location = loc;
		window.frames["Content"].frames["MailBanner"].location = "MailBanner.cfm?Page="+ pageToOpen;
	}
//	window.open( loc, "Page");
//	window.open( "MailBanner.cfm?Page="+ pageToOpen, "MailBanner");
}
function BringToTop()
{	var browser = navigator.appName;
	var version = navigator.appVersion
	var ver1    = version.substring(0,1)
	if((browser == "Microsoft Internet Explorer") && (ver1 >= 4)) // only possible with Explorer >= 4
	{	if(document.all["ActSub1"])	document.all["ActSub1"].scrollIntoView(true);} 
}
function ParseQuery( url, qname )
{
	queryString = url.split("?");
	if( queryString[1] == null )
	{
		return null;
	}
	else
	{
		queries = queryString[1].split("&");
		for(var i = 0 ;queries[i] != null;i++ )
		{
			query = queries[i].split("=");
			if( query[0] == qname || query[0] == qname.toLowerCase())
			{
				return query[1];
			}
		}
		return null;
	}
}
function setMenuVariables(url)
{
	if( selectedMain == null )
	{
		area = ParseQuery( url, "Area" );

		if( area != null)
		{
			selectedMain = area.toLowerCase();
			currentMain = area.toLowerCase();
		}
		else
		{
			selectedMain = menuTable[0+","+0+","+0].mainIntName;
			currentMain = menuTable[0+","+0+","+0].mainIntName;
		}
		if( ParseQuery( url, "Sub1Menu" ) != null && ParseQuery( url, "Sub2Menu" ) != null)
		{
			sub1 = ParseQuery( url, "Sub1Menu" );
			sub2 = ParseQuery( url, "Sub2Menu" );
			selectedSub1 = sub1.toLowerCase();
			currentSub1 = sub1.toLowerCase();
			selectedSub2 = sub2.toLowerCase();
			currentSub2 = sub2.toLowerCase();
		}
		else
		{
			selectedSub1 = "";
			currentSub1 = "";
			selectedSub2 = "";
			currentSub2 = "";
		}
	}
	else if(ParseQuery( url, "Area" ) != null )
	{
		area = ParseQuery( url, "Area" );
		selectedMain = area.toLowerCase();
		currentMain = area.toLowerCase();
		if( ParseQuery( url, "Sub1Menu" ) != null && ParseQuery( url, "Sub2Menu" ) != null)
		{
			sub1 = ParseQuery( url, "Sub1Menu" );
			sub2 = ParseQuery( url, "Sub2Menu" );
			selectedSub1 = sub1.toLowerCase();
			currentSub1 = sub1.toLowerCase();
			selectedSub2 = sub2.toLowerCase();
			currentSub2 = sub2.toLowerCase();
		}
		else
		{
			selectedSub1 = "";
			currentSub1 = "";
			selectedSub2 = "";
			currentSub2 = "";
		}
	}
	// If Url.Area is omitted.
	else  if(ParseQuery( url, "Area" ) == null &&
	( ParseQuery( url, "Sub1Menu" ) != null && ParseQuery( url, "Sub2Menu" ) != null))
	{
		if( ParseQuery( url, "Sub1Menu" ) != null && ParseQuery( url, "Sub2Menu" ) != null)
		{
			sub1 = ParseQuery( url, "Sub1Menu" );
			sub2 = ParseQuery( url, "Sub2Menu" );
			selectedSub1 = sub1.toLowerCase();
			currentSub1 = sub1.toLowerCase();
			selectedSub2 = sub2.toLowerCase();
			currentSub2 = sub2.toLowerCase();
		}
		else
		{
			selectedSub1 = "";
			currentSub1 = "";
			selectedSub2 = "";
			currentSub2 = "";
		}
	}
}
function clickMainMenu(menu,webtitle)
{
	currentMain = menu;
	selectedMain = menu;
	selectedSub1 = '';
	selectedSub2 = '';
	currentSub1 = '';
	currentSub2 = '';
	lastPage = "";
	lastURLArgs = "";
	if( window.navigator.platform.toLowerCase().indexOf('win') != -1 && (document.getElementById !=null || document.all != null))	// NN6 or IE4,5 and only Win
	{
		if( navigator.userAgent.toLowerCase().indexOf('opera') != -1)
		{
			document.frames["Content"].frames["MainMenu"].location = "MainMenu.cfm";
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			targetMainMenu.innerHTML = updateMainMenu();
			targetSubMenu.innerHTML = updateSubMenu();
		}
	}
	else
	{
		if( isIE )
		{
			document.frames["Content"].frames["MainMenu"].location = "MainMenu.cfm";
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			window.frames["Content"].frames["MainMenu"].location = "MainMenu.cfm";
			window.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
	}
	openPage();
	if( webtitle != "")
	{
		document.title = webtitle;
	}
	return false;
}
function hoverMainMenu(menu)
{
	currentMain = menu;
	if( window.navigator.platform.toLowerCase().indexOf('win') != -1 && (document.getElementById !=null || document.all != null))	// NN6 or IE4,5 and only Win
	{
		if( navigator.userAgent.toLowerCase().indexOf('opera') != -1)
		{
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			targetSubMenu.innerHTML = updateSubMenu();
		}
	}
	else
	{
		if( isIE )
		{
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			window.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
	}
	return false;
}
function clickSub1Menu(menu)
{
	if( currentSub1 == menu )
	{
		currentSub1 = "";
	}
	else
	{
		currentSub1 = menu;
	}
	if( window.navigator.platform.toLowerCase().indexOf('win') != -1 && (document.getElementById !=null || document.all != null))	// NN6 or IE4,5 and only Win
	{
		if( navigator.userAgent.toLowerCase().indexOf('opera') != -1)
		{
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			targetSubMenu.innerHTML = updateSubMenu();
		}
	}
	else
	{
		if( isIE )
		{
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			window.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
	}
	return false;
}
function clickSub2Menu(main,sub1,sub2,webtitle)
{
	currentSub2 = sub2;
	selectedMain = main;
	selectedSub1 = sub1;
	selectedSub2 = sub2;
	lastPage = "";
	lastURLArgs = "";
	if( window.navigator.platform.toLowerCase().indexOf('win') != -1 && (document.getElementById !=null || document.all != null))	// NN6 or IE4,5 and only Win
	{
		if( navigator.userAgent.toLowerCase().indexOf('opera') != -1)
		{
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
			targetSubMenu.innerHTML = updateSubMenu();
		}
	}
	else
	{
		if( isIE )
		{
//			document.frames["Content"].frames["MainMenu"].location = "MainMenu.cfm";
			document.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
		else
		{
//			window.frames["Content"].frames["MainMenu"].location = "MainMenu.cfm";
			window.frames["Content"].frames["SubMenu"].location = "SubMenu.cfm";
		}
	}
	openPage();
	if( webtitle != "")
	{
		document.title = webtitle;
	}
	return false;
}
function updateMainMenu()
{
	toOutput = '';
	if( menuTable == null )
		return toOutput;
	today = new Date();
	thisyear = today.getYear();
	if( thisyear < 1900 )	// For Netscape
	{
		thisyear += 1900;
	}
			
	toOutput += '<div class="smalltext">';
	toOutput += '&nbsp;&nbsp;&nbsp;' + weekArray[today.getDay()] + "&nbsp;" + today.getDate() + "&nbsp;" + monthArray[today.getMonth()] + "&nbsp;" + thisyear ;
//	toOutput += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(Now(),"dddd d mmm yyyy")#';
	toOutput += '</div><br>';
	toOutput += '<table><tr><td>';
	toOutput += '<div align="CENTER" valign="MIDDLE">';
	toOutput += '<table border="0" cellpadding="0" cellspacing="0">';

	for( var i =0;menuTable[i+","+0+","+0] != null && 
	 menuTable[i+","+0+","+0].mainIntName != "";i++)
	{
		menuIntName = menuTable[i+","+0+","+0].mainIntName;
		menuItem = menuTable[i+","+0+","+0].mainItem;
		linkThrough = menuTable[i+","+0+","+0].linkThrough;
		webTitle = menuTable[i+","+0+","+0].mainTitle;
		if( menuIntName == selectedMain )
		{
			Btn = "BtnTriRed";
		}
		else
		{
			Btn = "BtnTriGrey";
		}
		if( menuIntName == currentMain )
		{
			Men = "Menu2";
		}
		else
		{
			Men = "Menu";
		}
//		if( menuIntName == "libarchive" &&	linkThrough != 0 )
//		{
//			loc = "libarchive/LibMenu1/FolioStart.cfm"; 
//		}
//		else
//		{
			loc = menuIntName + "/Welcome" + menuIntName + ".cfm";
//		}

		toOutput += '<tr><td width="13" height="18" align="center" valign="middle">';
		toOutput += '<img border="0"  src="GeneralPicture/Menu/' + Btn + '.gif">';
		toOutput += '</td>';
		toOutput += '<td height="13" align="left" valign="middle" nowrap>';
		toOutput += '<div class="' + Men + '">';
		toOutput += '<a href="MainMenu.cfm"';
//		toOutput += '<a href="Content.cfm?' + s + '"';
		toOutput += ' onClick="return top.clickMainMenu(\'' + menuIntName + '\',\'' + webTitle +'\');"';
//		toOutput += ' onMouseOver="return top.hoverMainMenu(\'' + menuIntName + '\');\"';
		toOutput += ' target=\"MainMenu\">&nbsp;' + menuItem + '&nbsp;</a></div>';
		toOutput += '</td>';
		toOutput += '</tr>';
	}
	toOutput += '</table></div></td></tr></table>';
	return toOutput;
}
function updateSubMenu()
{
	toOutput = '';
	if( menuTable == null )
	{
		return toOutput;
	}

	toOutput += '<table border="0" cellpadding="0" cellspacing="0">';

	for( var i =0;menuTable[i+","+0+","+0] != null && 
	 menuTable[i+","+0+","+0].mainIntName != "" ;i++)
	{
		mainIntName = menuTable[i+","+0+","+0].mainIntName;
		mainItem = menuTable[i+","+0+","+0].mainItem;
		if( mainIntName == currentMain )
		{
			for( var j =0;menuTable[i+","+j+","+0] != null &&
			 menuTable[i+","+j+","+0].sub1IntName != "" ;j++)
			{
				sub1IntName = menuTable[i+","+j+","+0].sub1IntName;
				sub1Item = menuTable[i+","+j+","+0].sub1Item;
				sub2IntName = menuTable[i+","+j+","+0].sub2IntName;
				sub2Item = menuTable[i+","+j+","+0].sub2Item;
				webTitle = menuTable[i+","+j+","+0].sub2Title;

				toOutput += '<tr>';
				toOutput += '<td width="15" height="10" align="center" valign="middle">';
				if( sub1IntName == selectedSub1 )
				{
//					toOutput += '<img border="0" src="GeneralPicture/Menu/BtnQuadRed.gif">';
					toOutput += '<br></td>';
					<!--- calling the Page  --->
					toOutput += '<td height="10" align="left" valign="middle">';
					toOutput += '<div class="Sub1">';
					toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
					 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
					 ' onClick=\"return top.clickSub1Menu(\'' + sub1IntName +
					 '\');\" target=\"Content\" name=\"ActSub1\">';
//					toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
//					 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
//					 ' onMouseOver=\"return top.clickSub1Menu(\'' + sub1IntName +
//					 '\');\" target=\"Content\" name=\"ActSub1\">';
				}
				else
				{
//					toOutput += '<img border="0" src="GeneralPicture/Menu/BtnQuadGrey.gif">';
					toOutput += '<br></td>';
					<!--- calling the Page  --->
					toOutput += '<td height="10" align="left" valign="middle">';
					toOutput += '<div class="Sub1">';
					toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
					 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
					 ' onClick=\"return top.clickSub1Menu(\'' + sub1IntName +
					 '\');\" target=\"Content\">';
//					toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
//					 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
//					 ' onMouseOver=\"return top.clickSub1Menu(\'' + sub1IntName +
//					 '\');\" target=\"Content\">';
				}
				toOutput += sub1Item + '</a></div></td></tr>';

				if( sub1IntName == currentSub1 )
				{
					for( var k =0;menuTable[i+","+j+","+k] != null &&
					 menuTable[i+","+j+","+k].sub2IntName != "";k++)
					{
						sub2IntName = menuTable[i+","+j+","+k].sub2IntName;
						sub2Item = menuTable[i+","+j+","+k].sub2Item;
						webTitle = menuTable[i+","+j+","+k].sub2Title;
						toOutput += '<tr><td width="15"></td><td>';
						toOutput += '<table border="0" cellpadding="0" cellspacing="0">';
						toOutput += '<tr><td width="15" align="center" valign="middle">';
						if( sub2IntName == selectedSub2 )
						{
							toOutput += '<img border="0" src="GeneralPicture/Menu/BtnBulletAni.gif">';
						}
						else
						{
							toOutput += '<img border="0" src="GeneralPicture/Menu/BtnBulletGrey.gif">';
						}
						toOutput += '</td><td align="left" valign="top">';
						toOutput += '<div class="Sub2">';
						loc = mainIntName + "/" + sub1IntName + "/" + sub2IntName + ".cfm";
						toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
						 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
						 ' onClick=\"return top.clickSub2Menu(\'' + mainIntName + '\',\'' +
						 sub1IntName + '\',\'' + sub2IntName + '\',\'' + webTitle + '\');\" target=\"SubMenu\">';
//						toOutput += '<a href=\"Content.cfm?Area=' + mainIntName +
//						 '&Sub1Menu=' + sub1IntName + '&Sub2Menu=' + sub2IntName + '\"' +
//						 ' onClick=\"return top.clickSub2Menu(\'' + mainIntName + '\',\'' +
//						 sub1IntName + '\',\'' + sub2IntName + '\');\" target=\"Content\">';
						toOutput += sub2Item + '</a></div></td></tr>';
						toOutput += '</table>';
					}
				}
			}
		}
	}
	toOutput += '</table>';
	return toOutput;
}
function updateContent()
{
	updatePageToOpen();

	toOutput = '';
	toOutput += '<frameset name="contentframe" cols="165,*" border="0" frameborder="0" framespacing="0" marginwidth="0" marginheight="0">';
	toOutput += '<frameset rows="145,*,60" border="0" frameborder="0" framespacing="0" marginwidth="0" marginheight="0">';
	toOutput += '<frame NAME="MainMenu" target="MainMenu" ';
	toOutput += 'src="MainMenu.cfm?Area=' + parent.currentMain + '&Sub1Menu=' + parent.currentSub1 + '&Sub2Menu=' + parent.currentSub2 + '"' ;
	toOutput += 'SCROLLING="auto" frameborder="no" border="no" framespacing="0" marginwidth="0"' ;
	toOutput += 'marginheight="0">';
	toOutput += '<frame NAME="SubMenu"  target="SubMenu" ';
	toOutput += 'src="SubMenu.cfm" ';
	toOutput += 'SCROLLING="auto" ';
	toOutput += 'frameborder="no" border="no" framespacing="0" marginwidth="0" marginheight="0">';
	toOutput += '<frame NAME="MailBanner"  target="MailBanner"  ';
	toOutput += 'src="MailBanner.cfm?Page=' + parent.pageToOpen + '"';
	toOutput += 'SCROLLING="no" ';
	toOutput += 'frameborder="no" border="no" framespacing="0" marginwidth="0" marginheight="0">';
	toOutput += '</frameset>';
	toOutput += '<frame    NAME="Page"     target="Page"  ';
	if( editContext != "" )
	{
		toOutput += 'src="/edit/trans/dePage.cfm?Page=' + parent.pageToOpen + '"';
	}
	else
	{
		if( parent.forwardToPage != "" )
		{
			toOutput += 'src="' + parent.pageToOpen + '"';
		}
		else
		{
			if( parent.lastURLArgs != "" )
			{
				toOutput += 'src="' + parent.pageToOpen + '.cfm?' + lastURLArgs + '"';
			}
			else
			{
				toOutput += 'src="' + parent.pageToOpen + '.cfm"';
			}
		}
	}
	toOutput += 'SCROLLING="AUTO" frameborder="no" border="no" framespacing="0" marginwidth="0"';
	toOutput += 'marginheight="0">';
	toOutput += '<noframes>';
	toOutput += '<!--- do we want to provide something for not frame capable browers ??? --->';
	toOutput += '</noframes>';
	toOutput += '</frameset>';
	return toOutput;
}
checkforframe();
// -->

