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

// fix wc bug
var url = document.location.href;
var eSign = url.indexOf('=');
if(eSign > -1){
    queryString = url.substring(eSign+1);
    rIsProblem = /^[^_\.]+_[^\.]+\./;
    if(rIsProblem.test(queryString)){
        rFixProblem = /^([^_]+)(.*)$/;
        parsedQueryString = rFixProblem.exec(queryString);
        newQueryString = parsedQueryString[1]+"."+parsedQueryString[1]+parsedQueryString[2];
        newURL = "/home/?pageLabel="+newQueryString;
        document.location.replace(newURL);
    }
}

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

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=800;
    var tall=600;
    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 openLoanApp()
{
bWindow = window.open("http://soundcb.mortgagewebcenter.com/",'newWin');
	bWindow = null;
	return;
}

function openPersonalLoanApp()
{
bWindow = window.open("https://www.loans24.net/atl/clientSelect.do?clientID=7416",'newWin');
	bWindow = null;
	return;
}

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

function openIB(page){
    if (page=="demo")
		self.location.href="home?demo";
	else if (page=="register")
		//openWin('https://www.soundcb.com/onlineserv/HB/OnlineForm.cgi?form=BRS_enroll_app');
		testForDemo('https://www.soundcb.com/onlineserv/HB/STDReg.cgi');			
	else if (page=="info")
		self.location.href="cu_faq";
	else if (page=="forgot")
		testForDemo('https://www.soundcb.com/onlineserv/HB/ForgottenPW.html');	
	else
		self.location.href="?pageLabel=home";
}

/************************************************************************************************************
* 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 : "_top";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	messages[0] = '<h4 style="text-align:center;">Third Party Site Disclaimer</h4><br/>By continuing you will be leaving Sound Community Bank\'s website. We are not responsible for accuracy, security, or content of other websites. We encourage you to view privacy and security disclosures of all websites you visit.';
	
	messages[1] = '<h4 style="margin-left:100px;">Third Party Site Disclaimer</h4><br>You are leaving Sound 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 Sound Community Bank. The site you are about to visit may have a privacy policy that is different than Sound Community Bank\'s. Please review their privacy policy. Sound 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[2] = '<h4>E-mail Disclaimer</h4><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.';
	
	messages[3] = '<h4>Third Party Site Disclaimer</h4><br>You are leaving Sound 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 Sound Community Bank. The site you are about to visit may have a privacy policy that is different than Sound Community Bank\'s. Please review their privacy policy. Sound 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] = '<h4>Third Party Site Disclaimer</h4><br>You are leaving Sound 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 Sound Community Bank. The site you are about to visit may have a privacy policy that is different than Sound Community Bank\'s. Please review their privacy policy. Sound 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] = '<h4>Third Party Site Disclaimer</h4><br>You are leaving Sound 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 Sound Community Bank. The site you are about to visit may have a privacy policy that is different than Sound Community Bank\'s. Please review their privacy policy. Sound 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.';

	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 showWarning(URL)
{
	document.location.href = "?pageLabel=thirdparty&amp;newUrl="+URL;
}	
*/

function show_warning(url){
var content = new Array();
var index = 0;
content[index++] = "<h4>Third Party Site Disclaimer</h4>By accessing the noted link you will be leaving your financial institution's website and entering a website hosted by another party. Your financial institution 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 your financial institution'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.";
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 getUrl(){
	var url = document.location.href;
	var urlstart = url.indexOf("newUrl=") + 7;
	var urlToReturn = url.substring(urlstart);
	return urlToReturn;
}

function swapHome1(myLin,myImage) {
divContent = "";
imgSrc = "";
lnkSrc = "";

imgSrc = "<img src=\"fiFiles/static/images/"+myImage+"\" name=\"keyin_1\" id=\"keyin_1\" width=\"151\" height=\"124\" style=\"float:right; margin-top: 36px;\" border=\"0\" /></a>";
//lnkSrc = "<a href=\""+myLin+"\">";

if (myLin.indexOf('http') >= 0) {
	
	lnkSrc = "<a href=\""+myLin+"\">";
	
}
else {

lnkSrc = "<a href=\""+myLin+"\">";


}
    
divContent = lnkSrc; 
divContent += imgSrc;
    

document.getElementById("key1").innerHTML = divContent;
document.getElementById("key1").style.display = "block";

}

function swapHome2(myLin,myImage) {
divContent = "";
imgSrc = "";
lnkSrc = "";

//alert (myLin);
imgSrc = "<img src=\"fiFiles/static/images/"+myImage+"\" name=\"keyin_2\" id=\"keyin_2\" width=\"151\" height=\"124\" style=\"float:right;\" border=\"0\" /></a>";

if (myLin.indexOf('http') >= 0) {
	
	lnkSrc = "<a href=\""+myLin+"\">";
	
}
else {

lnkSrc = "<a href=\""+myLin+"\">";


}
    
divContent = lnkSrc; 
divContent += imgSrc;
    

document.getElementById("key2").innerHTML = divContent;
document.getElementById("key2").style.display = "block";

}


function swapHome3(myLin,myImage) {
divContent = "";
imgSrc = "";
lnkSrc = "";

//alert (myLin);
imgSrc = "<img src=\"fiFiles/static/images/"+myImage+"\" name=\"keyin_3\" id=\"keyin_3\" width=\"151\" height=\"124\" style=\"float:right;\" border=\"0\" /></a>";

if (myLin.indexOf('http') >= 0) {
	
	lnkSrc = "<a href=\""+myLin+"\">";
	
}
else {

lnkSrc = "<a href=\""+myLin+"\">";


}
    
divContent = lnkSrc; 
divContent += imgSrc;
    

document.getElementById("key3").innerHTML = divContent;
document.getElementById("key3").style.display = "block";

}


function anchorIframe()
{

if (document.location=="https://www.soundcb.com/home/per_chk_oaa#gift"){

document.getElementById("account_app").src="https://www.soundcb.com/Forms/OnlineForm.cgi?form=account_app#gift"
}


}


//end of file
