//<![CDATA[
var timeoutID = 0;
var divId
var div2Id
var endWidth;
var endHeight;
var direction;
var startX = 0;
var timeoutSpeed = 100;
var pixPerSec = 90;
var tmpW = 0;
var tmpH = 0;
var pxSpeed = pixPerSec / (1000/timeoutSpeed);
var browIE = false;;
if(navigator.appName == "Microsoft Internet Explorer"){
	browIE=true;
}
function slideDiv(div, div2, w, h, dir){
	if(!timeoutID){
		divId = div;
		div2Id = div2
		endWidth = w;
		endHeight = h;
		direction = dir;
		tmpW = 0;
		tmpH = 0;
		var d = document.getElementById(divId);
		d.style.display = "";
		startX = parseInt(d.offsetLeft);
		timeoutID = setTimeout(expand, 1)
	}else{
		clearTimeout(timeoutID);
		tmpW = endWidth;
		tmpH = endHeight;
		colapse();
	}
}
function colapse(){
	var td = document.getElementById(div2Id)
	td.style.display = "none";
	var d = document.getElementById(divId);
	var curWidth = parseInt("0" + d.style.width);
	var curHeight = parseInt("0" + d.style.height);
	tmpW -= pxSpeed;
	tmpH -= pxSpeed;
	var bHorOver = false;
	var bVerOver = false;
	if(parseInt(tmpW)<=0){
 		bHorOver = true;
		d.style.width = "0px";		
		if(direction == -1){
			d.style.left = startX + "px";
		}
	}else{
		d.style.width = parseInt(tmpW) + "px";
		
		if(direction == -1){
			d.style.left = (startX - parseInt(tmpW)) + "px";
		}
	}
	if(parseInt(tmpH)<=0){
		d.style.height = "0px";
		bVerOver = true;
	}else{
		d.style.height = parseInt(tmpH) + "px";
	}
	if(!(bVerOver && bHorOver )){
		timeoutID = setTimeout(colapse, 1)
	}else{
		clearTimeout(timeoutID);
		timeoutID = 0;
		d.onmouseout = null;
	}
}
function expand(){
	var d = document.getElementById(divId);
	var curWidth = parseInt("0" + d.style.width);
	var curHeight = parseInt("0" + d.style.height);
	tmpW += pxSpeed;
	tmpH += pxSpeed;
	var bHorOver = false;
	var bVerOver = false;
	if(endWidth <= parseInt(tmpW)){
 		bHorOver = true;
		d.style.width = parseInt(endWidth) + "px";		
		if(direction == -1){
			d.style.left = (startX - parseInt(endWidth)) + "px";
		}
	}else{
		d.style.width = parseInt(tmpW) + "px";
		
		if(direction == -1){
			d.style.left = (startX - parseInt(tmpW)) + "px";
		}
	}
	if(endHeight <= parseInt(tmpH)){
		d.style.height = parseInt(endHeight) + "px";
		bVerOver = true;
	}else{
		d.style.height = parseInt(tmpH) + "px";
	}
	if(!(bVerOver && bHorOver )){
		timeoutID = setTimeout(expand, 1)
	}else{
		clearTimeout(timeoutID);
		tmpW = endWidth;
		tmpH = endHeight;
		//d.onmouseout = colapse;
		var td = document.getElementById(div2Id)
		td.style.display = "block";
	}
}
//]]>