document.createElement("testimonial");
document.createElement("name");
document.createElement("company");

window.onload = function () {
    var bodyID = document.getElementsByTagName('body')[0].id;
    if (bodyID == "AboutUs" || bodyID == "OurServices" || bodyID == "CoverageAreas" || bodyID == "ClientTestimonials" || bodyID == "ContactUs") {
        var lnkImage = document.getElementById("lnk" + bodyID);
        lnkImage.src = "/images/lnk" + bodyID + "Red.gif";
        formatCols();
        fillTestimonials();
    }
    else if (!(bodyID == "Home" || bodyID == "Login" || bodyID == "PlaceAnOrder" || bodyID == "Confirmation")) {
        var tabImage = document.getElementById("tab" + bodyID);
        tabImage.src = "/images/tab" + bodyID + "Red.png";
        if (document.getElementsByTagName('body')[0].className == "BackendGeneral") {
            document.getElementById('tabsGeneral').style.display = "";
            document.getElementById('tabsSpec').style.display = "none";
        }
        else {
            document.getElementById('tabsSpec').style.display = "";
            document.getElementById('tabsGeneral').style.display = "none";
        }
    }
    else if (!(bodyID == "Confirmation")) {
        fillTestimonials();
        if (bodyID == "PlaceAnOrder") {
            formatCols();
        }
    }
    if (bodyID == "Transactions") {
        checkChanged('default');
    }
}

function formatCols() {
    var col1Height = ((document.getElementById('col1').offsetHeight) + 'px');
    document.getElementById('col2').style.height = col1Height;
}

function fillTestimonials() {
    var testimonial = document.getElementsByTagName("testimonial")[0];
    var name = document.getElementsByTagName("name")[0];
    var company = document.getElementsByTagName("company")[0];

    var arrTestimonials = new Array();
    arrTestimonials[0] = new Array("Thank you for being so speedy.", "Linda S. Houser", "Landamerica Commonwealth Title");
    arrTestimonials[1] = new Array("Thanks for a job well done and so quickly. I really appreciate it.", "GALE", "JM TITLE");
    arrTestimonials[2] = new Array("Thanks for all you do. I love working with you. When we have a tough client, it helps to know you are there on the other end for me.", "Susan Hindmarsh", "Ticor Title");
    arrTestimonials[3] = new Array("Here is the contact info for Hudson Search. We found this company to be much quicker and offer more personal service than some of the big companies and the pricing was always reasonable.", "Linda Izzo Heinrich", "");
    arrTestimonials[4] = new Array("Thanks again for your great services. I'm glad we took a chance with Hudson. You are the best!!!", "Kathleen Mullen", "The Monte Group");
    arrTestimonials[5] = new Array("Thank you. I'm impressed with your turnaround time. I look forward to working with you here on out.", "Derrick Saunders", "Greenacre Abstract");
    arrTestimonials[6] = new Array("I will continue to send all my tax and muni requests to you... Why would I choose anyone else when I already use the best?!", "John C. Killam", "Title Processing Center");
    
    var temp = parseInt(Math.random() * arrTestimonials.length);

    testimonial.innerHTML = arrTestimonials[temp][0] + "&#34;";
    name.innerHTML = arrTestimonials[temp][1];
    company.innerHTML = arrTestimonials[temp][2];

    if (name.innerHTML == "") {
        name.parentNode.style.display = "none";
    }
}

function hoverLinks(link) {
    if (link == "lnkOurServices" || link == "lnkAboutUs") {
        displayDdl(link);
    }
    if (document.getElementById(link.substring(3))) {
    }
    else {
        var image = document.getElementById(link);
        if (link.substring(0, 3) != "tab") {
            image.src = "/images/" + link + "Red.gif";
        }
        else {
            image.src = "/images/" + link + "Red.png";
        }
    }
}
function removeHover(link) {
    if (link == "lnkOurServices" || link == "lnkAboutUs") {
        hideDdl(link);
    }
    if (document.getElementById(link.substring(3))) {
    }
    else {
        var image = document.getElementById(link);
        if (link.substring(0, 3) != "tab") {
            image.src = "/images/" + link + ".gif";
        }
        else {
            image.src = "/images/" + link + ".png";
        }
    }
}
function displayDdl(link) {
    var ddl = document.getElementById("ddl" + link.substring(3));
    ddl.style.display = "";
}
function hideDdl(link) {
    var ddl = document.getElementById("ddl" + link.substring(3));
    ddl.style.display = "none";
}
