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

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

var imgdir = "diFiles/skins/default/images/";
var dir = "diFiles/skins/default/";
var sitedir = "";
var securedir = "";
var homedir = "../";

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,'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>
**************************************************************************************************************/

//'<div class="speedbumpIB"><div style="margin:0px 0 10px 0;background:url(diFiles/skins/default/images/header_bg.gif)"><img src="fiFiles/static/images/logo.gif" alt="Capitol Federal Savings Bank" border="0" /></div><h2 align="center">Third Party Site Disclaimer</h2><p>The "Continue" link below will take you out of the Capitol Federal Savings Bank website. Links which take you out of Capitol Federal Savings Bank web site are not under the control of the Capitol Federal Savings Bank, and the Capitol Federal Savings Bank is not responsible for the contents of any such site or any further links from such site. Capitol Federal Savings Bank is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement of the linked site by Capitol Federal Savings Bank.</p>';


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>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
	
	messages[1] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
	
	messages[2] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
	
	messages[3] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
	
	messages[4] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
	
	// Message 5 (or E in the WCAC) is the Insecure Email Disclosure.
	messages[5] = "<h2>E-mail Disclosure</h2><p>E-mail messages sent over the Internet are not secure. Please do not include any account or personal information such as social security numbers in the message.</p>";
	
	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<div align="center" class="sblinks"><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 navContactIFrame(){
    var fiDomain = "www.sturdyonline2.com";
//    var fiDomain = "skynet.diginsite.com/staging/spectrumbank2/spectrumbank2docs";

    if(!document.getElementById)return;
    url = document.location.href;
    formName = url.match(/type=([^#&]+)/);
    if(!formName || !formName[1]){
        fName = 'email';
    }
    else
        fName = formName[1];
    
    objFrame = document.getElementById("formFrame");
    objFrame.src = "https://" + fiDomain + "/Forms/OnlineForm.cgi?form=contact&type="+fName;
}

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

show_warning = showWarning;
/*function show_warning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
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>  <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 show_warning_here(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving Sturdy Savings Bank's website and entering a website hosted by another party. Sturdy Savings Bank 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 Sturdy Savings 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 Sturdy Savings Bank's.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\""+url+"\" onclick=\"document.getElementById('ex_dis').style.display = 'none'\">Continue</a>  <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 mail_warning(url){
    url = "mailto:"+url;
   //content creation
   var content = new Array();
          var index = 0;
   content[index++] = '<h3>E-mail Disclaimer</h3><br />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.';
   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\'">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: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');


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

//end of file