function getEscapeAlert(id)  {
	//if(id != getCookie(id))  {
		//setCookie(id, id);
		wid = 440;
		hg = 400;
		var newwindow;
		var x = (screen.availWidth - wid)/2;
		var y = (screen.availHeight - hg)/2;
		var title = "Escape Alert";
		if (newwindow && !newwindow.closed)  {
			newwindow.focus(); 
			newwindow.document.clear();
		}  else  { 
			//newwindow=window.open('http://vega.oit.state.nj.us/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			//Below is a local test location
			//newwindow=window.open('http://10.15.14.116/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			newwindow=window.open('https://www6.state.nj.us/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			//newwindow.moveTo(x,y);
			//newwindow.document.close();
		}
	//}
}

/*function getEscapeAlert1(id)  {
	//if(id != getCookie(id))  {
		//setCookie(id, id);
		wid = 440;
		hg = 400;
		var newwindow;
		var x = (screen.availWidth - wid)/2;
		var y = (screen.availHeight - hg)/2;
		var title = "Escape Alert";
		if (newwindow && !newwindow.closed)  {
			newwindow.focus(); 
			newwindow.document.clear();
		}  else  { 
			//newwindow=window.open('http://vega.oit.state.nj.us/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			/* Below is a local test location 
			//newwindow=window.open('http://10.15.14.116/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			newwindow=window.open('http://vega.oit.state.nj.us/DOC_Inmate/escapeAlert.jsp?z='+ id,id,'width=' + wid + ', height=' + hg + ',resizable=0, scrollbars=1');
			newwindow.moveTo(x,y);
			newwindow.document.close();
		}
	//}
}*/

/*function getEscapeAlert()  {
	wid = 350;
	hg = 350;
	var newwindow;
	var x = (screen.availWidth - wid)/2;
	var y = (screen.availHeight - hg)/2;
	var title = "Escape Alert";
	if (newwindow && !newwindow.closed)  {
		newwindow.focus(); 
		newwindow.document.clear();
	}  else  { 
		newwindow=window.open('escapesAlert.html','EscapeAlert','width= ' + wid + ', height=' + hg + ',resizable=0');
		//newwindow=window.open("!work_in_progress/alert/mockpage.html","EscapeAlert",'width= ' + wid + ', height=' + hg + ', resizable=0');
		newwindow.moveTo(x,y);
		newwindow.document.close();
	}		
}  */

//            *********************

function getCookie(name) {
    var c = document.cookie;
    var index = c.indexOf(name + "=");
    if (index == -1) {
		return null;
	}  else  {
    	index = c.indexOf("=", index) + 1;
    	var endstr = c.indexOf(";", index);
    	if (endstr == -1) endstr = c.length;
    	return unescape(c.substring(index, endstr));
	}
}

function setCookie(name, value) {
	document.cookie=name + "=" + escape(value);
}

//         **************************

function EscapeMessage()  {
	opener.location = "https://www4.state.nj.us/NASApp/DOC_InmateSearchEngine/inmatefinder?i=E";
	window.close();
}