function inputfocus($name, $namef)
{
	document.getElementById($namef).style.display = "none";
	document.getElementById($name).style.display = "";
	document.getElementById($name).focus();
}
function inputblur($name, $namef)
{
	if(document.getElementById($name).value == "")
	{
		document.getElementById($name).style.display = "none";
		document.getElementById($namef).style.display = "";
	}
}
function ftrim($value)
{
	$return = "";
	for($y = 0; $y < $value.length; $y ++)
	{
		if($value.charAt($y) != " ")
		{
			$return += $value.charAt($y);
		}
	}
	return $return;
}
function ftocart($cartid, $linkid, $id)
{
	document.cookie = $id + "=" + $id;
	fcart($cartid, $linkid);
}
function fcart($id, $linkid)
{
	$location = "";
	$cookie = document.cookie.split(";");
	$j = 0;
	for($i = 0; $i < $cookie.length; $i ++)
	{
		$item = $cookie[$i].split("=");
		if(ftrim($item[0]) == ftrim($item[1]))
		{
			if($j > 0)
			{
				$location += ";";
			}
			$location += $item[1];
			$j ++;
		}
	}
	if($j > 0)
	{
		document.getElementById($linkid).href = "./?module=cart&item=" + $location;
	}
	else
	{
		document.getElementById($linkid).href = "./?module=cart";
	}
	document.getElementById($id).innerHTML = $j;
}
function fdelay($id, $delayid)
{
	$id.style.display = "none";
	document.getElementById($delayid).style.display = "";
}
