// JavaScript Document
var p1, p2, p3, c1, c2, c3, l_col, r_col;

function StartMain()
{
	InitPromo();
	InitBody();
}

function StartInner()
{
	InitPromo();
	InitInnerBody();
}


function ExpandPromo(item)
{
	if(item == 1)
	{
		p1.style.width = '333px';
		p2.style.width = '183px';
		p3.style.width = '184px';
		
		t1.style.visibility = 'visible';
	}
	if(item == 2)
	{
		p1.style.width = '183px';
		p2.style.width = '333px';
		p3.style.width = '184px';
		
		t2.style.visibility = 'visible';
	}
	if(item == 3)
	{
		p1.style.width = '183px';
		p2.style.width = '184px';
		p3.style.width = '333px';
		
		t3.style.visibility = 'visible';
	}
}


function ClosePromo()
{
	// Determining if a page has loaded completely.
//	if(document.readyState == 'complete')
//	{
		p1.style.width = '233px';
		p2.style.width = '233px';
		p3.style.width = '234px';	
		
		t1.style.visibility = 'hidden';
		t2.style.visibility = 'hidden';
		t3.style.visibility = 'hidden';
//	}
}


function InitPromo()
{
	p1 = document.getElementById('promo1');
	p2 = document.getElementById('promo2');
	p3 = document.getElementById('promo3');
	
	t1 = document.getElementById('promo_txt1');
	t2 = document.getElementById('promo_txt2');
	t3 = document.getElementById('promo_txt3');
}


function getObjByEvent(evt)
{
	evt = (evt) ? evt : ((window.event) ? event : null);
	if(evt)
	{
		return obj = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null );
	}
	return null;
}

function InitBody()
{
	var max_height;
		
	c1 = document.getElementById('col1');	
	c2 = document.getElementById('col2');	
	c3 = document.getElementById('col3');		
	
	if(c1.offsetHeight > c2.offsetHeight)
	{
		if(c1.offsetHeight > c3.offsetHeight)
		{
			max_height = c1.offsetHeight;
		}
		else
		{
			max_height = c3.offsetHeight;			
		}
	}
	else if(c2.offsetHeight > c3.offsetHeight)
	{
		max_height = c2.offsetHeight;
	}
	else
	{
		max_height = c3.offsetHeight;			
	}
	c1.style.height = c2.style.height = c3.style.height = max_height + 10 + 'px';
}

function InitInnerBody()
{
	var max_height;
	/*	
	l_col = document.getElementById('l_column');	
	r_col = document.getElementById('r_column');	
	
	if(l_col.offsetHeight > r_col.offsetHeight)
	{
		max_height = l_col.offsetHeight;
	}
	else
	{
		max_height = r_col.offsetHeight;
	}
	l_col.style.height = r_col.style.height = max_height + 10 + 'px';
	*/
}
