function resize()
{
  	var myWidth = 0;
  
  	myWidth = GetWidth() - GetScrollBarWidth();
	
	var topleft=document.getElementById('topleft');
	var topright=document.getElementById('topright');

	var bottomleft=document.getElementById('bottomleft');
	var bottomright=document.getElementById('bottomright');

	var middleleft=document.getElementById('middleleft');
	var middleright=document.getElementById('middleright');
	
	if(myWidth <= 1256)
	{
		topleft.style.width = 270 + 'px';
		bottomleft.style.width = 270 + 'px';
		middleleft.style.width = 270 + 'px';
	
		if((myWidth - 986) > 0)
		{
				topright.style.width = (myWidth - 986) + 'px';
		 		bottomright.style.width = (myWidth - 986) + 'px';
				middleright.style.width = (myWidth - 986) + 'px';
	
		}
		else
		{
				topright.style.width = 0 + 'px';
				bottomright.style.width = 0 + 'px';
				middleright.style.width = 0 + 'px';
		}
	}
	else
	{
		topleft.style.width = (myWidth - 716)/2 + 'px';
		topright.style.width = (myWidth - 716)/2 + 'px';
		
		bottomleft.style.width = (myWidth - 716)/2 + 'px';
		bottomright.style.width = (myWidth - 716)/2 + 'px';
		
		middleleft.style.width = (myWidth - 716)/2 + 'px';
		middleright.style.width = (myWidth - 716)/2 + 'px';
	}
	
	//topleft.style.height = GetHeight() - 600 + 'px';

}

function mapsresize()
{
	var myWidth = 0;
  
  	myWidth = GetWidth() - GetScrollBarWidth();
	

	var mapsmiddleleft=document.getElementById('mapsmiddleleft');
	var mapsmiddleright=document.getElementById('mapsmiddleright');
	
	var bottomleft=document.getElementById('bottomleft');
	var bottomright=document.getElementById('bottomright');

	if(myWidth <= 1256)
	{
		bottomleft.style.width = 270 + 'px';
		mapsmiddleleft.style.width = 270 + 'px';
		
		if((myWidth - 986) > 0)
		{
			bottomright.style.width = (myWidth - 986) + 'px';
			mapsmiddleright.style.width = (myWidth - 986) + 'px';
		}
		else
		{
			bottomright.style.width = 0 + 'px';
			mapsmiddleright.style.width = 0 + 'px';
		}
	}
	else
	{	
		bottomleft.style.width = (myWidth - 716)/2 + 'px';
		bottomright.style.width = (myWidth - 716)/2 + 'px';
		
		mapsmiddleleft.style.width = (myWidth - 716)/2 + 'px';
		mapsmiddleright.style.width = (myWidth - 716)/2 + 'px';
	}
		
}

function GetWidth()
{
	var x = 0;

	if (self.innerWidth)
	{
			x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
			x = document.documentElement.clientWidth;
	}
	else if (document.body)
	{
			x = document.body.clientWidth;
	}

	return x;
}

function GetHeight()
{
	var x = 0;

	if (self.innerHeight)
	{
			x = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
			x = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
			x = document.body.clientHeight;
	}

	return x;
}

function GetScrollBarWidth ()
{
	var inner = document.createElement('p');
	inner.style.width = "100%";
	inner.style.height = "200px";
	
	var outer = document.createElement('div');
	outer.style.position = "absolute";
	outer.style.top = "0px";
	outer.style.left = "0px";
	outer.style.visibility = "hidden";
	outer.style.width = "200px";
	outer.style.height = "150px";
	outer.style.overflow = "hidden";
	outer.appendChild (inner);
	
	document.body.appendChild (outer);
	var w1 = inner.offsetWidth;
	outer.style.overflow = 'scroll';
	var w2 = inner.offsetWidth;
	if (w1 == w2) w2 = outer.clientWidth;
	
	document.body.removeChild (outer);
	
	return (w1 - w2);
}
