		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;
		}
		function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('pagewrap').offsetHeight +156;
					var leftcloud = document.getElementById('leftcloud');
					var rightcloud = document.getElementById('rightcloud');
					//var footerHeight  = footerElement.offsetHeight;
					var footerHeight  = 242;

					if (windowHeight > (contentHeight + 60)) {
						//alert("setting bottom "+windowHeight);
						var newlheight = windowHeight-201;
						var newrheight = windowHeight-242;
						
						if(undefined!==window.ie6)
						{
							leftcloud.style.top = (windowHeight-201)+'px'; 
							rightcloud.style.top = (windowHeight-242)+'px';
						}
						else 
						{
							movecall(newlheight, newrheight, windowHeight);
						}
						
						//leftcloud.style.top = (windowHeight-201)+'px'; 
						//rightcloud.style.top = (windowHeight-242)+'px'; //diff of 42px
					}
					else {
						
						//alert("content greater than window");
						
						var newlheight = contentHeight-150;
						var newrheight = contentHeight-191;
						if(undefined!==window.ie6)
						{
							leftcloud.style.top = (contentHeight-150) + 'px';
							rightcloud.style.top = (contentHeight-191) + 'px';
						}
						else
						{
							//alert('right: '+getstyleright('rightcloud')+' left: '+getstyleleft('leftcloud'));
							movecall(newlheight, newrheight, windowHeight);
							//alert('right: '+getstyleright('rightcloud')+' left: '+getstyleleft('leftcloud'));
						}
					}
				}
			}
		}
		window.onload = function() {
			setFooter();
			//$('rightcloud').setStyles("right: -985px;");
			//$('leftcloud').setStyles("left: -618px;");
			//movehorzcall(getWindowHeight());
		}
		window.onresize = function() {
			setFooter();
		}
		
		function openDrPhil()
		{
		   document.getElementById('pnlDrPhil').style.display='';
		   // philslide = new Fx.Slide('pnlDrPhil', {transition: Fx.Transitions.bounceOut, duration: 500}).hide();
		   // philslide.toggle();
		}
		
		function closeDrPhil()
		{
		    document.getElementById('pnlDrPhil').style.display='none';
		}
		
function moveLeftCloud(lpixels)
{
  // get the stylesheet, if I can
  //
  var the_style = $('leftcloud').getStyle('top');
  //var current_lvert = $('leftcloud').getStyle('top').toInt();
  var current_lvert = getstyletop('leftcloud');
  if (the_style)
  {
		//left cloud
		if(current_lvert > lpixels)
		{
	    	//move div up    	
	    	var difference = current_lvert - lpixels;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_lvert = Math.round(current_lvert - (difference/6));
	    	}
	    	else
	    	{
	    		var new_lvert = current_lvert - 1;
	    	}
	    	//alert('moving up to top: '+lpixels+',current top: '+current_lvert+', shifting to: '+new_lvert+' ');

			$('leftcloud').setStyles("top: "+new_lvert+"px;");
				
		}
		else if(current_lvert < lpixels)
   	{
	   	//move down
	   	var difference = lpixels - current_lvert;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_lvert = Math.round(current_lvert + (difference/4));  
	    	}
	    	else
	    	{
	    		var new_lvert = current_lvert + 1;
	    	}
		
			$('leftcloud').setStyles("top: "+new_lvert+"px;");
			
		}		
	}
}
function resizeLeftCloud(lpixels)
{
  // get the stylesheet, if I can
  //
 // var the_style = $('leftcloud').getStyle('height');
  //var current_lvert = $('leftcloud').getStyle('top').toInt();
  var current_lvert =$('leftcloud').getStyle('height').toInt();
 
  if(!isNaN(current_lvert))
  {
		//left cloud
		//alert('current less than 618 ' +current_lvert);
		if(current_lvert < lpixels)
		{
			// alert('current less than 618 ' +current_lvert);
	    	//grow div
	    	var difference = lpixels - current_lvert;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_lvert = Math.round(current_lvert + (difference/6));
	    	}
	    	else
	    	{
	    		var new_lvert = current_lvert + 1;
	    	}
	    	alert('moving up to top: '+lpixels+',current top: '+current_lvert+', shifting to: '+new_lvert+' ');

			$('leftcloud').setStyles("height: "+new_lvert+"px;");		
		}
	}
}
function moveRightCloud(rpixels)
{
   //right cloud
	var the_style = $('leftcloud').getStyle('top');
	//var current_rvert = $('rightcloud').getStyle('top').toInt();
	var current_rvert = getstyletop('rightcloud');
	if (the_style)
	{
		if(current_rvert > rpixels)
		{
	    	//move div up
	    	var difference = current_rvert - rpixels;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_rvert = Math.round(current_rvert - (difference/6));
	    	}
	    	else
	    	{
	    		var new_rvert = current_rvert - 1;
	    	}

				$('rightcloud').setStyles("top: "+new_rvert+"px;");
			
		}
		else if(current_rvert < rpixels)
   	{
	   	//move down
	   	var difference = rpixels - current_rvert;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_rvert = Math.round(current_rvert + (difference/4));
	    	}
	    	else
	    	{
	    		var new_rvert = current_rvert + 1;
	    	}

				$('rightcloud').setStyles("top: "+new_rvert+"px;");
		
		}		
	}	
}
function moveRightCloudtoZero()
{
   //right cloud
	//var current_rvert = $('rightcloud').getStyle('top').toInt();
	var current_rhorz = getstyleright('rightcloud');
	if (current_rhorz && current_rhorz != 0)
	{
		if(current_rhorz < 0)
		{
	    	//move left
	    	var difference = (-1) * current_rhorz;
	    	if(difference > 15)
	    	{
	    		//long way to go
	    		var new_rvert = Math.round(current_rhorz + (difference/5));
	    	}
	    	else
	    	{
	    		//alert('here');
	    		var new_rvert = current_rhorz + 1;
	    	}
		//alert('setting right to: '+new_rvert+' current pos: '+current_rhorz);
			$('rightcloud').setStyles("right: "+new_rvert+"px;");
			var tmp = getstyleright('rightcloud');
			//alert('right now '+tmp);
		}	
	}	
}
function moveLeftCloudtoZero()
{
   //right cloud
	//var current_rvert = $('rightcloud').getStyle('top').toInt();
	var current_rhorz = getstyleleft('leftcloud');
	if (current_rhorz)
	{
		if(current_rhorz < 0)
		{
	    	//move left
	    	var difference = (-1)* current_rhorz;
	    	if(difference > 8)
	    	{
	    		//long way to go
	    		var new_rvert = Math.round(current_rhorz + (difference/6));
	    	}
	    	else
	    	{
	    		var new_rvert = current_rhorz + 1;
	    	}
//alert('setting right to: '+new_rvert+' current pos: '+current_rhorz);
			$('leftcloud').setStyles("left: "+new_rvert+"px;");
			
		}	
	}	
}
function getstyletop(theelement)
{
	var tmp = $(theelement).getStyle('top').toInt();
	//alert('tmp: '+tmp);
	if(isNaN(tmp))
	{
		//IE + safari dont set a top value, or set it to 'auto' when only the bottom value is set in the css. Kludge around it.
		if(theelement == 'leftcloud')
		{
			var tmp = getWindowHeight()+201;
		}
		else
		{
			var tmp = getWindowHeight()+242;
		}
		//var tmp = $(theelement).currentStyle['top'].toInt();
	}
	return tmp
	
}
function getstyleright(theelement)
{
	var tmp = $(theelement).getStyle('right').toInt();
	//alert('tmp: '+tmp);
	if(isNaN(tmp))
	{
			var tmp = 0;
	}
	return tmp
	
}
function getstyleleft(theelement)
{
	var tmp = $(theelement).getStyle('left').toInt();
	//alert('tmp: '+tmp);
	if(isNaN(tmp))
	{
		//IE + safari dont set a top value, or set it to 'auto' when only the bottom value is set in the css. Kludge around it.
		var tmp = 0;
	}
	return tmp
	
}
function movehorzcall(oldwindowheight)
{
	var windowHeight = getWindowHeight();
	//alert('been called: '+ltop+', rtop: '+rtop);
	if(oldwindowheight != windowHeight)
	{
		//its been resized again, so cancel this loop.
		return null;
	}
	else
	{
		var current_lhorz = getstyleleft('leftcloud');
	  	var current_rhorz = getstyleright('rightcloud');
	 
	 	if(current_lhorz != 0)
			{
				moveLeftCloudtoZero();
			} 	
		if(current_rhorz != 0)
			{
				moveRightCloudtoZero();
			}
			
		if(current_rhorz !=0 || current_lhorz !=0)
		{
			var t =  setTimeout('movehorzcall('+oldwindowheight+');',20);
		}
	}
		
}
function movecall(ltop, rtop, oldwindowheight)
{
	var windowHeight = getWindowHeight();
	//alert('been called: '+ltop+', rtop: '+rtop);
	if(oldwindowheight != windowHeight)
	{
		//alert('exiting recursion: '+oldwindowheight+', new: '+windowHeight);
		//its been resized again, so cancel this loop.
		return null;
	}
	else
	{
		//var current_lvert = $('leftcloud').getStyle('top').toInt();
		var current_lvert = getstyletop('leftcloud');
	  	//var current_rvert = $('rightcloud').getStyle('top').toInt();
	  	var current_rvert = getstyletop('rightcloud');
	  	
		//verticle first
		if(ltop != current_lvert)
			{
				moveLeftCloud(ltop);
			}
		
		if(rtop != current_rvert)
			{
				moveRightCloud(rtop);
			}
		
			
		if(ltop != current_lvert || rtop != current_rvert)
		{
			//recurse
			var t =  setTimeout('movecall('+ltop+', '+rtop+', '+oldwindowheight+');',20);
		}
	}
}