       // Initialise the effects
        var containerHeight; 
        var windowDimX = 0;
        var windowDimY = 0;
        var windowHeight = 0;    
        var windowWidth  = 0;
		var doingSize = true;

        window.onload = function() 
        {
			windowHeight = readCookie('windowHeight');       
			windowWidth  = readCookie('windowWidth');              
	
			 if (windowHeight == null)
               {
					doSize();
	           }
	           else
	           {
           			document.getElementById('textarea').style.overflow = 'auto';
	           		document.getElementById('rightimage').style.height = windowHeight + 'px';
	           		document.getElementById('textarea').style.height = windowHeight + 'px';
	           		document.getElementById('linkbox').style.height = parseInt(windowHeight) + 135  + 'px';
	           		
	           }
	           
	           	           
        }

        window.onresize = function()
        {
		
		   		if(windowDimY != document.documentElement.clientHeight || windowDimY == self.innerHeight)
				{
					{
					windowDim();
					windowHeight = windowDimY - 225;     
					windowWidth  = windowDimX - 325;     

           			document.getElementById('textarea').style.overflow = 'auto';
	           		document.getElementById('rightimage').style.height = windowHeight + 'px';
	           		document.getElementById('textarea').style.height = windowHeight + 'px';
	           		document.getElementById('linkbox').style.height = parseInt(windowHeight) + 135  + 'px';
					}
				}		
      			document.getElementById('textarea').style.overflow = 'auto';
         		document.getElementById('linkbox').style.height = parseInt(windowHeight) + 135  + 'px';
        }        
        
function windowDim()
{
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	windowDimX = x;
	windowDimY = y;
}
        
function undoCenter()
{
	var all = $('all');
	all.style.marginLeft = '10px';
/*	all.style.margin = '0';
	all.style.width = 'auto';
	all.style.height = 'auto';
*/
	
}
function expandWidth()
{
	allWidth.custom(779,windowDimX);
	contentWidth.custom(456,windowWidth);
	bannerWidth.custom(456,windowWidth);
}
function expandHeight()
{
	allHeight.custom(425,windowDimY);
	contentHeight.custom(233,windowHeight);
	bannerHeight.custom(233,windowHeight);
	linkHeight.custom(233,parseInt(windowHeight) + 135);

}
function doSize()
{
	contentHeight = new fx.Height('textarea', {duration: 4000});
	contentWidth  = new fx.Width('textarea', {duration: 4000});
	bannerHeight  = new fx.Height('rightimage', {duration: 4000});  // right side, next to content banner
	bannerWidth   = new fx.Width('top', {duration: 4000});  // data. develop...
	linkHeight 	  = new fx.Height('linkbox',{duration: 4000}); //navigation container
	allWidth      = new fx.Width('all', {duration: 4000});  // containing div width
	allHeight     = new fx.Height('all', {duration: 4000});  // containing div height
	//contentHeight.custom(233, 500);
	windowDim();
	windowHeight = windowDimY - 225;     
	windowWidth  = windowDimX - 325;     
	
//	if (windowDimX <= 800)
//		windowWidth = 779 - 325;


	if (windowDimY >= 525)
	{
		//undoCenter();
		expandHeight();
		//expandWidth();   
		createCookie('windowWidth',windowWidth);
		createCookie('windowHeight',windowHeight);
		document.getElementById('textarea').style.overflow = 'auto';
		document.getElementById('linkbox').style.overflow = 'auto';

	}
	
	else
	{
		windowHeight = windowDimY - 200;
		expandHeight();
		document.getElementById('textarea').style.overflow = 'auto';
		document.getElementById('linkbox').style.overflow = 'auto';
	}
	
	doingSize = false;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}