function showModal(id)  {
	hideAllModals();
	document.getElementById(id).style.display = "block";
	return false;
}

function hideAllModals()  {
	$('div.popup').hide();
}

function fadeOutModal(id, delay) {
	//Sätt globala variabler som funkar med Timeout
	id_global = id;
	//Fade out
	setTimeout("$('#'+id_global).fadeOut('slow')", delay);
}

function hover(obj)  {
	obj.style.backgroundColor = "#ccc";
}

function unHover(obj)  {
	obj.style.backgroundColor = "white";
}

function emptyField(obj, content)  {
	if (obj.value == content)  {
		if (content == "Lösenord")  {
			var obj2 = obj.cloneNode(false);
			obj2.type = 'password';
			obj.parentNode.replaceChild(obj2, obj)
			obj = obj2;
			obj.focus();
		}
		obj.style.color = "#5b5b5b";
		obj.style.fontStyle = "normal";
		obj.value = "";
	}
}

function fillField(obj, content)  {
	if (obj.value == "")  {
		if (content == "Lösenord")  {
			var obj2 = obj.cloneNode(false);
			obj2.type = 'text';
			obj.parentNode.replaceChild(obj2, obj)
			obj = obj2;
		}
		obj.style.color = "#aaa";
		obj.style.fontStyle = "italic";
		obj.value = content;
	}
}

function signupFields(obj)
{
	var id = obj.id;
	var idLen = id.length;
	var idShort = id.substr(0, idLen-1);
	var val = obj.value;
	document.getElementById(idShort+'1').value = val;
	document.getElementById(idShort+'2').value = val;
}
