function close_all()
{

	closemenu();
	closecm();

}

function firecm()
{

	var c_top = document.getElementById('cmslider').offsetTop;
	
	if(c_top < 0) {		// menu is hidden
	
		opencm();
	} else {
		closecm();
	}
}

function opencm()
{
	timedCountCmOp();
	document.getElementById('imgA4').src = "transarrow2.gif";
}

function closecm()
{
	timedCountCmCl();
	document.getElementById('imgA4').src = "transarrow.gif";
}

function timedCountCmOp()
{
	var c_top = document.getElementById('cmslider').offsetTop;
	c_top = c_top + 10;
	if(c_top >= 0) {
		document.getElementById('cmslider').style.top = 0;
		document.getElementById('cmslidertext').style.top = 0;
		return;
	}
	document.getElementById('cmslider').style.top = c_top;
	document.getElementById('cmslidertext').style.top = c_top;
	
	t = setTimeout("timedCountCmOp()", 5);

}

function timedCountCmCl()
{
	var c_top = document.getElementById('cmslider').offsetTop;
	c_top = c_top - 10;
	
	if(c_top <= -95) {
		
		document.getElementById('cmslider').style.top = -95;
		document.getElementById('cmslidertext').style.top = -95;
		

		return;
	}
	document.getElementById('cmslider').style.top = c_top;
	document.getElementById('cmslidertext').style.top = c_top;
	
	
	t = setTimeout("timedCountCmCl()", 5);


}


function firemenu()
{

	var c_top = document.getElementById('slider').offsetTop;

	if(c_top < 0) {		// menu is hidden

		openmenu();
	} else {
		closemenu();
	}
}


function openmenu()
{
	//document.getElementById('slider').style.top = 0;
	//document.getElementById('slidertext').style.top = 0;

	timedCountOp();
	document.getElementById('imgA2').src = "transarrow2.gif";


}

function timedCountOp()
{
	var c_top = document.getElementById('slider').offsetTop;
	c_top = c_top + 10;
	if(c_top >= 0) {
		document.getElementById('slider').style.top = 0;
		document.getElementById('slidertext').style.top = 0;
		document.getElementById('contactmenu').style.top = (c_top + 137 + 53);
		return;
	}
	document.getElementById('slider').style.top = c_top;
	document.getElementById('slidertext').style.top = c_top;
	
	if((c_top + 127) > 0) {
		document.getElementById('contactmenu').style.top = (c_top + 137 + 53);
	}
	
	t = setTimeout("timedCountOp()", 5);
}

function closemenu()
{
	timedCountCl();
	document.getElementById('imgA2').src = "transarrow.gif";

}

function timedCountCl()
{
	var c_top = document.getElementById('slider').offsetTop;
	c_top = c_top - 10;
	
	
	if((c_top + 137) >= -11) {
		var nval = (c_top + 137 + 53);
		if(nval < 53) nval = 53;
		document.getElementById('contactmenu').style.top = nval;
	}
	
	if(c_top <= -270) {
		
		document.getElementById('contactmenu').style.top = 53;
		document.getElementById('slider').style.top = -270;
		document.getElementById('slidertext').style.top = -270;
		

		return;
	}
	document.getElementById('slider').style.top = c_top;
	document.getElementById('slidertext').style.top = c_top;
	
	
	t = setTimeout("timedCountCl()", 5);
}
