// onload funtions
$(document).ready(function(){
	$('.blink').fadeOut("fast",function(){blinkIn()});
});

// for Cool Menus
if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

function stopError() {
  //return true;
}

window.onerror = stopError;

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 = dir + '/images/' + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = dir + '/images/'  + this.name_off;
}


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;
}


document.write('<img src="'+dir+'/images/wcscreenrez.gif?width='+screen.width+'&height='+screen.height+'" width="1" height="1">'); 

function wcInternalPopup(url, height, width){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'internalpopup',features);
} 

function wcPopup(url, height, width, disclaimer){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'externalpopup',features);
} 

/************************************************************************************************************
* This function is used in the onclick of the a tag to display the external site warning. 
* @param msg - Integer specifying the which message to display.
* @param lk - The a link object
* Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a>
**************************************************************************************************************/
function displayThirdPartyAlert(msg,lk){
	var description = lk.innerHTML;
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	showWarning(lk.href, description, lk.target, msg);
	return false;
}

/************************************************************************************************************
* This function is used in the href of the a tag to display the external site warning. 
* @param lk - The url of the site to be opened
* @param desc - The description of the site to be opened, i.e. the name of the site.
* @param target - Allows for the window to opened in a new window
* @param msg - Integer specifying the which message to display.
* Usage: <a href="javascript:('http://wwww.mysite.com');">My Site</a>
**************************************************************************************************************/
function showWarning(lk, desc, target, msg){
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	messages[0] = '<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving Peoples First Community Bank\'s website and entering a website hosted by another party. Peoples First Community Bank has not approved this as a partner site.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Peoples First Community Bank\'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 your financial institution\'s.';
	
	messages[1] = '<h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ lk +'</strong> are not provided or guaranteed by Central Valley Bank. The site you are about to visit may have a privacy policy that is different than Central Valley Bank\'s. Please review their privacy policy. Central Valley Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[2] = '<h1 style="margin-left:100px;">Non-Secure Email Disclaimer</h1><br/>As a convenience to you and to provide additional means of communications between you and Peoples First Community Bank, you can use electronic mail (e-mail) to contact the bank regarding general inquiries and general access and maintenance issues. However communication via e-mail is not considered secure, and you agree that you will not use e-mail to transmit sensitive and/or confidential information such as account numbers, user IDs, or PINs, or to request or authorize any financial transaction.';
	
	messages[3] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ lk +'</strong> are not provided or guaranteed by Central Valley Bank. The site you are about to visit may have a privacy policy that is different than Central Valley Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[4] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ lk +'</strong> are not provided or guaranteed by Peoples First Community Bank. The site you are about to visit may have a privacy policy that is different than Peoples First Community Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[5] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ lk +'</strong> are not provided or guaranteed by Peoples First Community Bank. The site you are about to visit may have a privacy policy that is different than Peoples First Community Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';

	messages[6] = '<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving Peoples First Community Bank\'s website and entering a website hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Peoples First Community Bank\'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 your financial institution\'s.';
	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="window.open(\''+lk+'\');document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<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);
}

function openIB(){
    showMessage();
}

function showMessage(){
    var content = new Array();
	var index = 0;
	content[index++] = '<h1>Coming Soon!!</h1><br/><p>You are attempting to access a page or product that is not yet available.</p>  <p>Please check back often. It will be available soon.</p><p>Thank you!</p>';
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'"><strong>Close</strong></a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);

}

function showMortgageWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2 align=\"center\">Peoples First does not lend on<br />properties outside of the following areas:<br />State of Florida, South Georgia, and South Alabama!</h2><h3>Peoples First Community Bank will only accept and/or process applications for loans within the State of Florida, South Georgia, and South Alabama in the following Counties:</h3><p><strong>FLORIDA:</strong> Baker, Bay, Bradford, Brevard, Calhoun, Citrus, Clay, Columbia, Duval, Escambia, Flagler, Franklin, Gadsden, Gulf, Hernando, Holmes, Jackson, Jefferson, Lake, Leon, Liberty, Madison, Marion, Nassau, Okaloosa, Orange, Osceola, Pasco, Polk, Putnam, Santa Rosa, Seminole, Sumter, St. Johns, Taylor, Union, Volusia, Wakulla, Walton, and Washington. <strong>GEORGIA:</strong> Brooks, Camden, Charlton, Clinch, Decatur, Echols, Grady, Lowndes, Seminole, Thomas, and Ware. <strong>ALABAMA:</strong> Baldwin, Covington, Escambia, Geneva, Houston, and Mobile.</p><p>Also, if you are applying for an <strong>Auto Loan</strong> or <strong>Personal Loan</strong> you must live within the service area of one of our <a href=\"?pageLabel=loc\">local branches</a>. If you live outside of our service area please <strong>do not submit a loan application</strong>.</p>";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');document.getElementById('ex_dis').style.display = 'none'\">Continue</a> &nbsp;&nbsp; <a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Cancel</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}


// 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 showlendingWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<center><img src='fiFiles/static/images/logo.gif' border='0' /><br clear='all' /><h2>PLEASE READ!</h2></center><h3>Peoples First does not lend outside the State of Florida!</h3><p>Peoples First Community Bank is a Florida based bank and does not lend outside the State of Florida. Loan applicants must live within a 100-mile radius from one of our <a href=\"?pageLabel=loc\">local branches</a>. If you live outside the State of Florida or do not live near one of our branches please do not submit a loan application.</p>";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');document.getElementById('ex_dis').style.display = 'none'\">Continue</a> &nbsp;&nbsp; <a href=\"javascript:void('0');\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Cancel</a></div></div>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}

function openPdf(pdf)
{

	//page variables
	var page_bgcolor="#DEDFDE";
	var border_color="#000066";
	var table_bgcolor="#DEDFDE";
	var time_visible=300000; //automatically closes after this time

	//content creation
	var content=""
	content+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
	content+='<head>';
	content+='<title>People\'s First Community Bank | Forms &amp; Disclosures</title>';
	content+='</head>';
	content+='<frameset rows="140, *">';
	content+='<frame src="' + fiDocs + '/message.html" name="top" />';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/'+pdf+'" name="main">';
	content+='</frameset>';
	content+='</html>';

	//actual centering popup code
	
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 320) / 2);
     newwin = window.open("","newwin", "height=600,width=800,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
 	newwin.document.open();
	newwin.document.write(content);
	newwin.document.close();
}

function openPdf_Bookkeeping(pdf)
{

	//page variables
	var page_bgcolor="#DEDFDE";
	var border_color="#000066";
	var table_bgcolor="#DEDFDE";
	var time_visible=300000; //automatically closes after this time

	//content creation
	var content=""
	content+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
	content+='<head>';
	content+='<title>People\'s First Community Bank | Forms &amp; Disclosures</title>';
	content+='</head>';
	content+='<frameset rows="140, *">';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/message_bookkeeping.html" name="top" />';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/'+pdf+'" name="main">';
	content+='</frameset>';
	content+='</html>';

	//actual centering popup code
	
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 320) / 2);
     newwin = window.open("","newwin", "height=600,width=800,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
 	newwin.document.open();
	newwin.document.write(content);
	newwin.document.close();
}


function openPdf_Blank(pdf)
{

	//page variables
	var page_bgcolor="#DEDFDE";
	var border_color="#000066";
	var table_bgcolor="#DEDFDE";
	var time_visible=300000; //automatically closes after this time

	//content creation
	var content=""
	content+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
	content+='<head>';
	content+='<title>People\'s First Community Bank | Forms &amp; Disclosures</title>';
	content+='</head>';
	content+='<frameset rows="140, *">';
	content+='<frame src="fiFiles/static/documents/message_blank.html" name="top" />';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/'+pdf+'" name="main">';
	content+='</frameset>';
	content+='</html>';
	
	//actual centering popup code
	
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 320) / 2);
     newwin = window.open("","newwin", "height=600,width=800,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
 	newwin.document.open();
	newwin.document.write(content);
	newwin.document.close();
}


function openPdf_IB(pdf)
{

	//page variables
	var page_bgcolor="#DEDFDE";
	var border_color="#000066";
	var table_bgcolor="#DEDFDE";
	var time_visible=300000; //automatically closes after this time

	//content creation
	var content=""
	content+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
	content+='<head>';
	content+='<title>People\'s First Community Bank | Forms &amp; Disclosures</title>';
	content+='</head>';
	content+='<frameset rows="140, *">';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/message_ib.html" name="top" />';
	content+='<frame src="http://www.peoplesfirstonline2.com/home/fiFiles/static/documents/'+pdf+'" name="main">';
	content+='</frameset>';
	content+='</html>';

	//actual centering popup code
	
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 320) / 2);
     newwin = window.open("","newwin", "height=600,width=800,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
 	newwin.document.open();
	newwin.document.write(content);
	newwin.document.close();
}



function writeDate (){

var myDate = new Date();
var month = myDate.getMonth();
var date = myDate.getDate();
var year = "";

if (document.all)
	{
	year = myDate.getYear();
	}
else
	{
	year =myDate.getYear() + 1900;
	}	

var months = new Array ("January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December");


//alert (days[day] + ", " + months[month] + " " + date + ",  " + year);
var finalDate = (months[month] + " " + date + ",  " + year);

document.write (finalDate);

}


function getJob(city){
var page = city;	
	//setTimeout("self.location='/home/au/au_careers_listings#"+ page +"';",1); 
	self.location="/home/about/careers/listings#"+ page; 
	return false;
}

/*
	A generic version of getJob. You have to give the name of the anchor and the page the anchor is on
*/
function getPageAnchor(city){
    //alert(city);
	var anchorName = city;	
	self.location = "/home/about/listing#"+ anchorName;
	return false;
}

function getInvestor(city){
var page = city;	
	self.location="/home/investment/center/"+ page; 
	return false;
}

function getBranch(city){
var page = city;	
	self.location="/home/locations/"+ page; 
	return false;
}

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);
}


function jump()
	{
			setTimeout("self.location='/home/electronic/cashmgmt';");	
	}


function wc_testForDemo(URL)
{
    if(document.cookie.indexOf('demo') != -1)
    {
        var exit_demo = confirm("In order to proceed, you must first exit the demo.  Would you like to exit the demo?");
        if (exit_demo)
        {
            expireDate = new Date("January 1, 1970");
            var kill_string1 = "cookie_check=invalid;expires=" + expireDate.toGMTString() + "; path=/";
            document.cookie = kill_string1;
            var kill_string2 = "demo=stub;expires=" + expireDate.toGMTString() + "; path=/";
            document.cookie = kill_string2;
            window.location.href="/home/home";
        }
        else
        {
            window.location.href="/home/home?demo";
        }
    }
    else
    {
            window.open(URL);
    }
}

 
// jquery effects funtions

function blinkIn() {
  $('.blink').fadeIn("fast",function(){blinkOut()});
}

function blinkOut() {
  $('.blink').fadeOut("fast",function(){blinkIn()});
}

function showDiv(divID) {
	$("#" + divID).show();
}

function hideDiv(divID) {
	$("#" + divID).hide();
}

var fiName="Peoples First Community Bank";
//end of file