<!--

//User defined variables - change these variables to alter the behaviour of the script
var ImageFolder_prom1 = "/bn/img/bannerderecho/banner_2/"; //Folder name containing the images
var ImageFileNames_prom1 = new Array('bder_actdatos.gif',
									 'bder_ahorroprog.jpg',
									 'bcer_limpiezavirilla.jpg',
									 'bder_bnvivienda.jpg',
									 'bder_firmadigital.gif',
									 'bder_bcatelefonica.jpg',									 
									 'bder_pagocajeros.gif'); //List of images to use

//var imgref -- definida en configbanner
var ImageURLs_prom1 = new Array(imgref  + 'BN/downloads/BNCR - Actualizacion Datos.pdf',
								imgref  + 'BN/downloads/BNCR - Presentacion de Afiliacion.pdf',
								imgref  + 'BN/index.asp?c=home',
								'https://www.bnonline.fi.cr/Login/Prestamos/SimuladorHipotecarioPage.aspx',	
								imgref  + 'BN/seguridad/index.asp?c=seguridad',
								imgref  + 'BN/downloads/BNCR - Banca Telefonica.pdf',																
							    imgref  + 'BN/index.asp?c=home'); //List of hyperlinks associated with the list of images
								
var DefaultURL_prom1 = 'http://www.bncr.fi.cr/BN/index.asp?c=home'; //Default hyperlink for the Banner Ad
var DisplayInterval_prom1 = 4; //Number of seconds to wait before the next image is displayed
var TargetFrame_prom1 = ""; //Name of the frame to open the hyperlink into

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser_prom1 = false;
var Bannerdo1Code = 0;
var Bannerdo1Images = new Array(NumberOfImages_prom1);
var DisplayInterval_prom1 = DisplayInterval_prom1 * 1000;
var NumberOfImages_prom1 = ImageFileNames_prom1.length;

//A dd a trailing forward slash to the ImageFolder_prom1 variable if it does not already have one
if (ImageFolder_prom1.substr(ImageFolder_prom1.length - 1, ImageFolder_prom1.length) != "/" && ImageFolder_prom1 != "") { ImageFolder_prom1 += "/";
}

if (TargetFrame_prom1 == '') {
var FramesObject_prom1 = null;
} else {
var FramesObject_prom1 = eval('parent.' + TargetFrame_prom1);
}

//Function runs when this page has been loaded and does the following:
//1. Determine the browser name and version
// (since the script will only work on Netscape 3+ and Internet Explorer 4+).
//2. Start the timer object that will periodically change the image displayed
// by the Banner Ad.
//3. Preload the images used by the Banner Ad rotator script
function InitialiseBannerDoRotator_prom1() {

//Determine the browser name and version
//The script will only work on Netscape 3+ and Internet Explorer 4+
var BrowserType_prom1 = navigator.appName;
var BrowserVersion_prom1 = parseInt(navigator.appVersion);

if (BrowserType_prom1 == "Netscape" && (BrowserVersion_prom1 >= 3)) {
IsValidBrowser_prom1 = true;
}

if (BrowserType_prom1 == "Microsoft Internet Explorer" && (BrowserVersion_prom1 >= 4)) {
IsValidBrowser_prom1 = true;
}

if (IsValidBrowser_prom1) {
TimerObject_prom1 = setTimeout("ChangeImage_prom1()", DisplayInterval_prom1);
Bannerdo1Code = 0;

for (i = 0; i < NumberOfImages_prom1; i++) {
Bannerdo1Images[i] = new Image();
Bannerdo1Images[i].src = ' ' + ImageFolder_prom1 + ImageFileNames_prom1[i];
}

}

}

//Function to change the src of the Banner Ad image
function ChangeImage_prom1() {

if (IsValidBrowser_prom1) {
Bannerdo1Code = Bannerdo1Code + 1;

if ( Bannerdo1Code == NumberOfImages_prom1) {
Bannerdo1Code = 0;
}

window.document.bannerdo1.src = Bannerdo1Images[Bannerdo1Code].src;
TimerObject_prom1 = setTimeout("ChangeImage_prom1()", DisplayInterval_prom1);
}
}

//Function to redirect the browser window/frame to a new location,
//depending on which image is currently being displayed by the Banner Ad.
//If Banner Ad is being displayed on an old browser then the DefaultURL_prom1 is displayed
function ChangePage_prom1() {

if (IsValidBrowser_prom1) {

if (TargetFrame_prom1 != '' && (FramesObject_prom1)) {
FramesObject_prom1.location.href = ImageURLs_prom1[Bannerdo1Code];
} else {
document.location =  ImageURLs_prom1[Bannerdo1Code];
}

} else if (!IsValidBrowser_prom1) {
document.location = DefaultURL_prom1;
}

}
