	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;
		
		if (winWidth < 790) {
			document.getElementById("header").style.width = "770px";
			document.getElementById("allSiteContent").style.width = "770px";
		} else {
			document.getElementById("header").style.width = "100%";
			document.getElementById("allSiteContent").style.width = "100%";
		}
	}
	


function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }
y = y+2000

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'01':( 2==m)?'02':(3==m)?'03':
    ( 4==m)?'04':( 5==m)?'05':(6==m)?'06':
    ( 7==m)?'07':( 8==m)?'08':(9==m)?'09':
    (10==m)?'10':(11==m)?'11':'12';

  return "" +
    (d<10?"0"+d:d) + "/" +
    mmm + "/" +
    (y<10?"0"+y:y);
}


//
// get last modified date of the 
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = " " + date_ddmmmyy(new Date(d1));
  }

  return s;
}

