

		
			// Change this to an addLoadEvent, or make sure you put all your onloads in here
			window.onload = function()
			{
				doImagePopups();
			}

			function doImagePopups()
			{
				// Get all links in the document
				var as = document.getElementsByTagName('a');
				var i;

				// Run through them
				for(i=0; i<as.length; i++)
				{
					// Check so that the links classname is "pop-up"
					if(as[i].className.indexOf('pop-up') != -1)
					{
						// Add onclick-event to link
						as[i].onclick = function()
						{
							// Remove imageContainer if there already is one
							if(document.getElementById('pop-up-image-container'))
							{
								var oldImageContainer = document.getElementById('pop-up-image-container');
								oldImageContainer.parentNode.removeChild(oldImageContainer);
							}

							// Create imageContainer
							var imageContainer = document.createElement('div');
							imageContainer.id = 'pop-up-image-container';
							imageContainer.innerHTML = '<h4>' +this.getAttribute('title') + ' </h4><p><em>Stäng fönstret genom att klicka på bilden</em></p><img src="' +this.getAttribute('href') +'" alt="" />';
							imageContainer.style.position = 'absolute';

							// Append it to body
							document.body.appendChild(imageContainer);

							// Remove imageContainer on-click
							imageContainer.onclick = function()
							{
								this.parentNode.removeChild(this);
							}

							return false;
						}
					}
				}
			}
	
