	function startUp() {
		updateLinks();
		if (isInternetExplorer && !isPrinterFriendly()) {
			setContentWidth();
		}
	}
	
	window.onload = startUp;
	if (isInternetExplorer && !isPrinterFriendly()) {
		window.onresize = setContentWidth;
	}

	/** Standard popup window open
	 * The first parameter will be the new URL.
	 * Subsequent parameters will be (if supplied) the width and height.
	 * If not specified the width and height will be 500 and 200 respectively.
	 */
	function openWin()
	{
		var url, width=500, height=200, menu=""; args = arguments;
		url = args[0];
		if (args.length>1)
		{
			width=args[1];
		}
		if (args.length>2)
		{
			height=args[2];
		}
		if (args.length>3)
		{
			if (args[3])
			{
				menu=",menubar=yes,toolbar=yes";
			}
		}
		var newwin = window.open(url, 'newWin'+Math.floor(Math.random()*1000), 'width='+width+',height='+height+',scrollbars,resizable' + menu);
	}

    /** Standard popup window open
	 * The first parameter will be the new URL.
	 * Subsequent parameters will be (if supplied) the width and height.
	 * If not specified the width and height will be 500 and 200 respectively.
     'toolbar=no, directories=no, location=no,
  status=yes, menubar=no, resizable=no, scrollbars=no,
  width=300, height=200');
	 */
	function openCustomWin()
	{
		var url, width=500, height=200, toolbar=""; args = arguments; menubar="";scrollbars="";resizable="";screenX=200;screenY=200;
		url = args[0];
		if (args.length>1)
		{
			width=args[1];
		}
		if (args.length>2)
		{
			height=args[2];
		}
		if (args.length>3)
		{
			if (args[3])
			{
				toolbar="toolbar=yes";
			}
		}
        if (args.length>4)
		{
			if (args[4])
			{
				menubar="menubar=yes";
			}
		}
        if (args.length>5)
		{
			if (args[5])
			{
				scrollbars="scrollbars";
			}
		}
        if (args.length>6)
		{
			if (args[6])
			{
				resizable="resizable";
			}
		}
         if (args.length>7)
		{
			if (args[7])
			{
				screenX=args[7];
			}
		}
         if (args.length>8)
		{
			if (args[8])
			{
				screenY=args[8];
			}
		}

		var newwin = window.open(url, 'newWin', 'width='+width+',height='+height+','+toolbar+','+menubar+','+scrollbars+','+resizable+','+status+',screenX='+screenX+',screenY='+screenY);
	}

	function openNonEncodedUrlWin()
	{
		var url, width=500, height=200, menu=""; args = arguments;
		url = args[0];
		if (args.length>1)
		{
			width=args[1];
		}
		if (args.length>2)
		{
			height=args[2];
		}
		if (args.length>3)
		{
			if (args[3])
			{
				menu=",menubar=yes,toolbar=yes";
			}
		}

		var newwin = window.open(url, 'newWin', 'width='+width+',height='+height+',scrollbars,resizable' + menu);
	}
	
	function printPage() {
if (window.print)
    window.print()
	else
	alert( "Sorry, your browser doesn't support this feature. Please use the Print menu option of this browser to print the page. " );
	}
	
/*-- Back to Webpage --*/
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

/* Disable right-click
function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")
*/

	function isInternetExplorer() {
		return navigator.appName.indexOf("Microsoft") > -1;
	}
	
	function isPrinterFriendly() {
		var printFriendlyRegExp = /\/url\/printerFriendly\/[^\/]+\/on/;
		var url = window.location.href;
		
		return printFriendlyRegExp.test(url);
	}
	
	function setContentWidth() {
        	// Additional check to make sure we're in MSIE
		if (!isInternetExplorer) {
			return;
		}
		
		var winWidth = document.body.offsetWidth;
		var contentWidth;
		
		if (winWidth < 960) {
			contentWidth = "960px";
		} else {
			contentWidth = "100%";
		}
		document.getElementById("header").style.width = contentWidth;
		document.getElementById("allSiteContent").style.width = contentWidth;
	}
	
