function setMail(obj,sendTo,email,subject,message)
 {this.obj = obj;

  this.sendTo = ""
  if (sendTo == "") {this.sendTo = "SzG"}
  if (sendTo.substr(0,3)=="SzG") {this.sendTo+="csiripcsirip@gmail.com"}
    else {this.sendTo+="csiripcsirip@gmail.com"}
  if (sendTo.indexOf("SzG",3)>1) {this.sendTo+=",csiripcsirip@gmail.com"}
  if (this.sendTo == '') {alert("Send To?"); return false;}

  this.mail="mailto:" + this.sendTo + "?subject=";
  if (subject!=null && subject!="") {this.mail+=subject}
    else if (window.document.title!=null) {this.mail+=window.document.title}
    else {this.mail+="Pax&nbsp;Note"}
  if (message!=null && message!="") {this.mail+="&body=e-mail: " + email + "\r\n" + message};

  if (this.obj.nodeName.toUpperCase()=='FORM')
     {if (message == "") {alert("Message?"); return false;}
       else return this.obj.action=this.mail;
     }
    else if (this.obj.nodeName.toUpperCase()=='A') return this.obj.href=this.mail;
    else return this.mail;
 }

function setCnn(where,what)
 {this.cnn=""
  if (where=="home") {this.cnn="http://www.rc.net/toronto/paxromana/"}
   else if (where=="iras") {this.cnn="http://ca.geocities.com/gondolkodo@rogers.com/"}
  return this.cnn+what;
 }

function doPopup(pUrl,pLeft,pTop,pWidth,pHeight,pScroll,pResize) 
{this.winProps = "left="+pLeft+",top="+pTop+",width="+pWidth+",height="+pHeight+",scrollbars="+pScroll+",resizable="+pResize;
 return window.open(pUrl, "preview", this.winProps);
}

function callPopup(parentObj, popupObj, pos)   //pos: top, right, bottom, left
 {if (popupObj==null) {alert("The Popup Object can't be null"); return}
  if (parentObj==null) {alert("The Parent Object can't be null"); return}

  this.timerId=null;
  popupObj.onmouseover = function(){if (this.timerId) clearTimeout(this.timerId);popupObj.style.display='block';};
  popupObj.onmouseout = function(){popupObj.style.display='none'};
  parentObj.onmouseover = function(){if (this.timerId) clearTimeout(this.timerId);popupObj.style.display='block';};
  parentObj.onmouseout = function(){this.timerId=setTimeout(popupObj.onmouseout(), 20)};

  this.x=0;
  this.y=0;
  this.objTrail=parentObj;
  while(this.objTrail)
    {this.x+=this.objTrail.offsetLeft;
     this.y+=this.objTrail.offsetTop;
     this.objTrail=this.objTrail.offsetParent;
    }

  popupObj.style.display='block';
  popupObj.style.left = this.x + ((pos=="right")?parentObj.offsetWidth:(pos=="left")?(-popupObj.offsetWidth):0) + "px";
  popupObj.style.top = this.y + ((pos=="bottom")?parentObj.offsetHeight:(pos=="top")?(-popupObj.offsetHeight):0) + "px";
  popupObj.style.width = popupObj.offsetWidth + "px";
  popupObj.style.height = popupObj.offsetHeight + "px";
 }

