/**
 * --------------------------------------------------------------------------------
 * Author: Paul McIntyre
 * Revision History:		23 January 2007	- Created
 *
 *
 * Description: This file holds all the scripts required for the Secure-ISS Website
 *
 * --------------------------------------------------------------------------------
 */

function breadCrumbs(base,delStr,defp,cStyle,tStyle,dStyle,nl) 
/* 
 * Create the breadcrumbs on each of the pages
 */

{
	loc=window.location.toString();
	subs=loc.substr(loc.indexOf(base)+base.length+1).split("/");
 	document.write('<a href="'+getLoc(subs.length-1)+defp+'" class="'+cStyle+'">Home</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
 	a=(loc.indexOf(defp)==-1)?1:2
	for (i=0;i<(subs.length-a);i++) { 
		subs[i]=makeCaps(unescape(subs[i]));
 		document.write('<a href="'+getLoc(subs.length-i-2)+defp+'" class="'+cStyle+'">'+subs[i]+'</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
 		}
 	if (nl==1) document.write("<br>")
	document.write('<span class="'+tStyle+'">'+document.title+'</span>');
}

function getLoc(c) 
{
	var d="";
	if (c>0) for (k=0;k<c;k++) d=d+"../"; 
	return d;
}

function makeCaps(a) 
{
 g=a.split(' ');
 for (l=0;l<g.length;l++)
  g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);
 return g.join(" ");
}

function DisplayImage(picURL,picWidth,picHeight, picTitle)
/* 
 * Display an image according to the required size in a pop-up window
 */
{
	newWindow=window.open(picURL,'newWin','toolbar=no,width='+picWidth+',height='+picHeight) ;
	newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'"><\/body><\/html>') ;
	newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight) ;

	newWindow.focus() ;
}
function DisplayURL(winURL, winWidth, winHeight, winTitle){
/* 
 * Display a URL in a pop-up window
 */
	newWindow=window.open(winURL,'newWin','width='+winWidth+',height='+winHeight+', scrollbars') ;
	newWindow.resizeBy(winWidth-newWindow.document.body.clientWidth,winHeight-newWindow.document.body.clientHeight) ;

	newWindow.focus() ;
}
