
function startSearch(inputValue) {
	if (inputValue.value == "Search Earthrise.com") {
		inputValue.value = "";
		inputValue.style.color = "#000000"
	}
}

function endSearch(inputValue) {
	if (trim(inputValue.value) == "") {
		inputValue.value = "Search Earthrise.com";
		inputValue.style.color = "#C4C4C4"
	}
}

function startPostCodeMain(inputValue) {
    inputValue.value = "";
    inputValue.style.color = "#000000"
}
function startPostCode(inputValue) {
    if (inputValue.value == "Zip Code") {
        inputValue.value = "";
        inputValue.style.color = "#000000"
    }
}

function endPostCode(inputValue) {
    if (trim(inputValue.value) == "") {
        inputValue.value = "Zip Code";
        inputValue.style.color = "#C4C4C4"
    }
}

function trim(inputValue) {
	return inputValue.replace(/^\s+|\s+$/g,"");
}

function setTab(tabID) {
    var maxTab = 0;
    var stopLoop = false;
    var generateTabExecute = "";
    while (!stopLoop) {
        maxTab++;
        var tempObject = eval("document.getElementById(\"tab" + maxTab + "\")");
        if (tempObject == null) {
            stopLoop = true;
        }
        else {
            if (generateTabExecute != "") {
                generateTabExecute += ", ";
            }
            generateTabExecute += "\"tab" + maxTab + "\"";
        }
    }
    eval("var tabList = Array(" + generateTabExecute + ")");

    for (var i = 0; i < tabList.length; i++) {
        var tabObject = document.getElementById(tabList[i]);
        var tabContentObject = document.getElementById(tabList[i] + "Content");

        if (tabList[i] == tabID) {
            tabObject.className = "active";
            tabContentObject.style.display = "";
        }
        else {
            tabObject.className = "";
            tabContentObject.style.display = "none";
        }
    }
}

function openWindow(inputObject) {
    window.open(inputObject.href, "_blank");
    return false;
}
