﻿
function changeTest(linkID) {

    document.getElementById(linkID).innerHTML = "Please wait...";
    //document.getElementById(linkID).disabled = "disabled";


}

function conToUppercase(fieldName) {

    var conStr = document.getElementById(fieldName).value;
    var result = conStr.toUpperCase();
    document.getElementById(fieldName).value = result;

}

function signin() {

    document.getElementById('reminder').style.display = "none";
    document.getElementById('sign-in').style.display = "";

}

function reminder() {

    document.getElementById('reminder').style.display = "";
    document.getElementById('sign-in').style.display = "none";

}

function openNewAddress() {

    document.getElementById('add_address').style.display = "";

}

function closeNewAddress() {

    document.getElementById('add_address').style.display = "none";

}

function openWindow(url, width, height) {
    window.open(url, "NewWindow", "status = 1, height = " + height + ", width = " + width + ", resizable = 0")
}

function chatWindow(url) {
    window.open(url, "ChatWindow", "status = 1, height = 500, width = 600, resizable = 0")
}

function switchAddress(firstname, lastname, companyName, address, address2, address3, county, postcode, countryCode) {

    if (typeof (firstname) === 'undefined') { firstname = ""; }
    if (typeof (lastname) === 'undefined') { lastname = ""; }
    if (typeof (companyName) === 'undefined') { companyName = ""; }
    if (typeof (address) === 'undefined') { address = ""; }
    if (typeof (address2) === 'undefined') { address2 = ""; }
    if (typeof (address3) === 'undefined') { address3 = ""; }
    if (typeof (county) === 'undefined') { county = ""; }
    if (typeof (postcode) === 'undefined') { postcode = ""; }
    if (typeof (countryCode) === 'undefined') { countryCode = ""; }


    document.getElementById('firstname').value = firstname;
    document.getElementById('lastname').value = lastname;
    document.getElementById('companyName').value = companyName;
    document.getElementById('address').value = address;
    document.getElementById('address2').value = address2;
    document.getElementById('address3').value = address3;
    document.getElementById('county').value = county;
    document.getElementById('postcode').value = postcode;
    document.getElementById('countryCode').value = countryCode;

}

function resetSearch(resetcontainer,text) {

    if (document.getElementById(resetcontainer).value == "") {
        document.getElementById(resetcontainer).value = text;
    }

}

function showMore(id) {

    document.getElementById('link_' + id).style.display = "none";
    document.getElementById('more_' + id).style.display = "";

}

function openPage(url) {

    window.location = url;

}

function clearSearch(container, text) {

    if (document.getElementById(container).value == text) {
        document.getElementById(container).value = "";
    }

}


