use strict;return sub{my $this = shift;my $C = $this->{C};$this->out("");$this->out(Zen::PerlHandler->get("II1252dc7fb87692516a837baa47a9aaf3->mnt_display")->do($this->{C}));$this->out("\n<style type=\"text/css\">\n	.Linkdir_$C->{UniqId}_ {\n	  padding:5px;\n	  background-color:$C->{Style}{bgcolor};\n	  color:$C->{Style}{font_color};\n	  font-family:$C->{Style}{font_style};\n	  font-size:$C->{Style}{font_size};\n	}\n\n	a.Cat_$C->{UniqId}_ {\n	  color:$C->{Style}{font_color};\n	  background-color:$C->{Style}{bgcolor};\n	  font-family:$C->{Style}{font_style};\n	  font-size:$C->{Style}{font_size};\n	}\n\n	a.CatSel_$C->{UniqId}_ {\n	  color:$C->{Style}{bgcolor};\n	  background-color:$C->{Style}{font_color};\n	  font-family:$C->{Style}{font_style};\n	  font-size:$C->{Style}{font_size};\n	}\n</style>\n\n<script>\n\n$C->{JsArrays}\n\nfunction SelectCat_$C->{UniqId}_(cat_id, display_all)\n{\n	var divCats = document.getElementById(\'Cats_$C->{UniqId}_\');\n	\n	if ($C->{CatsCount})\n	{\n		if (cat_id == -1)\n			divCats.innerHTML = \'<b><a class=\"CatSel_$C->{UniqId}_\">All categories</a></b>\';\n		else\n			divCats.innerHTML = \'<b><a class=\"Cat_$C->{UniqId}_\" href=\"javascript:SelectCat_$C->{UniqId}_(-1,0);\">All categories</a></b>\';\n	}\n	\n	for (n = 0; n < $C->{CatsCount}; n++)\n	{\n		divCats.innerHTML += \'&nbsp;&nbsp;|&nbsp;&nbsp;\';\n		\n		if (cat_id == n)\n			divCats.innerHTML += \'<b><a class=\"CatSel_$C->{UniqId}_\">\' + Cats_$C->{UniqId}_[n] + \'</a></b>\';\n		else\n			divCats.innerHTML += \'<b><a class=\"Cat_$C->{UniqId}_\" href=\"javascript:SelectCat_$C->{UniqId}_(\' + n + \',0);\">\' + Cats_$C->{UniqId}_[n] + \'</a></b>\';\n	};\n	\n	if (cat_id == -1)\n	{\n		var AllLinks = new Array();\n		\n		for (c = 0; c < Links_$C->{UniqId}_.length; c++)\n			for (l = 0; l < Links_$C->{UniqId}_[c].length; l++)\n				AllLinks.push(Links_$C->{UniqId}_[c][l]);\n		\n		AllLinks.sort(SortLinks_$C->{UniqId}_);\n		DisplayLinks_$C->{UniqId}_(AllLinks, display_all, -1);\n	}\n	else\n		DisplayLinks_$C->{UniqId}_(Links_$C->{UniqId}_[cat_id], display_all, cat_id);\n	\n}\n\nfunction DisplayLinks_$C->{UniqId}_(LinkArray, display_all, cat_id)\n{\n	var first_page_size = $C->{Linkdir}{first_page_size};\n	var allow_visitors_links = $C->{Linkdir}{allow_visitors_links};\n	\n	var divLinks = document.getElementById(\'Links_$C->{UniqId}_\');\n	divLinks.innerHTML = \'\';\n	\n	if (LinkArray.length)\n	{\n		for (n = 0; n < (display_all || ! first_page_size || LinkArray.length < first_page_size ? LinkArray.length : first_page_size); n++)\n		{\n			divLinks.innerHTML += \'*<b><a href=\"\' + LinkArray[n][1] + \'\" target=\"_blank\" class=\"$C->{LinkdirCSSClass}\" style=\"$C->{Style}{css_style}\">\' + LinkArray[n][2] + \'</a></b><br>\';\n			if(LinkArray[n][3] != \'\')divLinks.innerHTML += LinkArray[n][3] + \'<br>\';\n			divLinks.innerHTML += \'<br>\';\n		};\n		\n		if ( ! display_all && first_page_size > 0 && LinkArray.length > first_page_size )\n		{\n			divLinks.innerHTML += \'<b><a class=\"Cat_$C->{UniqId}_\" href=\"javascript:SelectCat_$C->{UniqId}_(\' + cat_id + \',1)\">\' \n				+ ($C->{CatsCount} ? \'Display all in this category\' : \'Display all\')\n				+ \'</a></b>\';\n			\n			if (allow_visitors_links)\n				divLinks.innerHTML += \'&nbsp;&nbsp;|&nbsp;&nbsp;\';\n		}\n	}\n	else\n	{\n		divLinks.innerHTML = $C->{CatsCount} ? \'This category is empty\' : \'Links directory is empty\';\n		\n		if (allow_visitors_links)\n			divLinks.innerHTML += \'<br><br>\';\n	}\n	\n	// Add your link\n	if (allow_visitors_links)\n		divLinks.innerHTML += \'<b><a class=\"Cat_$C->{UniqId}_\" href=\"javascript:ShowFormPostLink_$C->{UniqId}_()\">Add your link</a></b>\';\n}\n\nfunction SortLinks_$C->{UniqId}_(a, b)\n{\n	if (a[0] > b[0])\n		return 1;\n	else\n		return -1;\n}\n\nfunction ShowFormPostLink_$C->{UniqId}_()\n{\n	var iframeId = \'IFramePostLink_$C->{UniqId}_\';\n	var iframe = document.getElementById(iframeId);\n	iframe.style.display=\'\';\n}\n\n</script>\n\n<table class=\"$C->{LinkdirCSSClass}\" style=\"$C->{Style}{css_style}\" width=\"$C->{Style}{width}\">\n");if ( $C->{CatsCount} ) {$this->out("	<tr><td><div id=\"Cats_$C->{UniqId}_\">Cats</div></td></tr>\n	<tr><td>&nbsp;</td></tr>\n");}$this->out("	<tr><td><div id=\"Links_$C->{UniqId}_\">Links</div></td></tr>\n");if ( $C->{Linkdir}{allow_visitors_links} ) {$this->out("	<tr><td><br>\n		<iframe\n			width=\"100\%\" height=\"430\" frameborder=\"0\" style=\"display:none\"\n			name=\"IFramePostLink_$C->{UniqId}_\" id=\"IFramePostLink_$C->{UniqId}_\"\n			src=\"$C->{PostLinkURL}\">\n		</iframe> \n	</td></tr>\n");}$this->out("</table>\n\n<script>SelectCat_$C->{UniqId}_(-1,0);</script>\n");}