function writePages (n_pages) {
	var n_links = 5;

	// get the url of the page
	var s_fullPath = window.location;

	// extract the path, prefix, index and ext.
	var re_fileName = /([^\/]+)$/;
	var re_nameIdxExt = /^(.+?)(\d+)(\..+)$/;
	
	if (!re_fileName.exec(s_fullPath)) return;
	var s_fileName = RegExp.$1;
	var s_filePath = RegExp.leftContext;

	if (!re_nameIdxExt.exec(s_fileName)) return;
	var s_prefix = RegExp.$1,
		n_index = Number(RegExp.$2),
		s_ext = RegExp.$3;

	
	
	

	if (n_links) {
		if (n_links > n_pages)
			n_links = n_pages;
		
		var n_sideLinks = Math.floor((n_links - 1) / 2),
			n_firstLink, n_lastLink;
		
		if (n_index + n_sideLinks >= n_pages) {
			n_firstLink = n_pages - n_links + 1;
			n_lastLink = n_pages;
		}
		else if (n_index - n_sideLinks <= 0) {
			n_firstLink = 1;
			n_lastLink = n_links;
		}
		else {
			n_firstLink = n_index - n_sideLinks;
			n_lastLink = n_firstLink + n_links - 1;
		}
		for (var i = n_firstLink; i <= n_lastLink; i++)
			document.write('page&nbsp;'+i == n_index ? i + '<br>' : '<a  style="font-family:Verdana; font-size: 14px; font-style: normal;	format: normal; color: #5A5A5A;  margin-top: 5px;margin-bottom: 2px;  text-align: left; background: none" href="' + s_filePath + s_prefix + i + s_ext + '" title="go to page ' + i + '">page&nbsp;'+ i + '</a><br>');
			
	}
	
	
	}
