// The following array and function are for the scrolling text in the branding area

var msgArray = new Array(
"Acne",
"Adrenal Support",
"Aging",
"Allergies",
"Aloe",
"Alzheimers",
"Antibiotics",
"Antioxidants",
"Anxiety",
"Arthritis",
"Asthma",
"Athletic Support",
"Blood",
"Bruising",
"Burns",
"Cancer",
"Candida",
"Carbs",
"Chelation",
"Chronic Fatigue",
"Colds",
"Depression",
"Diabetes",
"Enzymes",
"Fatigue",
"Fibromyalgia",
"Food Allergies",
"Food Storage",
"Headaches",
"Heart Attack, Stroke, Atherosclerosis, Arteriosclerosis",
"History of Naturopathic Medicine",
"Homeostasis",
"Hormonal Support",
"Immune Enhancement",
"Indigestion",
"Injuries",
"Insomnia",
"Liver Detoxification and Support",
"Memory Medical Considerations",
"Toxic Metal Exposure",
"Microcurrent",
"Minerals",
"MSM",
"Nutrition",
"Osteoperosis",
"Pain",
"Parkinsons Disease",
"Probiotics",
"Benign Prostatic Hypertrophy (BPH)",
"Prostatitis",
"Protein",
"Science Based Nutrition",
"Sexual Enhancement",
"Sinusitis",
"Skin Conditions",
"Stress",
"Tendonitis",
"Thyroid Medical Considerations",
"Vision",
"Vitamins",
"Weight Loss and Management"
);
var speed = 40;
var cdel = 2500;
var maxfont = 20;

// Expanding and shrinking text banner Javascript
// copyright 24th July 2005, by Stephen Chapman http://javascript.about.com
// permission to use this Javascript on your web page is granted
// provided that this copyright notice is included
var x = y = 0;
var msg;
function start()
	{
		bnr('1');
	}
function bnr(dir)
	{
		if (dir)
		{
			msg = msgArray[y];
			if (x < maxfont) 
			{
			x++;setTimeout("bnr(1)",speed);
			}
			else setTimeout("bnr(0)",cdel);
			} 
			else 
			{
				if (x > 1) 
			{
			x--;setTimeout("bnr(0)",speed);
			}
			else
			{
			setTimeout("bnr(1)",10);
			y++;
			if (y>=msgArray.length) y=0;
			}
			}
			document.getElementById('btx').innerHTML = msg;
			btx.style.fontSize=x+'px'
			}
//window.onload = start;
// commented out this window.onload method because it was conflicting with my onload in the body tag for the time display function. Instead I added the onload start function to the body tag.                  














// The following "today" variable and two functions are for the date and time display in the branding area
today = new Date();

function showTime(dateObj)
	{
	thisSecond = dateObj.getSeconds();
	thisMinute = dateObj.getMinutes();
	thisHour = dateObj.getHours();
	
	// Change thisHour from 24-hour time to 12-hour time by:
	// 1) if thisHour < 12 then set ampm to " am", otherwise set it to " pm"
	ampm = (thisHour < 12) ? " AM" : " PM";
	// subtract 12 from thisHour variable
	thisHour = (thisHour > 12) ? thisHour - 12 : thisHour;
	// if thisHour == 0, change it to 12
	thisHour = (thisHour == 0) ? 12 : thisHour;
	
	// Add leading zeros to minutes and seconds if value is less than 10.
	thisMinute = thisMinute < 10 ? "0" + thisMinute : thisMinute;
	thisSecond = thisSecond < 10 ? "0" + thisSecond : thisSecond;
	
	return thisHour + ":" + thisMinute + ":" + thisSecond + ampm;
	}

function display()
	{
	// the today variable contains the current date and time
	var today = new Date();
	// display the current date and time
	document.getElementById('time').innerHTML = showTime(today);
	}














// The following function displays a random image


function get_random()
{
var ranNum = Math.floor(Math.random() * 22);
return ranNum;
}
var whichImg = get_random();

function show_image() {

var img = new Array(22)
img[0]="<img src='http://www.naturopathic-physician.com/images/dave/6.jpg' border='0' />";
img[1]="<img src='http://www.naturopathic-physician.com/images/dave/10.jpg' border='0' />";
img[2]="<img src='http://www.naturopathic-physician.com/images/dave/11.jpg' border='0' />";
img[3]="<img src='http://www.naturopathic-physician.com/images/dave/12.jpg' border='0' />";
img[4]="<img src='http://www.naturopathic-physician.com/images/dave/18.jpg' border='0' />";
img[5]="<img src='http://www.naturopathic-physician.com/images/dave/21.jpg' border='0' />";
img[6]="<img src='http://www.naturopathic-physician.com/images/dave/23.jpg' border='0' />";
img[7]="<img src='http://www.naturopathic-physician.com/images/dave/24.jpg' border='0' />";
img[8]="<img src='http://www.naturopathic-physician.com/images/dave/26.jpg' border='0' />";
img[9]="<img src='http://www.naturopathic-physician.com/images/dave/29.jpg' border='0' />";
img[10]="<img src='http://www.naturopathic-physician.com/images/dave/31.jpg' border='0' />"; 
img[11]="<img src='http://www.naturopathic-physician.com/images/dave/33.jpg' border='0' />"; 
img[12]="<img src='http://www.naturopathic-physician.com/images/dave/35.jpg' border='0' />"; 
img[13]="<img src='http://www.naturopathic-physician.com/images/dave/36.jpg' border='0' />"; 
img[14]="<img src='http://www.naturopathic-physician.com/images/dave/38.jpg' border='0' />";
img[15]="<img src='http://www.naturopathic-physician.com/images/dave/building1.jpg' border='0' />";
img[16]="<img src='http://www.naturopathic-physician.com/images/dave/building2.jpg' border='0' />";
img[17]="<img src='http://www.naturopathic-physician.com/images/dave/building3.jpg' border='0' />";
img[18]="<img src='http://www.naturopathic-physician.com/images/dave/Easter-047.jpg' border='0' />";
img[19]="<img src='http://www.naturopathic-physician.com/images/dave/Easter-024.jpg' border='0' />";
img[20]="<img src='http://www.naturopathic-physician.com/images/dave/Easter-012.jpg' border='0' />";
img[21]="<img src='http://www.naturopathic-physician.com/images/dave/Easter-006.jpg' border='0' />";
document.write(img[whichImg]);
}








// new rotating image function

/*

var imgs = new Array();
var imgcnt = 0;
var thisimg = 0;
imgs[imgcnt++] = 'images\/dave\/logo.gif';
imgs[imgcnt++] = 'images\/dave\/6.jpg';
imgs[imgcnt++] = 'images\/dave\/10.jpg';
imgs[imgcnt++] = 'images\/dave\/11.jpg';
imgs[imgcnt++] = 'images\/dave\/building1.jpg';
imgs[imgcnt++] = 'images\/dave\/18.jpg';
imgs[imgcnt++] = 'images\/dave\/21.jpg';
imgs[imgcnt++] = 'images\/dave\/23.jpg';
imgs[imgcnt++] = 'images\/dave\/24.jpg';
imgs[imgcnt++] = 'images\/dave\/26.jpg';
imgs[imgcnt++] = 'images\/dave\/29.jpg';
imgs[imgcnt++] = 'images\/dave\/31.jpg';
imgs[imgcnt++] = 'images\/dave\/33.jpg';
imgs[imgcnt++] = 'images\/dave\/35.jpg';
imgs[imgcnt++] = 'images\/dave\/36.jpg';
imgs[imgcnt++] = 'images\/dave\/38.jpg';
imgs[imgcnt++] = 'images\/dave\/12.jpg';
imgs[imgcnt++] = 'images\/dave\/building2.jpg';
imgs[imgcnt++] = 'images\/dave\/26.jpg';
imgs[imgcnt++] = 'images\/dave\/Easter-047.jpg';
imgs[imgcnt++] = 'images\/dave\/Easter-024.jpg';
imgs[imgcnt++] = 'images\/dave\/Easter-012.jpg';
imgs[imgcnt++] = 'images\/dave\/building3.jpg';
imgs[imgcnt++] = 'images\/dave\/Easter-006.jpg';

function rotate() {
if (document.images) {
thisimg++;
if (thisimg >= imgcnt) thisimg = 0;
document.rollimg.src = imgs[thisimg];
setTimeout("rotate();",5000);
}
}
setTimeout("rotate();",5000); 

*/




// Yet another js rotating image function to try...
// 1) Insert this script in the <BODY> section where you want the image swapping rotator to appear in the page

// Copyright 1996, Infohiway, Inc. (http://www.infohiway.com)
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/

function adArray() {
 for (i=0; i*2<adArray.arguments.length; i++) {
  this[i] = new Object();
  this[i].src = adArray.arguments[i*2];
  this[i].href = adArray.arguments[i*2+1];
 }
 this.length = i;
}
function getAdNum() {
 dat = new Date();
 dat = (dat.getTime()+"").charAt(8);
 if (dat.length == 1)
  ad_num = dat%ads.length;
 else
  ad_num = 0;
 return ad_num;
}
var ads = new adArray(
"images/banner_1.gif","http://planmagic.com",
"images/banner_2.gif","http://simplythebest.net",
"images/banner_3.gif","http://simplythebest.net/scripts/");
var ad_num = getAdNum(); 
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD '
+'ALIGN=CENTER><FONT SIZE=2 FACE=Arial><B>SimplytheBest DHTML Scripts & JavaScripts is sponsored by: '
+'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'WIDTH="468" HEIGHT="60" BORDER=0 name=js_ad></A></TD></TR></TABLE></CENTER>');
link_num = document.links.length-1;
function rotateSponsor() {
 if (document.images) {
  ad_num = (ad_num+1)%ads.length;
  document.js_ad.src = ads[ad_num].src;
  document.links[link_num].href = ads[ad_num].href;
  setTimeout("rotateSponsor()",5000);
 }
}
setTimeout("rotateSponsor()",5000);




// 2) Define the swapping images, the links and the HTML to appear with the images in this section of the script:

var ads = new adArray(
"images/banner_1.gif","http://planmagic.com",
"images/banner_2.gif","http://simplythebest.net",
"images/banner_3.gif","http://simplythebest.net/scripts/");
var ad_num = getAdNum(); 
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD '
+'ALIGN=CENTER><FONT SIZE=2 FACE=Arial><B>SimplytheBest DHTML Scripts & JavaScripts is sponsored by: '
+'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'WIDTH="468" HEIGHT="60" BORDER=0 name=js_ad></A></TD></TR></TABLE></CENTER>');

3) Choose how fast you want your images to swap in this section of the script:

setTimeout("rotateSponsor()",5000); 
// the default is a new image every 5 seconds



//below is my customized version of the above script, named mikes_image()
function mikes_image()
	{
	
function adArray() {
 for (i=0; i*2<adArray.arguments.length; i++) {
  this[i] = new Object();
  this[i].src = adArray.arguments[i*2];
  this[i].href = adArray.arguments[i*2+1];
 }
 this.length = i;
}
function getAdNum() {
 dat = new Date();
 dat = (dat.getTime()+"").charAt(8);
 if (dat.length == 1)
  ad_num = dat%ads.length;
 else
  ad_num = 0;
 return ad_num;
}
var ads = new adArray(
"images/dave/Pic_01.jpg","http://www.naturopathic-physician.com",
"images/dave/Pic_02.jpg","http://www.naturopathic-physician.com",
"images/dave/Pic_03.jpg","http://www.naturopathic-physician.com",
"images/dave/Pic_04.jpg","http://www.naturopathic-physician.com",
"images/dave/Pic_05.jpg","http://www.naturopathic-physician.com",
"images/dave/Pic_06.jpg","http://www.naturopathic-physician.com",
"images/dave/6.jpg","http://www.naturopathic-physician.com",
"images/dave/10.jpg","http://www.naturopathic-physician.com",
"images/dave/11.jpg","http://www.naturopathic-physician.com",
"images/dave/12.jpg","http://www.naturopathic-physician.com",
"images/dave/18.jpg","http://www.naturopathic-physician.com",
"images/dave/21.jpg","http://www.naturopathic-physician.com",
"images/dave/23.jpg","http://www.naturopathic-physician.com",
"images/dave/24.jpg","http://www.naturopathic-physician.com",
"images/dave/26.jpg","http://www.naturopathic-physician.com",
"images/dave/29.jpg","http://www.naturopathic-physician.com",
"images/dave/31.jpg","http://www.naturopathic-physician.com",
"images/dave/33.jpg","http://www.naturopathic-physician.com",
"images/dave/35.jpg","http://www.naturopathic-physician.com",
"images/dave/36.jpg","http://www.naturopathic-physician.com",
"images/dave/38.jpg","http://www.naturopathic-physician.com",
"images/dave/building1.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/building2.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/building3.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/Easter-047.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/Easter-024.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/Easter-012.jpg.jpg","http://www.naturopathic-physician.com",
"images/dave/Easter-006.jpg.jpg","http://www.naturopathic-physician.com"
);
var ad_num = getAdNum(); 
document.write('<a href="'+ads[ad_num].href+'"><img src="'+ads[ad_num].src+'" '
+'width="300px" height="230px" border=0 name=js_ad></a>');
link_num = document.links.length-1;
function rotateSponsor() {
 if (document.images) {
  ad_num = (ad_num+1)%ads.length;
  document.js_ad.src = ads[ad_num].src;
  document.links[link_num].href = ads[ad_num].href;
  setTimeout("rotateSponsor()",5000);
 }
}
setTimeout("rotateSponsor()",5000);

	}