// Baggrundsfarve til knapperne
bgColor = Array("#d65efe", "#c95dfe", "#bd5dfe", "#b05dfe", "#a45cfe", "#985cfe", "#8c5cfe", "#7f5bfe", "#735bfe", "#675bfe", "#5b5bfe")
bgSpeed = "100"
bgTimerId = Array()

function Hove(Id) {
	clearTimeout(bgTimerId[Id])
	document.getElementById(Id).style.background = bgColor[0]
}

function Fade(Id, State) {
	State++
	clearTimeout(bgTimerId[Id])
	document.getElementById(Id).style.background = bgColor[State]
	if (State < 10) bgTimerId[Id]=setTimeout("Fade('" + Id + "', " + State + ")",bgSpeed)
}


// Tips i header - fade funktion
msgColor = Array("#ffffff", "#e6e6e6", "#cccccc", "#b3b3b3", "#999999", "#808080", "#666666", "#4d4d4d", "#333333", "#1a1a1a", "#000000")
msgSpeed = "100"
msgTimerId = Array()

function Show(Id, State) {
	State++
	clearTimeout(msgTimerId[Id])
	document.getElementById(Id).style.visibility = "visible"
	document.getElementById(Id).style.color = msgColor[State]
	if (State < 10) msgTimerId[Id]=setTimeout("Show('" + Id + "', " + State + ")", msgSpeed)
}

function Hide(Id) {
	clearTimeout(msgTimerId[Id])
	document.getElementById(Id).style.color = msgColor[0]
	document.getElementById(Id).style.visibility = "hidden"
}


//Generate mail address...
function sendMail() {
  mserver = "mettle.dk"
  mname = "mail"
  window.location.href = "mailto:" + mname + "@" + mserver
}

// Clear text field on tag wall
function clearText(thefield){
  if (thefield.defaultValue == thefield.value)
    thefield.value = ""
}

// Show / hide / change image for things in the blog
function showhide(p) {
  prefix = 'i' + p;
  if(document.getElementById(prefix + 'Show').style.display == 'none') { // Hide things
    document.getElementById(prefix + 'Show').style.display = 'inline';
    document.getElementById(prefix + 'Hide').style.display = 'none';
    document.getElementById(prefix + 'Content').style.display = 'none';
    document.getElementById(prefix + 'Img').src = '/img/blogbullet.gif';
  }
  else { // Show things
    document.getElementById(prefix + 'Show').style.display = 'none';
    document.getElementById(prefix + 'Hide').style.display = 'inline';
    document.getElementById(prefix + 'Content').style.display = 'block';
    document.getElementById(prefix + 'Img').src = '/img/blogbulletd.gif';
  }
}
