//Choir
var display_width=640//initialize at minimum


function initialize(rightmargin){
        repositionLeft("menu",0,106)
        repositionLeft("banner",0,display_width)
        if(document.getElementById("crest2")){document.getElementById("crest2").style.width=110;}
        if(document.getElementById("bannertext")){document.getElementById("bannertext").style.width=360;}
        if(document.getElementById("shadow")){document.getElementById("shadow").style.width=360;}
        
        repositionLeft("bannertext",Math.round(display_width/2-getWidth("bannertext")/2),getWidth("bannertext"));
        repositionLeft("shadow",Math.round(display_width/2-getWidth("shadow")/2),getWidth("shadow"));
        repositionLeft("crest2",display_width-getWidth("crest2")-3,getWidth("crest2"));

        repositionLeft("backToTop",display_width-50,20)
        repositionLeft("slide",display_width-50,20)
        repositionLeft("back",display_width*0.9,20)
        
        repositionLeft("maintext",20,display_width-rightmargin)
        repositionLeft("pictures",400,200)
} //eoFn


function repositionLeft(name,objLeft,objWidth){
 page_width=findLivePageWidth()

 display_width=Math.min(page_width, 780)
 
 display_left=Math.round((page_width-display_width)/2)
 display_right=display_width
          
    if (document.getElementById(name)){
                var obj=document.getElementById(name);
                pLeft=display_left+objLeft;
                obj.style.width=objWidth+"px";
                obj.style.left=pLeft+"px";
        }//eoIf
} //eoFn

function getWidth(name){
  if (document.getElementById(name)){
   var objWidth=document.getElementById(name).style.width;
   objWidth=eval(objWidth.substring(0,objWidth.indexOf("p")));
   return objWidth
 }//eoIf
}//eoFn

function repositionToScroll(name,num){
 if (document.getElementById(name)){
        var obj=document.getElementById(name);
        ie =document.all?1:0
        if (ie||(name=="backToTop")){
                //don't scroll menu in NS
                obj.style.top=document.body.scrollTop+num;
        }//eoIf
 }//eoIf
} //eoFn

function findLivePageWidth() {
        if (window.innerWidth)
                return window.innerWidth;
        if (document.body.clientWidth)
                return document.body.clientWidth;
        return (null);
}//eoFn



function findLivePageHeight() {
        if (window.innerHeight) {
                return window.innerHeight;
                }
        if (document.body.clientHeight) {
                return document.body.clientHeight;
                }
        return (null);
}//eoFn

function MailAddress(username,domainname) {
at="@"
document.write("<A HREF='mailto:"+username+""+at+""+domainname+"'>"+username+""+at+""+domainname+"</a>")
}//eoFn




