var img = new Image();
var img2 = new Image();
img.src = '/interactive/lookandfeel/100608/dev/body-overlay-loading.jpg';
img2.src = '/interactive/lookandfeel/100608/dev/body-overlay.jpg';
var branchAddress;
function autoPopulate(a) {
    var b = document.getElementById(a);
    if ((b.value == '') && (b.title != '')) {
        b.value = b.title
    };
    $(b).focus(function () {
        if (b.value == b.title) {
            b.value = '';
            b.select()
        }
    });
    $(b).blur(function () {
        if (!b.value.length) {
            b.value = b.title
        }
    })
};
var main = (function ($) {
    var k = 'mailto:Enter your friend\'s e-mail here.?subject=Lake City Bank Link: ~&body=A friend has sent you a link to the following page on the Lake City Bank web site.%0D%0D~';
    var l = 'You will now be accessing information at a website not controlled by Lake City Bank. Lake City Bank is not responsible for, nor does it endorse any information provided by the website you are about to access. Our privacy policy does not extend to the site being accessed through this link.';
    var q = false;
    var w;
    var x = new Array();
    var y = {};
    var z;
    var A;
    var B;
    var C = '';
    var D = false;
    var E = false;
    var t = document.title.split(' | ');
    B = t[t.length - 1];
    var u = String(window.location);
    if (u[u.length - 1] == '/') u = u.slice(0, -1);
    u = u.split('/');
    z = u[0] + '//' + u[2];
    function initNoAnimation() {
        $('li.email a').mailPopup({
            parentDiv: '.text',
            cssPosition: true
        });
        y.page = (u.length > 4 || u[3] == 'contact-us' ? {
            type: '03'
        } : {
            type: '02'
        });
        setupHeaderBanner();
        forcePopup();
        setupBannerNoAnimation();
        setupSearch();
        $("tbody tr").filter("tr:odd").addClass("odd").end().filter("tr:even").addClass("even");
        $("a[href$='.doc'],a[href$='.pdf'],a[href$='.jpg']").attr('target', '_blank').unbind('click').click(function () {
            pageTracker._trackPageview('/files/' + this.href.replace(z + '/files/', ''))
        });
        $("a[href^='https://'],a[href^='http://']").not("a[href^='" + z + "']", '.application-popup').attr('target', '_blank').unbind('click').click(function () {
            pageTracker._trackPageview('/external/' + this.href.replace('http://', '').replace('https://', ''))
        });
        $("a.confirm").unbind('click').click(function (e) {
            var a = window.confirm(l);
            if (a) {
                pageTracker._trackPageview('/external/' + this.href.replace('http://', '').replace('https://', ''));
                window.open(this.href, "_blank")
            };
            return false
        });
        if (!$.browser.msie || $.browser.version > 6) {
            $('<li><a class="skipHyjack" href="">Turn Animation On</a></li>').appendTo('#foot ul').click(turnOnAnimation)
        };
        if (u[4] && u[4].indexOf('search') == 0) {
            loadScript('search.js', function () {
                $.search()
            })
        };
        if (u[3] && u[3] == 'branches') {
            loadScript('branches.js', function () {
                $.branches(branchAddress);
                branchAddress = null
            })
        }
    };
    function initAnimation() {
        setupSearch();
        setupMask();
        hyjackLinks();
        $('#body').css({
            minHeight: '400px'
        });
        $('<li><a class="skipHyjack" href="">Turn Animation Off</a></li>').appendTo('#foot ul').click(turnOffAnimation)
    };
    function setupHeaderBanner() {
        switch (y.page.type) {
        case '02':
            $('h2.banner').css({
                width: '754px',
                height: '235px',
                backgroundColor: '#fff',
                borderBottom: 'none'
            }).html('<div id="headerBanner"></div>');
            swfobject.embedSWF("/flash/categoryBanner.swf", "headerBanner", "754", "235", "9.0.0", "", {},
            {
                menu: 'false',
                wmode: 'opaque',
                allowscriptaccess: 'sameDomain',
                bgcolor: '#fff'
            },
            {});
            A = getFlashMovie('headerBanner');
            break;
        default:
            if (y.page.type == '04') break;
            $('h2.banner').css({
                width: '754px',
                height: '117px',
                backgroundColor: '#000D2F'
            }).html('<div id="headerBanner"></div>');
            swfobject.embedSWF("/flash/headerBanner.swf", "headerBanner", "754", "117", "9.0.0", "", {},
            {
                menu: 'false',
                wmode: 'opaque',
                allowscriptaccess: 'sameDomain',
                bgcolor: '#000D2F'
            },
            {});
            A = getFlashMovie('headerBanner');
            break
        }
    };
    function setupBannerNoAnimation() {
        var u = String(window.location);
        if (u[u.length - 1] == '/') u = u.slice(0, -1);
        u = u.split('/');
        $.getJSON('/ajax-data.php', {
            action: 'getParents',
            cat: u[3],
            sec: u[4],
            page: u[u.length - 1]
        },
        function (a) {
            y.pages = [null, a.pages[0]];
            if (a.pages[1].name) y.pages.push(a.pages[1]);
            updateHeaderBanner()
        })
    };
    function setupMask() {
        if (!w) {
            if (!$('#loadingMask')[0]) {
                $('<div id="loadingMask"></div>').appendTo('#body').css({
                    opacity: 0
                }).hide()
            };
            w = $('#loadingMask');
            $('<div id="loadingImage"><img src="/images/ajax-loader.gif" alt="loading..." />Animation and transitions choppy? <a href="#">Click here</a> to turn them off.</a></div>').appendTo(w).find('a').click(turnOffAnimation);
            $(w).find('#loadingImage')
        }
    };
    function setupSearch() {
        autoPopulate('sitesearch');
        $('#sitesearch').parent().parent().submit(function () {
            if (y.page && y.page.url == 'search') {
                $.get('/ajax-data.php', {
                    action: 'searchTerm',
                    term: $('#sitesearch').val()
                });
                loadScript('search.js', function () {
                    $.search()
                })
            } else {
                if (q) {
                    $.get('/ajax-data.php', {
                        action: 'searchTerm',
                        term: $('#sitesearch').val()
                    },
                    function () {
                        window.location = z + '/site/search+' + $('#sitesearch').val()
                    })
                } else {
                    $.get('/ajax-data.php', {
                        action: 'searchTerm',
                        term: $('#sitesearch').val()
                    });
                    SWFAddress.setValue('/site/search/')
                }
            };
            return false
        })
    };
    function updateHeaderBanner() {
        try {
            var a = y.pages[1];
            var b = y.pages[2];
            if (!A) {
                A = getFlashMovie('headerBanner')
            };
            var c = formatText(a.name);
            var d = (b ? (b.short ? formatText(b.short) : formatText(b.name)) : '');
            var e = (d ? b.header_image : a.header_image);
            var f = (d ? b.header_flag : a.header_flag);
            A.changeSection(c, d, e, f)
        } catch(err) {
            setTimeout(updateHeaderBanner, 300)
        }
    };
    function updateMenu() {
        var b = y.pages[1];
        if (b != y.lastPages[1]) {
            var d = $('.menu ul');
            var e = $('.menu ul li');
            var f = e.length;
            var g = 0;
            var h = new Array();
            $(d).css({
                overflow: 'hidden',
                height: d.height()
            });
            $(e).animate({
                opacity: 0
            },
            200, function () {
                $(this).remove();
                g++;
                if (g == f) {
                    for (var i = 0, len = b.children.length; i < len; i++) {
                        var a = b.children[i];
                        h.push('<li', (a.url == y.pathNames[1] ? ' class="selected"' : ''), '><a href="', (isOffsite(a.url) ? formatOffsite(a.url) : (isFile(a.url) ? a.url : '/' + b.url + '/' + a.url)), '"', (a.popup_confirm == '1' ? ' class="confirm"' : ''), '><strong>', a.name, '</strong></a>');
                        if (a.children.length > 0) {
                            h.push('<ul>');
                            for (var j = 0, cLen = a.children.length; j < cLen; j++) {
                                var c = a.children[j];
                                h.push('<li><a href="', (isOffsite(c.url) ? formatOffsite(c.url) : (isFile(c.url) ? c.url : '/' + b.url + '/' + a.url + '/' + c.url)), '"', (c.popup_confirm == '1' ? ' class="confirm"' : ''), '>', c.name, '</a></li>')
                            };
                            h.push('</ul>')
                        };
                        h.push('</li>')
                    };
                    $(d).html(h.join('')).css({
                        height: 'auto'
                    });
                    $(d).children().hide().fadeIn(200);
                    hyjackLinks()
                }
            })
        }
    };
    function updateLogin() {
        var a = new Array();
        var b = y.pages[1].login;
        if (b && b.headline) {
            a.push('<h3><img src="/images/icons/lock.png" alt="" /> ', b.headline, '</h3>', b.body)
        };
        $('div.login').html(a.join('')).css({
            display: (a.length > 0 ? 'block' : 'none')
        })
    };
    function updateSelected() {
        try {
            var b = y.pages[2];
            var c = y.pathNames;
            var d = false;
            if (b != y.lastPages[2]) {
                $('.menu li.selected').find('ul').slideUp().end().siblings().find('ul').css({
                    display: 'block'
                }).hide()
            };
            if (b.children.length < 1) {
                $('.menu li,.more-info li').removeClass('selected');
                $('.menu li a[href*=' + b.url + ']').each(function () {
                    $(this).parent().addClass('selected')
                });
                return
            };
            $('.menu li').removeClass('selected').find('ul').siblings().each(function () {
                if (d) return;
                var h = $(this).attr('href');
                if (h.indexOf('/') == 0) {
                    h = h.substr(1)
                };
                if (h.lastIndexOf('/') == h.length - 1) {
                    h.slice(0, -1)
                };
                h = h.split('/');
                var i = (h[0] == 'https:' ? 3 : 0);
                if (h[i + 1] == c[1]) {
                    $(this).parent().addClass('selected').find('ul').slideDown().find('li a').each(function () {
                        var a = $(this).attr('href');
                        a = a.replace(z, '');
                        if (a.indexOf('/') == 0) {
                            a.substr(1)
                        };
                        var n = a.split('/');
                        if (n[3] == c[2]) {
                            $(this).parent().addClass('selected');
                            d = true
                        }
                    })
                }
            });
            $('.more-info li').removeClass('selected').find('a').each(function () {
                if (d) {
                    return
                };
                var h = this.href;
                if (h.lastIndexOf('/') == h.length - 1) {
                    h = h.slice(0, -1)
                }
                h = h.split('/');
                if (h[h.length - 1] == c[c.length - 1]) {
                    $(this).parent().addClass('selected')
                }
            })
        } catch(err) {}
    };
    function updateBread() {
        var t = $('div.tool');
        $(t).css({
            overflow: 'hidden',
            height: $(t).height()
        });
        $('.print').find('a').attr('href', 'https://print.' + z.substr(z.indexOf('//') + 2).replace('www.', '') + SWFAddress.getPath());
        updateEmail();
        var a = new Array('<a href="/">Home</a>');
        var b = '';
        $(y.pages).each(function (i, p) {
            if (i == 0 || !p.name) {
                return
            };
            if (p.url.indexOf('+') == 0) {
                b += p.url
            } else {
                b += '/' + p.url
            };
            if (!p.status || p.status == '1') {
                a.push(' &gt; <a href="', b, '/">', (p.short ? p.short : p.name), '</a>')
            }
        });
        $('#crumbs').animate({
            marginTop: '20px'
        },
        'fast', function () {
            $(this).html(a.join('')).css({
                marginTop: '-20px'
            }).animate({
                marginTop: 0
            },
            'fast');
            hyjackLinks()
        })
    };
    function updateEmail() {
        var a = $('li.email').find('a');
        var b = k;
        b = b.replace('~', y.page.name);
        b = b.replace('~', z + SWFAddress.getPath());
        $(a).attr('href', b)
    };
    function updateSecondary() {
        var c = $('div.more-info');
        var d = $('div.related-links');
        var e = y.pages[2];
        if (e != y.lastPages[2]) {
            if (e && e.more_info.length > 0) {
                var f = new Array();
                if ($(c)) {
                    $(c).show().find('ul').remove();
                    f.push('<ul>');
                    $(e.more_info).each(function (i, a) {
                        var b = isOffsite(a.url) ? formatOffsite(a.url) : (isFile(a.url) ? a.url : '/' + y.pages[1].url + '/' + (e ? e.url + '/' : '') + a.url + '/');
                        f.push('<li><a href="', (a.popup == '1' ? a.url : b), '"', (a.popup == '1' ? ' class="popup"' : ''), '>', a.name, '</a></li>')
                    });
                    f.push('</ul>');
                    $(f.join('')).appendTo(c)
                }
            } else {
                $(c).find('ul').remove().end().hide()
            };
            if (e && e.related_links.length > 0) {
                var f = '';
                if ($(d)) {
                    $(d).show().find('ul').remove();
                    f = '<ul>';
                    $(e.related_links).each(function (i, a) {
                        var b = a.url.substr(a.url.length - 3);
                        if (b != 'pdf' && b != 'doc') {
                            b = ''
                        };
                        f += '<li' + (b ? ' class="' + b + '"' : (isOffsite(a.url) ? ' class="external"' : '')) + '><a href="' + (isOffsite(a.url) ? formatOffsite(a.url) : a.url + (a.url.lastIndexOf('/') != a.url.length ? '/' : '')) + '"' + (a.popup_confirm == '1' ? ' class="confirm"' : '') + (a.popup == '1' ? ' class="popup"' : '') + '>' + a.name + '</a></li>'
                    });
                    f += '</ul>';
                    $(f).appendTo(d)
                }
            } else {
                $(d).find('ul').remove().end().hide()
            }
        }
    };
    function handleUrlChange(e) {
        if (q) {
            return false
        };
        y.lastPathNames = y.pathNames;
        y.pathNames = SWFAddress.getPathNames();
        if (y.pathNames.length > 0) {
            y.vars = y.pathNames[y.pathNames.length - 1];
            var b = y.vars.indexOf('+');
            if (b > 0) {
                y.pathNames[y.pathNames.length - 1] = y.vars.substr(0, b);
                y.vars = y.vars.substr(b + 1)
            } else {
                y.vars = ''
            }
        };
        try {
            if (y.pathNames.length > 0) {
                if (!x[y.pathNames[0]]) {
                    $(w).stop().show().fadeTo(350, 1, function () {
                        if (!y.page) {
                            $('.section').remove()
                        }
                    });
                    $('body').ajaxError(function (e, a, s) {
                        SWFAddress.setValue('/site/404/')
                    });
                    $.getJSON('/ajax-data.php', {
                        action: 'getCategory',
                        parentUrl: y.pathNames[0]
                    },
                    function (a) {
                        x[y.pathNames[0]] = a;
                        updatePage()
                    })
                } else {
                    updatePage()
                }
            }
        } catch(err) {
            setTimeout(handleUrlChange, 50)
        }
    };
    function updatePage() {
        if (y.pathNames) {
            y.lastPages = y.pages;
            y.pages = Array({
                name: 'Home',
                url: '/'
            });
            y.pages.push(x[y.pathNames[0]]);
            for (var p = 1; p < y.pathNames.length; p++) {
                if (p == 2 && y.mi_flag) {
                    if (typeof y.pages[1].more_info_pages == 'object') {
                        var a = y.pages[1].more_info_pages;
                        for (var i = 0; i < a.length; i++) {
                            if (a[i].url == y.pathNames[p]) {
                                y.pages.push(a[i]);
                                i = 100
                            }
                        }
                    }
                } else {
                    for (var i = 0; i < y.pages[p].children.length; i++) {
                        if (y.pages[p].children[i].url == y.pathNames[p]) {
                            y.pages.push(y.pages[p].children[i]);
                            i = 100
                        }
                    }
                }
            };
            y.page = y.pages[y.pathNames.length];
            if (!y.page || !y.template) {
                changeTemplate()
            } else {
                y.lastTemplate = y.template;
                y.template = y.page.type;
                if (y.lastTemplate == y.template) {
                    changePage()
                } else {
                    changeTemplate()
                }
            }
        }
    };
    function changeTemplate() {
        $(w).stop().show().fadeTo(350, 1, function () {
            var a = '';
            $(y.pathNames).each(function (i, u) {
                a += u + ','
            });
            var b = '';
            if (!y.page) {
                y.page = {
                    type: '03'
                }
            };
            b = 'type-' + y.page.type + '.php';
            y.template = y.page.type;
            removeSign();
            y.includeVars = {
                urls: (a.length > 0 ? a.slice(0, -1) : '')
            };
            getCurrentVars();
            if (y.vars) {
                y.includeVars.action = 'getIncludeMeta';
                y.includeVars.include = y.page.include;
                $.getJSON('/ajax-data.php', y.includeVars, handleMetaData)
            };
            if (b) {
                $.get('/templates/' + b, y.includeVars, setupTemplate)
            }
        })
    };
    function handleMetaData(a) {
        if (y.pages[y.pages.length - 1].name != a.meta.name) {
            a.meta.url = '+' + y.vars;
            y.pages.push(a.meta)
        };
        changeTitle()
    };
    function setupTemplate(a) {
        $('#page,.section').remove();
        $('#nav1').after(a);
        setupHeaderBanner();
        changeTitle();
        $('.print').find('a').attr('href', 'https://print.' + z.substr(z.indexOf('//') + 2).replace('www.', '') + SWFAddress.getPath());
        $(w).fadeTo(350, 0, function () {
            $(this).hide();
            updateHeaderBanner();
            if (y.pages[1].more_info_pages) {
                getMoreInfo()
            }
        });
        pageLoaded()
    };
    function getMoreInfo() {
        var c = y.pages[1];
        if (!c.loadingMorePages && typeof c.more_info_pages == 'string') {
            c.loadingMorePages = true;
            $.getJSON('/ajax-data.php', {
                action: 'getMoreInfo',
                pages: c.more_info_pages
            },
            function (r) {
                c.more_info_pages = r.pages;
                c.loadingMorePages = false
            })
        }
    };
    function changePage() {
        changeTitle();
        $(w).stop().fadeTo(200, 0, function () {
            $(this).hide()
        });
        switch (y.page.type) {
        case '02':
            updateHeaderBanner();
            $('.text').stop().css({
                height: $('.text').height(),
                overflow: 'hidden'
            }).children().remove();
            updateTemplate2();
            break;
        case '06':
        case '03':
        case '05':
            var a = y.page;
            updateHeaderBanner();
            $('.text').stop().css({
                height: $('.text').height(),
                overflow: 'hidden'
            }).children().remove();
            if (y.page.include) {
                y.includeVars = {
                    action: 'getInclude',
                    headline: a.headline,
                    include: a.include,
                    sidebar: (a.sidebar ? a.sidebar : '')
                };
                getCurrentVars();
                $('.text').css({
                    height: $('.menu ul').height() - 20,
                    background: '#fff url(/interactive/lookandfeel/100608/dev/include-ajax-loader.gif) no-repeat center center'
                });
                updateMenu();
                $.getJSON('/ajax-data.php', y.includeVars, handleInclude)
            } else {
                updateMenu();
                updateBread();
                updateSecondary();
                updateSelected();
                var b = new Array('<div><h3>', a.headline, '</h3>');
                if (a.body) {
                    b.push(a.body)
                };
                if (a.subpages == '1' && a.children.length > 0) {
                    var c = '/';
                    for (var i = 0, len = y.pages.length; i < len; i++) {
                        if (i) {
                            c += y.pages[i].url + '/'
                        }
                    };
                    b.push('<ul class="subpage-list">');
                    for (var j = 0, len = a.children.length; j < len; j++) {
                        var p = a.children[j];
                        b.push('<li><a href="', (p.url.indexOf('https') == 0 ? '' : c), p.url, '"><strong>', p.name, '</strong><br />', p.summary, '</a></li>')
                    };
                    b.push('</ul>')
                };
                if (a.disclaimer) {
                    b.push('<div class="disclaimer">', a.disclaimer, '</div>')
                };
                b.push('</div>');
                $('.text').html(b.join('')).animate({
                    height: $('.text').children().height() + 40
                },
                400);
                $('.text').find('img').load(function () {
                    $('.text').stop().css({
                        height: 'auto'
                    })
                })
            };
            break
        };
        updateLogin();
        pageLoaded()
    };
    function updateTemplate2() {
        var a = y.pages[1].children;
        $('.full').css({
            height: $('.full').height(),
            background: '#fff url(/interactive/lookandfeel/100608/dev/include-ajax-loader.gif) no-repeat center center'
        }).children().remove();
        $('.note').html('<h3><img src="/images/icons/phone.png" alt="new icon"/>' + y.page.headline + '</h3>' + y.page.body);
        var b = new Array('<ul class="section-list">');
        for (var i = 0, len = a.length; i < len; i++) {
            var c = a[i];
            var d = c.url;
            b.push('<li class="section-', d, '">');
            if (isOffsite(d)) {
                d = formatOffsite(d)
            } else if (d.indexOf('.pdf') < 0) {
                d = '/' + y.pages[1].url + '/' + d + '/'
            };
            b.push('<a href="', d, '">');
            if (c.icon) {
                b.push('<img alt="', c.name, '" src="/images/icons-big/', c.icon, '" />')
            };
            b.push('<strong>', (c.short ? formatText(c.short) : formatText(c.name)), '</strong><br />');
            if (c.summary) {
                b.push('<em>', c.summary, '</em>')
            };
            b.push('</a>');
            b.push('</li>')
        };
        b.push('</ul>');
        $('.full').html(b.join('')).css({
            background: '#fff',
            height: 'auto'
        })
    };
    function animateMenu() {
        $('#nav1 li').each(function () {
            var a = $(this).find('ul');
            $(a).css({
                width: $(a).width(),
                zIndex: 101
            });
            var m = $('<div class="menuMask"></div>').appendTo(this).css({
                zIndex: 99,
                position: 'absolute',
                left: 0,
                height: $(a).height() + 15,
                width: $(a).width() + 8,
                top: -1000,
                overflow: 'hidden'
            });
            $(a).appendTo(m);
            $(this).find('ul').css({
                top: -$(a).height()
            })
        }).hover(function () {
            var a = $(this).find('ul');
            $(this).find('div').css({
                top: 25
            });
            $(a).stop().animate({
                top: 0
            },
            400, function () {
                $(a).css({
                    display: 'block'
                }).parent().css({
                    overflow: 'visible'
                })
            })
        },
        function () {
            $(this).find('.menuMask').css({
                overflow: 'hidden'
            });
            var a = $(this).find('ul');
            if ($(a).height() > 0) {
                $(a).stop().animate({
                    top: -$(a).height()
                },
                300, function () {
                    $(this).parent().css({
                        top: -1000
                    })
                })
            }
        })
    };
    function hyjackLinks() {
        if (q) {
            return false
        };
        $("a[href$='.doc'],a[href$='.pdf'],a[href$='.jpg']").attr("target", "_blank").unbind("click").click(function () {
            pageTracker._trackPageview('/files/' + this.href.replace(z + '/files/', ''))
        });
        $("a[href^='https://'],a[href^='http://']").not("a[href^='" + z + "']", '.application-popup').attr("target", "_blank").unbind("click").click(function () {
            pageTracker._trackPageview('/external/' + this.href.replace('http://', '').replace('https://', ''))
        });
        $("a.confirm").unbind('click').click(function (e) {
            var a = window.confirm(l);
            if (a) {
                pageTracker._trackPageview('/external/' + this.href.replace('http://', '').replace('https://', ''));
                window.open(this.href, "_blank")
            };
            return false
        });
        $('a').not("[href^=mailto],.popup,#promo a[rel],.emailPopup a, #lightbox a, #loadingMask a, .skipHyjack, .application-popup").each(function (i) {
            if (this.target && this.target == "_blank") {
                return
            };
            var h = $(this).attr('href');
            if (h.lastIndexOf('/') == h.length - 1) {
                h = h.slice(0, -1)
            };
            if (!h || h == '/' || (h.indexOf(z) == 0 && h.length == z.length)) {
                $(this).click(function () {
                    window.location = z
                });
                return
            };
            if (h.indexOf('/') == 0) {
                h = h.substr(1)
            };
            h = h.split('/');
            var p = '/#/';
            var a = (h[0].indexOf('http') == 0 ? 3 : 0);
            for (var j = a; j < h.length; j++) {
                p += h[j] + '/'
            };
            $(this).unbind('click').click(function () {
                if ($(this).parent().parent().parent().hasClass('more-info')) {
                    y.mi_flag = true
                } else {
                    y.mi_flag = false
                };
                window.location = p.replace('//', '/');
                return false
            })
        })
    };
    function pageLoaded(a) {
        forcePopup();
        hyjackLinks();
        updateEmail();
        $('.email a').mailPopup({
            parentDiv: '.text',
            cssPosition: true
        });
        $("div.login form").attr('target', '_blank').submit(function () {
            if (this.action.indexOf('login-redirect.php') > 0) {
                pageTracker._trackPageview('/online-banking/' + String($(this).find('select').val()).replace('http://', '').replace('https://', ''))
            } else {
                pageTracker._trackPageview('/online-banking/' + this.action.replace('http://', '').replace('https://', ''))
            };
            setTimeout(function () {
                $('div.login form input[type=text]').val('')
            },
            1000)
        });
        $("tbody tr").filter("tr:odd").addClass("odd").end().filter("tr:even").addClass("even");
        if (y.page.url == 'search') {
            $('.text').stop().css({
                height: 'auto'
            });
            loadScript('search.js', function () {
                $.search()
            })
        };
        if (parseInt(y.page.member_fdic)) {
            $('#member-fdic').removeClass('hide')
        } else {
            $('#member-fdic').addClass('hide')
        };
        switch (y.page.type) {
        case '03':
            if ((!y.lastPages || !y.page.include || a) && y.page.scripts) {
                var b = y.page.scripts.split(',');
                $(b).each(function (i, s) {
                    setTimeout(function () {
                        $.getScript('/scripts/' + b[i])
                    },
                    i * 50)
                })
            };
            break;
        case '04':
            loadScript('branches.js', function () {
                $.branches(branchAddress);
                branchAddress = null
            });
            break;
        case '05':
            setupContactForm();
            break;
        case '06':
            loadScript('jquery.lightbox.js', function () {
                $('.lightbox').lightbox()
            });
            break
        };
        if (!E && !a) {
            pageTracker._trackPageview(SWFAddress.getPath())
        };
        E = false
    };
    function setupContactForm() {
        $('form#contact').submit(function () {
            $.post('/ajax-data.php', {
                action: 'submitContactForm',
                name: $('#name').val(),
                address_1: $('#address_1').val(),
                address_2: $('#address_2').val(),
                city: $('#city').val(),
                state: $('#state').val(),
                zip: $('#zip').val(),
                email: $('#email').val(),
                phone: $('#phone').val(),
                details: $('#details').val()
            },
            function (a) {
                if (a) {
                    $('.text p:first').html(a).addClass('error')
                } else {
                    $('.text').html('<h3>Thank you for contacting us.</h3><p>Your message has been sent. If you requested it, we\'ll respond as soon as possible.</p>');
                    pageTracker._trackPageview('/submitted-form/contact/')
                }
            });
            return false
        })
    };
    function handleInclude(a) {
        try {
            if (y.pages[y.pages.length - 1].name != a.page.name) {
                a.page.url = '+' + y.vars;
                y.pages.push(a.page)
            };
            updateBread();
            updateSelected();
            changeTitle();
            if (y.page.type == '06') {
                $('div.side').html(a.page.sidebar)
            };
            $('.text').css({
                background: '#fff'
            }).html(a.page.body).css({
                height: 'auto'
            });
            hyjackLinks();
            pageLoaded(true)
        } catch(err) {}
    };
    function changeTitle() {
        var a = B;
        if (y.pages[y.pages.length - 1]) {
            a = y.pages[y.pages.length - 1].title + ' | ' + a
        };
        document.title = formatText(a)
    };
    function removeSign() {
        $('.sign h6#sign').animate({
            marginTop: '150px'
        },
        200, function () {
            $(this).remove()
        });
        $('.sign #head form').animate({
            right: '50px'
        },
        200, function () {
            $('body').removeClass('sign')
        })
    };
    function turnOffAnimation(e) {
        if (e) {
            e.preventDefault()
        };
        $.cookie('animation', 'off', {
            expires: 7,
            path: '/',
            domain: 'lakecitybank.com'
        });
        var a = String(window.location);
        a = a.replace('#/', '');
        window.location = a
    };
    function turnOnAnimation(e) {
        if (e) {
            e.preventDefault()
        };
        $.cookie('animation', 'on', {
            expires: 7,
            path: '/',
            domain: 'lakecitybank.com'
        });
        var u = String(window.location);
        u = u.split('/');
        if (u.length > 3 && u[3] && u[3].indexOf('#') != 0) {
            var a = 'https://' + u[2] + '/#/';
            for (var i = 3; i < u.length; i++) a += u[i] + '/';
            window.location = a.slice(0, -1)
        } else {
            window.location = 'https://' + u[2] + '/'
        }
    };
    function forcePopup() {
        var b = document.getElementById('printAnchor');
        if (b) {
            b.onclick = function () {
                window.open(this.href, '_blank', 'width=800, height=740, scrollbars=yes, menubar=yes, resizable=yes');
                return false
            }
        };
        $('a.popup').not('#printAnchor').each(function (i, a) {
            a.onclick = function () {
                pageTracker._trackPageview('/popup' + this.href.replace(z, ''));
                window.open(this.href, '_blank', 'width=985, height=575, scrollbars=yes, menubar=yes, resizable=yes');
                return false
            }
        });
        $('a.application-popup').each(function (i, a) {
            a.onclick = function () {
                pageTracker._trackPageview('/popup' + this.href.replace(z, ''));
                window.open(this.href, '_blank', 'width=655, height=740, scrollbars=yes, menubar=yes, resizable=yes');
                return false
            }
        })
    };
    function isOffsite(a) {
        return (a.indexOf('.com') > 0 || a.indexOf('.org') > 0 || a.indexOf('.gov') > 0 || a.indexOf('.net') > 0)
    };
    function isFile(a) {
        return (a.indexOf('.pdf') > 0 || a.indexOf('.xls') > 0 || a.indexOf('.doc') > 0)
    };
    function formatOffsite(a) {
        if (a.indexOf('http') == 0 && a.indexOf(z) != 0) {
            return a
        };
        if (a.indexOf('/') == 0) {
            a = a.substr(1)
        };
        var u = a.split('/');
        if (u[0].indexOf('off-site') != 0) {
            return 'http://' + a
        };
        var o = u[1] + '//';
        for (var i = 2; i < u.length; i++) {
            o += u[i] + '/'
        };
        o = o.slice(0, -1);
        return o
    };
    function loadScript(a, b) {
        if (C.indexOf(a) < 0) {
            $.getScript('/scripts/' + a, b);
            C += ',' + a
        } else {
            b()
        }
    };
    function getFlashMovie(a) {
        var b = navigator.appName.indexOf("Microsoft") != -1;
        return (b ? window[a] : document[a])
    };
    function formatText(a) {
        a = a.replace(/�/g, '');
        a = a.replace(/&amp;/g, '&');
        a = a.replace(/&#241;/g, 'ñ');
        a = a.replace(/&ntilde;/g, 'ñ');
        a = a.replace(/&reg;/g, '®');
        a = a.replace(/&oacute;/g, 'ó');
        a = a.replace(/&eacute;/g, 'é');
        return a
    };
    function getCurrentVars() {
        if (y.vars) {
            var a = y.vars.split('+');
            $(a).each(function (i, v) {
                var t = String.fromCharCode("a".charCodeAt(0) + i);
                eval("current.includeVars." + t + "='" + v + "'")
            })
        }
    };
    $(document).ready(function () {
        if (String(window.location).indexOf('#') > 0) {
            E = true
        };
        if ($.browser.msie && $.browser.version <= 6) {
            $.cookie('animation', 'off', {
                expires: 7,
                path: '/',
                domain: 'lakecitybank.com'
            });
            q = true;
            $('#nav1 li').hover(function () {
                $(this).find('ul').show()
            },
            function () {
                $(this).find('ul').hide()
            })
        };
        $("div.login form").submit(function () {
            if (this.action.indexOf('login-redirect.php') > 0) {
                pageTracker._trackPageview('/online-banking/' + String($(this).find('select').val()).replace('http://', '').replace('https://', ''))
            } else {
                pageTracker._trackPageview('/online-banking/' + this.action.replace('http://', '').replace('https://', ''))
            };
            setTimeout(function () {
                $('div.login form input[type=text]').val('')
            },
            1000)
        });
        if ($.cookie('animation') == 'off') q = true;
        forcePopup();
        if (q) {
            initNoAnimation()
        } else {
            initAnimation()
        };
        SWFAddress.addEventListener(SWFAddressEvent.CHANGE, function () {
            D = true
        })
    });
    window.onload = function () {
        if (D || String(window.location).indexOf('#') > 0) {
            handleUrlChange()
        };
        SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleUrlChange)
    }
})(jQuery);