public function getInput($fieldValue = null)
	{
		if (!$this->isPublished())
		{
			return "";
		}

		$app = JFactory::getApplication();
		if ($app->isSite())
		{
			$value = !is_null($fieldValue) ? $fieldValue : $this->value;

			$this->setAttribute("type", "text", "input");
			$this->addAttribute("class", $this->getInputClass(), "input");
			$this->addAttribute("class", "readonly", "input");

			if ((int) $this->params->get("size", 32))
			{
				$this->setAttribute("size", (int) $this->params->get("size", 32), "input");
			}
			$this->setAttribute("readonly", "readonly", "input");

			$this->setVariable('value', $value);

			return $this->fetch('input.php', __CLASS__);
		}
		else
		{
			return parent::getInput($fieldValue);
		}
	}
	public function canEdit($userID = null)
	{
		$app = JFactory::getApplication();
		if ($app->isSite())
		{
			return false;
		}
		else
		{
			return parent::canEdit($userID);
		}
	}
	public function parseValue($value)
	{
		if (!$value || $value == '0000-00-00 00:00:00')
		{
			if (is_object($this->doc))
			{
				return $this->doc->created;
			}
		}

		return parent::parseValue($value);
	}
	public function getOutput($options = array())
	{
		if (!$this->isPublished())
		{
			return "";
		}

		if (intval($this->value) == 0)
		{
			$this->setVariable('value', $this->value);

			return $this->fetch('output.php', __CLASS__);
		}
		else
		{
			return parent::getOutput();
		}
	}
	public function storeValue($value, $type = 'default', $inputData = null)
	{
		if (!$value)
		{
			$db    = JFactory::getDbo();
			$value = $db->getNullDate();
		}

		
		if ($value != $this->doc->updated)
		{
			
			$db    = JFactory::getDbo();
			$query = $db->getQuery(true);
			$query->update('#__judownload_versions')
				->set('date = ' . $db->quote($value))
				->where('doc_id = ' . $db->quote($this->doc_id))
				->where('version = ' . $db->quote($this->doc->version));
			$db->setQuery($query);
			$db->execute();

			return parent::storeValue($value, $type, $inputData);
		}
		
		else
		{
			return true;
		}
	}