window.onerror = function(){ return true; }

// 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 target_blank(url){
    tmp = window.open(url);
    tmp = null;
}

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);
}

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.usfed.org/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

function openPDF(page)
{
bWindow = window.open(fiDocs+'/'+page,'newWin');
	bWindow = null;
	return;
}

function openDisc(page)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 300)
var pHeight = (((parseInt(screen.height) / 2)) - 400)
bWindow = window.open(page,'discwin',"scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0,width=600,height=600,top=" + pHeight + ",left=" + pWidth);
	bWindow = null;
	return;
}

/************************************************************************************************************
* 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 : "_blank";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	messages[0] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Presidio 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 Presidio Bank. The site you are about to visit may have a privacy policy that is different than Presidio Bank\'s. Please review their privacy policy. Presidio 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[1] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Presidio 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 Presidio Bank. The site you are about to visit may have a privacy policy that is different than Presidio Bank\'s. Please review their privacy policy. Presidio 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>Third Party Site Disclaimer</h1><br/>You are leaving Presidio 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 Presidio Bank. The site you are about to visit may have a privacy policy that is different than Presidio Bank\'s. Please review their privacy policy. Presidio 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[3] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Presidio 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 Presidio Bank. The site you are about to visit may have a privacy policy that is different than Presidio Bank\'s. Please review their privacy policy. Presidio 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 Presidio 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 Presidio Bank. The site you are about to visit may have a privacy policy that is different than Presidio Bank\'s. Please review their privacy policy. Presidio 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>Secure Email Disclaimer</h1><br>Email is not a secure means of communication. Please do not include any sensitive information such as Social Security Numbers and Account Numbers over email. Presidio Bank is not responsible for any losses incurred due to the interception of sensitive data sent via unsecured and/or unencrypted email';

	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+lk+'" target="'+target+'" onclick="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 showIBWarning() {

var content = new Array();
	var index = 0;
	content[index++] = '<h1>Computer System Upgrade</h1>In an effort to better serve our clients, as we had previously advised, we performed a computer system upgrade over this past weekend beginning on Friday October 30th at 6 p.m.<br /><br /><div style="text-decoration: underline; text-align: center; font-weight: bold;">We are pleased to advise you that the upgrade was successful and all services have been restored earlier than we had originally communicated;</div><br /><strong>The following notes the status of those areas that would have affected you:</strong><br /><br /><ul><li><strong>INTERNET BANKING</strong> users are <span style="text-decoration: underline;">now</span> able to access their accounts effective as of 9:30 p. m. on Sunday, November 1st.<br /><br /></li><li><strong>REMOTE CHECK DEPOSIT</strong> users are <span style="text-decoration: underline;">now</span> able to access this service effective as of 9:30 p. m. on Sunday, November 1st.<br /><br /></li><li><strong>ATM/DEBIT CARDS</strong> were active and usable but did not reflect a "live" balance from 6:00 p.m. Friday, with "live" balance information <span style="text-decoration: underline;">restored</span> on Saturday at 5 p.m.<br /><br /></li><li><strong>Frequently Asked Questions.</strong>.  Please click on the appropriate link for more information on this system upgrade:<br /><br /><a href="javascript:openPDF(\'FAQ-BusinessConversion.pdf\')"><strong>Business FAQ</strong></a><br /><br /><a href="javascript:openPDF(\'FAQ-PersonalConversion.pdf\')"><strong>Personal FAQ</strong></a></li></ul><div style="text-align: center; font-weight: bold;">We apologize for any inconvenience this may have caused and are pleased we were able to bring these services back on line ahead of schedule in support of your banking needs.</div>';
	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>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);

}


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. Please check back often. It will be available soon.</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 showWarning(URL)
{
	document.location.href = "?pageLabel=thirdparty&amp;newUrl="+URL;
}	
*/
function getUrl(){
	var url = document.location.href;
	var urlstart = url.indexOf("newUrl=") + 7;
	var urlToReturn = url.substring(urlstart);
	return urlToReturn;
}

//end of file