/*
window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}
*/

if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

// CALL TO CORRECT DIRECTORY BELOW
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.fnbpville.com/images/"
sitedir="http://www.fnbpville.com/site/"
securedir="http://www.fnbpville.com/site/"
homedir="http://www.fnbpville.com/"
}
else if(window.securepage)
{
imgdir="https://www.fnbpville.com/images/"
sitedir="http://www.fnbpville.com/site/"
securedir="https://www.fnbpville.com/site/"
homedir="http://www.fnbpville.com/"
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="nav_" + name +"_on.gif";
this.name_off="nav_" + name +"_off.gif";
this.width=width;
this.height=height;
this.newimage_on = new Image(width,height);
this.newimage_on.src = imgdir + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = imgdir + this.name_off;
}

var navitems = new Array();
navitems["products"] = new makeNavImage("products",175,35);
navitems["about"] = new makeNavImage("about",175,35);
navitems["calculators"] = new makeNavImage("calculators",175,35);
navitems["help"] = new makeNavImage("help",175,35);
navitems["home"] = new makeNavImage("home",175,35);

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
document[imgName].src = navitems[imgName].newimage_off.src;
}
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW
function openWin(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}

function open_apps(nameofapp){
self.location.href = "https://www.fnbpville.com/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

function openIB(page){
if (page=="demo") self.location.href = homedir+"index.html?demo";
else self.location.href = homedir+"index.html";
//if (page=="demo") openWin("https://www.fnbpville.com/onlineserv/HB/demo.html");
//else openWin("https://www.fnbpville.com/onlineserv/HB/")
}

var warningMessages = {
	defaultMessage:	"<h3 align='center' style='margin-top: 2px;'>Third Party Site Disclaimer</h3>By accessing the noted link you will be leaving your First National Bank in Pinckneyville's website and entering a website hosted by another party. First National Bank in Pinckneyville has not approved this as a reliable partner site.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of First National Bank in Pinckneyville's website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of First National Bank in Pinckneyville's." +
					"<br /><br /><br />",
	winPS3:	"<h3 align='center' style='margin-top: 2px;'>GET IN THE GAME</h3>" +
			"<p>Every time you use your debit card to make purchases between October 1 and December 31, 2009, you're automatically entered to win great prizes.  <strong>One of our debit card users will be guaranteed to win a Play Station 3<sup>&reg;</sup></strong>.  No purchase necessary.  Ask a teller for details.</p>" +
			"<p class='small'>\"PS3\" is a registered trademark of Sony, which is not affiliated with, and does not sponsor or endorse the services of FNB, or the \"Get in the Game\" campaign.</p>"
};

var warningLinks = {
	defaultMessage:	{ accept: "I Accept", decline: "I Decline" },
	close:	{ accept: "NONE", decline: "Close" }
};


function showWarning(url, args){
args = args ? args : {};
var target = args["target"] ? args["target"] : "_self";
var message = args["message"] ? args["message"] : "defaultMessage";
var links = args["links"] ? args["links"] : "defaultMessage";
links = warningLinks[links] ? warningLinks[links] : warningLinks["defaultMessage"];
var linksAccept = links["accept"] ? links["accept"] : warningLinks["defaultMessage"]["accept"];
var linksDecline = links["decline"] ? links["decline"] : warningLinks["defaultMessage"]["decline"];
var content = new Array();
var index = 0;
content[index++] = "<div>";
content[index++] = warningMessages[message] ? warningMessages[message] : warningMessages["defaultMessage"];
content[index++] = "<div align=\"center\">";
if(linksAccept != "NONE") {
	content[index++] = "<a href='javascript:window.location=\""+url+"\";' target=\""+target+"\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">" + linksAccept + "</a>&nbsp;&nbsp;&nbsp;";
}
if(linksDecline != "NONE") {
	content[index++] = "<a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">" + linksDecline + "</a></div></div>";	
}
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}

function promo(){
var content = new Array();
var index = 0;
content[index++] = "<div><h3 align='center' style='margin-top: 2px;'>Limited Time Only</h3> *Annual percentage yield is accurate as of 12/28/07.  Rates may change at any time without prior notice.  After your certificate is opened, the interest rate is fixed for the term.  $10,000 minimum deposit.  A penalty will be assessed for early withdrawal.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Close</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}

function showMail(url){
var content = new Array();
var index = 0;
content[index++] = "<div align='center'><h3 align='center'>Please Note</h3>This is <strong>NOT</strong> secure e-mail, do not send personal/financial information. ";
content[index++] = "<br /><br />";
content[index++] = "<div align=\"center\"><a href='"+url+"' onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Continue</a>&nbsp;&nbsp;&nbsp;<a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Decline</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}


document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:125px; left:300px; border: medium solid #181C94; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');
// OTHER FUNCTIONS ABOVE

if(typeof($) != "undefined") {
/* jQuery onload code */
$( function() {
	$(".promos .promo").hover(
		/* OnHover */
		function() {
			$(this).children(".label").addClass("visible");
		},
		/* OffHover */
		function() {
			$(this).children(".label").removeClass("visible");
		}
	);
});
}