/*window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}*/

if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

// CALL TO CORRECT DIRECTORY BELOW
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.redwoodcu.org/images/"
sitedir="http://www.redwoodcu.org/site/"
securedir="http://www.redwoodcu.org/site/"
homedir="http://www.redwoodcu.org/"
}
else if(window.securepage)
{
imgdir="https://www.redwoodcu.org/images/"
sitedir="http://www.redwoodcu.org/site/"
securedir="https://www.redwoodcu.org/site/"
homedir="http://www.redwoodcu.org/"
}

else if(window.youthpage)
{
var imgdir = "../images/";
var sitedir = "../site/";
var securedir = "";
var homedir = "../";
}

// for all subfolders that aren't the site folder
else if(window.otherpage)
{
var imgdir = "../images/";
var sitedir = "../site/";
var securedir = "../site/";
var homedir = "../";
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
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 = imgdir + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = imgdir + this.name_off;
}

var navitems = new Array();
navitems["home"] = new makeNavImage("home",29,15);
navitems["about"] = new makeNavImage("about",53,15);
navitems["join"] = new makeNavImage("join",45,15);
navitems["locations"] = new makeNavImage("locations",47,15);
navitems["contact"] = new makeNavImage("contact",51,15);
navitems["onlinebanking"] = new makeNavImage("onlinebanking",75,15);
navitems["rates"] = new makeNavImage("rates",44,29);
navitems["ratesbp"] = new makeNavImage("ratesbp",44,29);
navitems["checking"] = new makeNavImage("checking",62,29);
navitems["checkingbp"] = new makeNavImage("checkingbp",62,29);
navitems["savings"] = new makeNavImage("savings",139,29);
navitems["savingsbp"] = new makeNavImage("savingsbp",139,29);
navitems["loans"] = new makeNavImage("loans",95,29);
navitems["eservices"] = new makeNavImage("eservices",66,29);
navitems["insurance"] = new makeNavImage("insurance",70,29);
navitems["tools"] = new makeNavImage("tools",122,29);

navitems["bizcm"] = new makeNavImage("bizcm",104,29);
navitems["bizdp"] = new makeNavImage("bizdp",104,29);
navitems["bizlp"] = new makeNavImage("bizlp",88,29);
navitems["bizms"] = new makeNavImage("bizms",110,29);
navitems["bizpayroll"] = new makeNavImage("bizpayroll",99,29);
navitems["bizrates"] = new makeNavImage("bizrates",93,29);

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;
}
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW
function openWin(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}

function openPdf(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}



function open_apps(nameofapp){
self.location.href = "https://www.redwoodcu.org/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

function openIB(page){
if (page=="demo") self.location.href = homedir+"index.html?demo";
else self.location.href = homedir+"index.html";
//if (page=="demo") openWin("https://www.redwoodcu.org/onlineserv/HB/demo.html");
//else openWin("https://www.redwoodcu.org/onlineserv/HB/")
}

/*function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2 align='center'>Third Party Site Disclaimer</h2><p>You have clicked on a link that will take you off of the Redwood Credit Union web site.</p><p>Please note that Redwood Credit Union has no control of the accuracy of the information nor of the security of the site you are about to visit, and makes no warranty thereof.</p><p>Thank you for visiting Redwood Credit Union's web site. Please be sure to visit again soon.</p>";
content[index++] = "<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>";	
document.getElementById("ex_dis").innerHTML = content.join("");
document.getElementById("ex_dis").style.display = "block";
scrollTo(0, 0);
}*/

/************************************************************************************************************
* 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:showWarning('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;
	lk = (lk.substring(0,1)=="/" && !(lk.substring(0,8)=="/mstinc/"))? contextPath + lk: lk; // for local pages
	
	var messages = new Array(6);
	// Standard 3rd Party Warning
	messages[0] = messages[1] = "<h2 align='center'>Third Party Site Disclaimer</h2><p>You have clicked on a link that will take you off of the Redwood Credit Union web site.</p><p>Please note that Redwood Credit Union has no control of the accuracy of the information nor of the security of the site you are about to visit, and makes no warranty thereof.</p><p>Thank you for visiting Redwood Credit Union's web site. Please be sure to visit again soon.</p>";
	// Standard Partner Warning
	messages[2] = '<h2 style="text-align:center">Partner Site Disclaimer</h2><p>By accessing the noted link you will be leaving our website and entering a partner site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>';
	// Standard Affiliate Warning
	messages[3] = '<h2 style="text-align:center">Affiliate Site Disclaimer</h2><p>By accessing the noted link you will be leaving our website and entering an affiliate site located which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>';
	// Notice to Members for Insurance Services
	messages[4] = '<h2 style="text-align:center;">Notice to User</h2><p>RCU Insurance Services will gather essential personal information and electronically transmit between our Insurance Agency and our A-rated, appointed carriers, in order to provide you with a competitive policy quote.</p><p><a href="http://www.redwoodcu.org/site/privacy.html">Redwood Credit Union Privacy Policy</a></p>';
	
	// Standard mailto: Insecure Warning
	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 style="margin-top:1em;text-align:center"><a href="'+lk+'"'+(target?' target="'+target+'"':'')+' onclick="$(\'#ex_dis\').hide()">Continue</a>&#160;&#160;<a href="#" onclick="$(\'#ex_dis\').hide();return false;">Decline</a></div>';	
	$("#ex_dis").html(content.join("")).show();
	scrollTo(0,0);
}



function showNumber(){

var num = document.forms.telephone.numbers.value;
var content = new Array();
var index = 0;
middletext = "</td></tr><tr><td class='tablecontent2' align='center'>";
content[index++] = "<div align='center'><table class='table'><tr><td class='tableheader' align='center'>";
switch(num){
	case "main":	content[index++] ="Main RCU Phone Numbers For All Services" +middletext+ "Local: (707) 545-4000<br />Toll Free within U.S.: (800) 479-7928";
					break;
					
	case "member":	content[index++] ="RCU Telephone Member Service Center" +middletext+ "<h3>Account Assistance, Information,<br /> and Loans By Phone</h3>Local: (707) 545-4000<br />Toll Free within U.S.: (800) 479-7928<br />Loan By Phone: (888) 545-4000<h3>Phone Center Hours:</h3>Mon. - Fri.: 7 a.m.-8 p.m. PST<br />Saturday: 8 a.m.-5 p.m. PST";
					break;
		
	case "24":	content[index++] ="24-Hour Telephone Teller" +middletext+ "Account Access by Touch-Tone Phone<br />Local: (707) 576-5000<br />Toll Free within US: (800) RCU-4030 ";
					break;
					
	case "business":	content[index++] ="Business Services" +middletext+ "(877) 545-4100";
					break;					
					
	case "savings":	content[index++] ="Current Savings Rates" +middletext+ "Local: (707) 541-2620<br />Toll Free within US: (800) 479-7928";
					break;
					
	case "loan":	content[index++] ="Current Loan Rates" +middletext+ "Local: (707) 541-2621<br />Toll Free within US: (800) 479-7928 ";
					break;
					
	case "real":	content[index++] ="Real Estate Loan Information" +middletext+ "Toll Free within US: (800) 609-9009 ";
					break;
					
	case "check":	content[index++] ="Report a Lost/Stolen ATM Card or VISA® Check Card" +middletext+ "Toll Free within US: (888) 782-2228";
					break;
					
	case "credit":	content[index++] ="Report a Lost/Stolen VISA® Credit Card" +middletext+ "Toll Free within US: (800) 556-5678 ";
					break;

case "media":	content[index++] ="Media & Public Relations" +middletext+ "Local: (707) 576-5224<br />Toll-free: 1 (800) 479-7928, ext. 5224";
}
content[index++] = "</td></tr></table></div><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);
}


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: thick solid #006C3A; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');
// OTHER FUNCTIONS ABOVE

function getBranch(){
var page = document.forms.locations.city.value;	
	setTimeout("self.location='http://www.redwoodcu.org/site/contact_"+ page +".html';",1); 
	
}

function getRates(){
var ratepage= document.forms.rates.page.value;
	setTimeout("self.location='http://www.redwoodcu.org/site/rates_" + ratepage + ".html';",1);


}

/*if(window.securedir)
{
document.write('<script language="Javascript" type="text/javascript" src="' + securedir + '_mailto_speedbump.js"></script>');
}
else
{
document.write('<script language="Javascript" type="text/javascript" src="' + sitedir + '_mailto_speedbump.js"></script>');
}*/
