<?
function urlCategory($categoryName, $categoryId = null) {
	$str = "";
	if (isset($categoryId)) {
		if ($categoryId==10) { /// Education Eye
			return "http://edeye.com.au";
		}
		else {
			$str .= "/livingin/";
		}
	}
	$str .= strtolower(preg_replace('#\s+#', '-', preg_replace('#[^a-zA-Z0-9-\s]#', '', $categoryName)));
	if (isset($categoryId)) { $str .= "/"; }
	return $str;
}

function urlArticle(&$arg1, $articleFileName = null, $categoryId = null) {
	if (is_a($arg1, "Recordset")) {
		$articleId = $arg1->gcv("ArticleId");
		$articleFileName = $arg1->gcv("ArticleFileName");
	}
	else {
		$articleId = $arg1;
	}
	$str = "";
	if (isset($categoryId)) {
		if ($categoryId == 10) { ///Education Eye
			return "http://edeye.com.au/ee/article.php?ArticleId=".$articleId;
		}
		else {
			$str .= "/livingin/";
		}
	}
	if ($articleFileName) {
		$str .= $articleFileName."-";
	}
	else {
		$str .= "article-";
	}
	$str .= $articleId. ".html";
	return $str;
}
?>