// 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 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 openPDF(file)
{
	wcInternalPopup(file);
}

function targetBlank(file)
{
	wcInternalPopup(file, 600, 800);
}

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 disclaimer=parseInt(disclaimer);
    var wide=parseInt(width);
    var tall=parseInt(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;
	
	if (disclaimer)
	{
		showWarning("javascript:void(window.open('"+url+"','externalpopup','"+features+"'))", url, "_self", disclaimer)
	}
	else
	{
	    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;
}

/************************************************************************************************************
* 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] = '<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] = '<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[3] = '<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[4] = '<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[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>Valued Member:</p>';
    messages[6] += '<p>Due to popular demand, access to your VISA account has moved to DOCFCU online banking effective September 2, 2008! </p>';
    messages[6] += '<p>To access your VISA credit card information, go to www.docfcu.org</p>';
    messages[6] += '<p>Click on the Online Banking Login button located in the upper right-hand corner of the screen.</p>';
    messages[6] += '<p>Enter your member number and password in the appropriate fields for online banking. (Enter your challenge questions, if prompted)</p>';
    messages[6] += '<p>From the main navigation menu, click the “Products & Services” tab.</p>';
    messages[6] += '<p>Click “Enter” for Credit Cards to access your VISA credit card information.</p>';
    messages[6] += '<p>Please note:</p>';
    messages[6] += '<p>One time only process: You will have to click on the “Add Card” link to add your card/s the very first time that you attempt to access your VISA account.</p>';
    messages[6] += '<p>If you have any questions and/or concerns, please contact us at (202) 482-4134 or service@docfcu.org.</p>';
    messages[6] += '<p>Thanks for using DOCFCU products & services!</p>';

	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<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 membershipPopup(lnk, target) {
    target = (target) ? target : "_self";
    var content = new Array();
	var index = 0;
    
    content[index++] = '<p>Thank you for opening a Department of Commerce Federal Credit union account.   Please provide a valid government issued  ID  for every applicant to comply with the US Patriot Act.  The following are acceptable forms government issued ID’s:</p>'
    content[index++] = '<ul>';
    content[index++] = '<li>Current Driver’s License (photograph required);</li>';
    content[index++] = '<li>Current Armed Forces Identification (photograph required);</li>';
    content[index++] = '<li>Valid Passport (photograph required);</li>';
    content[index++] = '<li>Current Alien Identification (current photograph required);</li>';
    content[index++] = '</ul>';
  	content[index++] = '<br /><br />';
	content[index++] = '<div align="center"><a href="'+lnk+'" target="'+target+'" 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 visaPopup(){
	msg = 0;
	
	var messages = new Array();

    messages[0] = '<p>Valued Member:</p>';
    messages[0] += '<p>Due to popular demand, access to your VISA account has moved to DOCFCU online banking effective September 2, 2008! </p>';
    messages[0] += '<p>To access your VISA credit card information, go to www.docfcu.org</p>';
    messages[0] += '<p>Click on the Online Banking Login button located in the upper right-hand corner of the screen.</p>';
    messages[0] += '<p>Enter your member number and password in the appropriate fields for online banking. (Enter your challenge questions, if prompted)</p>';
    messages[0] += '<p>From the main navigation menu, click the “Products & Services” tab.</p>';
    messages[0] += '<p>Click “Enter” for Credit Cards to access your VISA credit card information.</p>';
    messages[0] += '<p>Please note:</p>';
    messages[0] += '<p>One time only process: You will have to click on the “Add Card” link to add your card/s the very first time that you attempt to access your VISA account.</p>';
    messages[0] += '<p>If you have any questions and/or concerns, please contact us at (202) 482-4134 or service@docfcu.org.</p>';
    messages[0] += '<p>Thanks for using DOCFCU products & services!</p>';

	var content = new Array();
	var index = 0;
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Close</a></div></div>';
	content[index++] = messages[msg];
	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 checkSize()
{
    var width = 800; // Default window width is 800px

    if ( typeof(window.innerWidth) == 'number' ) { width = window.innerWidth; } //Non-IE
    else if ( document.documentElement && ( document.documentElement.clientWidth ) ) { width = document.documentElement.clientWidth; } //IE 6+ in 'standards compliant mode'
    else if ( document.body && ( document.body.clientWidth ) ) { width = document.body.clientWidth; } //IE 4 compatible

    return width;
}

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:' + (parseInt(checkSize()/2)-175) + 'px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 100000; width:400px; overflow: hidden;"></div>');

function stringReplacement(str)
{
	var result = str;
	
	if (result == '') result = '&#160;';
	
	while (result.indexOf('(br)') >= 0)
	{ result = result.replace(/\(br\)/,"<br />"); }

	while (result.indexOf('(b)') >= 0)
	{ result = result.replace(/\(b\)/,"<strong>"); }
	while (result.indexOf('(/b)') >= 0)
	{ result = result.replace(/\(\/b\)/,"</strong>"); }

	return result;
}

//end of file
