
var curent_h;
var curent_bottom_h=25;
var top_h=186;

var top_bottom_h=34;

timerval_hide=setInterval('false');
timerval_show=setInterval('false');


$(document).ready(function() {
	
	curent_h=$('#contact').height();
	
});
 
function show()
{
	window.clearInterval(timerval_hide);
	window.clearInterval(timerval_show);
	timerval_show =setInterval('addHeight()',20);
	
	
}

function addHeight()
{
	if(curent_h<=top_h)
	{
		curent_h+=10;
		curent_bottom_h-=2;
		
		if(curent_h >= top_h) 
		{
			document.getElementById('link1').style.display='block'
			document.getElementById('link2').style.display='block'
			curent_h=top_h;
			clearInterval(timerval_show);
		}
		$('#contact').height(curent_h+'px');
		
		if(curent_bottom_h <= 0)
			curent_bottom_h=0;
		$("#bottom_pic").height(curent_bottom_h+'px')
		
		//console.log(curent_h);
	}
} 


function hide()
{
	window.clearInterval(timerval_hide);
	window.clearInterval(timerval_show);
	timerval_hide =setInterval('removeHeight()',20);
}

function removeHeight()
{
	if(curent_h > 0)
	{
		curent_h-=10;
		curent_bottom_h+=2;
		if(curent_h <= 0) 
		{
			curent_h=0;
			clearInterval(timerval_hide);
		}
		
		
		if(document.getElementById('link1').style.display=='block')
		{
			document.getElementById('link1').style.display='none'
			document.getElementById('link2').style.display='none'
		}
		$('#contact').height(curent_h+'px');
		
		if(curent_bottom_h >= top_bottom_h)
			curent_bottom_h=top_bottom_h;
		$("#bottom_pic").height(curent_bottom_h+'px')

	}

}