
function turnOn(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "on.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "off.src");
  }
}

function isValidCharacters(pstrOriginal) {
  if (pstrOriginal.indexOf("~") != -1)
    return false;
  if (pstrOriginal.indexOf("`") != -1)
    return false;
  if (pstrOriginal.indexOf("!") != -1)
    return false;
  if (pstrOriginal.indexOf("@") != -1)
    return false;
  if (pstrOriginal.indexOf("#") != -1)
    return false;
  if (pstrOriginal.indexOf("$") != -1)
    return false;
  if (pstrOriginal.indexOf("%") != -1)
    return false;
  if (pstrOriginal.indexOf("^") != -1)
    return false;
  if (pstrOriginal.indexOf("&") != -1)
    return false;
  if (pstrOriginal.indexOf("*") != -1)
    return false;
  if (pstrOriginal.indexOf("]") != -1)
    return false;
  if (pstrOriginal.indexOf("[") != -1)
    return false;
  if (pstrOriginal.indexOf("{") != -1)
    return false;
  if (pstrOriginal.indexOf("}") != -1)
    return false;
  if (pstrOriginal.indexOf("<") != -1)
    return false;
  if (pstrOriginal.indexOf(">") != -1)
    return false;
  if (pstrOriginal.indexOf("\"") != -1)
    return false;
  if (pstrOriginal.indexOf("?") != -1)
    return false;
  if (pstrOriginal.indexOf("/") != -1)
    return false;
  return true;
}



function loadBot(){

        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=6;	/* Change this number to increase decrease the rotation speed */
        Timer();

}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime){
		if (i < 4){
			i++;
			document.bota.src = eval("bota" + i + ".src");
			document.botb.src = eval("botb" + i + ".src");
		}
		else{
			i = 1;
			document.bota.src = eval("bota" + i + ".src");
			document.botb.src = eval("botb" + i + ".src");
		}
		loadBot();
	}
        else{
                window.setTimeout("Timer()",1000)}

}


//
// Open a new window for the features popup.
//

function openfeatures(pstrdirectory) {
var pstrURL, pinttop, pintleft;
if (pstrdirectory != null)
{pstrURL=pstrdirectory+"/enl_features.htm";}
else
{pstrURL="enl_features.htm";};
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"features", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{featureswindow=window.open(pstrURL,'features','resizable,scrollbars,height=480,width=600');}
}

//
// Open a new window for the generic samples popup.
//

function openGenericSamples(pstrdirectory) {
var pstrURL, pinttop, pintleft;
if (pstrdirectory != null)
{pstrURL=pstrdirectory+"/enl_generic_samples.htm";}
else
{pstrURL="enl_generic_samples.htm";};
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"samples", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{sampleswindow=window.open(pstrURL,'features','resizable,scrollbars,height=480,width=600');}
}

//
// Open a new window for the worldwide popup.
//

function openWorld(pstrdirectory) {
var pstrURL, pinttop, pintleft;
if (pstrdirectory != null)
{pstrURL=pstrdirectory+"/enl_worldwide.htm";}
else
{pstrURL="enl_worldwide.htm";};
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"worldwide", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{sampleswindow=window.open(pstrURL,'worldwide','resizable,scrollbars,height=480,width=600');}
}

//
// Open a new window for the testimonials popup.
//

function openTestimonials(pstrdirectory) {
var pstrURL, pinttop, pintleft;
if (pstrdirectory != null)
{pstrURL=pstrdirectory+"/enl_testimonials.htm";}
else
{pstrURL="enl_testimonials.htm";};
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"testimonials", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{sampleswindow=window.open(pstrURL,'testimonials','resizable,scrollbars,height=480,width=600');}
}


//
// Open a new window for the terms popups.
//

function openTerms(pstrpage) {
var pstrURL, pinttop, pintleft;
pstrURL="enl_"+pstrpage+".htm";
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"terms", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{termswindow=window.open(pstrURL,'terms','resizable,scrollbars,height=480,width=600');}
}

//
// Open a new window for the sample pages.
//

function openSample(pstrpage) {
var pstrURL, pinttop, pintleft;
pstrURL="samples/"+pstrpage+".html";
pinttop = (screen.availHeight/2-275);
pintleft = (screen.availWidth/2-325);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"sample", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=550, width=650,top="+pinttop+",left="+pintleft);}
else
	{samplewindow=window.open(pstrURL,'sample','resizable,scrollbars,height=550,width=650');}
}


function openHelp(pstrHelpId) {
var pstrURL, pinttop, pintleft;
pstrURL="enl_help_helppopupwait.jsp?HelpId="+pstrHelpId;
pinttop = (screen.availHeight/2-240);
pintleft = (screen.availWidth/2-300);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"help", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=480, width=600,top="+pinttop+",left="+pintleft);}
else
	{helpwindow=window.open(pstrURL,'help','resizable,scrollbars,height=480,width=600');}
}


//
// Open a new window for the send samples popup.
//

function samplesend() {
var pstrURL, pinttop, pintleft;
pstrURL="enl_samplenewsletter.htm";
pinttop = (screen.availHeight/2-115);
pintleft = (screen.availWidth/2-230);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"sample", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=230, width=460,top="+pinttop+",left="+pintleft);}
else
	{samplewindow=window.open(pstrURL,'sample','resizable,scrollbars,height=230,width=460');}
}


//
// Open a new window for the about page - needs to be a bit smaller than the full window so that users see it's a different window.
//

function openabout() {
var pstrURL, pintheight, pintwidth;
pstrURL="enl_about.htm";
pintheight=(screen.availHeight*0.9);
pintwidth = (screen.availWidth*0.9);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"about", "directories=yes, location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes, height="+pintheight+",width="+pintwidth);}
else
	{aboutwindow=window.open(pstrURL,'about','resizable,scrollbars');}
}

//
// Open a new window for the image tips page
//

function openpopup(pstrpopname) {
var pstrURL, pintheight, pintwidth;
pstrURL="enl_" + pstrpopname + ".htm";
pinttop = (screen.availHeight/2-180);
pintleft = (screen.availWidth/2-275);
if (navigator.appName == 'Microsoft Internet Explorer') 
	{window.open(pstrURL,"popup", "directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, height=360, width=550,top="+pinttop+",left="+pintleft);}
else
	{popupwindow=window.open(pstrURL,'popup','resizable,scrollbars,height=360,width=550');}
}


function login() {
var pstrURL
pstrURL=JSPServer+"enewsletter/enl_login.jsp";

  if (navigator.appName == 'Microsoft Internet Explorer') 
    mwinLogin = window.open(pstrURL,"Login", "directories=no, location=no, scrollbars=no, menubar=no, resizable=yes, status=no, toolbar=no, height=250, width=350, top=100, left=75");
  else
    mwinLogin=window.open(pstrURL,'Login','resizable,scrollbars=no,height=250,width=350');
}


//
// scroll through the testimonials on the About page.
//

var pnumtsmdelay = 10000; 
var tsmslidenum = 0;
var tsmtimerID = 0;

function showTestimonials() {
tsmslidenum++;
if (tsmslidenum < tsmslidecount+1) {
   window.testimonial.location.href = pstrpage[tsmslidenum-1];
}
if (tsmslidenum == tsmslidecount+1) { // if finished
tsmslidenum = 0;
tsmtimerID = setTimeout('showTestimonials()', pnumtsmdelay)
}
else tsmtimerID = setTimeout('showTestimonials()', pnumtsmdelay);
}



