//  unobtrusive popupwindow script.// USAGE: parses document for links with TARGET attributes, if it finds them, it looks for the string popup at the start of the target, then parses name/value pairs at the end of the string// the syntax is like this <a href="whatev.html" target="popup-height|400-width|500-scrollbars-etc">text</a>window.onload = function () {		if(!window.opener) {			var as,i,popfun			var windowAttributes = new Array();			var attList = new Array(); // holds name/value pairs for later			as=document.getElementsByTagName('a');			for (i=0;i<as.length;i++) {				if(as[i].target) {					// parse target for info on popup window					if (as[i].target.substring(0,5) == 'popup') { // assume a syntax of popup-height|400-width|500-scrollbars-etc						pairs = as[i].target.substring(5,(as[i].target.length)).split("-");						for (ii=1;ii<pairs.length;ii++) {							if (pairs[ii].split("|").length == 2) {								attList[attList.length] = pairs[ii].split("|")[0] + '=' + pairs[ii].split("|")[1];							} else {								attList[attList.length] = pairs[ii];							}						}												windowAttributes[as[i].href] = attList.join(",");						attList.length = 0;						popfun=function() { 								window.open(this.href,'',windowAttributes[this.href]);return false; 							};						as[i].onclick=popfun;						as[i].onkeypress=popfun;					}				}			}		}	}