// navTog
function navTog(cell){
	if (cell.style){
		// using rgb colors to accomodate gecko
		cell.style.backgroundColor = (cell.style.backgroundColor == "rgb(208,208,197)") ? "rgb(253,254,239)" : "rgb(208,208,197)";
	}
	return true;
}// end navTog

// Create popup window - NOT for glossary
function openPrint(url){
	printWin = window.open(url,'historyPrintWindow','toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=600');
} 

// Create popup window - NOT for glossary
function openTranscript(url){
	transcriptWin = window.open(url,'historyTranscriptWindow','toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=350,height=400');
} 

//toc_toggle
function toc_toggle(){		
	if (navigator.appName == "Microsoft Internet Explorer"){
		for(i=0; i<document.links.length; i++){
			if (self.location.href == document.links[i].href){
				document.links[i].href="";
				document.links[i].style.fontWeight="normal";
				document.links[i].style.cursor="default";
			}								        
	        }
        }
}//end toc_toggle	


//pageNums - not used by XML published pages
function pageNums(totalPages){		
	var totalPages;
	var pageNum = 0;
	var url = (location.href);                                    
	var dotPos = (url.lastIndexOf('.'));
	var underScorePos = (url.lastIndexOf('_'));
	var underScoreInt = parseInt(underScorePos);
	var nextChar = url.charAt(underScoreInt + 1);
	var endCut = parseInt(dotPos);
	var startCut;
	
	if (nextChar != '0'){
		startCut = (underScoreInt + 1);
		}	
	else if (nextChar = '0'){ 
		startCut = (underScoreInt + 2);
		}
		
	pageNum = url.substring(startCut, endCut);
	
	return pageNum;
	return totalPages;

}//end pageNums




//function for drop down
function goTo(url) {
	if (url != "") { self.location=url; } 
}


// for webwise pop-up. Taken from webwise include ( <!--#include virtual="/webwise/support.ssi"--> no longer required in pages)
// If the WebWise include code changes, it must be reflected in this file !!
function openWindow(file){
	popupWin = window.open(file, 'popup', 'scrollbars=yes,status=0,menubar=yes,resizable=yes,width=338,height=375');
myTimer=setTimeout("popupWin.focus()",1000);
}

//opens glossary-style pop-up (used in /war/normans/ etc.

var popUpWindow
function openGlossPop(theFile){
	popUpWindow = window.open(theFile, 'popup', 'scrollbars=yes,status=0,menubar=no,resizable=yes,width=340,height=400');
	popUpWindow.focus();
	return false;
}

// function to set dimensions of pop-up and launch it - pass width and height parameters to suit page size - cf. multimedia games, vrs etc.
// Use this for all multimedia launch pages from 11.02.03 - PB
function anySizePop(url,w,h) {
	var w;
	var h;
	pop_window = window.open(url,'any_size_pop','width=' + w + ',height=' + h + ',left=0,screenX=0,top=0,screenY=0,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
	self.name = "main";
	return false;
	if (window.focus) {
		setTimeout('any_size_pop.focus();',1000);
	}
}


