function enableMainNavSIFR(){
  return;
	var listItems = document.getElementById('main-nav').getElementsByTagName('li');
	var listItem, anchor, outerWrapper, innerWrapper;
	
	for(var i = 0; i < listItems.length; i++){
	  listItem = listItems[i];
	  anchor = listItem.firstChild;
	  em = anchor.firstChild;
	  em.innerHTML = em.innerHTML.toUpperCase();
	  innerWrapper = document.createElement('div');
	  outerWrapper = document.createElement('div');
	  outerWrapper.appendChild(innerWrapper, anchor);
	  innerWrapper.appendChild(anchor.cloneNode(true), anchor);
	  listItem.replaceChild(outerWrapper, anchor);

	}

if(typeof sIFR == "function"){
	sIFR.replaceElement(named({sSelector:"#main-nav li.active div div",
	sFlashSrc:"sifrFuturaLight.swf",
	sColor:"#ffffff",
	sLinkColor:"#ffffff",
	sBgColor:"#000000",
	sHoverColor:"#ffffff",
	nPaddingTop:0,
	nPaddingBottom:0,
	sWmode:'transparent',
	sFlashVars:"textalign=left&offsetTop=2"
	}));

	sIFR.replaceElement(named({sSelector:"#main-nav li div div",
	sFlashSrc:"sifrFuturaLight.swf",
	sColor:"#000000",
	sLinkColor:"#000000",
	sBgColor:"#FFFFFF",
	sHoverColor:"#000000",
	nPaddingTop:0,
	nPaddingBottom:0,
	sWmode:'transparent',
	sFlashVars:"textalign=left&offsetTop=2"
	}));
};
}


 /*
  get cookie
*/
function getCookie(sName){
	var aCookie = document.cookie.split("; ");
	
	for (var i=0; i < aCookie.length; i++){
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]){
			return unescape(aCrumb[1]);
		}
	}
	
	return null;
} /*

handleBodyLoad();

*/

function handleBodyLoad() {
  markLinks();
  enableMainNavSIFR();
  initPopupPainting();
  initShadowOverlay();
} /*
  marklinks
*/
function markLinks(){

        var links = document.getElementsByTagName('a');
        var link, href, mark;
        
        for(var i = 0; i < links.length; i++){

               link = links[i];

               switch(link.getAttribute('rel')){

                       case 'ext': case 'external':
                               link.className += ' external';
                               link.target = '_blank';
                               
                               
                               if(link.getElementsByTagName('img').length == 0){
                                      href = link.getAttribute('href').toLowerCase();
                                      href = href.substring((href.length - 4), (href.length));

                                      switch(href){

                                              case '.pdf':
                                                     link.className += ' pdf';
                                                     mark = document.createElement('img');
                                                     mark.src = '/data/link-icons/pdf.png';
                                                     link.insertBefore(mark , (link.firstChild));
                                                     break;

                                              case '.xls':

                                                     link.className += ' pdf';
                                                     mark = document.createElement('img');
                                                     mark.src = '/data/link-icons/xls.png';
                                                     link.insertBefore(mark , (link.firstChild));
                                                     break;

                                              case '.doc':

                                                     link.className += ' pdf';
                                                     mark = document.createElement('img');
                                                     mark.src = '/data/link-icons/doc.png';
                                                     link.insertBefore(mark , (link.firstChild));
                                                     break;


                                              case '.ppt':
                                                     link.className += ' pdf';
                                                     mark = document.createElement('img');
                                                     mark.src = '/data/link-icons/ppt.png';
                                                     link.insertBefore(mark , (link.firstChild));
                                                     break;
                                                     
                                              default:
                                                     mark = document.createElement('img');
                                                     mark.src = '/data/link-icons/external.png';
                                                     link.appendChild(mark);
                                                     break;

                               }
                       }
               }
        }
      

        links = document.getElementById('content').getElementsByTagName('a');
  
        for(var i = 0; i < links.length; i++){
               if(links[i].getAttribute('href')){
                       href = document.createElement('span');
                               href.className = 'print';
                               href.appendChild((document.createTextNode(' [' + links[i].href + ']')));
                      

                       links[i].appendChild(href);
               }
        }

        mark = null;
        href = null;
        link = null;
        links = null;

} /*
  popupPainting
*/
function createPopupPainting(src){
	var popup;
	var popupHeader;
	var unescapedSRC;
	
	var titleText;
	
	// first replace until last /
	unescapedSRC = unescape(src);
	titleText = (unescapedSRC.substr(unescapedSRC.lastIndexOf('/')+1)).replace('.jpg','');
	
	if(document.getElementById('popup')){
		popup = document.getElementById('popup');
		
	} else {
		popup = document.createElement('div');
		
		popup.setAttribute('id', 'popup');
		
		var popupHeader = document.createElement('div');
		popupHeader.setAttribute('id', 'popupHeader');
		
		var popupCloseLink = document.createElement('a');
		popupCloseLink.appendChild(document.createTextNode(' ')); //x
		popupCloseLink.href = '#';
		popupCloseLink.onclick = function(){ 
			switchShadowOverlay('off'); 
			document.getElementById('popup').style.display = 'none'; 
			return false; 
		}
		
		popupHeader.appendChild(popupCloseLink);
		popup.appendChild(popupHeader);
		
		var popupImageContainer = document.createElement('div');
		popupImageContainer.setAttribute('id', 'popupImageContainer');
		popup.appendChild(popupImageContainer);
		
		// append popup
		document.body.appendChild(popup);
		
	}
	
	document.getElementById('popupImageContainer').style.backgroundImage = "url('"+unescape(src)+ "')";
	popup.style.display = 'block'; 
	
}
	
function initPopupPainting(){
	var listItems = null;
	
	if(document.getElementById('imagebar')) var listItems = document.getElementById('imagebar').getElementsByTagName('li');
	
	if(!listItems) return;
	
	// for every list item, get anchor and specifiy the onclick event to be createpopup (a.src) 
	
	for(var i=0; i<listItems.length; i++) {
		listItems[i].getElementsByTagName('a')[0].onclick = function(){ 
			switchShadowOverlay('on');
			createPopupPainting(this.href); 
			return false;
		}
	}
}

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function switchShadowOverlay(onoff) {
var objOverlay = document.getElementById('overlay');
	var arrayPageSize =getPageSize(); 
	switch(onoff) {
		case 'on':
			objOverlay.style.height = (arrayPageSize[1] + 'px');
			objOverlay.style.display = 'block';
			break;
		default:
			objOverlay.style.display = 'none';	
	}
}

function initShadowOverlay() {
var objBody = document.getElementsByTagName("body").item(0);
	
	// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','overlay');
	objOverlay.onclick = function () {document.getElementById('popup').style.display = 'none';switchShadowOverlay('off'); return false;}
	objOverlay.style.display = 'none';
	objOverlay.style.position = 'absolute';
	objOverlay.style.top = '0';
	objOverlay.style.left = '0';
	objOverlay.style.zIndex = '90';
 	objOverlay.style.width = '100%';
	objBody.insertBefore(objOverlay, objBody.firstChild);
}
 /*
  popups
*/
var aPopups = new Array();
var aModalPopups = new Array();

window.onfocus = function()
{
	if(aModalPopups.length != 0)
	{
		aModalPopups[0].focus();
	}
}


var sDefaultFeatures = 'channelmode=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0';

// create popup
function createPopup(sURL, sName, sFeatures, iWidth, iHeight)
{
	var iLeft	= (screen.availWidth - iWidth) / 2;
	var iTop	= (screen.availHeight - iHeight) / 2;
	
	return window.open(sURL, sName, sFeatures + ', width=' + iWidth + ', height=' + iHeight + ', left=' + iLeft + ', top=' + iTop);
}
