function attachPopups(){
if(document.getElementsByTagName){
anchors=document.getElementsByTagName("a");
popups=new Array();
for(i=0;i<anchors.length;i++){
if (anchors[i].id.match(/popup_/)||anchors[i].className.match(/popup_/)){
popup=new popupControl(anchors[i]);
popups[popup.id]=popup;
Event.observe(anchors[i],"click",popupOnClick);
}
}
}
}
function popupOnClick(e){
var _2=Event.element(e);
id=_2.getAttribute("id");
if(!id){
_2=_2.parentNode;
id=_2.getAttribute("id");
}
result=popups[id].throwPop();
if(result){
Event.stop(e);
}
}
function popupControl(_3){
this.id=_3.getAttribute("id");
var _4=_3.href.split("?",2);
this.popupHref=_3.href;
if(!isUndefined(_4[1])){
_4[1]=_4[1].replace(/#.*/,"");
var _5=_4[1].split("&");
for(var i=0;i<_5.length;i++){
var _7=_5[i].split("=");
var _8=_7[0].toLowerCase();
var _9=_7[1];
switch(_8){
case "w":
this.width=_9;
break;
case "h":
this.height=_9;
break;
case "wname":
this.name=_9;
break;
case "tbar":
this.toolBar=_9;
break;
case "mbar":
this.menuBar=_9;
break;
case "sbar":
this.scrollBar=_9;
break;
case "resize":
this.resize=_9;
break;
case "lbar":
this.location=_9;
break;
case "dirs":
this.directories=_9;
break;
case "status":
this.status=_9;
break;
}
}
if(isUndefined(this.width)){
this.width=250;
}
if(isUndefined(this.height)){
this.height=350;
}
if(isUndefined(this.name)){
this.name="popup";
}
if(isUndefined(this.toolBar)){
this.toolBar="no";
}
if(isUndefined(this.menuBar)){
this.menuBar="no";
}
if(isUndefined(this.scrollBar)){
this.scrollBar="auto";
}
if(isUndefined(this.resize)){
this.resize="auto";
}
if(isUndefined(this.location)){
this.location="no";
}
if(isUndefined(this.directories)){
this.directories="no";
}
if(isUndefined(this.status)){
this.status="no";
}
}
this.isUndefined=isUndefined;
this.throwPop=throwPop;
}
function throwPop(){
window.name="popupSource";
newWin=window.open(this.popupHref,this.name,config="height="+this.height+", width="+this.width+", toolbar="+this.toolBar+", menubar= "+this.menuBar+", scrollbars= "+this.scrollBar+", resizable="+this.resize+", location="+this.location+", directories="+this.directories+", status="+this.status);
return newWin;
}
Event.observe(window,"load",attachPopups);

