var t;
var doLoop = true;

function slide_up(div_height)
{
	var div = document.getElementById('text');
	if(div)
	{
		if (div.scrollTop<10000000000 && doLoop)
		{
			div.scrollTop+=4; //scroll 1 pixel up
			t = setTimeout('slide_up('+div_height+')', 1);
		}
		else clearTimeout(t);
	}
	var scroll_up = document.getElementById("scroll_up");
	if(scroll_up && div.scrollTop > (div_height + 40))
	{
		scroll_up.style.display = "inline";
	}
	var scroll_down = document.getElementById("scroll_down");
	if(scroll_down && div.scrollTop >= (div_height + 40))
	{
		scroll_down.style.display = "inline";
	}
}

function slide_down()
{
	var div = document.getElementById('text');
	if(div)
	{
		if (div.scrollTop>0 && doLoop)
		{
			div.scrollTop-=4; //scroll 1 pixel up
			t = setTimeout('slide_down()', 1);
		}
		else clearTimeout(t);
	}
	var scroll_up = document.getElementById("scroll_up");
	if(scroll_up)
	{
		scroll_up.style.display = "none";
	}
	var scroll_down = document.getElementById("scroll_down");
	if(scroll_down)
	{
		scroll_down.style.display = "none";
	}
}

function stop()
{
	doLoop = false;
	setTimeout('doLoop = true;', 5);
}










var t3;
var doLoop3 = true;

function slide_up2(div_id)
{
	
	var div = document.getElementById(div_id);
	if(div)
	{
		if (div.scrollTop<10000000000 && doLoop3)
		{
			div.scrollTop+=4; //scroll 1 pixel up
			t3 = setTimeout('slide_up2("'+div_id+'")', 1);
		}
		else clearTimeout(t3);
	}
}

function slide_down2(div_id)
{
	var div = document.getElementById(div_id);
	if(div || 1)
	{
		if (div.scrollTop>0 && doLoop3)
		{
			div.scrollTop-=4; //scroll 1 pixel up
			t3 = setTimeout('slide_down2("'+div_id+'")', 1);
		}
		else clearTimeout(t3);
	}
}

function stop3()
{
	doLoop3 = false;
	setTimeout('doLoop3 = true;', 5);
}













var t2;
var doLoop2 = true;
function scrollDivToTop2(){

var div2 = document.getElementById('more_scroll');
if (div2.scrollTop>0  && doLoop2){
div2.scrollTop-=2; //scroll 1 pixel up
t2 = setTimeout('scrollDivToTop2()', 1);
}
else clearTimeout(t2);
}

function scrollDivToBottom2(){

var div2 = document.getElementById('more_scroll');
if (div2.scrollTop<10000000000 && doLoop2){
div2.scrollTop+=2; //scroll 1 pixel up
t2 = setTimeout('scrollDivToBottom2()', 1);
}
else clearTimeout(t2);
}
function stop2()
{
	doLoop2 = false;
	setTimeout('doLoop2 = true;', 5);
}

function swap_project_image(id)
{
	image = document.getElementById("project_"+id);
	if(image)
	{
		image.src='images/projects/project_'+id+'_sel.png'	
	}
	image = document.getElementById("read_more_"+id);
	if(image)
	{
		image.style.display = "inline"
	}
}

function swap_out_project_image(id)
{
	image = document.getElementById("project_"+id);
	if(image)
	{
		image.src='images/projects/project_'+id+'.png'	
	}
	image = document.getElementById("read_more_"+id);
	if(image)
	{
		image.style.display = "none"
	}
}

function swap_client_image(id)
{
	image = document.getElementById("client_"+id);
	if(image)
	{
		image.src='images/clients/client_'+id+'_sel.png'	
	}
}

function swap_out_client_image(id)
{
	image = document.getElementById("client_"+id);
	if(image)
	{
		image.src='images/clients/client_'+id+'.png'	
	}
}

function display_footer()
{
	Effect.BlindDown('footer1');
	Effect.BlindDown('footer2');
	return false;
}