active=1;

//get current server
host = window.location.hostname;
prefix = parent.location.protocol + '//';
basepath = prefix+host;

// Pop-up windows
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

//Preload images
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Kaosweaver breadcrumbs
function breadCrumbs(base,delStr,defp,cStyle,tStyle,dStyle,nl) { // by Paul Davis - http://www.kaosweaver.com
loc=window.location.toString();subs=loc.substr(loc.indexOf(base)+base.length+1).split("/");
 document.write('<a href="'+getLoc(subs.length-1)+defp+'" class="'+cStyle+'">Norfolk District Home</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
 a=(loc.indexOf(defp)==-1)?1:2;for (i=0;i<(subs.length-a);i++) { subs[i]=makeCaps(unescape(subs[i]));
 document.write('<a href="'+getLoc(subs.length-i-2)+defp+'" class="'+cStyle+'">'+subs[i]+'</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');}
 if (nl==1) document.write("<br>");document.write('<span class="'+tStyle+'">'+document.title+'</span>');
}
function makeCaps(a) {
  g=a.split(' ');for (l=0;l<g.length;l++) g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);
  return g.join(" ");
}
function getLoc(c) {
  var d="";if (c>0) for (k=0;k<c;k++) d=d+"../"; return d;
}

// Pull quotes
var pullquote = { 
init : function() { 
// Check that the browser supports the methods used 
if (!document.getElementById || !document.createElement || !document.appendChild) return false; 
var oElement, oPullquote, oPullquoteP, oQuoteContent, i, j; 
// Find all span elements with a class name of pullquote 
var arrElements = document.getElementsByTagName('span'); 
var oRegExp = new RegExp("(^|\\s)pullquote(\\s|$)"); 
for (i = 0; i < arrElements.length; i++) { 
// Save the current element 
oElement = arrElements[i]; 
if (oRegExp.test(oElement.className)) { 
// Create the blockquote and p elements 
oPullquote = document.createElement('blockquote'); 
oPullquote.className = oElement.className; 
oPullquoteP = document.createElement('p'); 
// Insert the pullquote text 
for(j = 0; j < oElement.childNodes.length; j++) { 
oPullquoteP.appendChild( oElement.childNodes[j].cloneNode(true) ); 
} 
oPullquote.appendChild(oPullquoteP); 
// Insert the blockquote element before the span element's parent element 
oElement.parentNode.parentNode.insertBefore( oPullquote,oElement.parentNode ); 
} 
} 
} 
}; 
// addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html 
function addEvent(obj, type, fn) { 
if (obj.addEventListener) 
obj.addEventListener( type, fn, false ); 
else if (obj.attachEvent) 
{ 
obj["e"+type+fn] = fn; 
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } 
obj.attachEvent( "on"+type, obj[type+fn] ); 
} 
} 
addEvent(window, 'load',pullquote.init); 
