function adjustHeights()
{
var maxHeight= 629;
var maxHeight= Math.max(getDivSize("content") + 144,maxHeight);
var maxHeight= Math.max(getWindowHeight(),maxHeight);
document.getElementById("outerContainer").style.height = maxHeight + "px";	
document.getElementById("leftNav").style.height = (maxHeight - 134) + "px"
//shift position of footer for IE 5.5
document.getElementById("footer").style.bottom = "";
document.getElementById("footer").style.top = (maxHeight - getDivSize("footer")) + "px"
}

// preload rollovers
preload("images/lNavCompletedProjects_o.gif");
preload("images/lNavContactUs_o.gif");
preload("images/lNavCurrentProjects_o.gif");
preload("images/lNavEmployment_o.gif"); 
preload("images/lNavFoundationDirectors_o.gif"); 
preload("images/lNavFoundationStaff_o.gif"); 

// handle rollovers
function mOver(Image) {
	if(Image) {

		if(Image.src.indexOf("_o") == -1) {
   			
		Image.src = Image.src.replace(".gif", "_o.gif");
		
	    }
	   
	 }
	 if(lastImage) {
		lastImage.src = lastImage.src.replace("_o.gif", ".gif");
		}
		
	lastImage = Image;
}

var lastImage;


// simple preload function
function preload(sPath) {
	var o = new Image();
	o.src = sPath;
	return o;
}

//get height of the window
function getWindowHeight() {
var windowHeight=0;
if (typeof(window.innerHeight)=='number') {
windowHeight=window.innerHeight;
}
else {
if (document.documentElement&& document.documentElement.clientHeight) {
windowHeight=
document.documentElement.clientHeight;
}
else {
if (document.body&&document.body.clientHeight) {
windowHeight=document.body.clientHeight;
}
}
}
return windowHeight;
}

// determine height for <div> element 
function getDivSize(DivID) {	
	d= document.getElementById(DivID)
	var divHeight = 0
	if(d.offsetHeight)
		{ 
		 divHeight=d.offsetHeight; 
		} 
		else if(d.style.pixelHeight)
		{ 
		 divHeight=d.style.pixelHeight; 
		} 
	return divHeight;
	
}

function checkEmail(strEmail)
 {
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(strEmail))) 
	{ 
	       return false;
	} else {
	return true;
	}
}

function checkNumeric(checkStr)
{
  var checkOK = "0123456789-.,";
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
  return false;
  } else {
  return true;
  }
  }
  
  //Textbox maxlength function
    function CheckTextAreaLength(textareaRef, maxlength) {

                        if (textareaRef.value.length >= maxlength) {

                                    try {

                                                eval('textareaRef.value = ' + textareaRef.name + 'var');

                                    } catch(Exception) {

                                                textareaRef.value = textareaRef.value.substring(0, maxlength);                                           

                                    }

                        }                                   

                        eval(textareaRef.name + 'var = textareaRef.value' );

                        return false;

            }

