﻿// JScript File

function blink()
{
	setTimeout("setblink()",500);
	
}
var fadevalue=0;
function setblink()
{
	
	var carten=document.getElementById("cart");
	
	carten.style.backgroundColor="#69a05d";
	runfade();
}

function runfade()
{
	fadevalue++;
	var carten=document.getElementById("cart");
	var hex=carten.style.backgroundColor;
	//alert(carten.style.backgroundColor);
	
	var red=hex.substring(1,3);
	var green=hex.substring(3,5);
	var blue=hex.substring(5,8);
	
	var newred=parseInt("0x" + red)+fadevalue;
	if (newred>255)
	{
		newred=255;
	}
	var newgreen=parseInt("0x" + green)+fadevalue;
	if (newgreen>255)
	{
		newgreen=255;
	}
	var newblue=parseInt("0x" + blue)+fadevalue;
	if (newblue>255)
	{
		newblue=255;
	}
	
	var newhex=newred.toString(16) + newgreen.toString(16) + newblue.toString(16);
	//alert(red + "!" + green + "!" + blue);
	document.getElementById("cart").style.backgroundColor=newhex;
	
	if (fadevalue<255)
	{
		setTimeout("runfade()",100);
	}
}

function rabat(object)
		{
			var tmpx=0;
			var tmpy=0;

			tmpx=parseInt(event.clientX + document.body.scrollLeft - 100);
			//tmpy=parseInt(event.clientY + document.body.scrollTop - 50);
			
			if(!isNaN(document.documentElement.scrollTop))
			{
				tmpy=parseInt(event.clientY + document.documentElement.scrollTop + 15);
			}
			else
			{
				tmpy=parseInt(event.clientY + document.body.scrollTop + 15);
			}
			//tmpx=parseInt(event.clientX + document.body.scrollLeft );
			//alert(tmpy);
			document.getElementById(object).style.left=tmpx;
			document.getElementById(object).style.top=tmpy;


			document.getElementById(object).style.visibility="visible";
		}
  
		function norabat(object)
		{
			document.getElementById(object).style.width=1;
			document.getElementById(object).style.height=1;
			document.getElementById(object).style.visibility="hidden";
		}
		
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
function showfordeledelay()
		{
			setTimeout("showfordele()",500);
		}
		function showfordele()
		{
			document.getElementById("fordele").style.left="auto";
		}
		function hidefordele()
		{
			document.getElementById("fordele").style.left="-900px";
		}
function dagpop(Itemno)
		{
			window.open('/dagpop.aspx?id=' + Itemno + '', 'Popup', 'height=386,width=441,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no,status=no,directories=no');
		}
	function fold(id)
	{
		if (document.getElementById("tab" + id)!=null)
		{
			if (document.getElementById("tab" + id).style.display=="none")
			{
				document.getElementById("tab" + id).style.display="inline";
			}
			else
			{
				document.getElementById("tab" + id).style.display="none";
			}
	
		}
	}
function Bigpopup(fil)
		{
			window.open('/popup.aspx?src=' + fil + '', 'Popup', 'height=405,width=405,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no,status=no,directories=no');
		}
function GetXmlHttp() 
{
	var xmlhttp = false;
	if (window.XMLHttpRequest)
	{
		xmlhttp = new XMLHttpRequest()
	}
	else if (window.ActiveXObject)// code for IE
	{
		try
		{
		      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e) 
		{
			try
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
			} 
			catch (E) 
			{
				xmlhttp=false
			}
		}
	}
	return xmlhttp;
}


function clearsearch(felt)
	{
		if (document.getElementById(felt).value=="Indtast søgeord")
		{
			document.getElementById(felt).value="";
		}
	}