// Copyright Acro Media Inc. 1998-2003, www.acromediainc.com

var preloaded = 0;
var newWin;
var imageNames;
var imageOver;
graphicsDir = dirDepth+"graphics/toolbar/";
sendtoafriendPage = dirDepth+"sendtoafriend.htm";

if (document.images) {
	imageNames = new initArray("accounts", "investor", "about", "contact", "home");
	imageOver = new initArray("b_accounts_02.gif", "b_investor_02.gif", "b_about_02.gif", "b_contact_02.gif", "b_home_02.gif");

}

function preloadImages(){
	if(document.images){
		var i, temp;

		for(i=0; i<imageNames.length; i++){
			document.images[imageNames[i]].offsrc = document.images[imageNames[i]].src;
		}

		for(i=0; i<imageNames.length; i++){
			temp = new Image();
			temp.src = graphicsDir + imageOver[i];
			document.images[imageNames[i]].oversrc = temp.src;
		}
		preloaded = 1;
		
		prelogin = new Image();
		prelogin.src = "https://www.netteller.com/firstreliance/PreLogin.cfm"
	}
}

function initArray(){
      if (document.images) {
      this.length = initArray.arguments.length;
      for (var i=0;i<= this.length; i++)
         this[i] = initArray.arguments[i];
   }
}

function mouseOver(imageID) {
	if (document.images && preloaded) {
		document.images[imageNames[imageID]].src = document.images[imageNames[imageID]].oversrc;
	}
}

function mouseOut(imageID) {
	if (document.images && preloaded){
		document.images[imageNames[imageID]].src = document.images[imageNames[imageID]].offsrc;
	}
}

function sendToAFriend(){
	var refURL;
	refURL = sendtoafriendPage + "?refUrl="+document.location;
	openUp(refURL, 350, 295);

}

function go(goUrl){
	var openUrl;
	
	openUrl = dirDepth + "goConfirm.htm?page="+goUrl;
	openUp(openUrl, 444, 322);
}

function openUp(windowURL, windowWidth, windowHeight, regularWindow) {
  var topPos = "";
  var leftPos = "";
  if (!regularWindow) regularWindow = false;
  if(!windowWidth) windowWidth = 0;
  if(!windowHeight) windowHeight = 0;
  if(windowWidth == 0){
    if(screen){
      windowWidth = screen.availWidth -10;
    }
    else{
      windowWidth = 790;
    }
    leftPos = ",left=0";
  }
  if(windowHeight == 0){
    if(screen){
      windowHeight = screen.availHeight -30;
    }
    else{
      windowHeight = 790;
    }
    topPos = ",top=0";
  }
  
  if (regularWindow) {
    newWin = window.open(windowURL,"firstreliance");
  }
  else {
    newWin = window.open(windowURL,"firstreliance","toolbar=no,menubar=0,width="+windowWidth+",height="+windowHeight+topPos+leftPos+",scrollbars=yes,resizable=yes");
  }

  if(javascript_version > 1.0){
    setTimeout('newWin.focus();',100);
  }
}

function copyrightYear(){
	var d=new Date();
	(d.getYear() < 2000) ? document.write(d.getYear()+1900) : document.write(d.getYear());
}
