function PagerHelper(baseUrl, pagerId, currentPage, totalPages, containerElementId, navigationElementId, useAsync)
		{
			this.m_baseUrl = baseUrl;
			this.m_pagerId = pagerId;			
			this.m_useAsync = useAsync;
			this.m_containerElement = document.getElementById(containerElementId);
			this.m_navigationElement = document.getElementById(navigationElementId);
			
			this.currentPage = currentPage;
			this.totalPages = totalPages;
			
			this.showNextPage = function()
			{
				if(this.currentPage < this.totalPages)
				{
					++this.currentPage;
					this.updatePage(this.currentPage); 					
			    }
			}
			
			this.showPrevPage = function()
			{
				if(this.currentPage > 1)
				{
					--this.currentPage;
					this.updatePage(this.currentPage);					
				}			
			}
			 
			this.showPage = function(page)
			{
				this.currentPage = page;
				this.updatePage(this.currentPage);				
			}
			
			this.updatePageInner = function(innerHtml)
			{
				if(this.m_containerElement)
				{
					this.m_containerElement.innerHTML = innerHtml;					
				    this.updateNavigation();
				}
			}
			
			this.updatePage = function(page)
			{
				if((this.xmlHttpObj) && (page > 0))
				{
					if(this.m_useAsync)
						this.sendXmlHttpRequest(this.m_baseUrl, "page=" + page, true, this.updatePageInner);
					else	
					{
						var innerHtml = this.sendXmlHttpRequest(this.m_baseUrl, "page=" + page, false, null);
						this.updatePageInner(innerHtml);
					}
				}
			}
			
			this.updateNavigation = function()
				{
					if(!this.m_navigationElement) 
						return;
						
					var innerHtml = "";	
					if(this.totalPages > 1)
					{
					    
						innerHtml +="<ul class='clearfix'>";
						
					
						//prev
						innerHtml += "<li class='previous'>";
						if(this.currentPage>1)
							innerHtml += "<a class='grey-link' href='javascript:" + this.m_pagerId + ".showPrevPage()'>«&nbsp;Tilbage</a>";
						else
							innerHtml += "«&nbsp;Tilbage";
						innerHtml +="</li>";
						
						
						//next
						innerHtml += "<li class='next'>";
						if(this.currentPage < this.totalPages)
							innerHtml += "<a class='grey-link' href='javascript:" + this.m_pagerId + ".showNextPage()'>Frem&nbsp;»</a>";
						else
							innerHtml += "Frem&nbsp;»";
						innerHtml +="</li>";
						
						
						//Side
						innerHtml +="<li>";	
						innerHtml += "Side";	
						innerHtml +="</li>";
						
						//pages
						for(var i = 1; i <= this.totalPages; i++)
						{
						   
							if(this.currentPage == i)
								innerHtml += "<li class='current'>" + i + "</li>";
							else
								innerHtml += "<li><a class='grey-link' href='javascript:" + this.m_pagerId + ".showPage(" + i + ")'>" + i +"</a></li>";		
						}
						
						
					innerHtml +="</ul>";
					}
					
					this.m_navigationElement.innerHTML = innerHtml;
				}
				
			function getXmlHttpObject()
			{
				var XmlHTTPObj = null;
					
				if (window.XMLHttpRequest) {
					XmlHTTPObj = new XMLHttpRequest();
					if (XmlHTTPObj.overrideMimeType)
					{
						XmlHTTPObj.overrideMimeType('text/xml');
					}
				} 
				else 
					if (window.ActiveXObject)
					{
						 var versions = [ "MSXML2.XMLHTTP", 
						"Microsoft.XMLHTTP", 
						"Msxml2.XMLHTTP.7.0", 
						"Msxml2.XMLHTTP.6.0", 
						"Msxml2.XMLHTTP.5.0", 
						"Msxml2.XMLHTTP.4.0", 
						"MSXML2.XMLHTTP.3.0" ]; 
                     
						for (var i = 0; i < versions.length; i++) 
						{ 
							try 
							{ 
								XmlHTTPObj = new ActiveXObject(versions[i]); 
								if (XmlHTTPObj) 
									break; 
							} 
							catch (e) 
							{} 
						} 					
					}			
					
					
					return XmlHTTPObj;  
			}
			
		    this.xmlHttpObj = getXmlHttpObject();
			
			this.sendXmlHttpRequest = function(url, params, async, callback)
			{		
                var iXmlHttpObj = this.xmlHttpObj; 			
				if((!iXmlHttpObj ) || (!url))
					alert("Can't send AJAX request: XmlHttp object or url is null");
					
			    var response = null;
				var fullUrl = (params)? url + '&' + params: url; 	
		
				if ((async) && (callback))
				{				    
					iXmlHttpObj.onreadystatechange = function()
						{
							if (iXmlHttpObj.readyState == 4 && iXmlHttpObj.status == 200)
								callback(iXmlHttpObj.responseText);
                        };
						
					iXmlHttpObj.open('GET', fullUrl, true);		
                    iXmlHttpObj.send(null);					
				} 
				else 
				{
					iXmlHttpObj.open('GET', fullUrl, false);
					iXmlHttpObj.send(null);
					response = iXmlHttpObj.responseText;
				}
				
				return response;			
			}
						
			this.updatePage(currentPage);		
		}
		