function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {
// W3C DOM
return document.getElementById(objectId);
} else if (document.all && document.all(objectId)) {
// MSIE 4 DOM
return document.all(objectId);
} else if (document.layers && document.layers[objectId]) {
// NN 4 DOM.. note: this won't find nested layers
return document.layers[objectId];
} else {
return false;
}
}

// 显示列表框
function displayList(_id){
var _sid=document.getElementById(_id);
var _s=$("#"+_id)
var max_h = 175;
var anim = function(){
	if(_s.height() >= max_h){
		_sid.style.height=max_h+"px";
		if(tt){window.clearInterval(tt);}
	}
	else{
		_sid.style.height =( _s.height()+5)+"px";
	}
}
var tt = window.setInterval(anim,1);
}

// 隐藏列表框
function hiddenList(_id){
var _sid=document.getElementById(_id);
var _s=$("#"+_id);
var min_h = 23;
var anim = function(){
	if(_s.height() <= min_h){
		_sid.style.height=min_h+"px";
		if(tt){window.clearInterval(tt);}
	}
	else{
		_sid.style.height = (_s.height()-5)+"px";
	}
}
var tt = window.setInterval(anim,1);
}
window.onload=function(){
$("#culture h5").click( function() {
	//alert($("#culture").height());
	if ($("#culture").height()==23){
		$("#culture h5").css({background:"url(templates/default/culture.jpg) no-repeat center bottom"});
		displayList("culture");
		return false;

	}
	else{
		$("#culture h5").css({background:"url(templates/default/culture.jpg) no-repeat center top"});
		hiddenList("culture");
		return false;
	}
} );

$("#sale h5").click( function() {
	//alert($("#sale").height());
	if ($("#sale").height()==23){
		$("#sale h5").css({background:"url(templates/default/sale.gif) no-repeat center bottom"});
		displayList("sale");
		return false;

	}
	else{
		$("#sale h5").css({background:"url(templates/default/sale.gif) no-repeat center top"});
		hiddenList("sale");
		return false;
	}
} );

$("#team h5").click( function() {
	//alert($("#team").height());
	if ($("#team").height()==23){
		$("#team h5").css({background:"url(templates/default/team.gif) no-repeat center bottom"});
		displayList("team");
		return false;

	}
	else{
		$("#team h5").css({background:"url(templates/default/team.gif) no-repeat center top"});
		hiddenList("team");
		return false;
	}
} );

$("#faq h5").click( function() {
	//alert($("#faq").height());
	if ($("#faq").height()==23){
		$("#faq h5").css({background:"url(templates/default/faq.jpg) no-repeat center bottom"});
		$("#faq span").css({padding:"10px",display:"block",height:"114px"});
		displayList("faq");
		return false;

	}
	else{
		$("#faq h5").css({background:"url(templates/default/faq.jpg) no-repeat center top"});

		hiddenList("faq");
		return false;
	}
} );
}

