//Add link to users link collection

function addlink(id)
{

	if (confirm("Vil du tilføje linket til dine linkssamling?"))
	{
		window.location = "/minelinks/nytlink/?action=create&id=" + id;
	} else {
		window.location = window.location;

	}
}

//Delete group from users addressbook

function removegroup(id)
{
	if (confirm("Er du sikker på at du vil fjerne gruppe fra din adressebog?"))
	{
		window.location = "/adressebog/redigergruppe/?action=removegroup&id=" + id;
	} else {
		window.location = "/adressebog/redigergruppe/";

	}
}

//Delete person from users addressbook

function removeperson(id)
{
	if (confirm("Er du sikker på at du vil fjerne personen fra din adressebog?"))
	{
		window.location = "/adressebog/redigerperson/?action=removeperson&id=" + id;
	} else {
		window.location = "/adressebog/redigerperson/";

	}
}

//Delete link from users link collection

function removelink(id)
{
	if (confirm("Er du sikker på at du vil fjerne linket fra dine links?"))
	{
		window.location = "/minelinks/redigerlinks/?action=removelink&id=" + id;
	} else {
		window.location = "/minelinks/redigerlinks/";

	}

}

//Delete iamge from the users profile

function deleteimage(id)
{
	if (confirm("Er du sikker på at du vil slette dit profil billede?"))
	{
		window.location = "/minprofil/billede/?action=deleteimage&id=" + id;
	} else {
		window.location = "/minprofil/billede/";

	}

}

//Create a popup window

function popwin(fil,navn,bred,hoj,scroll,resize)
{
	window.open(fil,navn,eval("'width=" + bred + ",height=" + hoj + ",scrollbars=" + scroll + ",resizable=" + resize + ",status=no,titlebar=no'"));
}


//Function for showing and hiding divs

var bgcolor1 = '#ffffff';
var bgcolor2 = '#ffffff';

function changebgcolorLogin(layer_ref) {
	if (bgcolor1 == '#e6f1f9') {
		bgcolor1 = '#ffffff';
	} else {
		bgcolor1 = '#e6f1f9';
	}
	if (document.all) { //IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.backgroundColor = bgcolor1");
	}
	if (document.layers) { //NETSCAPE 4 or below
		document.layers[layer_ref].backgroundColor = bgcolor1;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.backgroundColor = bgcolor1;
	}
}

function changebgcolorCreate(layer_ref) {
	if (bgcolor2 == '#e6f1f9') {
		bgcolor2 = '#ffffff';
	} else {
		bgcolor2 = '#e6f1f9';
	}
	if (document.all) { //IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.backgroundColor = bgcolor2");
	}
	if (document.layers) { //NETSCAPE 4 or below
		document.layers[layer_ref].backgroundColor = bgcolor2;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.backgroundColor = bgcolor2;
	}
}

var state1 = 'none';
var state2 = 'none';

function showhideLogin(layer_ref) {
	if (state1 == 'block') {
		state1 = 'none';
	} else {
		state1 = 'block';
	}
	if (document.all) { //IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state1");
	}
	if (document.layers) { //NETSCAPE 4 or below
		document.layers[layer_ref].display = state1;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state1;
	}
}

function showhideCreate(layer_ref) {
	if (state2 == 'block') {
		state2 = 'none';
	} else {
		state2 = 'block';
	}
	if (document.all) { //IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state2");
	}
	if (document.layers) { //NETSCAPE 4 or below
		document.layers[layer_ref].display = state2;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state2;
	}
}

function bookmark() {
	if (navigator.appName == "Microsoft Internet Explorer") {
		window.external.AddFavorite(location.href, document.title);
	} else {
		alert('Tryk på CTRL+D for at tilføje budento.dk til dine foretrukne');
	}
}