/* 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="site/";
}
else if(window.absolutepage)
{
imgdir="http://www.diwebsales.com/new_site/images/"
sitedir="http://www.diwebsales.com/new_site/site/"
securedir="http://www.diwebsales.com/new_site/site/"
homedir="http://www.diwebsales.com/new_site/"
}
else if(window.securepage)
{ 
imgdir="https://www.diwebsales.com/new_site/images/"
sitedir="http://www.diwebsales.com/new_site/site/"
securedir="https://www.diwebsales.com/new_site/site/"
homedir="http://www.diwebsales.com/new_site/"
}
// 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=29;

var navitems = new Array();
navitems["webproducts"] = new makeNavImage("webproducts",35,19);
navitems["webdelivery"] = new makeNavImage("webdelivery",35,19);
navitems["security"] = new makeNavImage("security",35,19);
navitems["resources"] = new makeNavImage("resources",35,19);
navitems["calculators"] = new makeNavImage("calculators",35,19);
navitems["contactus"] = new makeNavImage("contactus",35,19);



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 open_apps(nameofapp){
self.location.href = "https://www.equitableonline.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") openWin("https://www.equitableonline.com/onlineserv/HB/demo.html");
//else openWin("https://www.equitableonline.com/onlineserv/HB/")
}

function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving .....";
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);
}

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; margin-left:200px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');

function comingSoon(link){
var content = new Array();
var index = 0;
content[index++] = "<h2>Coming Soon</h2>You have attempted to access " + link + " on The DI Web Sales'' website.  This page is currently being developed.  Please check back soon for this online feature.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"#\" onclick=\"document.getElementById('cs_dis').style.display = 'none'\">Close</a>  </div></div>";  
document.getElementById("cs_dis").innerHTML = content.join("");
document.getElementById("cs_dis").style.display = "block";
scrollTo(0, 0);
}

document.write('<div id="cs_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute;  margin-left:0px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');

function showEmailWarning(email){

var content = new Array();
var index = 0;
content[index++] = "<h2>Email Security Warning</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>";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"mailto:"+ email +"\" onclick=\"document.getElementById('email_dis').style.display = 'none'\">Continue</a>  <a href=\"#\" onclick=\"document.getElementById('email_dis').style.display = 'none'\">Decline</a></div></div>";  
document.getElementById("email_dis").innerHTML = content.join("");
document.getElementById("email_dis").style.display = "block";
scrollTo(0, 0);
}

document.write('<div id="email_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute; margin-left:0px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');

// HOME PAGE PROMO IMAGES ROTATOR-->

// rotating banner with no links updated 10/12/04 by Richard Wise and Joe Dawley
// original rotating banner with corresponging links by matthew billings

// 1. drop script in head or script file
// 2. fill out config variables 
// 3. add onLoad="changeBanner();" to <body> 
// 4  make sure  img tag has name="banner" and id="bannerImg"
// 5. general form of use. <a href="#"><img src="./img1.gif" name="banner" border="0" id="bannerImg"></a> 

//Config variables
var numImages = 3; //number of images to rotate out.
var imageArray = new Array("images/promo_mainsalessupport.jpg",  "images/promo_mainsalessupport2.jpg", "images/promo_mainsalessupport3.jpg"); //the src values for the images
var imgElement = "bannerImg";
var visibleForSeconds = 5; //how many seconds to you want before the banner swaps out;


// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 


//for random number choosing
function rand(numImages) {
		return Math.ceil((Math.random()* numImages));       
};

//vaiables that shouldn't be edited
var iteratorNum = ( rand(numImages) - 1); //-1 to take into account that array starts at 0
var count = 1; //don't touch. It's an initializer 

	
//the function that does all the work
function changeBanner(){
	
	//IE4/5
	if( document.all )
	{
		//new image swapping code
		document.all[imgElement].src = imageArray[iteratorNum];
	}
	else
	//IE6/NS6 thisis the w3c standard to access
	{
		//new image swapping code
		document.getElementById(imgElement).src = imageArray[iteratorNum];
	}
		
	//fancypants math stuff
	iteratorNum +=1;
	iteratorNum %= numImages;
	
	//sleeps and then changes banner
	setTimeout('changeBanner()', visibleForSeconds * 1000)

}


// OTHER FUNCTIONS ABOVE
