window.onload = preparePopups;

function preparePopups() {
	var links = document.getElementsByTagName("a");
	for(i=0;i<links.length;i++) {
		if(links[i].getAttribute("rel")) {
			if(links[i].getAttribute("rel").indexOf("popup") > -1){
				links[i].onclick = function () {
					if(this.getAttribute("rel").indexOf("@")==5) {
						features = this.getAttribute("rel").substring(6);
						// alert(features);
						window.open(this.getAttribute("href"),null,features);
					} else {
						window.open(this.getAttribute("href"));
					}
					return false;
				}
			}
		}
	}
}