// main javascript functions for OSterely web site



var isNav, isIE
var coll = ""
var styleObj = ""
if (parseInt(navigator.appVersion) >= 4) {
  if (navigator.appName == "Netscape") {
    isNav = true
  } else {
    isIE = true
    coll = "all."
    styleObj = ".style"
  }
}

// Convert object name string or object reference
// into a valid object reference
function getObject(obj) {
  var theObj
  if (typeof obj == "string") {
    theObj = eval("document." + coll + obj + styleObj)
  } else {
    theObj = obj
  }
  return theObj
}

// Positioning an object at a specific pixel coordinate
function shiftTo(obj, x, y) {
  var theObj = getObject(obj)
  if (isNav) {
    theObj.moveTo(x,y)
  } else {
    theObj.pixelLeft = x
    theObj.pixelTop = y
  }
}

// Moving an object by x and/or y pixels
function shiftBy(obj, deltaX, deltaY) {
  var theObj = getObject(obj)
  if (isNav) {
    theObj.moveBy(deltaX, deltaY)
  } else {
    theObj.pixelLeft += deltaX
    theObj.pixelTop += deltaY
  }
}

// Setting the z-order of an object
function setZIndex(obj, zOrder) {
  var theObj = getObject(obj)
  theObj.zIndex = zOrder
}

// Setting the background color of an object
function setBGColor(obj, color) {
  var theObj = getObject(obj)
  if (isNav) {
    theObj.bgColor = color
  } else {
    theObj.backgroundColor = color
  }
}

// Setting the visibility of an object to visible
function show(obj) {
  var theObj = getObject(obj)
  theObj.visibility = "visible"
}

// Setting the visibility of an object to hidden
function hide(obj) {
  var theObj = getObject(obj)
  theObj.visibility = "hidden"
}

// Retrieving the x coordinate of a positionable object
function getObjectLeft(obj)  {
  var theObj = getObject(obj)
  if (isNav) {
    return theObj.left
  } else {
    return theObj.pixelLeft
  }
}

// Retrieving the y coordinate of a positionable object
function getObjectTop(obj)  {
  var theObj = getObject(obj)
  if (isNav) {
    return theObj.top
  } else {
    return theObj.pixelTop
  }
}

// Utility function returns the available content width space in browser window
function getInsideWindowWidth(){
  if (isNav) {
    return window.innerWidth
  } else {
    return document.body.clientWidth
  }
}
// Utility function returns the available content height space in browser window
function getInsideWindowHeight() {
  if (isNav) {
    return window.innerHeight
  } else {
    return document.body.clientHeight
  }
}


// mta stuff
function spacer(x,y){
  document.write("<img src='images/5x5.gif' width=" + x + " height=" + y + ">");
}
function spacer2(x,y){
  document.write("<img src='../images/5x5.gif' width=" + x + " height=" + y + ">");
}





/* *********************************************************** */
// MTA news stuff



// function to insert and scale an image
// arguments: url of image. hsight, width, scalefactor


function doimage(url,h,w,sf){
    var height=Math.round(h*sf);
    var width=Math.round(w*sf);
    document.write("<center><img src='" + url + "' height=" + height + " width=" + width + "></center>");
  }





// function to insert space
// syntax: spacer(<x space> <y space>)

// arguments are in pixels
// NB if either argument is 0, then this function makes it 1
// as a zero height/width gif doesn't make sense


function spacer(x,y){
  if(x==0)x=1;
  if(y==0)y=1;
  if((x>0) && (y>0))document.write("<img src='images/5x5.gif' width=" + x + " height= " + y + ">");
}



// function tocheck to see if we are in the right frame
// and open the contents of the current page there
// (if we are in inherited frames or the wrong frame)

function checkname(name,url){
  if(self.name!=name){
    location.replace(url);
  }
}


// procs fo allow pages wrongly called outside of frames to reposition themselves

function BreakOutOfFrames(){
  if (window != top) top.location.href = location.href;
}

// declare some arrays so we can force reloading of frames

//var replacearr = new Array();
//var newarr = new Array();


// proc to set things up at the top level

function PrepareTopLevel(){

  // first remove the "?"

  var searchstr=new String();
  var tmparr=new Array();


  if(location.search.indexOf("?")>-1){
    searchstr=location.search.substr(1);
    tmparr=searchstr.split("&");
    var i;
    var j;  // a write index, this need not equal i, as js arrays are sparse

    j=0;
    for(i=0;i<tmparr.length;i++){
      ptr=tmparr[i].indexOf("=");
      if(ptr>-1){
        replacearr[j]=tmparr[i].slice(0,ptr);
        newarr[j]=tmparr[i].slice(ptr+1);
        j++;
      }
    }
    }
  else{
    searchstr="";
  }
}


// proc to force frames, and to reload frames as needed
// this relies on replacearr and newarr being declared
// and PrepareTopLevel() being run at the top level of
// the frameset.

// This works by testing to see if the frame name
// fails to match the name sullped in the "name"
// argument.

// If the path argument is empty then the top level frameset is loaded

// If path is not empty, then it is assumed to be a string
// of the form <framename=fileto replace with>, and when
// the frameset is loaded, that frame gets replaced.

// topurl is the url of the top level frameset relative to this file

function PutInFrames(name, path, topurl){
  if(name.length<1)error("PutInFrames called with no first argument");
  if(topurl.length<1)error("PutInFrames called with no first argument");

//alert("self.name is: [" + self.name + "] name is [" + name + "]");

  if(self.name!=name){
    if(path.indexOf(".htm")>0){
//alert("loading with path, self.name: [" + self.name + "], path: [" + path + "]" );
      top.location.replace(topurl + "?" + path);
      }
    else{
//alert("loading without path");
      top.location.replace(topurl);
    }
    }
  else{
    // now do any re-loading that might be passed through top.replacearr
//alert("seeing if replacement is needed");
    var i;
    var indfound=-1;
    for(i=0;i<top.replacearr.length;i++){
//alert("self.name: " + self.name + " top.replacearr[i]: " + top.replacearr[i]);
      if(self.name==top.replacearr[i])indfound=i;
    }

    if(indfound!=-1){
      var newurl=top.newarr[indfound];
      top.newarr.splice(indfound,1);
      top.replacearr.splice(indfound,1);
//alert("replacing with: + newurl");
      location.replace(newurl);
    }
  }
}


function PreloadImages(time){
  var TimeNow=new Date();
  var time_to_stop=time;
  if(time_to_stop>30)time_to_stop=30;
  var EndTime=TimeNow.getSeconds()+time;

  if(document.images){
    var ImageNames=new Array(
"http://www.campionhouse.org/images/5x5.gif",
"http://www.campionhouse.org/images/ab01.jpg",
"http://www.campionhouse.org/images/ab03.jpg",
"http://www.campionhouse.org/images/ab04.jpg",
"http://www.campionhouse.org/images/ab05.jpg",
"http://www.campionhouse.org/images/ab06.jpg",
"http://www.campionhouse.org/images/ab07.jpg",
"http://www.campionhouse.org/images/ab08.jpg",
"http://www.campionhouse.org/images/ab09.jpg",
"http://www.campionhouse.org/images/ab10.jpg",
"http://www.campionhouse.org/images/about.gif",
"http://www.campionhouse.org/images/circle.gif",
"http://www.campionhouse.org/images/conf.gif",
"http://www.campionhouse.org/images/cont.gif",
"http://www.campionhouse.org/images/cross.jpg",
"http://www.campionhouse.org/images/curves.gif",
"http://www.campionhouse.org/images/emi.gif",
"http://www.campionhouse.org/images/emi.jpg",
"http://www.campionhouse.org/images/j005.jpg",
"http://www.campionhouse.org/images/j19ath.jpg",
"http://www.campionhouse.org/images/j27.jpg",
"http://www.campionhouse.org/images/jrs.gif",
"http://www.campionhouse.org/images/jrslogo.gif",
"http://www.campionhouse.org/images/laym.gif",
"http://www.campionhouse.org/images/links.gif",
"http://www.campionhouse.org/images/livth.gif",
"http://www.campionhouse.org/images/livth.jpg",
"http://www.campionhouse.org/images/livth2a.jpg",
"http://www.campionhouse.org/images/news.gif",
"http://www.campionhouse.org/images/orat.jpg",
"http://www.campionhouse.org/images/retr.gif",
"http://www.campionhouse.org/images/retr.jpg",
"http://www.campionhouse.org/images/ring.gif",
"http://www.campionhouse.org/images/story.gif",
"http://www.campionhouse.org/images/tablet.jpg",
"http://www.campionhouse.org/images/title1.gif",
"http://www.campionhouse.org/images/title2.gif",
"http://www.campionhouse.org/rimg/igday/jpg",
"http://www.campionhouse.org/rimg/040227a/jpg",
"http://www.campionhouse.org/rimg/040130/jpg",
"http://www.campionhouse.org/rimg/040213a/jpg",
"http://www.campionhouse.org/rimg/040213b/jpg",
"http://www.campionhouse.org/rimg/040227b/jpg",
"http://www.campionhouse.org/rimg/040306/jpg",
"http://www.campionhouse.org/rimg/040319a/jpg",
"http://www.campionhouse.org/rimg/040320-1/jpg",
"http://www.campionhouse.org/rimg/040312/jpg",
"http://www.campionhouse.org/rimg/040319b/jpg",
"http://www.campionhouse.org/rimg/040326a/jpg",
"http://www.campionhouse.org/rimg/040320-2/jpg",
"http://www.campionhouse.org/rimg/040320-0/jpg",
"http://www.campionhouse.org/rimg/040322/jpg",
"http://www.campionhouse.org/rimg/040326b/jpg",
"http://www.campionhouse.org/rimg/040402/jpg",
"http://www.campionhouse.org/rimg/040423a/jpg",
"http://www.campionhouse.org/rimg/040423b/jpg",
"http://www.campionhouse.org/rimg/040430/jpg",
"http://www.campionhouse.org/rimg/040514/jpg",
"http://www.campionhouse.org/rimg/040604-1/jpg",
"http://www.campionhouse.org/rimg/040521/jpg",
"http://www.campionhouse.org/rimg/040604-2/jpg",
"http://www.campionhouse.org/rimg/040604-3/jpg",
"http://www.campionhouse.org/rimg/040618a/jpg",
"http://www.campionhouse.org/rimg/040618b/jpg",
"http://www.campionhouse.org/rimg/040618c/jpg",
"http://www.campionhouse.org/rimg/040626/jpg");

    var lim=ImageNames.length;
    var ImgsArr=new Array(lim);

    for(i=0;(i<lim); i++){
      TimeNow=new Date();
      if(TimeNow<EndTime){
        ImgsArr[i]=new Image();
        ImgsArr[i].src=ImageNames[i];
      }
    }
  }
}


// time limits to stop automatic downloading jamming up the browser for ages


function onLoadProc(time){PreloadImages();}

// function to force very soft reloading f pages when browser resizes

function onResizeProc(){window.history.go(0);}


// function to hide email addresses from robots

// create a lookup table

var lookup = new Array();
lookup["Annie"]="retreats";
lookup["Marian"]="college";

var domn="campionhouse.org";
var atstr="@";


function blat(classdesc, str){
  document.write("<A ");
  if(classdesc.length>0){document.write("class=" + classdesc + " ");}
  document.write("href='mailto:" + lookup[str] + atstr + domn +"'>");
  document.write(lookup[str] + atstr + domn + "</a>");
}




// things for header of story page

function Storyheader(){
  var cellmin=120;
  var innerwidth=getInsideWindowWidth();
  var numcells=Math.floor(innerwidth/cellmin);
  var cellcount=1000;
  var cellwid=Math.round(innerwidth/numcells);
  var colours=new Array();
  colours[0]="#ff9966";
  colours[1]="#ffaacc";
  colours[2]="#ffcccc";



// StoryAddCell adds a cell to the table, and (if the flag is 1) adds a
// coloured background
// it is defined inside Storyheader to inherit the formers variables

    function StoryAddCell(str,flag){
      if(cellcount>numcells){cellcount=numcells;}
      if (cellcount==numcells){
        document.write("<tr valign='middle'>");
        if((numcells==3)||(numcells==6)||(numcells==9)){colind=(colind+1)%3;}
        cellcount=0;
      }
      document.write("<td width=" + cellwid);
      if(flag==1){
        document.write(" bgcolor=" + colours[colind]);
        colind=(colind+1)%3;
        }
      else{
        document.write(" bgcolor=#ffccff" + colours[colind]);
      }
      document.write(">");

      cellcount=cellcount+1;
      document.write("<center><a class=lmmenu href='xxx.htm'>")
      document.write(str);
      document.write("</a></center>");
      document.write("</td>");
    }

  var colind=0;
  document.write("<table width=100% cellpadding=4 cellspacing=0>");
  StoryAddCell("Welcome",0);
  StoryAddCell("My first Ignatian&nbsp;day",1);
  StoryAddCell("Called to lay&nbsp;ministry",1);
  StoryAddCell("Leaving a&nbsp;seminary",1);
  StoryAddCell("An art retreat",1);
  StoryAddCell("Changing direction",1);
  StoryAddCell("Called to priesthood",1);
  StoryAddCell("Brokenness and wholeness",1);
  StoryAddCell("Called to marriage",1);
  StoryAddCell("Finding the next&nbsp;step",1);
  StoryAddCell("Walking with God in a time of happiness",1);
  StoryAddCell("Drawing closer to&nbsp;God",1);
  StoryAddCell("Finding God in darkness",1);
  document.write("</table>");
}



// stuff for dynamic repositioning of header stuff on narrow windows
// function to set up sizes for the different menuing options
// normal values are SetUpMenuSizes(8,9,10,11)

function SetUpMenuSizes(menu0size, menu1size, menu2size, menu3size){

document.write("<style>");
document.write("A.menu0:link, A.menu0:active, A.menu0:visited{");
document.write("color: #990066;");
document.write("text-decoration: none;");
document.write("font-style: normal;");
document.write("font-weight: normal;");
document.write("font-size: " + menu0size + "pt;");
document.write("line-height: 110%;");
document.write("font-family: verdana, sanserif;");
document.write("}");
document.write("a.menu0:hover{color: #9900ff;}");
document.write("");
document.write("");
document.write("A.menu1:link, A.menu1:active, A.menu1:visited{");
document.write("color: #990033;");
document.write("text-decoration: none;");
document.write("font-style: normal;");
document.write("font-weight: bold;");
document.write("font-size: " + menu1size + "pt;");
document.write("line-height: 120%;");
document.write("font-family: verdana, sanserif;");
document.write("}");
document.write("a.menu1:hover{color: #9900ff;}");
document.write("");
document.write("");
document.write("A.menu2:link, A.menu2:active, A.menu2:visited{");
document.write("color: #990066;");
document.write("text-decoration: none;");
document.write("font-style: normal;");
document.write("font-weight: bold;");
document.write("font-size: " + menu2size + "pt;");
document.write("line-height: 120%;");
document.write("font-family: verdana, sanserif;");
document.write("}");
document.write("a.menu2:hover{color: #9900ff;}");
document.write("");
document.write("");
document.write("A.menu3:link, A.menu3:active, A.menu3:visited{");
document.write("color: #990066;");
document.write("text-decoration: none;");
document.write("font-style: normal;");
document.write("font-weight: bold;");
document.write("font-size: " + menu3size + "pt;");
document.write("line-height: 120%;");
document.write("font-family: verdana, sanserif;");
document.write("}");
document.write("a.menu3:hover{color: #9900ff;}");
document.write("</style>");
document.write("");
}




// first create three arrays, to hold header strings, x and y coordinates
var Header_str=new Array(13);
var Header_x=new Array(13);
var Header_y=new Array(13);

// initialise strings

  Header_str["retr"]="<a class=menu3 href='retr.htm' target='_top'>Spirituality&nbsp;&amp;&nbsp;Retreats</a>";
  Header_str["laym"]="<a class=menu3 href='laym.htm' target='_top'>Lay&nbsp;ministry&nbsp;courses</a>";
  Header_str["about"]="<a class=menu2 href='about.htm' target='_top'>About</a>";
  Header_str["home"]="<a class=menu3 href='index.htm' target='_top'>Home</a>";
//  Header_str["deac"]="<a class=menu1 href='deac.htm' target='_top'>Courses&nbsp;for&nbsp;deacons</a>";
  Header_str["news"]="<a class=menu2 href='news.htm' target='_top'>News</a>";
//  Header_str["talk"]="<a class=menu1 href='talks.htm' target='_top'>Evening&nbsp;talks</a>";
//  Header_str["story"]="<a class=menu3 href='story.htm' target='_top'>Stories</a>";
  Header_str["conf"]="<a class=menu1 href='conf.htm' target='_top'>Conference facilities</a>";
  Header_str["emi"]="<a class=menu1 href='emi.htm' target='_top'>Emi&#146;s&nbsp;page</a>";
  Header_str["jrs"]="<a class=menu3 href='jrs.htm' target='_top'>Jesuit&nbsp;Refugee&nbsp;Service</a>";
  Header_str["links"]="<a class=menu1 href='links.htm' target='_top'>Links</a>";
  Header_str["livth"]="<a class=menu3 href='livth.htm' target='_top'><i>Living&nbsp;Theology</i>&nbsp;Summer&nbsp;course</a>";
  Header_str["cont"]="<a class=menu1 href='cont.htm' target='_top'>Contact</a>";


function header(){
  var paintwid;
  var initialised=0;
  var fixedspace=240; // fixed space -- width of title, plus margins, plus spacer
  var sparespace=getInsideWindowWidth()-fixedspace; // space for paint.gif

  if(sparespace>600){ // initialisers for 600 pixel paint.gif 
    paintwid=600;
    //set up menu sizes
    SetUpMenuSizes(8,9,10,11)
    
    // initialise x coordinates
    Header_x["retr"]=120;   Header_x["laym"]=390;   Header_x["about"]=210;
    Header_x["home"]=12;
    // Header_x["deac"]=420;
    Header_x["news"]=120;
    //Header_x["talk"]=190;
    //Header_x["story"]=320;
    Header_x["conf"]=320;
    Header_x["emi"]=9;      Header_x["jrs"]=40;     Header_x["links"]=85;
    Header_x["livth"]=290;  Header_x["cont"]=500;
    
    // initialise y coordinates
    Header_y["retr"]=0;     Header_y["laym"]=12;    Header_y["about"]=34;
    Header_y["home"]=20;
    // Header_y["deac"]=40;
    Header_y["news"]=40;
    //Header_y["talk"]=72;
    //Header_y["story"]=52;
    Header_y["conf"]=48;
    Header_y["emi"]=55;     Header_y["jrs"]=98;     Header_y["links"]=76;
    Header_y["livth"]=110;  Header_y["cont"]=72;
    initialised=1;
  }

  if((sparespace>500)&&(initialised==0)){ // initialisers for 500-600 pixel paint.gif 
    paintwid=500;
    //set up menu sizes
    SetUpMenuSizes(8,9,10,11)

    
    // initialise x coordinates
    Header_x["retr"]=100;   Header_x["laym"]=320;   Header_x["about"]=180;
    Header_x["home"]=11;
    //Header_x["deac"]=348;
    Header_x["news"]=108;
    //Header_x["talk"]=165;
    //Header_x["story"]=268;
    Header_x["conf"]=280;
    Header_x["emi"]=8;      Header_x["jrs"]=26;     Header_x["links"]=76;
    Header_x["livth"]=230;  Header_x["cont"]=440;
    
    // initialise y coordinates
    Header_y["retr"]=0;     Header_y["laym"]=12;    Header_y["about"]=34;
    Header_y["home"]=20;
    // Header_y["deac"]=40;
    Header_y["news"]=40;
    //Header_y["talk"]=72;
    //Header_y["story"]=52;
    Header_y["conf"]=49;
    Header_y["emi"]=55;     Header_y["jrs"]=98;     Header_y["links"]=76;
    Header_y["livth"]=115;  Header_y["cont"]=72;
    initialised=1;
  }

  if((sparespace>400)&&(initialised==0)){ // initialisers for 400-500 pixel paint.gif 
    paintwid=400;
    //set up menu sizes
    SetUpMenuSizes(8,9,10,11)

    // initialise x coordinates
    Header_x["retr"]=40;   Header_x["laym"]=220;   Header_x["about"]=280;
    Header_x["home"]=12;
    // Header_x["deac"]=270;
    Header_x["news"]=120;
    //Header_x["talk"]=160;
    //Header_x["story"]=320;
    Header_x["conf"]=244;
    Header_x["emi"]=9;      Header_x["jrs"]=20;     Header_x["links"]=85;
    Header_x["livth"]=130;  Header_x["cont"]=500;
    
    // initialise y coordinates
    Header_y["retr"]=0;     Header_y["laym"]=22;    Header_y["about"]=44;
    Header_y["home"]=20;
    // Header_y["deac"]=50;
    Header_y["news"]=40;
    //Header_y["talk"]=68;
    //Header_y["story"]=72;
    Header_y["conf"]=92;
    Header_y["emi"]=55;     Header_y["jrs"]=94;     Header_y["links"]=76;
    Header_y["livth"]=118;  Header_y["cont"]=72;
    initialised=1;
  }


  if((sparespace>300)&&(initialised==0)){ // initialisers for 400-500 pixel paint.gif 
    paintwid=300;
    //set up menu sizes
    SetUpMenuSizes(8,9,10,11)

    
    // initialise x coordinates
    Header_x["retr"]=0;
    Header_x["home"]=0; Header_x["about"]=64;
    //Header_x["talk"]=0;
    Header_x["emi"]=0;
    Header_x["conf"]=100;
    Header_x["livth"]=0;
    Header_x["laym"]=0;
    Header_x["jrs"]=0;

    //Header_x["story"]=240;
    //Header_x["deac"]=160;
    Header_x["cont"]=250;
    Header_x["news"]=240;
    Header_x["links"]=240;



    // initialise y coordinates


    Header_y["retr"]=0;
    Header_y["home"]=20; Header_y["about"]=23;
    //Header_y["talk"]=40;
    Header_y["emi"]=60;
    Header_y["conf"]=60;
    Header_y["livth"]=80;
    Header_y["laym"]=100;
    Header_y["jrs"]=120;

    //Header_y["story"]=0;
    //Header_y["deac"]=20;
    Header_y["cont"]=40;
    Header_y["news"]=100;
    Header_y["links"]=120;


    initialised=1;
  }



  if(sparespace>300){
    //set up menu sizes
    SetUpMenuSizes(7,8,9,10)

    document.write("<div style='position: relative; top:0; left:0;'>");
    document.write("<img src='images/paint.gif' width=" + paintwid + " height=140>");

    for(prop in Header_x){
      document.write("<span style='position: absolute; left:" + Header_x[prop] + ";  top:" +Header_y[prop] + ";'>");
      document.write(Header_str[prop]);
      document.write("</span>");
    }

    document.write("</div>");
    }
  else{
    document.write("<table width=100% cellpadding=3>");
    document.write("<tr><Td><center><a class=menu0 href='retr.htm' target='_top'>Spirituality&nbsp;&amp;&nbsp;Retreats</a></center></td>");
    document.write("<Td><center><a class=menu0 href='laym.htm' target='_top'>Lay&nbsp;ministry&nbsp;courses</a></center></td>");
    document.write("<tr><Td><center><a class=menu0 href='about.htm' target='_top'>About</a></center></td>");
    document.write("<Td><center><a class=menu0 href='index.htm' target='_top'>Home</a></center></td>");
  //  document.write("<tr><Td><center><a class=menu0 href='deac.htm' target='_top'>Courses&nbsp;for&nbsp;deacons</a></center></td>");
    document.write("<Td><center><a class=menu0 href='news.htm' target='_top'>News</a></center></td>");
  //  document.write("<tr><Td><center><a class=menu0 href='talks.htm' target='_top'>Evening&nbsp;talks</a></center></td>");
  //  document.write("<Td><center><a class=menu0 href='story.htm' target='_top'>Stories</a></center></td>");
    document.write("<tr><Td><center><a class=menu0 href='conf.htm' target='_top'>Conference facilities</a></center></td>");
    document.write("<Td><center><a class=menu0 href='emi.htm' target='_top'>Emi&#146;s&nbsp;page</a></center></td>");
    document.write("<tr><Td><center><a class=menu0 href='jrs.htm' target='_top'>Jesuit&nbsp;Refugee&nbsp;Service</a></center></td>");
    document.write("<Td><center><a class=menu0 href='links.htm' target='_top'>Links</a></center></td>");
    document.write("<tr><Td><center><a class=menu0 href='livth.htm' target='_top'><i>Living&nbsp;Theology</i> Summer&nbsp;course</a></center></td>");
    document.write("<Td><center><a class=menu0 href='cont.htm' target='_top'>Contact</a></center></td> ");
    document.write("</table>");
  }
}


/// divider for livinf theology page (on right)

function livthdivider(){
  var wid=Math.round(getInsideWindowWidth()*0.3);
  document.write("<br clear=left>");
  document.write("<img src='../images/5x5.gif' align=right height=2 width=" + wid + " style='background-color: ccccff;'>");
  document.write("<br>");
}

/// divider for living theology page (om left)

function livthdividerl(){
  var wid=Math.round(getInsideWindowWidth()*0.3);
  document.write("<br clear=left>");
  document.write("<img src='../images/5x5.gif' height=2 width=" + wid + " style='background-color: ccccff;'>");
  document.write("<br>");
}



/// divider for retreats: syntax retrdivider(<width of image><proportion of rest>)

function retrdividerl(pwid,propn){
  if(arguments.length!=2)alert("Insufficient arguments to retrdividerl");

  var wid=getInsideWindowWidth()-pwid;
  wid=Math.round(wid*propn);
  document.write("<div style='position: relative; left: -6px;'>");
  document.write("<img src='../images/5x5.gif' height=2 width=" + wid + " style='background-color: ccccff;'>");
  document.write("</div>");
}











// function to open window for images from conference page

function newconfwin(url,width,height,title){
  var confwin;
  var openwidth=width+40;
  var openheight=height+100;
  var args="height=" + openheight + ",width=" + openwidth + ",screenX=0,screenY=0,location=no,left=0,top=0,resizable=yes,status=no,toolbar=no,scrollbars=yes";
  confwin=open(url,"confwin",args);
  confwin.focus();
  confwin.document.write("<html>");
  confwin.document.write("<head><link rel=stylesheet href='../main.css' type='text/css'></head>");
  confwin.document.write("<body>");
  confwin.document.write("<center>");
  confwin.document.write("<img src='" + url + "' height = " + height + " width=" + width + ">");
  confwin.document.write("<p>");
  confwin.document.write("<span class=ssbfsm>" + title + "</span>");
  confwin.document.write("<p><a href='javascript:self.close();'>click here to close</a>");
  confwin.document.write("</body>
</html>