var moveSpeed = 3;
var toValue = 5;
var minHeight = 0;

function showImage(img_path)
{
	window.open(img_path);
}

function blurInput(obj, blur_text)
{
	if (obj.value == '')
	{
		obj.value = blur_text;
		obj.className = 'itext';
	}
}

function focusInput(obj, blur_text)
{
	obj.className = 'itext_f';

	if (obj.value == blur_text)
		obj.value = '';
}

function slideMenu(menu_name)
{
	var menu_obj = document.getElementById(menu_name);

	if (menu_obj.mnuTimer)
		clearTimeout(menu_obj.mnuTimer);
	
	if ((!menu_obj.style.height) && (!menu_obj.processed))
	{
		menu_obj.style.height = minHeight + 'px';
	}
	
	if ((menu_obj.style.height != 'auto') && (parseInt(menu_obj.style.height) <= minHeight))
	{
		menu_obj.mnuSpeed = moveSpeed;
		menu_obj.style.height = 'auto';
		menu_obj.mnuHeight = menu_obj.offsetHeight;
		menu_obj.style.height = minHeight + 'px';			
	} else
	{
		if (menu_obj.style.height == 'auto')
			menu_obj.style.height = menu_obj.offsetHeight + 'px';
		menu_obj.mnuSpeed = -moveSpeed;
		menu_obj.mnuHeight = 0;
	} 
	
	menu_obj.processed = 1;
	menu_obj.mnuTimer = setTimeout("moveMenu('"+menu_name+"')", toValue);
}

function moveMenu(menu_name)
{
	var menu_obj = document.getElementById(menu_name);
	if (menu_obj.mnuSpeed == 0) return;
	
	var height = parseInt(menu_obj.style.height);
	var nHeight = height + menu_obj.mnuSpeed;
	
	if ((menu_obj.mnuSpeed < 0) && (nHeight <= minHeight))
	{
		menu_obj.style.height = minHeight + 'px';
		menu_obj.mnuSpeed = 0;
	} else
	if ((menu_obj.mnuSpeed > 0) && (nHeight >= menu_obj.mnuHeight))
	{
		menu_obj.style.height = 'auto';
		menu_obj.mnuSpeed = 0;
	} else
	{
		menu_obj.style.height = nHeight + 'px';
		menu_obj.mnuTimer = setTimeout("moveMenu('"+menu_name+"')", toValue);
	}
}

function printDate()
{
	var curdate = new Date();
	var day = curdate.getDate();
	var month = curdate.getMonth();
	var year = curdate.getYear();
	
	if (year < 2000) year += 1900;
	
	document.write(day+'.'+month+'.'+year);
}
