
	function addProduct(ID){
	//alert('/moduler/rillenshop/frontend/kurv/cart.asp?action=add&productID='+ID+'&url='+escape(window.location.href))
	window.location = '/moduler/rillenshop/frontend/kurv/cart.asp?action=add&productID='+ID+'&url='+escape(window.location.href);
	}
	function RemoveProduct(ID){
	window.location = '/moduler/rillenshop/frontend/kurv/cart.asp?action=delete&ProduktID='+ID+'&url='+escape(window.location.href);
	}
function ShowAmt(id)
{
if (id == 99999)
	{
	window.open('http://www.kommunikationogsprog.dk/auklub');
	}
	else
	{
	window.location=('/?Id='+id);
	}
}

function UnCheckWhat(FormField)
{
	FormField.checked = false;
}
function SetChecked(val, intFrom, intTo, frmName) 
{
	strForm=document.forms[frmName];
	var i=intFrom;
	for( i=intFrom ; i<=intTo ; i++) 
	{
		strForm.elements[i].checked=val;
	}
}



function ShowSatsList(id)
{
	window.location=('/index.asp?Id='+id);
}
function OpenPrint(strPage) 
{
	window.open(strPage,'Print','height=450,width=650,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no,top='+(screen.height-450)/2+',left='+(screen.width-600)/2);
}
function ScreenPrint()
{
	window.print();
	window.close();
}

function ShowPublicationList(id)
{
	if (id == 9999)
	{
	window.open('http://www.adir.dk/blanketter.htm');
	}
	else
	{
	window.location=('/moduler/publications/frontend/index.asp?PublicationCategory='+id);
	}
}
function ShowKursusList(id)
{
	window.location=(id);
}
function ShowNews(id)
{
	window.location=('/index.asp?NyhedsId='+id);
}

function NumberOk(str)
{
  for (var i = 0; i < str.length; ++i)
    if (str.charAt(i) < '0' || str.charAt(i) > '9') return false;
  return true;
}

function Trim(str)
{
  var tmp = "";
  var n = str.length;
  var i = 0;
  var j = n;
  while (str.charAt(i) == ' ' && i < n) ++i;
  while (str.charAt(j) == ' ' && j > 0) --j;
  if (i < j) tmp = str.substring(i, j);
  return tmp;
}

function ToAMD(dato)
{
  if (dato.length == 0) return "";
  var dag = dato.substring(0, 2);
  var mdr = dato.substring(3, 5);
  var aar = dato.substring(6);
  return aar + "-" + mdr + "-" + dag;
}

function ToDMA(dato)
{
  if (dato.length == 0) return "";
  var aar = dato.substring(0, 4);
  var mdr = dato.substring(5, 7);
  var dag = dato.substring(8);
  return dag + "-" + mdr + "-" + aar;
}

function y2k(number)
{
	return (number < 1000) ? number + 1900 : number;
}

function padout(number)
{
	return (number < 10) ? '0' + number : number;
}

var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = y2k(today.getYear());
var whichOne = 0;

function restart()
{
	document.editor.elements['date' + whichOne].value = '' + padout(day) + '-' + padout(month - 0 + 1) + '-' + year;
	mywindow.close();
	document.editor.elements['date' + whichOne].focus();
}

function newWindow(number)
{
	whichOne = number;
	day = today.getDate(), month = today.getMonth(), year = y2k(today.getYear());
	mywindow=open('../lib/cal.htm','vindue','resizable=no,width=300,height=190');
	mywindow.location.href = '../lib/cal.htm';
	if (mywindow.opener == null) mywindow.opener = self;
}

function found(box, id, kode)
{
  var item = id + ":" + kode;
	for (var i = 0; i < box.options.length; i++)
	{
		if (box.options[i].value == item) return true;
	}
	return false;
}

function moveTo(fbox, tbox, kode)
{
	for (var i = 0; i < fbox.options.length; i++)
	{
		if (fbox.options[i].selected && fbox.options[i].value != "")
		{
			if (!found(tbox, fbox.options[i].value, kode))
			{
				var no = new Option();
				no.value = fbox.options[i].value + ":" + kode;
				no.text = "[" + kode + "] " + fbox.options[i].text;
				tbox.options[tbox.options.length] = no;
			}
		}
	}
}

function removeFrom(box)
{
  for (var i = 0; i < box.options.length; i++)
  {
    if (box.options[i].selected && box.options[i].value != "")
    {
      box.options[i].value = "";
      box.options[i].text = "";
    }
  }
  BumpUp(box);
}

function BumpUp(box)
{
	for (var i = 0; i < box.options.length; i++)
	{
		if (box.options[i].value == "")
		{
			for (var j = i; j < box.options.length-1; j++)
			{
				box.options[j].value = box.options[j+1].value;
				box.options[j].text = box.options[j+1].text;
			}
			var ln = i;
			break;
		}
	}
	if (ln < box.options.length)
	{
		box.options.length -= 1;
		BumpUp(box);
	}
}



