function setMail(obj,sendTo,subject,type)
 {addresse="mailto:"
  if (sendTo.substr(0,3)=="GGy") {addresse+="julius.gaspar@utoronto.ca"}
    else if (sendTo.substr(0,3)=="SzG") {addresse+="gondolkodo@rogers.com"}
    else {addresse+="gondolkodo@rogers.com"}
  if (sendTo.indexOf("GGy",3)>0) {addresse+=",julius.gaspar@utoronto.ca"}
  if (sendTo.indexOf("SzG",3)>0) {addresse+=",gondolkodo@rogers.com"}
  addresse+="?subject=";
  if (subject!=null && subject!="") {addresse+=subject}
    else if (window.document.title!=null) {addresse+=window.document.title}
    else {addresse+="Pax&nbsp;hozzászólás"}

  if (type=='form') return obj.action=addresse;
   else return obj.href=addresse;
 }

function setCnn(where,what)
 {if (where=="home") {cnn="http://www.rc.net/toronto/paxromana/"}
   else if (where=="iras") {cnn="http://ca.geocities.com/gondolkodo@rogers.com/"}
   else {cnn=""}
  return cnn+what;
 }

function doPopup(pUrl,pLeft,pTop,pWidth,pHeight,pScroll,pResize) 
{winProps = "left="+pLeft+",top="+pTop+",width="+pWidth+",height="+pHeight+",scrollbars="+pScroll+",resizable="+pResize;
 preview = window.open(pUrl, "preview", winProps);
}

function callPopup(parentTag, popupId, pos)   //pos: top, right, bottom, left
 {timerId=null;
  if (popupId==null) {alert("The popup Id can't be null"); return}
  if (!window.pop) window.pop = new Array();
  pop[popupId]=document.getElementById(popupId);
  if (pop[popupId]==null) {alert(popupId+"  not exist in parent html"); return}
  pop[popupId].onmouseover = function(){if (timerId) clearTimeout(timerId);eval("pop['"+popupId+"']").style.display='block';};
  pop[popupId].onmouseout = function(){eval("pop['"+popupId+"']").style.display='none'};
  parentTag.onmouseover = function(){if (timerId) clearTimeout(timerId);eval("pop['"+popupId+"']").style.display='block';};
  parentTag.onmouseout = function(){timerId=setTimeout("pop['"+popupId+"'].style.display='none'", 20)};

  x=0;
  y=0;
  var objTrail=parentTag;
  while(objTrail)
    {x+=objTrail.offsetLeft;
     y+=objTrail.offsetTop;
     objTrail=objTrail.offsetParent;
    }

  pop[popupId].style.display='block';
  pop[popupId].style.left = x + ((pos=="right")?parentTag.offsetWidth:(pos=="left")?(-pop[popupId].offsetWidth):0) + "px";
  pop[popupId].style.top = y + ((pos=="bottom")?parentTag.offsetHeight:(pos=="top")?(-pop[popupId].offsetHeight):0) + "px";
  pop[popupId].style.width = pop[popupId].offsetWidth;
  pop[popupId].style.height = pop[popupId].offsetHeight;
 }

