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


var num = Math.ceil((Math.random()* 9));
var cphoto = new Image(170,228);
cphoto.src = "/images/content-photo"+num+".jpg";
window.onload = changeImage;
//Function to randomize the content photo
function changeImage(){
    if(window.homepage || !document.getElementById("content")){
        return;
    }
    document.getElementById("content").src = cphoto.src;
}

// 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.tropicanacu.com/images/"
sitedir="http://www.tropicanacu.com/site/"
securedir="http://www.tropicanacu.com/site/"
homedir="http://www.tropicanacu.com/"
}
else if(window.securepage)
{
imgdir="https://www.tropicanacu.com/images/"
sitedir="http://www.tropicanacu.com/site/"
securedir="https://www.tropicanacu.com/site/"
homedir="http://www.tropicanacu.com/"
}
// 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 nav_heights=12;
var nav_widths=171;
var navMain_heights=25;

var navitems = new Array();
navitems["aboutus"] = new makeNavImage("aboutus",59,nav_heights);
navitems["joinus"] = new makeNavImage("joinus",47,nav_heights);
navitems["contactus"] = new makeNavImage("contactus",68,nav_heights);
navitems["newsletter"] = new makeNavImage("newsletter",68,nav_heights);
navitems["home"] = new makeNavImage("home",36,nav_heights);
navitems["loanproducts"] = new makeNavImage("loanproducts",nav_widths,nav_heights);
navitems["deposits"] = new makeNavImage("deposits",nav_widths,nav_heights);
navitems["services"] = new makeNavImage("services",nav_widths,nav_heights);
navitems["online"] = new makeNavImage("online",nav_widths,nav_heights);
navitems["whatsnew"] = new makeNavImage("whatsnew",nav_widths,nav_heights);
navitems["moreinfo"] = new makeNavImage("moreinfo",62,14);
navitems["demo"] = new makeNavImage("demo",38,14);
navitems["navlogin"] = new makeNavImage("navlogin",66,20);

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
oM.mout();
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 open_apps(nameofapp){
self.location.href = "https://www.tropicanacu.com/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") self.location.href = "https://www.tropicanacu.com/onlineserv/HB/demo.html";
else self.location.href = "https://www.tropicanacu.com/onlineserv/HB/";
}
function openLink(lk){
    openWin(lk);
}
function openPdf(pdf){
    openWin(sitedir+pdf);
}
function showCalc(calc){
    openWin(calc);
}
function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<div style='text-align:center;background-color:#42518C;padding:10px;'><img src='"+imgdir+"logo-tropicanacu.gif' width='275' height='91' alt='' border='0'></div><br><h2>Third Party Site Disclaimer</h2>Tropicana  Federal Credit Union has no responsibility for content of the web sites found at these links, or beyond, and does not endorse or attest to the accuracy or propriety of any information, products or services located therein.  The Credit Union does not warrant that such sites, content, information, products or services are free from any claims of copyright, trademark or other infringement of the rights of third parties.  Such sites may have a privacy policy different than the credit union and may provide less security than the credit union\'s website.  Your connection to any linked site is at your own risk.'";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\""+url+"\" ";
/** Added so that the BP Contest banner still opens in a new window **/
if (url.toLowerCase().indexOf("http://www.diproductsite.com") == 0) {
	content[index++] = "target=\"_blank\" ";
}
content[index++] = "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);
}

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 FindPosition(image_name){
    if(!document.images[image_name]){
        return null;
    }
    this.image_name = image_name;
    this.xPos = 500;
    this.yPos = 500;
    this.ref_image = document.images[image_name];
    this.getRealLeft = getRealLeft;
    this.getRealTop = getRealTop;
    this.getRealLeft();
    this.getRealTop();
}

function getRealLeft(move) {
   if(!move){
        move = 0;
    }
   if(document.layers){
     this.xPos = this.ref_image.x + move;    
     return this.xPos;
   }
	this.xPos = this.ref_image.offsetLeft;
	tempEl = this.ref_image.offsetParent;
  	while (tempEl != null) {
  		this.xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
    this.xPos = this.xPos + move;
	return this.xPos;
}

function getRealTop(move) {
    if(!move){
        move = 0;
    }
    if(document.layers){
     this.yPos = this.ref_image.y + move; 
     return this.yPos
   }
	this.yPos = this.ref_image.offsetTop;
	tempEl = this.ref_image.offsetParent;
	while (tempEl != null) {
  		this.yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
    this.yPos = this.yPos + move;
	return this.yPos;
}


// OTHER FUNCTIONS ABOVE
