function setElementHeight ( ) {

var binarySwitch = 0 ;

//binary value to determine what elements exist

var hasLeftNav = $ ( '#left_nav' ) . attr ( 'id' ) ;

//find the div with id="left_nav". if it doesn't exist, null is returned

var mainContent = $ ( 'div[id*=main_content-]' ) . attr ( 'id' ) ;

//find the div with id="main_content-X" where X can be anything. if it doesn't exist, null is returned and errors will be alerted

var hasAdSpace = $ ( '#ad_space' ) . attr ( 'id' ) ;

//find the div with id="ad_space". if it doesn't exist, null is returned

// If the elements exist, add the appropriate value to the binarySwitch and extract their height

if ( hasLeftNav ) {

binarySwitch += 100 ;

}

if ( mainContent ) {

binarySwitch += 10 ;

}

if ( hasAdSpace ) {

binarySwitch += 1 ;

}

// Compare the different heights to find the tallest

switch ( binarySwitch ) {

case 0 :

break ;

case 1 :

break ;

case 10 :

break ;

case 11 :

setHeight011 ( ) ;

break ;

case 100 :

break ;

case 101 :

break ;

case 110 :

setHeight110 ( ) ;

break ;

case 111 :

setHeight111 ( ) ;

break ;

default :

break ;

} //end of switch

} //eof setElementHeight()

// this function sets the height of the mainContent and adSpace

function setHeight011 ( ) {

var heightMainContent = 0 ;

//height of the Main Content

var heightAdSpace = 0 ;

//height of the Ad Space

var mainContent = $ ( 'div[id*=main_content-]' ) . attr ( 'id' ) ;

heightMainContent = $ ( '#' + mainContent ) . height ( ) ;

heightAdSpace = $ ( '#ad_space' ) . height ( ) ;

if ( heightMainContent > heightAdSpace ) {

$ ( '#ad_space' ) . height ( $ ( '#' + mainContent ) . height ( ) + 2 ) ;

orgchildfund. tallestElement = $ ( '#' + mainContent ) . height ( ) + 2 ;

} else if ( heightAdSpace > heightMainContent ) {

$ ( '#' + mainContent ) . height ( $ ( '#ad_space' ) . height ( ) - 2 ) ;

orgchildfund. tallestElement = $ ( '#ad_space' ) . height ( ) - 2 ;

}

} //eof setHeight011

// this function sets the height of the leftNav and mainContent

function setHeight110 ( ) {

var heightLeftNav = 0 ;

//height of the Left Nav

var heightMainContent = 0 ;

//height of the Main Content

var mainContent = $ ( 'div[id*=main_content-]' ) . attr ( 'id' ) ;

heightLeftNav = $ ( '#left_nav' ) . height ( ) ;

heightMainContent = $ ( '#' + mainContent ) . height ( ) ;

if ( heightLeftNav > heightMainContent ) {

$ ( '#' + mainContent ) . height ( $ ( '#left_nav' ) . height ( ) - 2 ) ;

orgchildfund. tallestElement = $ ( '#left_nav' ) . height ( ) - 2 ;

} else if ( heightMainContent > heightLeftNav ) {

$ ( '#left_nav' ) . height ( $ ( '#' + mainContent ) . height ( ) + 2 ) ;

orgchildfund. tallestElement = $ ( '#' + mainContent ) . height ( ) + 2 ;

}

} //eof setHeight110()

// this function sets the height of the leftNav, mainContent, and adSpace

function setHeight111 ( ) {

var heightLeftNav = 0 ;

//height of the Left Nav

var heightMainContent = 0 ;

//height of the Main Content

var heightAdSpace = 0 ;

//height of the Ad Space

var mainContent = $ ( 'div[id*=main_content-]' ) . attr ( 'id' ) ;

heightLeftNav = $ ( '#left_nav' ) . height ( ) ;

heightMainContent = $ ( '#' + mainContent ) . height ( ) ;

heightAdSpace = $ ( '#ad_space' ) . height ( ) ;

if ( ( heightLeftNav > heightMainContent ) && ( heightLeftNav > heightAdSpace ) ) {

$ ( '#' + mainContent ) . height ( $ ( '#left_nav' ) . height ( ) - 2 ) ;

$ ( '#ad_space' ) . height ( $ ( '#left_nav' ) . height ( ) ) ;

orgchildfund. tallestElement = $ ( '#left_nav' ) . height ( ) - 2 ;

} else if ( ( heightMainContent > heightLeftNav ) && ( heightMainContent > heightAdSpace ) ) {

$ ( '#left_nav' ) . height ( $ ( '#' + mainContent ) . height ( ) + 2 ) ;

$ ( '#ad_space' ) . height ( $ ( '#' + mainContent ) . height ( ) + 2 ) ;

orgchildfund. tallestElement = $ ( '#' + mainContent ) . height ( ) + 2 ;

} else if ( ( heightAdSpace > heightLeftNav ) && ( heightAdSpace > heightMainContent ) ) {

$ ( '#left_nav' ) . height ( $ ( '#ad_space' ) . height ( ) ) ;

$ ( '#' + mainContent ) . height ( $ ( '#ad_space' ) . height ( ) - 2 ) ;

orgchildfund. tallestElement = $ ( '#ad_space' ) . height ( ) - 2 ;

}