var attributes;
var m_div;
var position = 'closed';
var init = 0;
var g_expand = '';

function set_div( height, div, page, expand){
	m_div = div; // in the future there may be more divs that will expand
	if( expand != null && expand != 'null') { g_expand = expand; }
	if(g_expand == '1'){
		if(getBrowser().indexOf('xp')>0){
			height = parseInt(height)+10;
			init = 3; }
		
		if(position == 'closed'){
			position = 'open';
			attributes = { height: { from: init, to: height } };
		}else{
			position = 'closed';
			attributes = { height: { from: height, to: init } }; }
		
		ease();
		
		if(page!=''){ 
			m_page = page;
			setTimeout("forwardTo()",1000);
			return; }
			
		setTimeout("show_divs()",100);
		document.getElementById(m_div).style.display="";
			
	}else{
		if(page!=''){ 
			m_page = page;
			forwardTo();
		}
		show_divs();
	}
}
function ease(){
	var anim = new YAHOO.util.Motion(m_div,
		attributes, 1, YAHOO.util.Easing.easeOut);
	anim.animate();
}

var m_page;
function forwardTo(){
	document.location.href=m_page;
}
function show_divs(){
	document.getElementById('nav_box').style.display="";
 	document.getElementById('nav').style.visibility="visible"; 
 }
