// CGEY NYSC JavaScript Functions

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function postDate () {
days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday"; 
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October"; 
months[11] = "November";
months[12] = "December";
today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear(); 
if (year < 2000)
year = year + 1900;
return (day +", " + month + " " + date + ", " + year );

}

var gAutoPrint = true // Flag for whether or not to automatically call the print function
function printSpecial(DivTagID)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n <link href="css/print.css" rel="stylesheet" type="text/css" media="screen">';

		if (document.getElementsByTagName != null)
		{
			//var headTags = document.getElementsByTagName("head");
			//if (headTags.length > 0)
			//	html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n<img src="Images/OLBSHeader.png" class="thumbImage" width="700">\n<p>\n<Div id="PrintSection" name="PrintSection">\n';
		var printReadyElem = document.getElementById(DivTagID);
		
		if (printReadyElem != null)
		{
			html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</Div>\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
		}
	
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}


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;
  }

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  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;
}

function fullyear()
{
	var d = new Date();
	d = d.getFullYear();
	return d;	

}


//
// finally display the last modified date
// as DD-MMM-YY
//


