function BG_ON(p)
{	document.getElementById(p).style.backgroundColor='#FFD98A';
}
function BG_OFF(p)
{	document.getElementById(p).style.backgroundColor='#FFF2D9';
}
function ShowProduct(category_name_url,product_id)
{	window.location.href="/katalog/"+category_name_url+"/"+product_id;
}
function PictureOpen(image_file, image_width, image_height)
{	window.open('/show_picture.php?image_file='+image_file+'&image_width='+image_width+'&image_height='+image_height,'','width='+image_width+',height='+image_height+',left='+((screen.width-image_width)/2)+',top='+((screen.height-image_height)/2));
}
function CheckLogin(f)
{	if (f.customer_login.value=="" || f.customer_login.value=="jméno")
	{	alert('Zadejte přihlašovací jméno ...');
		f.customer_login.focus();
		return false;
	}
	if (f.customer_password.value=="" || f.customer_password.value=="heslo")
	{	alert('Zadejte heslo ...');
		f.customer_password.focus();
		return false;
	}
	return true;
}

function CheckSearchForm(f)
{	if (f.search_text.value=="")
	{	alert('Zadejte řetězec pro vyhledávání ...');
		f.search_text.focus();
		return false;
	}
	return true;
}
function cislaplus(myfield, e, plus)
{	var key; var keychar;
	if (window.event) key = window.event.keyCode;
	else if (e) key = e.which; else return true;
	keychar = String.fromCharCode(key);
	if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) return true;
	else if ((("0123456789"+plus).indexOf(keychar) > -1)) return true; else return false;
}
function checkMail(email)
{	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(email);
}
