	function showSpecterBox(TargetUrl, maxWidth, maxHeight)
	{
		//hämtar fönsterstorleken. x = pagesize[0], y = pagesize[1]
		var pagesize = getPageSize();


		var IframeContent;
		IframeContent = "<iframe name=\"specterBoxIfrm\" id=\"specterBoxIfrm\" frameborder=\"0\" src=\"/shop/shopfunctions/specterbox/emptyBox.asp\">Your browser doesn't support iframes.</iframe>";
		IframeContent = IframeContent + "<div id=\"specterBoxText\" name=\"specterBoxText\"><img src=\"/shop/shopfunctions/img/x.gif\" onclick=\"hideSpecterBox();\"></div>";

		document.getElementById('specterBoxDiv').innerHTML = IframeContent;
	
		//Kolla om vi ska sätta iframen till något och om den finns..
		if(TargetUrl && document.getElementById('specterBoxIfrm'))
		{
			document.getElementById('specterBoxIfrm').src = TargetUrl;
		}
		//Sätt Autostorlek.
		setDynamicSize('specterBoxDiv', .9);
		//document.getElementById('specterBoxOverlay').style.width =  pagesize[0] + "px";
		//document.getElementById('specterBoxOverlay').style.height =  pagesize[1] + "px";
		document.getElementById('specterBoxOverlay').style.width =  getDocumentWidth() + "px";
		document.getElementById('specterBoxOverlay').style.height =  getDocumentHeight() + "px";
		getPageSize();

		document.getElementById('specterBoxDiv').style.top = getScrollPositionY() + "px";
		document.getElementById('specterBoxDiv').style.left = getScrollPositionX() + "px";
		
		//Onresize-funktion.
		window.onresize = function() 
		{
			setDynamicSize('specterBoxDiv', .9); 
			document.getElementById('specterBoxOverlay').style.width =  getDocumentWidth() + "px";
			document.getElementById('specterBoxOverlay').style.height =  getDocumentHeight() + "px";
			document.getElementById('specterBoxDiv').style.top = getScrollPositionY() + "px";
			document.getElementById('specterBoxDiv').style.left = getScrollPositionX() + "px";
		}
		window.onscroll = function() 
		{
			setDynamicSize('specterBoxDiv', .9); 
			document.getElementById('specterBoxDiv').style.top = getScrollPositionY() + "px";
			document.getElementById('specterBoxDiv').style.left = getScrollPositionX() + "px";
		}
			
		//Visa lagret.
		document.getElementById('specterBoxDiv').style.visibility = "visible";
		document.getElementById('specterBoxOverlay').style.visibility = "visible";
		document.getElementById('specterBoxDiv').focus();
		
	}


	//Dölj specterboxen.
	function hideSpecterBox()
	{
		//Dölj lagret
		document.getElementById('specterBoxDiv').style.visibility = "hidden";
		document.getElementById('specterBoxOverlay').style.visibility = "hidden";

		document.getElementById('specterBoxDiv').innerHTML = "";

		//Kollar om i-framen finns, isåfall töm den.
		if( document.getElementById('specterBoxIfrm') )
		{
			document.getElementById('specterBoxIfrm').src="/shop/shopfunctions/specterbox/emptyBox.asp";
		}
		window.onresize = "";
	}

	//Hämtar hur högt hela dokumentet är
	function getDocumentHeight()
	{
		var pageHeight;
		if( window.innerHeight && window.scrollMaxY ) // Firefox 
		{
			pageHeight = window.innerHeight + window.scrollMaxY;
		}
		else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
		{
		pageHeight = document.body.scrollHeight;
		}
		else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		{ 
			//pageWidth = document.body.offsetWidth + document.body.offsetLeft; 
			pageHeight = document.body.offsetHeight + document.body.offsetTop; 
		}
		return pageHeight;
	}

	//Hämtar hur brett hela dokumentet är
	function getDocumentWidth()
	{
		var pageWidth;
		if( window.innerWidth && window.scrollMaxX ) // Firefox 
		{
			pageWidth = window.innerWidth + window.scrollMaxX;
		}
		else if( document.body.scrollWidth > document.body.offsetWidth ) // all but Explorer Mac
		{
		pageWidth = document.body.scrollWidth;
		}
		else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		{ 
			pageWidth = document.body.offsetWidth + document.body.offsetLeft; 
		}
		return pageWidth;
	}


	//En funktion som hämtar hela pagesizen och returnerar den i en array.
	function getPageSize()
	{
		var de = document.documentElement;
		var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
		var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
		arrayPageSize = [w,h];
		return arrayPageSize;
	}




	//Hämtar positionen på toppen på sidan.
	function getScrollPositionY()
	{
		var yPosition;
		if (document.body.parentElement)  //om IE
		{
			yPosition = document.body.parentElement.scrollTop;
		}else	//Andra än IE
		{
			yPosition = window.pageYOffset;
		}
		return yPosition;
	}

	//Hämtar positionen på toppen på sidan.
	function getScrollPositionX()
	{
		var xPosition;
		if (document.body.parentElement)  //om IE
		{
			xPosition = document.body.parentElement.scrollLeft;
		}else	//Andra än IE
		{
			xPosition = window.pageXOffset;
		}
		return xPosition;
	}


	/*************************************************************************
	  free code from dyn-web.com
	  version date: mar 2008
	*************************************************************************/  
	function setIframeHeight(id, h) {
	    if ( document.getElementById ) {
	        var theIframe = document.getElementById(id);
	        if (theIframe) {
	            dw_Viewport.getWinHeight();
	            theIframe.style.height = Math.round( h * dw_Viewport.height ) + "px";
	            theIframe.style.marginTop = Math.round( (dw_Viewport.height - 
	                parseInt(theIframe.style.height) )/2 ) + "px";
	        }
	    }
	}
	  
	function setDynamicSize(id, h) {
	    if ( document.getElementById ) {
	        var theIframe = document.getElementById(id);
	        if (theIframe) {
	            dw_Viewport.getWinHeight();
	            theIframe.style.height = Math.round( h * dw_Viewport.height ) + "px";
	            theIframe.style.marginTop = Math.round( (dw_Viewport.height - parseInt(theIframe.style.height) )/2 ) + "px";

	            dw_Viewport.getWinWidth();
             	theIframe.style.width = Math.round( h * dw_Viewport.width ) + "px";
	            theIframe.style.marginLeft = Math.round( (dw_Viewport.width - parseInt(theIframe.style.width) )/2 ) + "px";
	        }
	    }
	}
	  
	var dw_Viewport = {
	    getWinWidth: function () {
	        this.width = 0;
	        if (window.innerWidth) 
	            this.width = window.innerWidth - 18;
	        else if (document.documentElement && document.documentElement.clientWidth) 
	            this.width = document.documentElement.clientWidth;
	        else if (document.body && document.body.clientWidth) 
	            this.width = document.body.clientWidth;
	        return this.width;
	    },
	  
	    getWinHeight: function () {
	        this.height = 0;
	        if (window.innerHeight) 
	            this.height = window.innerHeight - 18;
	        else if (document.documentElement && document.documentElement.clientHeight) 
	            this.height = document.documentElement.clientHeight;
	        else if (document.body && document.body.clientHeight) 
	            this.height = document.body.clientHeight;
	        return this.height;
	    },
	  
	    getScrollX: function () {
	        this.scrollX = 0;
	        if (typeof window.pageXOffset == "number") 
	            this.scrollX = window.pageXOffset;
	        else if (document.documentElement && document.documentElement.scrollLeft)
	            this.scrollX = document.documentElement.scrollLeft;
	        else if (document.body && document.body.scrollLeft) 
	            this.scrollX = document.body.scrollLeft; 
	        else if (window.scrollX) 
	            this.scrollX = window.scrollX;
	        return this.scrollX;
	    },
	    
	    getScrollY: function () {
	        this.scrollY = 0;    
	        if (typeof window.pageYOffset == "number") 
	            this.scrollY = window.pageYOffset;
	        else if (document.documentElement && document.documentElement.scrollTop)
	            this.scrollY = document.documentElement.scrollTop;
	        else if (document.body && document.body.scrollTop) 
	            this.scrollY = document.body.scrollTop; 
	        else if (window.scrollY) 
	            this.scrollY = window.scrollY;
	        return this.scrollY;
	    },
	    
	    getAll: function () {
	        this.getWinWidth(); this.getWinHeight();
	        this.getScrollX();  this.getScrollY();
	    }
	  
	}

