﻿//*************************************************************************************
// File     : pncu_functions.js
// Requires : jquery.js (version 1.3.1+), braingnat.js (version 0.2.0+)
// Author   : Kyle Weems (ksw)
// Origin   : mindfly.com
// Created  : Mar 30, 2009
// Modified : Jan 11, 2010
//*************************************************************************************

$(document).ready(function() {
    leavingSiteWarning();
    slideshow();
});

function leavingSiteWarning() {
    $('a').bind('click', function() {
        url = $(this).attr('href');
        if (url.substring(0, 5) == "http:") {
            var safeList = new Array;
            safeList[0] = "http://pncu.mindfly.net";
            safeList[1] = "http://www.pacificnwcu.com";
            safeList[2] = "http://nbp1.cunetbranch.com";
            safeList[3] = "http://obc.itsme247.com/loan/?cuid=915";
            safeList[4] = "http://pacificnwcu.com";
            var noMessage = false;
            for (i = 0; i < safeList.length; i++) {
                if (url.substring(0, safeList[i].length) == safeList[i]) {
                    noMessage = true;
                }
            }
            if (noMessage != true) {
                alert("Disclaimer: When you click on a link you may be leaving Pacific Northwest Credit Union's website. You may be linking to an alternate website not operated by Pacific Northwest Credit Union, and Pacific Northwest Credit Union is not responsible for the content of the alternate website. Pacific Northwest Credit Union does not represent either you or the website operator if you enter into a transaction. Privacy and security policies might differ from those practiced by Pacific Northwest Credit Union.");
            }
        }
    });
}

function slideshow() {

    var settings = {
        source: {
            type: "selector",
            value: ".mindslide",
            destination: ".mindslide"
        },
        random: false,
        slide: {
            duration: 5000,
            transition: 1000,
            effect: "fade",
            direction: "left",
            autoplay: true
        },
        interface: {
            play: false,
            arrows: false,
            markers: false,
            thumbs: false
        }
    }
    mindslide.load(settings);
}
