/*
	SimpleFoundation JavaScript Effects

	Should be used to add JavaScript effects to SimpleFoundation xhtml pages
	and should be used with the simplefoundation.css file.

	copyright under the GNU GPL by Timothy Edmund Crosley
*/


var textSize = "normal";
var textSizeId = "text-normal";

//Should be used to highlight code when the mouse is placed over it
function mouseOverCode(id)
{
	document.getElementById(id).style.backgroundColor = 'white';
}

//Should be used to unhighlight code when the mouse is moved away from it
function mouseOutOfCode(id)
{
	document.getElementById(id).style.backgroundColor = '#eaeaea';
}

//Should be used to highlight links when the mouse is placed over them
function mouseOverLink(id)
{
	document.getElementById(id).style.backgroundColor = '#eaeaea';
}

//Should be used to unhighlight links when the mouse is moved away from them
function mouseOutOfLink(id)
{
	document.getElementById(id).style.backgroundColor = 'white';
}

//Should be used to set the text size of an element dynamically
function setTextSize(textId, buttonId, size)
{
	document.getElementById(textSizeId).style.color = '#afcce7';
	
	if(size == "small"){
		document.getElementById(textId).style.fontSize = '50%';
		document.getElementById(buttonId).style.color = 'white';
		textSizeId = buttonId;
		textSize = size;
	}
	if(size == "normal"){
		document.getElementById(textId).style.fontSize = '100%';
		document.getElementById(buttonId).style.color = 'white';
		textSizeId = buttonId;
		textSize = size;
	}
	if(size == "large"){
		document.getElementById(textId).style.fontSize = '150%';
		document.getElementById(buttonId).style.color = 'white';
		textSizeId = buttonId;
	}
	if(size == "huge"){
		document.getElementById(textId).style.fontSize = '200%';
		document.getElementById(buttonId).style.color = 'white';
		textSizeId = buttonId;
	}
}

//Should be used to illuminate size choices on mouse over
function mouseOverSize(id)
{
	document.getElementById(id).style.color = 'white';
}

//Should be used to remove illumination when the mouse is no longer over a size choice
function mouseOutOfSize(id)
{
	if(id != textSizeId){
		document.getElementById(id).style.color = '#afcce7';
	}
}

//Should be used to change images on mouse over
function mouseOverImage(id, newImage)
{
	document.getElementById(id).src = newImage;
}

//Should be used to revert images on mouse out
function mouseOutOfImage(id, newImage)
{
	document.getElementById(id).src = newImage;
}
