﻿function initOverLabels() {
    if (!document.getElementById) return;

    var labels, id, field;

    // Set focus and blur handlers to hide and show 
    // LABELs with 'overlabel' class names.
    labels = document.getElementsByTagName('label');
    for (var i = 0; i < labels.length; i++) {

        if (labels[i].className == 'overlabel') {

            // Skip labels that do not have a named association
            // with another field.
            id = labels[i].htmlFor || labels[i].getAttribute('for');
            if (!id || !(field = document.getElementById(id))) {
                continue;
            } // end if

            // Change the applied class to hover the label 
            // over the form field.
            labels[i].className = 'overlabel-apply';

            // Hide any fields having an initial value.
            if (field.value !== '') {
                hideLabel(field.getAttribute('id'), true);
            } // end if

            // Set handlers to show and hide labels.
            field.onfocus = function () {
                hideLabel(this.getAttribute('id'), true);
            }; // end function
            field.onblur = function () {
                if (this.value === '') {
                    hideLabel(this.getAttribute('id'), false);
                } // end if
            }; //end function

            // Handle clicks to LABEL elements (for Safari).
            labels[i].onclick = function () {
                var id, field;
                id = this.getAttribute('for');
                if (id && (field = document.getElementById(id))) {
                    field.focus();
                }
            };

        } // end if
    } // end for
    document.getElementById('submit').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('firstname').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('lastname').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('ctry').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('_email').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('_phone').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('_fax').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('_area-of-work').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

    document.getElementById('cmmnts').onclick = function () {
        alert("We're sorry, but our Join Us form is not yet operational.");
        return false;
    };

};

function hideLabel(field_id, hide) {
    var field_for;
    var labels = document.getElementsByTagName('label');
    for (var i = 0; i < labels.length; i++) {
        field_for = labels[i].htmlFor || labels[i].getAttribute('for');
        if (field_for == field_id) {
            labels[i].style.textIndent = (hide) ? '-1000px' : '0px';
            return true;
        }
    }
}

/*window.onload = function () {
setTimeout(initOverLabels, 50);
}; */


var page = 'home';
var tab = 'latest';
var xmlhttp = false;
try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
    try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
        xmlhttp = false;
    }
}

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
{
    xmlhttp = new XMLHttpRequest();
}

function makerequest(sideName, mainName, objID, callback) 
{

    if (sideName == 'linksactive-' || sideName == 'links-') 
    {
        var serverPage = sideName + mainName + '.htm';
    }
    else 
    {
        tab = sideName;
        page = mainName;
        var serverPage = sideName + mainName + '.htm';
    }

//document.getElementById('banner').className = sideName+mainName;
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function () 
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
        {
            obj.innerHTML = xmlhttp.responseText;
            if (callback != null) 
            {
                callback();
            }
        }
    };
xmlhttp.send(null);
}// end function makerequest

function popitup(url) {
    newwindow = window.open(url, 'name', 'left=310,top=215,height=285,width=525');
    if (window.focus && newwindow != null) { newwindow.focus() }
    return false;
}

   