// JavaScript Document
var box1,box2;

function setBoxes() {
	
	box1 = document.getElementById("greenBox1");
	box1.onmouseover = function() { box1.style.backgroundPosition = "0px 101px"; };
	box1.onmouseout = function() { box1.style.backgroundPosition = "0px 0px"; };
	
	box2 = document.getElementById("greenBox2");
	box2.onmouseover = function() { box2.style.backgroundPosition = "0px 101px"; };
	box2.onmouseout = function() { box2.style.backgroundPosition = "0px 0px"; };
}

function forwardTo(pUrl)
{
	document.location.href = pUrl;	
	
}

function submitForm(formId)
{
	document.getElementById(formId).submit();
}

var originalValues = new Object();

function smartInputs()
{
	var i = arguments.length;
	
	if(i < 1)
		return;
		
	originalValues = new Array(i);
		
	for(var j = 0; j < i; j++)
	{
		var elem = $(arguments[j]);
		originalValues[arguments[j]] = elem.value;
		
		elem.onclick = function() { clearIfEmpty(this); }
		elem.onblur = function() { restoreIfEmpty(this); }
	}	
}

function clearIfEmpty(elem)
{
	if(elem.value == originalValues[elem.id])
		elem.value = "";
}

function restoreIfEmpty(elem)
{
	if(elem.value == "")
		elem.value = originalValues[elem.id];
}

function $(elem)
{
	return document.getElementById(elem);
}
