// BEGIN  -->
var minwdt=760;
var buttonimgdir = 'images/buttons/';
var random = Math.random();
var picnum = Math.round(random*imgct)+1;
if (picnum>imgct) {picnum=1;}
var currentpg=location.href.substring(location.href.lastIndexOf("/")+1,location.href.lastIndexOf("."));
if (currentpg==".com/") currentpg="index";

var imgNames = new Array();
var imgArray = new Array();
var imga = new Array();
var imgb = new Array();
var imgc = new Array();
// Set OffX in pixels to a negative number 
// somewhat larger than the width of the menu.
var OffX = -163;
var mmPosX = 17;	//main menu position x
var mmPosY = 173;	//main menu position y (was 111)
var PosX =  0; 
var PosY =  0;
var smPosX = 103;
// define current image directory
var picdir = './images/'+currentpg+'/';


function setToLoadImg(imgName){
	var _ret=-1;
	imgNames[_ret=(imgNames.length?imgNames.length:0)] = imgName;
	return(_ret);
}

function loadImgs(){
	for(var i=0;i<imgNames.length;i++){
		imgArray[i]=new Image();
		imgArray[i].src=imgNames[i];
	}
}

//swap image in table data
function tdsi(tdName,img,bonoff,menunum) {
	newImage="url('images/buttons/"+img+".gif')"
	if (document.getElementById){
		document.getElementById(tdName).style.backgroundImage = newImage;
	}
	else if (document.all){
		document.all(tdName).style.backgroundImage = newImage;
	}
	else if (document.layers){
		document.layers(tdName).style.backgroundImage = newImage;
	}
	if (bonoff=="on") MenuOn(menunum);
	else if (bonoff=="off") MenuOff(menunum);
}

function nextphoto(nextprev) {
	if (nextprev=='n') {
		picnum=picnum+1;
		if (picnum>imgct) {picnum=1;}
	} else {
		picnum=picnum-1;
		if (picnum<=0) {picnum=imgct;}
	}
	newImage=picdir+"photo"+picnum+".jpg";
	if (document.getElementById){
		document.getElementById('mainpic').src = newImage;
		document.getElementById('curimg').innerHTML = picnum+' of '+imgct;
	}
	else if (document.all){
		document.all('mainpic').src = newImage;
		document.all('curimg').innerHTML = picnum+' of '+imgct;
	}
	else if (document.layers){
		document.layers('mainpic').src = newImage;
		document.layers('curimg').innerHTML = picnum+' of '+imgct;
	}
}


var mmttle = new Array();
var mmlink = new Array();

mmlink[0]="./index.htm";
mmttle[0]="Home";
mmlink[1]="./location.htm";
mmttle[1]="Location";
mmlink[2]="";
mmttle[2]="Supplements";
mmlink[3]="./officehours.htm";		//Office Hours
mmttle[3]="Office Hours";
mmlink[4]="";		//Doctors
mmttle[4]="Doctors";
mmlink[5]="";		//Services
mmttle[5]="Services";
mmlink[6]="";		//Chiropractic Care
mmttle[6]="Patients";
mmlink[7]="./contact.htm";
mmttle[7]="Contact Us";
mmlink[8]="./hh_form.htm";
mmttle[8]="Health Form";
mmlink[9]="./staff.htm";
mmttle[9]="Staff";

var sm2link=new Array();
var sm2ttle=new Array();
sm2link[0]='http://www.lapeerwellness.meta-ehealth.com" target="_blank';
sm2ttle[0]="Metagenics";
//sm2link[1]="./drzeabari.htm";
//sm2ttle[1]="Dr. Zeabari";

var sm4link=new Array();
var sm4ttle=new Array();
sm4link[0]="./drzeabari.htm";
sm4ttle[0]="Dr. Zeabari";
//sm4link[1]="./drpartridge.htm";
//sm4ttle[1]="Dr. Partridge";

var sm5link=new Array();
var sm5ttle=new Array();
sm5link[0]="./massage.htm";
sm5ttle[0]="Massage Info";
//sm5link[1]="./maryann.htm";
//sm5ttle[1]="Mary Ann Nutt";
sm5link[1]="./firstlinetherapy.htm";
sm5ttle[1]="FirstLineTherapy";
//sm5link[3]="./maryjorhoads.htm";
//sm5ttle[3]="Mary Jo Rhoads";

var sm6link=new Array();
var sm6ttle=new Array();
sm6link[0]="./subluxation.htm";
sm6ttle[0]="Subluxation";
sm6link[1]="./athletic_injury.htm";
sm6ttle[1]="Athletic Injury";
sm6link[2]="./pregnancy.htm";
sm6ttle[2]="Pregnancy";
sm6link[3]="./betterhealth.htm";
sm6ttle[3]="Better Health";
sm6link[4]="./responsibility.htm";
sm6ttle[4]="Responsibility";
sm6link[5]="./faqs.htm";
sm6ttle[5]="FAQs";

var curmm=-1;
var cursm=-1;

// build submenus
for (var mm=0;mm<mmlink.length;mm++){
	if (mmlink[mm]==("./"+currentpg+".htm")){
		curmm=mm;
		break;
	}
	if (mmlink[mm]==""){
		mylink=eval("sm"+mm+"link");
		myttle=eval("sm"+mm+"ttle");
		for (var sm=0;sm<mylink.length;sm++){
			if (mylink[sm]==("./"+currentpg+".htm")){
				curmm=mm;
				cursm=sm;
				break;
			}
		}
	}
}


document.writeln('<table border="0" width="100%" bgcolor="#56005A" cellspacing="0" cellpadding="0" background="images/BorderUM.gif">');
document.writeln('	<tr>');
document.writeln('		<td width="16"><img border="0" src="images/BorderUL.gif" width="16" height="140"></td>');
document.writeln('		<td valign="middle" width="100%">');

document.writeln('			<p align="right" style="margin-top: 0; margin-bottom: 0"><img border="0" src="images/bspace.gif" width="666" height="1"></p>');
document.writeln('			<p align="right" style="margin-top: 0; margin-bottom: 0"><img border="0" src="images/bspace.gif" width="110" height="63" style="float: left"></p>');
document.writeln('			<p align="right" style="margin-top: 0; margin-bottom: 0"><a href="./index.htm"><img border="0" src="images/Logo_Brown_recessed_130x187.gif" style="position: absolute; left: 45; top: 15" width="97" height="141"></a></p>');
document.writeln('			<p align="right" style="margin-top: 0; margin-bottom: 0">&nbsp</p>');
document.writeln('			<p align="center" class="logo" style="margin-top: 0; margin-bottom: 0">ASSOCIATED CHIROPRACTIC</p>');
document.writeln('			<p align="center" class="LeftNavText" style="margin-top: 0; margin-bottom: 0">Lapeer Wellness, PLLC</p>');
document.writeln('			<p style="margin-top: 0; margin-bottom: 0"><img border="0" src="images/bspace.gif" width="'+(minwdt-322)+'" height="1"></p>');

document.writeln('		</td>');
document.writeln('		<td width="249" align="right" valign="bottom"><img border="0" height="108" width="78" src="images/staff/sdrsam.jpg"></td>');
document.writeln('		<td width="18" align="right"><img border="0" src="images/BorderUR.gif" width="18" height="140"></td>');
document.writeln('	</tr>');
document.writeln('</table>');
document.writeln('<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#FFF1EA">');
document.writeln('	<tr>');
document.writeln('		<td valign="top" width="198" style="background-image: url(\'images/frame9wide.gif\'); background-repeat: repeat-y;">');
document.writeln('			<table border="0" width="100%" bgcolor="#FFF1EA" cellspacing="0" cellpadding="0" height="62" >');
document.writeln('				<tr>');
document.writeln('					<td width="100%" height="27"><img border="0" src="images/BorderULb.gif" width="198" height="27"></td>');
document.writeln('				</tr>');
document.writeln('				<tr>');
document.writeln('					<td width="100%" height="339"><img border="0" src="images/frame8wide.gif" width="194" height="339"></td>');
document.writeln('				</tr>');
document.writeln('				<tr>');
document.writeln('					<td width="100%" height="18" style="background-image: url(\'images/frame9wide.gif\'); background-repeat: repeat-y; padding-left: 11; padding-right: 8" class="LeftNavText">');
document.writeln('						<b>Location:</b><br>');
document.writeln('						Lapeer Market Place<br>');
document.writeln('						700 S. Main St.<br>');
document.writeln('						Suite 107<br>');
document.writeln('						Lapeer, MI 48446<br>');
document.writeln('						<br><br>');
//document.writeln('						Dr. Bruce K. Sherman<br>');
//document.writeln('						Office: 810-245-1111<br>');
//document.writeln('						<br>');
document.writeln('						Dr. Samuel G. Zeabari<br>');
document.writeln('						Office: 810-664-1140<br>');
document.writeln('						<br>');
document.writeln('						Fax: 810-664-0138<br>');
document.writeln('						<br>');

document.writeln('					</td>');
document.writeln('				</tr>');
document.writeln('			</table>');
document.writeln('		</td>');
document.writeln('		<td valign="top" width="1" align="left" bgcolor="#FFF1EA"><img border="0" width="4" height="27" src="images/BorderUMb.gif"><br></td>');
document.writeln('		<td valign="top" width="100%">');
document.writeln('			<table border="0" width="100%" cellspacing="0" cellpadding="0" height="63" bgcolor="#FFF1EA">');
document.writeln('				<tr>');

//document.writeln('					<td width="100%" height="18" style="background-image: url(\'images/frame9wide.gif\'); background-repeat: repeat-y; padding-left: 11; padding-right: 8" class="LeftNavText">');
document.writeln('					<td width="100%" height="27" style="background-image: url(\'images/BorderUMb.gif\'); background-repeat: repeat-x;">');
//document.writeln('					<td width="100%" background="images/BorderUMb.gif" height="27">');


//****************** MUST PUT BACK
if (cursm>=0){
	document.writeln('<br><br>');
	mylink=eval("sm"+curmm+"link");
	myttle=eval("sm"+curmm+"ttle");
	for (var sm=0;sm<mylink.length;sm++){
		
		if (sm!=0) {
			document.writeln('&nbsp;| ');
		}
		if (sm==cursm){
			document.writeln('<a href="'+mylink[sm]+'">('+myttle[sm]+')</a>');
		}else{
			document.writeln('<a href="'+mylink[sm]+'">'+myttle[sm]+'</a>');
		}
	}
}


document.writeln('					</td>');
document.writeln('				</tr>');
document.writeln('				<tr>');
document.writeln('					<td width="100%" height="18" bgcolor="#FFF1EA">');
document.writeln('						<table width="100%" border="0" cellspacing="0" cellpadding="15">');
document.writeln('							<tr>');
document.writeln('								<td width="100%">');
document.writeln('									<img border="0" src="images/bspace.gif" width="'+(minwdt-249)+'" height="1">');
document.writeln('									<table width="1%" border="0" cellspacing="0" cellpadding="0" align="right" style="float: right">');
if (imgct>1) {
document.writeln('										<tr>');
document.writeln('											<td width="1%">&nbsp;</td>');
document.writeln('											<td width="99%" align="right">');
document.writeln('												<table width="190" border="0">');
document.writeln('													<tr>');
document.writeln('														<td width="61"><img border="0" src="images/buttons/previous.gif" width="61" height="18" onclick="nextphoto(\'p\');"></td>');
document.writeln('														<td width="68" id="curimg" align="center">'+picnum+' of '+imgct+'</td>');
document.writeln('														<td width="61"><img border="0" src="images/buttons/next.gif" width="61" height="18" onclick="nextphoto(\'n\');"></td>');
document.writeln('													</tr>');
document.writeln('												</table>');
document.writeln('											</td>');
document.writeln('										</tr>');
}

document.writeln('										<tr>');
document.writeln('											<td width="1%">&nbsp;</td>');
document.writeln('											<td width="99%">');

// Photo will be displayed here 
if (imgct>0) {
	if (bframe) {
		framePhoto(picdir+'photo'+picnum+'.jpg','photo','right');
	} else {
		document.writeln('<img id="mainpic" src='+picdir+'photo'+picnum+'.jpg>');
	}
} else {
	document.writeln('&nbsp;');
}

document.writeln('											</td>');
document.writeln('										</tr>');
document.writeln('									</table>');
document.writeln('									<p class="pageTitle" align="center">'+pgtitle+'</p>');
document.title=pgtitle;
//document.title=currentpg;

//  End -->

