﻿// JScript File
<!--
function ExpanderClick(sender)
{
    var cursor=sender;
    var flag=0;
    var i;

    while(flag==0)
    {
        for(i=0;i<cursor.childNodes.length;i++)
        {
            if(cursor.childNodes[i].className=="ExpanderVisible" || cursor.childNodes[i].className=="ExpanderHidden")
            {
                var expander = cursor.childNodes[i];
                if(expander.className=="ExpanderVisible")
                {
                    expander.className="ExpanderHidden";
                    sender.className="ExpanderClickerPlus";
                }
                else
                {
                    expander.className="ExpanderVisible";
                    sender.className="ExpanderClickerMinus";
                }
                flag=1;
                return false;
            }
        }
        if(flag==0)
        {
            cursor = cursor.parentNode;
        }
    }
}

function ClearAllContacts()
{
    document.getElementById('ctl00_MainContent_pnlHideShowContacts').style.display='none';
    document.getElementById('ctl00_MainContent_pnlHideShowNAContacts').style.display='none';
    
}

function ShowNAContacts()
{
    document.getElementById('ctl00_MainContent_pnlHideShowNAContacts').style.display='block';
}

function HideNAContacts()
{
    document.getElementById('ctl00_MainContent_pnlHideShowNAContacts').style.display='none';
}

function SetMapPart(desc)
{
    //Clear all child nodes from table
    var pnl = document.getElementById('ctl00_MainContent_pnlTest');
    var i = pnl.childNodes.length - 1;
    
    for(i;i> 0;i--)
    {
        var oldNode = pnl.childNodes[i];
        pnl.removeChild(oldNode);
    }

    var lb = document.getElementById('ctl00_MainContent_lbMapPart');
    lb.innerHTML = desc;
    
    var lb2 = document.getElementById('ctl00_MainContent_lbCounter');
    lb2.innerHTML = 0;
}

function ShowContacts(name, title, address, city, state, zip, tollfree, phone, fax, mobile, email)
{

    var contacts = document.getElementById('ctl00_MainContent_pnlHideShowContacts');
    var lb2 = document.getElementById('ctl00_MainContent_lbCounter');

    if(name != '')
    {
        contacts.style.display = 'block';
        
        if(lb2.innerHTML == 0)
        {
            var pnl = document.getElementById('ctl00_MainContent_pnlTest');
            var tbl = pnl.firstChild;

            var r = tbl.firstChild.nextSibling.firstChild;
            var c1 = r.firstChild;
            c1.firstChild.innerHTML = name;
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(title != "")
            {
                c1.firstChild.innerHTML = title;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(address != "")
            {
                c1.firstChild.innerHTML = address;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(city != "")
            {
                c1.firstChild.innerHTML = city + ", " + state + "  " + zip;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(tollfree != "")
            {
                c1.firstChild.innerHTML = "Toll Free:&nbsp;<b>" + tollfree + "</b>";
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(phone != "")
            {
                c1.firstChild.innerHTML = "Phone:&nbsp;<b>" + phone + "</b>";
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(fax != "")
            {
                c1.firstChild.innerHTML = "Fax:&nbsp;" + fax;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(mobile != "")
            {
                c1.firstChild.innerHTML = "Mobile:&nbsp;" + mobile;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(email != "")
            {
                c1.firstChild.innerHTML = "Email:&nbsp;" + email;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            lb2.innerHTML = 1
        }
        else
        {
            var pnl = document.getElementById('ctl00_MainContent_pnlTest');
            var tbl = pnl.firstChild;
            var tblcopy = tbl.cloneNode(true);
            
            pnl.appendChild(tblcopy);
            
            var r = tblcopy.firstChild.nextSibling.firstChild;
            var c1 = r.firstChild;
            c1.firstChild.innerHTML = name;
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(title != "")
            {
                c1.firstChild.innerHTML = title;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(address != "")
            {
                c1.firstChild.innerHTML = address;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(city != "")
            {
                c1.firstChild.innerHTML = city + ", " + state + "  " + zip;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(tollfree != "")
            {
                c1.firstChild.innerHTML = "Toll Free:&nbsp;<b>" + tollfree + "</b>";
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(phone != "")
            {
                c1.firstChild.innerHTML = "Phone:&nbsp;<b>" + phone + "</b>";
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(fax != "")
            {
                c1.firstChild.innerHTML = "Fax:&nbsp;" + fax;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(mobile != "")
            {
                c1.firstChild.innerHTML = "Mobile:&nbsp;" + mobile;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
            
            r = r.nextSibling;
            c1 = r.firstChild;
            if(email != "")
            {
                c1.firstChild.innerHTML = "Email:&nbsp;" + email;
                r.style.display = 'block';
            }
            else    
            {
                r.style.display = 'none';
            }
        }
    }
    else
    {
        contacts.style.display = 'none';
    }
}



//-->