// 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();

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


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

function scrub_url(url) {
	var newURL="";
	newURL = url.replace(/&#38;/,"&");
	newURL = newURL.replace(/&amp;/,"&");
	
	top.location.href=newURL;
}


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('fiFiles/static/documents/'+page);
	bWindow = null;
}

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

/************************************************************************************************************
* 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;
}

function displayThirdPartyAlertBlank(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, "_blank", 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){
               if (msg > 5) { msg = 4; }
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
    messages[0] = '<h2 style="text-align:center">Third Party Site Disclaimer</h2><p>You are leaving '+fiName+'\'s website. Links that may be accessed via this site are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by '+fiName+'. The site you are about to visit may have a privacy policy that is different than '+fiName+'\'s. Please review their privacy policy. '+fiName+' does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.</p>';
    messages[1] = '<h2 style="text-align:center">Third Party Site Disclaimer</h2><p>You are leaving '+fiName+'\'s website. Links that may be accessed via this site are for the convenience of informational purposes only. Any products and services accessed through this link are not provided or guaranteed by '+fiName+'. The site you are about to visit may have a privacy policy that is different than '+fiName+'\'s. Please review their privacy policy. '+fiName+' does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.</p>';
    messages[2] = '<h1>Important:</h1><br /> When registering your VISA credit card, you will need to use the <strong>primary</strong> member\'s social security number and birthdate.';
    messages[3] = '<strong>Notice: </strong>You are leaving harborstone.com, a secure website. By clicking &quot;Continue&quot;  you will enter our vendor site for JetSet benefits. Any information you provide will be electronically transmitted over the Internet in a non-secure (non-encrypted) mode. Do you want to proceed?';
    messages[4] = '<p><span class="headersmall"> You are about to leave harborstone.com<br />  and enter a linked site.</span></p> <span class="bodyText"><p >This link is provided for your convenience and should not be considered an endorsement of the products, services, or information provided, or an assurance of the security provided at the linked site.</p>';
    messages[5] = '<h2 style="text-align:center">E-mail Disclaimer</h2><p>WARNING: E-mail is an unsecure method of communication.  Any information contained in your message could be viewed by a third party.  Sensitive information such as passwords or social security numbers should be omitted from e-mail messages.</p>';
    //messages[6] = '<p><span class="headersmall"> You are about to leave harborstone.com<br />  and enter a linked site.</span></p><span class="bodyText"><p >This link is provided for your convenience and should not be considered an endorsement of the products, services, or information provided, or an assurance of the security provided at the linked site.</p>';
    //messages[7] = '<p><span class="headersmall"> You are about to leave harborstone.com<br />  and enter a linked site.</span></p><span class="bodyText"><p >This link is provided for your convenience and should not be considered an endorsement of the products, services, or information provided, or an assurance of the security provided at the linked site.</p>';

	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 getUrl(){
	var url = document.location.href;
	var urlstart = url.indexOf("newUrl=") + 7;
	var urlToReturn = url.substring(urlstart);
	return urlToReturn;
}

function openCalc(urllink){
		self.name = "main"
		target = urllink
		resultWindow = window.open(target,'resultWindow','height=500,width=500,scrollbars,screenX=0,screenY=0,resizable=yes')
		resultWindow.focus()
		}
		
function opener(urllink){
self.name = "main"
target = urllink
resultWindow = window.open(target,'resultWindow','height=415,width=645,scrollbars,screenX=0,screenY=0,resizable=yes')
resultWindow.focus()
}	
	
function makeDate() {

	/*
  Format masks -- 
    M, MM:  Month in digit format
    MMM:  Three-letter abbreviation of month
    MMMM:  Month spelled out

    D:  Date without any leading zero
    DD:  Date with a leading zero, if applicable
    DDD:  Three-letter abbreviation for day of the week
    DDDD:  Weekday spelled out

    YY:  Two-digit year
    YYYY:  Four-digit year
  All masks preceded and followed by an underscore character (_).
*/
    var dateMask = (arguments.length == 1) ? arguments[0] : "_MMMM_ _D_, _YYYY_";
    // Define array of months
    var months=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    // Define weekdays
    var weekdays=new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    // Create date object and get the numeric values for month, day and year
    var today = new Date();
    // Weekday
    var da = today.getDay();
    // Month with and without leading zero.
    var m = today.getMonth();
    var mo = "0"+(m+1);
    mo = mo.substring(mo.length-2, mo.length);
    // Date with and without leading zero.
    var d = today.getDate();
    var dy = "0"+d;
     
    dy = dy.substring(dy.length-2, dy.length);
    // Use getYear on older browsers and getFullYear on newer browsers
    //      (getYear deprecated in favor of getFullYear as of JavaScript 1.2
    //      but used 1.3 as a cutoff based on Netscape documentation)
    
    var yr = today.getYear();
    
    // Verify that a four digit year was returned and adjust if necessary 
    if (yr < 1900) yr += 1900;
    // If abbreviated year, add leading zero to make two digits, if necessary.
    var y = "0" + yr % 100;
    y = y.substring(y.length-2, y.length);
    //  Here's the fun part.  Replace the date mask specifications with the actual date.
    var date=dateMask;
    
    date=date.replace(/_YYYY_/g, yr);
    date=date.replace(/_YY_/g, y);
    date=date.replace(/_MMMM_/g, months[m]);
    date=date.replace(/_MMM_/g, months[m].substring(0, 3));
    date=date.replace(/_MM_/g, mo);
    date=date.replace(/_M_/g, m);
    date=date.replace(/_DDDD_/g, weekdays[da]);
    date=date.replace(/_DDD_/g, weekdays[da].substring(0, 3));
    date=date.replace(/_DD_/g, dy);
    date=date.replace(/_D_/g, d);
    
    document.getElementById("todaysdate").innerHTML = date;
}		

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: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;">blank</div>');
//end of file

//This is code added by a GRP Metavante Bill Payment and Presentment Demo Implementation Request when removing that demo remove this as well.
var openWin;

function openWindow(theURL,winName,features) { //v2.0

	openWin = window.open(theURL,winName,features);
	//so that the demo window can redirect this page if need be.
	window.name = 'opener';
	
}
