<!--
	var pgeTitle;
   var majorString = "support,company,alliances,contact,product,services,home,";
   var minorString = "quicklink,weblink,autolink,banklink,securelink,erp,latest,glossary";
   majorString = majorString.concat(minorString);
   var linkNames = majorString.split(/,/);
	// There are two matched arrays:
	// The first is all page names involved.
	// The second contains: gif name, gif id, cell id, minor menu displayed (Y or N), title, main page (Y or N)
	var pageNames=new Array;
	var pageOption=new Array;
	pageNames[ 0] = "brochures";
	pageOption[ 0] = "brochures ,brochures,li_brochures,Y,Brochures,Y";
	pageNames[ 1] = "change";
	pageOption[ 1] = "change ,change,li_change,Y,Change Management,Y";
	pageNames[ 2] = "company";
	pageOption[ 2] = "our company ,company,li_company,N,New Millennium Solutions,Y";
	pageNames[ 3] = "configuration";
	pageOption[ 3] = "configuration ,configuration,li_configuration,Y,Configuration Management,Y";
	pageNames[ 4] = "contactus";
	pageOption[ 4] = "contact us ,contact,li_contactus,N,,Y";
	pageNames[ 5] = "crossview";
	pageOption[ 5] = "our product ,product,li_product,Y,CrossView Product,Y";
	pageNames[ 6] = "helpdesk";
	pageOption[ 6] = "help desk ,helpdesk,li_helpdesk,Y,Help Desk,Y";
	pageNames[ 7] = "index";
	pageOption[ 7] = "home ,index,li_index,N,CrossView Service Level Management,Y";
	pageNames[ 8] = "legal";
	pageOption[ 8] = ",,,N,Legal Information,Y";
	pageNames[ 9] = "philosophy";
	pageOption[ 9] = ",,,N,Philosophy,Y";
	pageNames[10] = "problem";
	pageOption[10] = "problem ,problem,li_problem,Y,Problem Management,Y";
	pageNames[11] = "service";
	pageOption[11] = "service ,service,li_service,Y,Service Management,Y";
	pageNames[12] = "strengths";
	pageOption[12] = "strengths ,strengths,li_strengths,Y,Strengths,Y";
	pageNames[13] = "support";
	pageOption[13] = "support ,support,li_support,N,Support,Y";
	pageNames[14] = "technical";
	pageOption[14] = "technical ,technical,li_technical,Y,System Requirements,Y";
	pageNames[15] = "whitepapers";
	pageOption[15] = "white papers ,whitepapers,li_whitepapers,N,White Papers,Y";
	pageNames[16] = "responsibility";
	pageOption[16] = ",,,N,,Y";
	pageNames[17] = "accountability";
	pageOption[17] = ",,,N,,Y";
	pageNames[18] = "communication";
	pageOption[18] = ",,,N,,Y";
	pageNames[19] = "knowledge";
	pageOption[19] = ",,,N,,Y";
	pageNames[20] = "demo";
	pageOption[20] = ",,,N,CrossView Demonstration,Y";
	pageNames[21] = "downloads";
	pageOption[21] = ",,,N,CrossView Downloads,Y";
	pageNames[22] = "instructions";
	pageOption[22] = ",,,N,Support Instructions,Y";
	pageNames[23] = "promotions_3.3";
	pageOption[23] = ",,,N,,Y";
	pageNames[24] = "buildsmatrix";
	pageOption[24] = ",,,N,,Y";
	pageNames[25] = "features";
	pageOption[25] = ",,,N,,Y";
	pageNames[26] = "promotions_3.2";
	pageOption[26] = ",,,N,,Y";
	pageNames[27] = "buildsmatrix4";
	pageOption[27] = ",,,N,,Y";
	pageNames[28] = "promotions_4";
	pageOption[28] = ",,,N,,Y";
	pageNames[29] = "technicalpapers";
	pageOption[29] = ",,,N,,Y";
	// This array contains the cell IDs for the Minor Menu for the Main Pages
	var mpMenuIDs = new Array;
	mpMenuIDs [ 0] = "li_service";
	mpMenuIDs [ 1] = "li_problem";
	mpMenuIDs [ 2] = "li_change";
	mpMenuIDs [ 3] = "li_technical";
	mpMenuIDs [ 4] = "li_helpdesk";
	mpMenuIDs [ 5] = "li_strengths";
	mpMenuIDs [ 6] = "li_brochures";
	mpMenuIDs [ 7] = "li_configuration";
	//
	// This array contains the cell IDs for the Minor Menu for the Knowledge Base Pages
	var kbMenuIDs = new Array;
	kbMenuIDs [ 0] = "supportsub";
	kbMenuIDs [ 1] = "knowledge";
	//
	// This array is populated when we determine the page type
	var minorMenuIDs = new Array;
	//
	var displayMinorMenu;
	var infoMenu;
	
	function sesOnLoad()
	{
		// Get the page name from the URL
		var pgs = document.URL.split('/');
		if (pgs.length <1) {alert("Cannot split the URL " + document.URL);}
		// The last element contains the page name (either asp or htm)
		var thisPage = pgs[pgs.length - 1];
		if (thisPage.length ==0) { thisPage="index.asp"; pgs.push(thisPage);}
		//alert("thisPage " + thisPage);
		l = thisPage.indexOf(".asp");
		if (l < 0) thisPage.indexOf(".htm");
		if (l < 0) 
		{	
			//alert("Cannot find either .asp or .htm in " + thisPage);
			l = document.URL.indexOf(".kb.");
			if (l < 0)
			{
				thisName = "index";
			}
			else thisName = "kb";
		} else 	var thisName = thisPage.substr(0, l);
		//alert("l " + l + " str len " + thisPage.length);
		//alert("This name " + thisName);
		//alert("len " + pgs.length + " last " + thisPage);
		// Fix the current menu item to the current page
		for(i=0; i<pageNames.length;i++)
		{
			//alert("URL " + thisPage + " length " + thisPage.length + " name " + pageNames[i] + " length " + pageNames[i].length);
			l = thisName.indexOf(pageNames[i],0);
			if (l >= 0 && thisName.length == pageNames[i].length) 
			{
				// Get the id
				var ops = pageOption[i].split(/,/); // 0=gif name, 1=gif id, 2=cell id, 3=Y or N,4=title,5=infor or knowledge
				//alert("ops[2] " + ops[2]);
				if (ops[2].length > 0)
				{
					var el = document.getElementById(ops[2]);
					if (el)
					{
						//alert("pageNames[" + i + "]:" + pageNames[i] + ":");
						//alert("URL length " + thisPage.length + " name length " + pageNames[i].length);
						//alert(" ops[3] " + ops[3] + " ops[5] " + ops[5]);
						// Set the selected color
						var fc = el.firstChild;
						//alert("b4 fc color " + fc.style.color);
						//fc.style.color = "#000080";
						if (fc) {fc.style.color = "#9AFEFF";}	// red
						//alert("aft fc color " + fc.style.color);
						//alert("ops[5] " + ops[5]);
						if (ops[5] == 'Y')
						{
							for(j=0; j<mpMenuIDs.length;j++) {minorMenuIDs[j] = mpMenuIDs[j];}
							infoMenu = "true";
						}
						else
						{
							for(j=0; j<kbMenuIDs.length;j++) {minorMenuIDs[j] = kbMenuIDs[j];}
							infoMenu = "false";
						}
						//alert("ops[3] " + ops[3]);
				 		if (ops[3] == "Y") 
				 		{
				 			displayMinorMenu = "true";
				 		}
				 		else
				 		{
				 			displayMinorMenu = "false";
				 		}
						// Set the main menu PRODUCTS ON if PRODUCTS
						el = document.getElementById("li_product");
						if (el)
						{
							var fc = el.firstChild;
							if (fc)
							{
								if (displayMinorMenu == "true")
								{
									//fc.style.color = "#000080";
									fc.style.color = "#9AFEFF";		// red
								}
							}
							//alert("el " + el.innerHTML);
						}
						if (displayMinorMenu == "true")
						{
							el = document.getElementById("nav-next");
							//alert("kids " + el.childNodes.length);
							if (el)
							{
								for (i=0;i<el.childNodes.length;i++)
								{
									var tag = el.childNodes[i].tagName;
									if (tag && tag.toLowerCase().indexOf("li") >= 0) 
									{
										el.childNodes[i].style.visibility="visible";
										var idn = el.childNodes[i].id;
										if (idn)
										{
											if (idn.indexOf(thisName) >= 0)
											{
												//alert("el.child.inner " + el.childNodes[i].innerHTML);
												var fc = el.childNodes[i].firstChild;
												if (fc)
												{
													//alert("fc " + fc.innerHTML);
													//fc.style.color = "#000080";
													fc.style.color = "#9AFEFF";		// red
												}

											}
										}
									}
								}
							}
						}
					}
				}
			}
		}

	/*
		alert("1");				
		// Hide the minor menu items if they are not relevant
		var tStyle = "hidden";
		if (displayMinorMenu == "true") tStyle = "visible";
		//alert("tStyle " + tStyle);
		for(i=0; i<minorMenuIDs.length;i++)
		{
			var el = document.getElementById ( minorMenuIDs[i] );
			if (el)
			{
				//alert("parent " + el.parentNode);
				//el.parentNode = "";
				el.style.visibility = tStyle;
				if (el.style.visibility == "hidden") 
				{
					//alert("href " + el.href);
					var elid = minorMenuIDs[i]+"_href";
					el = null;
					el = document.getElementById ( elid );
					if (el)
					{
						//el.href = null;
						//el.onmouseover = null;
						//el.onmouseout = null;
						el.removeAttribute('href');
						el.removeAttribute('img');
						el.removeAttribute('rel');
					} 
					else alert("Unable to find " + elid);
				}
			}
			else alert("Unable to find " + minorMenuIDs[i]);
		}
	*/

	/*		
		alert("2");				
		// If the minor menu is shown and its an info page, the 'OUR PRODUCTS' menu is active
		if (tStyle == "visible" && infoMenu == "true")
		{
			pid = "products";
			for(i=0; i<pageNames.length;i++)
			{
				l = pid.indexOf(pageNames[i],0);
				if (l >= 0) 
				{
					var ops = pageOption[i].split(/,/); // 0=gif name, 1=gif id, 2=cell id, 3=Y or N
				 	var eh = document.getElementById (ops[2] );	
				 	if (eh)
				 	{
				 		var hf = ops[0].replace(/ /g,"%20");
				 		var hi = ops[1].replace(/ /g,"%20");
				 		hf = hf.concat("on.gif");
				 		var ht = "<img class='allimages' src=images/".concat(hf).concat(" id=").concat( hi ).concat(" />");
				 		eh.innerHTML = 	ht;
				 		//alert("id (our products) " + ops[2] + " html :" + eh.innerHTML + ":");
				 	}
				 	else	alert("Unable to find id:" +ops[2] + ":");	
				 }
			}
		}
	*/

	/*		
		alert("3");				
		// If the minor menu is shown and its knowledge, the 'SUPPORT' menu is active
		if (tStyle == "visible" && infoMenu == "false")
		{
			pid = "support";
			for(i=0; i<pageNames.length;i++)
			{
				l = pid.indexOf(pageNames[i],0);
				if (l >= 0) 
				{
					var ops = pageOption[i].split(/,/); // 0=gif name, 1=gif id, 2=cell id, 3=Y or N
				 	var eh = document.getElementById (ops[2] );	
				 	if (eh)
				 	{
				 		var hf = ops[0].replace(/ /g,"%20");
				 		var hi = ops[1].replace(/ /g,"%20");
				 		hf = hf.concat("on.gif");
				 		var ht = "<img class='allimages' src=../images/".concat(hf).concat(" id=").concat( hi ).concat(" />");
				 		eh.innerHTML = 	ht;
				 		//alert("id (support) " + ops[2] + " html :" + eh.innerHTML + ":");
				 	}
				 	else	alert("Unable to find id:" +ops[2] + ":");	
				 }
			}
		}
	*/
		

		// Adding a pop behaviour to the page and remove links for the current page. 
		var popups = document.getElementsByTagName("a");	// all the href's
		for (i=0;i<popups.length;i++)
 		{
			//alert("number " + i + " href " + popups[i].href + " thisPage " + thisPage);
			if (popups[i].href.indexOf(thisPage) < 0)
			{
 				if (popups[i].rel.indexOf("popup")== 0)
  				{
  					// attach popup behaviour
  					popups[i].onclick = doPopUp;
  					// add popup indicator
  					//alert("noicon " + popups[i].rel);
  					if (popups[i].rel.indexOf("noicon")==-1)
  					//more of the 'no icon' thing in a moment ...
   					{
   						popups[i].style.paddingLeft = "0px";
   					}
  					// If it's needed, add info to title attribute to alert fact that it's a pop-up window
  					if(popups[i].title.indexOf(" [Opens in pop-up window]") == -1) popups[i].title = popups[i].title + " [Opens in pop-up window]";
  				} 
 				if (popups[i].rel.indexOf("nopopup") == 0)
  				{
  					// attach popup behaviour
  					//popups[i].onclick = doPopUp;
  					// add popup indicator
  					//alert("noicon " + popups[i].rel);
  					//if (popups[i].rel.indexOf("noicon")==-1)
  					//more of the 'no icon' thing in a moment ...
   					//{
   					//	popups[i].style.paddingLeft = "0px";
   					//}
  					// If it's needed, add info to title attribute to alert fact that it's a pop-up window
  					if(popups[i].title.indexOf(" [Opens in same window]") == -1) popups[i].title = popups[i].title + " [Opens in same window]";
  				}
			} 
			else 
			{
				popups[i].removeAttribute("href");
				popups[i].style.textDecoration = "none";
			}
   		}

	/*
  		
  		// Fix the page heading. This is standard in the seshead include
		var el = document.getElementById ( 'titleSeSPage' );
		if (el)
		{
			//alert(" html before " + el.innerHTML);
			var newTitle = "<b>";
			newTitle = newTitle.concat(pgeTitle);
			newTitle = newTitle.concat("</b>");
			el.innerHTML= newTitle;
			//alert(" html after " + el.innerHTML);
			// Save the details
			var titLocY = el.y;
		}
  		else alert("unable to find id=titleSeSPage"); 
	*/
  		
	}
	function sesShow()
	{
		alert('show');
	}
	function sesHide()
	{
		alert('hide');
	}
	function sesOn( file )
	{
		//alert("infoMenu " + infoMenu);
		var el = document.getElementById ( file );
		//alert("linkNames.length " + linkNames.length);
		if (el)
		{
			for(i=0; i<pageOption.length;i++)
			{
				var ops = pageOption[i].split(/,/); // 0=gif name, 1=gif id, 2=cell id, 3=Y or N, 4=title, 5=info.. kb (Y or N)
				l =ops[1].indexOf(file,0);
				//alert ("l " + l + " file " + file + " linkFiles["+i+"] " + linkFiles[i]);
				//l = file.compare(linkNames[i]);
				if (l >= 0)
				{
					// we've found the one
					var gifn = ops[0].replace(/ /g,"%20");
				 	if (infoMenu == "false")
				 	{
				 		el.src = "../images/".concat(gifn).concat("on.gif");
				 	}
					else
				 	{
				 		el.src = "images/".concat(gifn).concat("on.gif");
				 	}
				 	//alert("el.src " + el.src);
				}
			}
		}
		else
		{
			alert("unable to find id " + file);
		}
	}
	function sesOff( file )
	{
		//alert("infoMenu " + infoMenu);
		var el = document.getElementById ( file );
		//alert("linkNames.length " + linkNames.length);
		if (el)
		{
			for(i=0; i<pageOption.length;i++)
			{
				var ops = pageOption[i].split(/,/); // 0=gif name, 1=gif id, 2=cell id, 3=Y or N
				l =ops[1].indexOf(file,0);
				//alert ("l " + l + " file " + file + " linkFiles["+i+"] " + linkFiles[i]);
				//l = file.compare(linkNames[i]);
				if (l >= 0)
				{
				 	if (infoMenu == "false")
				 	{
				 		el.src = "../images/".concat(ops[0]).concat("off.gif");
				 	}
				 	else
				 	{
				 		el.src = "images/".concat(ops[0]).concat("off.gif");
				 	}
				 	//alert("el.src " + el.src);
				}
			}
		}
	}
	function sesPageOn ( file )
	{
	}
	
	// Function handles the link to the page popups
	function doPopUp(e)
	{

		//set defaults - if nothing in rel attrib, these will be used
		var t = "standard";
		var w = "780";
		var h = "580";

		//look for parameters
		attribs = this.rel.split(" ");
		if (attribs[1]!=null) {t = attribs[1];}
		if (attribs[2]!=null) {w = attribs[2];}
		if (attribs[3]!=null) {h = attribs[3];}

		//call the popup script
		popUpWin(this.href,t,w,h);

		//cancel the default link action if pop-up activated
		if (window.event) 
 		{
 			window.event.returnValue = false;
 			window.event.cancelBubble = true;
 		} 
		else if (e) 
 		{
 			e.stopPropagation();
 			e.preventDefault();
 		}
	}

	function popUpWin(url, type, strWidth, strHeight)
	{
	
		//closeWin(); 		// PS 16Sep2008 Ignore this; stilll seems to work!
		//calls function to close pop-up if already open, 
		//to ensure it's re-opened every time, retainining focus
			
		type = type.toLowerCase();
		//alert("type " + type);
		if (type == "fullscreen")
		{
 			strWidth = screen.availWidth;
 			strHeight = screen.availHeight;
 		}
		var tools="";
		if (type == "standard") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes, width="+strWidth+",height="+strHeight+",top=0,left=0";
		if (type == "console" || type == "fullscreen") tools = "resizable,toolbar=no, location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
		newWindow = window.open(url, 'newWin', tools);
		newWindow.focus();
	}
	
function goHistory(dir)
  {
  	if (history.length > 0)
	{
		if (dir == "b") history.back();
		history.forward();
	}
	else alert("There is no history yet...");
  }
  
  
-->
