function manipurl( hp ) {//remove icons for search scoresfor ( i = 0; i < document.images.length; i++ ) {	if ( document.images[i].src.match( /\/icons\/vwicnsr[1-7]\.gif$/i ) ) {		document.images[i].width = '0' } }var t = location.href.match( /\.nsf\//i )				//set internal regexp variablesvar s = RegExp.rightContext						//get the part of the url to the right of the databasevar dburl = RegExp.leftContext	 + '.nsf/'			//get the url up to and including the database//var e = /&a=(PL|AP|LG|SL|HE)\b/i				//set pattern to match for areavar e = /(^SFC|^CA|^L)\b/i							//set pattern to match for areavar passed = e.exec( s )								//check if area parameter was passed in urlvar area = ( passed == null ) ? '' : passed[0]	//get the parameter if it was passedt = dburl.match( /^http:\/\/[a-z0-9_\-\.]*/i )		//set internal regexp variablesvar b = RegExp.lastMatch							//get the url up to and including the domainvar d = ''													//initialize variablesvar l = ''var a = ''var r = ''var c = ''var f = ''var o=(document.getElementById('outstat').value=="Down")  //if there is an outageif (o) {	var p=new RegExp("("+document.getElementById('outpatt').value+")","i")}	//set regexp patternfor ( i = 0; i < document.links.length; i++ ) {					//for each link on the page	l = document.links[i].href											//set variable for simplicity	if ( !l.match( /^mailto:/i ) ) {										//skip mailto: links			passed = e.exec( l )											//check if the link has an area parameter		a = ( passed == null ) ? area : passed[0]				//give precedence to parameter in link, if any		if ( passed != null ) {											//if the link has an area parameter			l = RegExp.leftContext + RegExp.rightContext }	//extract the parameter for later re-insertion		t = l.match( /^[a-z]*(:\/\/)?[a-z0-9_\-\.]*/i )					//set internal regexp variables		d = RegExp.lastMatch										//get the protocol and domain		r = RegExp.rightContext										//get everything to the right of the domain					//if the link is to an external site to be placed in a frame		if ( b != d && 																		//not the current server			!d.match( /(hesc\.com|hesc\.org|hesc\.state\.ny\.us|tapweb\.org)$/i ) && //not a HESC domain			!d.match( /nygearup\.org$/i ) &&										//not GEARUP			!d.match( /(www\.ny\.gov)$/i ) && 										//not in the State banner			!d.match( /(mappingyourfuture\.org|mapping-your-future\.org)$/i ) && 		//not Mapping Your Future			!d.match( /(hescmarketplace\.org)$/i ) && 						//not Market Place			!d.match( /(startheregetthere\.org)$/i ) && 							//not Start Here Get There			!d.match( /nymentor\.(com|org|edu)$/i ) ) {						//not NYMENTOR			//build the url for links to external sites that are to be placed in a frame			if ( a != null ) {													//if section exists, create parameter for external frame				a = "&a=" + a}//			document.links[i].href = dburl + 'ExternalPage?OpenFrameset' + a + '&u=' + l.split("&").join("%26") 			document.links[i].target="ExternalPage"; 		}		else if ( b!=d ) {							//if the link is to an external site not to be placed in a frame			if (o) {									//if there is an outage				if ( p.test(l) ) {						//if the link matches the pattern of those affected by the outage					document.links[i].onclick=function(){ return outage();} }	//take appropriate action					}//			this is where mainframe outage changes happen//			if ( d.match( /hesc\.org$/i ) ) {//				document.links[i].href = dburl + '0/D8CC97ACB2B84B2B85256EBB00677E8A?OpenDocument' + a }			}		else {			if ( hp ) {	 //adjust pattern to compensate for lack of a view on the home page				t = r.match( /^[a-z0-9%_\-\+\/]*\.nsf\/[a-f0-9]{32}\b/i ) }			else {				t = r.match( /^[a-z0-9%_\-\+\/]*\.nsf\/[a-z0-9%_\-\+]*\/[a-f0-9]{32}\b/i ) }			if ( t ) {																		//if the link is to a Domino doc				f = RegExp.lastMatch												//get up to and including doc unid 				c = RegExp.rightContext											//get everything after doc unid				l = dburl + '0' + f.substring( f.length - 33, f.length )		//force view to default				if ( c.match( /^\/\$file\//i ) ) {												//if the link is to an attachment					document.links[i].href = l + c }										//leave it alone				else if ( c.match( /^(\?|!)[a-z]{4,}\b/i ) ) {								//if link already has a command					//add area parameter back and move any anchor link to the end fo the url					document.links[i].href = l + RegExp.lastMatch + a + RegExp.rightContext }				else {																			//insert url command					document.links[i].href = l + "?OpenDocument" + a + c }	//add area parameter back				} //if the link is to a Domino doc			}	} //skip mailto: links} //for each link on the page} //manipurlfunction outage() {n=new Date()																				// nows=new Date(document.getElementById('outbeg').value)				// Outage start date and timevar expired=false																		// Outage expiration is false by defaultif (document.getElementById('outint').value=="Specific time") {		// if restore links at specific time	restore=new Date(document.getElementById('outrest').value)	// automatic restore date and time	if (n>=restore) {																		// if automatic restoration time has past		expired=true																		// set Outage expiration to true	}}if ((n>=s) && (expired==false)) {													//if during an outage that has not yet expired	if (document.getElementById('outtry').value=="Specific time") {	//try back at specific time		f=new Date(document.getElementById('outend').value)			//end date and time		if (n>=f) {																			//expected end has passed			w="in an hour"}		else {			w=f.getHours()			m="0"+f.getMinutes()			a=(w<12)?"A":"P"			if (w==0) {				w=12}			else if (w>12) {				w-=12}			w="after "+w+":"+m.substring(m.length-2,m.length)+" "+a+"M on "+(f.getMonth()+1)+"/"+f.getDate()+"/"+f.getFullYear()}		}	else {																		//try back later		w="later"}	alert(document.getElementById('outmsg').value+"  Please try again "+w+".")	//pop message	location.reload(true)													//refresh to make sure info is current	return false}																//do not follow linkelse {																			//if not during an outage	return true}																//continue on to link}function stdurl( u ) {//set internal regexp variablesvar t = u.match( /^[a-z]*(:\/\/)?[a-z0-9_\-\.]*[a-z0-9%_\-\+\/]*\.nsf\/[a-z0-9%_\-\+]*\/[a-f0-9]{32}\b/i )var m = RegExp.lastMatch											//get up to and including doc unidvar p = RegExp.rightContext										//get everything after doc unidif ( !p.match( /^(\?|!)[a-z]{4,}\b/i ) ) {								//if url does not have a command	u = m + "?OpenDocument" + RegExp.rightContext }	//insert url commandreturn u }
