function popup(url,name,win_height,win_width)
{
	pos_horizon = ((screen.width/2)-(win_width/2));
	pos_vertical = ((screen.height/2)-(win_height/2));
	window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
}

function eksempel(value)
{
	if (value == 1)
	{
		tekst = "Eks: 1000 kr";
		type = "Pris";
	}
	if (value == 2)
	{
		tekst = "Eks: Ring for pris";
		type = "Tekst";
	}
	if (value == 3)
	{
		tekst = "Eks: www.milling-byg.dk";
		type = "Link";
	}
	document.getElementById("eksempel").innerHTML = type;
	document.getElementById("eksempel2").innerHTML = tekst;
}

function createAjax()
{
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
			{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlHttp;
}

function skiftBillede(id, parent)
{
	var xmlHttp = createAjax();
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			document.getElementById("billedbox").innerHTML=xmlHttp.responseText;
		}
	}
	var url="./skift_billede.php";
	url=url+"?id="+id;
	url=url+"&parent="+parent;
	url=url+"&sid="+Math.random();
	xmlHttp.open("GET", url,true);
	xmlHttp.send(null);
}
