/*In the event the user changes the dimensions of their browser window
call the 'findWindowDim' function*/

window.onresize = findWindowDim;

function findWindowDim(){

/*Constructing the function to work with Netscape 6 (innerHeight)
and Netscape 7+, Mozilla 1.0.1+ and IE6+ (clientHeight).*/

//Determining browser type by functionality.
//Start IE5+, NS7 and Mozilla based on build 1.0.1

var leftHeight = document.getElementById('leftcolumn').offsetHeight;
var rightHeight = document.getElementById('rightcolumn').offsetHeight;
var mastheadHeight = document.getElementById('masthead').offsetHeight;
var centerHeight = document.getElementById('centercolumn').offsetHeight;
var containerHeight = document.getElementById('container').offsetHeight;

var objFooter = document.getElementById('footer')
var objLeft = document.getElementById('leftcolumn')
var objRight = document.getElementById('rightcolumn')
var objCenter = document.getElementById('centercolumn')
var objContainer = document.getElementById('container')

if ((centerHeight > leftHeight) && (centerHeight > rightHeight)) {
footerTop = mastheadHeight + centerHeight;
footerTopPx = footerTop+"px";
objFooter.style.top = footerTopPx;

colHeight = centerHeight;
Height = colHeight+"px";
objRight.style.height = Height;

CentercolHeight = centerHeight;
CenterCol = CentercolHeight+"px"
objCenter.style.height = CenterCol;
objLeft.style.height = Height;
objRight.style.height = Height;
objContainer.style.height = footerTopPx;
} else if ((rightHeight > leftHeight) && (rightHeight > centerHeight)) {
// If the right column is longer than the centre and left columns
footerTop = mastheadHeight + rightHeight;
footerTopPx = footerTop+"px";
objFooter.style.top = footerTopPx;

colHeight = rightHeight;
rHeight = colHeight+"px";
objLeft.style.height = rHeight;

CentercolHeight = rightHeight;
CenterCol = CentercolHeight+"px"
objCenter.style.height = CenterCol;
objContainer.style.height = footerTopPx;
} else if ((leftHeight > centerHeight) && (leftHeight > rightHeight)) {
// If the left column is longer than the centre and right columns
footerTop = mastheadHeight + leftHeight;
footerTopPx = footerTop+"px";
objFooter.style.top = footerTopPx;

colHeight = leftHeight;
lHeight = colHeight+"px";
objRight.style.height = lHeight;

CentercolHeight = leftHeight;
CenterCol = CentercolHeight+"px";
objCenter.style.height = CenterCol;
objContainer.style.height = footerTopPx;
} else {
// If left and right columns are shorter than the centre column
footerTop = mastheadHeight + centerHeight;
footerTopPx = footerTop+"px";
objFooter.style.top = footerTopPx;

CenterCol = centerHeight+"px";
objLeft.style.height = CenterCol;
objRight.style.height = CenterCol;
objContainer.style.height = footerTopPx;
	}
}

//special effects

function swapBGrow(el, BGR1, BGR2) {
if(document.getElementById||(document.all && !(document.getElementById))){
el.style.backgroundColor = (el.style.background == BGR1) ? BGR2 : BGR1;
	}
}

function swapBGcell(el, BGC1) {
if(document.getElementById||(document.all && !(document.getElementById))){
temp=el.style.backgroundColor;
el.style.backgroundColor=BGC1;
	}
}

function swapBGcellBack(el) {
if(document.getElementById||(document.all && !(document.getElementById))){
el.style.backgroundColor=temp;
	}
}	

function escramble(){
 var a,b,c,d,e,f,g,h,i
 a='<a href=\"mai'
 b='marinamacleanyoga'
 c='\"  class=\"darklink\">'
 a+='lto:'
 b+='@'
 e='</a>'
 f=''
 b+='yahoo.ca'
 g='<img src=\"'
 h=''
 i='\" alt="Email us." border="0">'

 if (f) d=f
 else if (h) d=g+h+i
 else d=b

 document.write(a+b+c+d+e)
}

function ChangeFontSize(left, centre, right, size) {
var lineheight = eval(size)+4+"px";
document.getElementById(left).style.fontSize = size + "px";
document.getElementById(left).style.lineHeight = lineheight;
document.getElementById(centre).style.fontSize = size + "px";
document.getElementById(centre).style.lineHeight = lineheight;
document.getElementById(right).style.fontSize = size + "px";
document.getElementById(right).style.lineHeight = lineheight;
self.focus();
}	