/*function showMaintMessage()  {
	endDate = new Date(2004, 11, 31);
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
	if(today < endDate)  {	
		id = 123;
		if(id != getCookie(id))  {
			setCookie(id, id);
			alert("The Department of Correction's web site and search engine will be unavailable on the following " +
						  "dates/times for maintenance: " +
						  "\n12/21  4:00 am   (Outage 2 to 2 1/2 hours) " +
						  "\n12/22  4:00 am   (Outage 2 to 2 1/2 hours) " +
						  "\n12/28  4:00 am   (Outage 2 to 2 1/2 hours) " +
						  "\n12/30  2:00 am   (Outage 2 to 2 1/2 hours) " +
						  "\n 1/4   7:00 pm   (15-20 minute outage) " +
						  "\n\n" +
						  "We apologize for any inconvenience this may cause. " +
						  "\n" +
						  "\Thank you for your patience.");
		}
	}
}*/

/*************** Tax Amnesty **********************/
function getAmnesty()  {
	startDate = new Date(2009, 4, 1);
	endDate = new Date(2009, 5, 15);
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
	
	if(today >= startDate && today <= endDate)  {
		document.write("<tr>");
		document.write("<td valign='top' class='Standard_Font' align='center'>");
		document.write("<a href='http://www.state.nj.us/treasury/taxation/'>");
		document.write("<img src='images/TaxAmnesty/TaxAmnesty.jpg' width='475'" + 
					   " height='95' border='0'>");
		document.write("</a></td></tr>");
		document.write("<tr><td>&nbsp;</td></tr>");
	}
}
/****************************************

/*************** Job Listings *****************/
function getJobs()  {
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
	
	//Months in Javascript start at 0 range is 0-11
	var months = ["January","February","March","April","May","June","July","August",	"September","October","November","December"];
	var JAN = 0;
	var FEB = 1;
	var MAR = 2;
	var APR = 3;
	var MAY = 4;
	var JUN = 5;
	var JUL = 6;
	var AUG = 7;
	var SEP = 8;
	var OCT = 9;
	var NOV = 10;
	var DEC = 11;
	
/*Array data is entered here <File Name>,<Link>,<Start Date>,<End Date>,<Size>
  When adding records to the array you must place a , between each record and a semicolon at the end
  EXAMPLE:
  	var rulesArray = [["data","data"],["data","data",]];*/

	var jobsArray = [
["Social Worker Trainee", "NJDOC_jobs/Social_Worker_Trainee.pdf", new Date(2009, MAR, 23), new Date(2009, APR, 06)],
["Chaplain (Islamic)", "NJDOC_jobs/Chaplain-Islamic.pdf", new Date(2009, NOV, 17), new Date(2009, DEC, 03)]
];

	var bg = "";
	var count = 0;
	document.write("<table width = '100%' border = '0' cellspacing = '0' cellpadding = '0' align='center'>");
	document.write("<tr><th width='50%' height='20' bgcolor='#003366'><font color='white'>Position</font></th><th width='25%' class='Standard_Font' height='20' align='right' bgcolor='#003366'><font color='white'>Posting Date</font></th><th width='25%' class='Standard_Font' height='20' align='right' bgcolor='#003366'><font color='white'>Closing Date</font></th></tr>");			
	for(i = 0; i <= jobsArray.length - 1; i++)  {
		if(count % 2 != 0)   {
			bg = "#FFF2C1";
		}  
		else  {
			bg = "#FFFFCC";
		}
		if(today >= jobsArray[i][2] && today <= jobsArray[i][3])  {
			document.write("<tr>");	
			document.write("<td class='Standard_Font' valign='top' bgcolor=" + bg + "><a href=" + jobsArray[i][1] + " target='_blank' >" + jobsArray[i][0] + "</a></td><td  class='Standard_Font' valign='top' align='right' bgcolor=" + bg + ">" + (months[jobsArray[i][2].getMonth()] + " " + jobsArray[i][2].getDate() + ", " + jobsArray[i][2].getFullYear()) + "</td><td class='Standard_Font' align='right' valign='top' bgcolor=" + bg + ">" + (months[jobsArray[i][3].getMonth()] + " " + jobsArray[i][3].getDate() + ", " + jobsArray[i][3].getFullYear()) + "</td>");
			document.write("</tr>");
			count++;
		}
	}
	if(count == 0)  {
		document.write("<tr>");
		document.write("<td class='Standard_Font'><font color = 'red'>There are no job postings at this time.</font></td>");
		document.write("</tr>");
	}			
	document.write("</table>");
}

/*********************  NJ Admin10a **********************/

function AcceptMessage()  {
	var site = location.href.split("/");
	var x=confirm("     The Department of Corrections provides notices of rule proposals in the New Jersey Register (N.J.R.), a semi-monthly official publication of the Office of Administrative Law which contains all State agency rule proposals and adoptions.  The following paragraph is quoted from the Proposal section of the New Jersey Register:\n\n " +
	"     Interested persons may submit comments, information or arguments concerning any of the rule proposals in this issue until the date indicated in the proposal.  Submissions and any inquiries about submissions should be addressed to the agency officer specified for a particular proposal.  The required minimum period for comment concerning a proposal is 30 days.  A proposing agency may extend the 30-day comment period to accommodate public hearings " + 
	"or to elicit greater public response to a proposed new rule or amendment.  Most notices of proposal include a 60-day comment period, in order to qualify the notice for an exception to the rulemaking calendar requirements of N.J.S.A. 52:14B-3.  An extended comment deadline will be noted in the heading of a proposal or appear in a subsequent notice in the Register.\n" + 
	"     At the close of the period for comments, the proposing agency may thereafter adopt a proposal, without change, or with changes not in violation of the rulemaking procedures at N.J.A.C. 1:30-6.3.  The adoption becomes effective upon publication in the Register of a notice of adoption, unless otherwise indicated in the adoption notice.  Promulgation in the New Jersey Register establishes a new or amended rule as an official part " + 
	"of the New Jersey Administrative Code.")


        if (x)  {
        	if(site[2] == "highpoint.state.nj.us")  {
                	window.location="http://highpoint.state.nj.us/corrections/NJadmin10a/rule.html";
                }  else  {
                	window.location="http://www.state.nj.us/corrections/NJadmin10a/rule.html";
        	}
        }
}

function AcceptMessage2()  {
	var x=confirm("Posted with the permission of LexisNexis.\n\nThe information on this site is updated quarterly - not updated in real time.")
    if (x)  {
		window.open("http://www.lexisnexis.com/njoal/");
	}  else  {
	}
}

// NJAdmin10a Rule Proposals
function getRules()  {
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
	
	//Months in Javascript start at 0 range is 0-11
	var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	var JAN = 0;
	var FEB = 1;
	var MAR = 2;
	var APR = 3;
	var MAY = 4;
	var JUN = 5;
	var JUL = 6;
	var AUG = 7;
	var SEP = 8;
	var OCT = 9;
	var NOV = 10;
	var DEC = 11;
	
/*Array data is entered here <File Name>,<Link>,<Start Date>,<End Date>,<Size>
  When adding records to the array you must place a , between each record and a semicolon at the end
  EXAMPLE:
  	var rulesArray = [["data","data"],["data","data",]];*/
	var rulesArray = [
["Inmate Jobs and Wages", "rule_proposals/090901_InmateJobsAndWages.pdf", new Date(2009, SEP, 08), new Date(2009, NOV, 07), "32kb"],
["Administration, Organization and Management",  "rule_proposals/090626_Admin_Org_and_Mgmt.pdf", new Date(2009, JUL, 06), new Date(2009, SEP, 04), "20kb"],
["Inmate Groups",  "rule_proposals/090626_Inmate_Groups.pdf", new Date(2009, JUL, 06), 
new Date(2009, SEP, 04), "22kb"],
["Records",  "rule_proposals/090601_Records.pdf", new Date(2009, JUN, 01), new Date(2009, JUL, 31), "24kb"],
["Prohibited Acts; Severity of Offense – Disciplinary Infractions Scale; Override Code Reference Index; Criteria for...", 
 "rule_proposals/090417_Prohibited_Acts_Severity_of_Offense.pdf", new Date(2009, APR, 20), new Date(2009, JUN, 19), "55kb"],
["Prohibited Acts; Severity of Offense--Disciplinary Infractions Scale", "rule_proposals/090416_Prohibited_Acts.pdf", new Date(2009, APR, 20), new Date(2009, JUN, 19), "25kb"],
["Attorneys And Court Related Personnel Visits", "rule_proposals/090224_Attorney_Visits.pdf", new Date(2009, MAR, 02), new Date(2009, MAY, 01), "37kb"],
["Definitions", "rule_proposals/081124_Definitions.pdf", new Date(2008, DEC, 01), new Date(2009, JAN, 30), "21kb"],
["Composition of the Adjustment Committee", "rule_proposals/081031_CompositionAdjCommitteeEligibility.pdf", new Date(2008, NOV, 03), new Date(2009, JAN, 02), "23kb"]	
];

	var bg = "";
	var count = 0;
	document.write("<table width = '95%' border = '0' cellspacing = '0' cellpadding = '0' align='center'>");
	document.write("<tr><th width='62%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Rule Proposal</font></th><th width='26%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Date</font></th><th width='12%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Size</font></th></tr>");			
	for(i = 0; i <= rulesArray.length - 1; i++)  {
		if(count % 2 != 0)   {
			bg = "#FFF2C1";
		}  else  {
			bg = "#FFFFCC";
		}
		if(today >= rulesArray[i][2] && today <= rulesArray[i][3])  {
			document.write("<tr>");	
			document.write("<td width='62%' class='Standard_Font' valign='top' bgcolor=" + bg + "><a href=" + rulesArray[i][1] + " >" + rulesArray[i][0] + "</a></td><td width='26%' class='Standard_Font' valign='top' align='right' bgcolor=" + bg + ">" + (months[rulesArray[i][2].getMonth()] + " " + rulesArray[i][2].getDate() + ", " + rulesArray[i][2].getFullYear()) + "</td><td width='12%' class='Standard_Font' align='right' valign='top' bgcolor=" + bg + ">" + rulesArray[i][4] + "</td>");
			document.write("</tr>");
			count++;
		}
	}
	if(count == 0)  {
		document.write("<tr>");
		document.write("<td class='Standard_Font'>There are no rule proposals at this time.</td>");
		document.write("</tr>");
	}			
	document.write("</table>");
}

//OTS RFQ's
function RFQ()  {
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
	
	//Months in Javascript start at 0 range is 0-11
	var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	var JAN = 0;
	var FEB = 1;
	var MAR = 2;
	var APR = 3;
	var MAY = 4;
	var JUN = 5;
	var JUL = 6;
	var AUG = 7;
	var SEP = 8;
	var OCT = 9;
	var NOV = 10;
	var DEC = 11;
	
/*Array data is entered here <File Name>,<Link>,<Start Date>,<End Date>,<Size>
  When adding records to the array you must place a , between each record and a semicolon at the end
  EXAMPLE:
  	var rulesArray = [["data","data"],["data","data",]];*/
	
	var rulesArray = [
["Camden County Resource Guide Request for Quotations", "OTS/RFQ/camden_county_resource_guide.pdf", new Date(2006, JUL, 17), new Date(2006, AUG, 07), "85kb"],
["Memo to Bidders", "OTS/RFQ/memo_to_bidders.pdf", new Date(2006, JUL, 17), new Date(2006, AUG, 07), "28kb"],
["Request for Quotations Form", "OTS/RFQ/rfq_form.pdf", new Date(2006, JUL, 17), new Date(2006, AUG, 07), "62kb"],
["Request for Quotations", "OTS/RFQ/rfq.pdf", new Date(2006, JUL, 17), new Date(2006, AUG, 07), "33kb"]
];

	var bg = "";
	var count = 0;
	document.write("<table width = '100%' border = '0' cellspacing = '0' cellpadding = '0' align='center'>");
	for(i = 0; i <= rulesArray.length - 1; i++)  {
		if(today >= rulesArray[i][2] && today <= rulesArray[i][3]) count++;
	}
	if(count > 0) {
		document.write("<tr><th width='62%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Request for Quotation</font></th><th width='26%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Date</font></th><th width='12%' class='Standard_Font' height='20' bgcolor='#003366'><font color='#FFFFFF'>Size</font></th></tr>");
		count = 0;
	}  else  {
		document.write("<tr><td><!-OTS Array is empty --></td></tr>");
	}
	for(i = 0; i <= rulesArray.length - 1; i++)  {
		if(count % 2 != 0)   {
			bg = "#FFF2C1";
		}  else  {
			bg = "#FFFFCC";
		}
		if(today >= rulesArray[i][2] && today <= rulesArray[i][3])  {
			document.write("<tr>");	
			document.write("<td width='62%' class='Standard_Font' valign='top' bgcolor=" + bg + "><a href=" + rulesArray[i][1] + " >" + rulesArray[i][0] + "</a></td><td width='26%' class='Standard_Font' valign='top' align='right' bgcolor=" + bg + ">" + (months[rulesArray[i][2].getMonth()] + " " + rulesArray[i][2].getDate() + ", " + rulesArray[i][2].getFullYear()) + "</td><td width='12%' class='Standard_Font' align='right' valign='top' bgcolor=" + bg + ">" + rulesArray[i][4] + "</td>");
			document.write("</tr>");
			count++;
		}
	}
	if(count == 0)  {
		document.write("<tr>");
		document.write("<td class='Standard_Font'>&nbsp;</td>");
		document.write("</tr>");
	}			
	document.write("</table>");
}

function startUp()  {
	MM_preloadImages('https://www.state.nj.us/corrections/images/footer/rollover/Template_bottom_links_r2_c2_f2.gif','https://www.state.nj.us/corrections/images/footer/rollover/Template_bottom_links_r2_c4_f2.gif','https://www.state.nj.us/corrections/images/footer/rollover/Template_bottom_links_r2_c6_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c1_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c3_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c5_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c7_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c9_f2.gif','https://www.state.nj.us/corrections/images/header/top_nav_rollover/Template_top_nav_NJlist_r1_c11_f2.gif');
}

function getCopyright()  {
	date = new Date();
	document.write(date.getFullYear());
}


//This function controls what to display for the search engine use // tags to comment out a function

function InmateCheck(x)  {
	var JAN = 0;
	var FEB = 1;
	var MAR = 2;
	var APR = 3;
	var MAY = 4;
	var JUN = 5;
	var JUL = 6;
	var AUG = 7;
	var SEP = 8;
	var OCT = 9;
	var NOV = 10;
	var DEC = 11;
	//If search engine is up and running up = "Y"
	//If search engine is down set up = "N"
	//If search engine has scheduled maintainence then set up ="M" and fill in the start and end times
	myDate = new Date();
	today = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate(), myDate.getHours(), myDate.getMinutes());
	//set the start and end times using this method (Time is in Military format, Months start at 0, range 0-11
	//startTime = new Date(<YEAR>,<MONTH>,<DAY>,<HOUR>,<MINUTES>); 
	startTime = new Date(2009, FEB, 01, 07, 55);
	endTime = new Date(2009, FEB, 01, 12, 05);
	var myHour = endTime.getHours();	
	//var up = "Y" OSE is up
	//var up = "N" OSE is down
	//var up = "M" OSE is undergoing maintenance, start and end times must be set
	
	var up = "M";
	
	if(up.toUpperCase() == "Y")  {
		goodLink(x);
	}  else  if(up.toUpperCase() == "M")  {
		if(today >= startTime && today <= endTime)  {
			MaintenanceLink(myHour);
		}  else  {
			goodLink(x);
		}	
	}  else  {
		badLink();
	}	
}

function badLink()  {
	alert("We apologize for the inconvenience:\n\nThe DOC Offender Search Engine is temporarily unavailable.\nPlease try again later.\n\nThank You,\nNJDOC");
}

function MaintenanceLink(myHour)  {
	var timeSuffix = "AM";
	var myMin = "";
	if(endTime.getMinutes() < 10) {
		myMin = "0" + endTime.getMinutes();
	}  else  {
		myMin = endTime.getMinutes();
	}
	if(myHour > 12) {
		myHour = myHour - 12;
		timeSuffix = "PM";
	}
	alert("We apologize for the inconvenience:\n\nThe DOC Offender Search Engine is undergoing maintenance at this time.\nIt will remain inactive until " + (endTime.getMonth()+1) + "/" + endTime.getDate() + "/" + endTime.getYear() + " at " + myHour + ":" + myMin + " " + timeSuffix + ".\n\nPlease try again at that time.\n\nThank You,\nNJDOC");
}

function goodLink(x)  {
	if(x =="I")  {
		window.location="https://www6.state.nj.us/DOC_Inmate/inmatefinder?i=I";
		/*
		Change made 8-18-04
		This is the old URL
		window.location="https://www4.state.nj.us/NASApp/DOC_InmateSearchEngine/inmatefinder?i=I";
		*/
	}  else if(x == "E")  {
		window.location="https://www6.state.nj.us/DOC_Inmate/inmatefinder?i=E";
		/*
		Change made 8-18-04
		This is the old URL
		window.location="https://www4.state.nj.us/NASApp/DOC_InmateSearchEngine/inmatefinder?i=E";
		*/
	}  else if(x == "C")  {
		window.location="https://www6.state.nj.us/DOC_Inmate/inmatefinder?i=C";
		/*
		Change made 8-18-04
		This is the old URL
		window.location="https://www4.state.nj.us/NASApp/DOC_InmateSearchEngine/inmatefinder?i=C";
		*/
	}
}

//fw menu stuff

function MM_displayStatusMsg(msgStr)  { //v3.0
	status=msgStr; document.MM_returnValue = true;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}