
//*** NEW

//*** SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS ***//
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();



//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

//Menu01
subInfo[1][1] = new Array("<strong> Welcome to Our Practice</strong>", "../ab_welcome.php", "_self");
subInfo[1][2] = new Array("<i>    • What Is Chiropractic?</i>", "../ab_chiro_01.php", "_self");
subInfo[1][3] = new Array("<i>    • Who Goes to a Chiroprator?</i>", "../ab_chiro_02.php", "_self");
subInfo[1][4] = new Array("<i>    • What Chiropractors Treat</i>", "../ab_chiro_03.php", "_self");
subInfo[1][5] = new Array("<strong> Meet Dr. Eric Lambert</strong>", "../ab_dreric.php", "_self");
subInfo[1][6] = new Array("<strong> Our Mission Statement</strong>", "../ab_mission.php", "_self");
subInfo[1][7] = new Array("<strong> Our Office Information</strong>", "../about.php", "_self");
subInfo[1][8] = new Array("<i>    • Staff</i>", "../ab_staff.php", "_self");
subInfo[1][9] = new Array("<i>    • Hours</i>", "../ab_hours.php", "_self");
subInfo[1][10] = new Array("<i>    • Map</i>", "../ab_map.php", "_self");
subInfo[1][11] = new Array("<strong> Testimonials</strong>", "../ab_testimonies.php", "_self");


//Menu02
//Blank


//Menu03
subInfo[3][1] = new Array("<strong> Gentle Chiropractic Care</strong>", "../os_gentle_chiro.php", "_self");
subInfo[3][2] = new Array("<strong> Therapeutic Massage</strong>", "../os_massage.php", "_self");
subInfo[3][3] = new Array("<strong> ART® Active Release Techniques</strong>", "../os_art_page.php", "_self");
subInfo[3][4] = new Array("<i>    • ART® Ironman</i>", "../os_art_ironman.php", "_self");
subInfo[3][5] = new Array("<strong> DTS-Decompression Therapy</strong>", "../os_dts.php", "_self");
subInfo[3][6] = new Array("<strong> Tests & Procedures</strong>", "../os_procedures.php", "_self");
subInfo[3][7] = new Array("<strong> Nutritional Supplements</strong>", "../os_vitamins.php", "_self");


//Menu04
subInfo[4][1] = new Array("<strong> What to Expect</strong>", "../visit.php", "_self");
subInfo[4][2] = new Array("<strong> Download New Patient Forms Here</strong>", "../visit_forms.php", "_self");
subInfo[4][3] = new Array("<strong> Our HIPPA Policy</strong>", "../downloads/HIPAA2003.pdf", "_self");


//Menu05- Education
subInfo[5][1] = new Array("<strong> Virtual Consultation</strong>", "../edu_virtual_consult.php", "_self");
subInfo[5][2] = new Array("<strong> Condition of the Month</strong>", "../cond_ofthe_month.php", "_self");
subInfo[5][3] = new Array("<strong> Featured Article</strong>", "../featured_article.php", "_self");
subInfo[5][4] = new Array("<strong> Stretches</strong>", "../stretches_main.php", "_self");
subInfo[5][5] = new Array("<strong> Conditions Chiropractors Treat</strong>", "../edu_conditions.php", "_self");
subInfo[5][6] = new Array("<strong> 'Healthy Lifestyle' Quiz</strong>", "../edu_healthy_quiz.php", "_self");
subInfo[5][7] = new Array("<strong> 'Do I Need My Spine Checked?' Quiz</strong>", "../edu_spine_quiz.php", "_self");
subInfo[5][8] = new Array("<strong> What is Subluxation?</strong>", "../edu_subluxation.php", "_self");


//Menu06
subInfo[6][1] = new Array("<strong> Most Recent Events</strong>", "../events.php", "_self");
subInfo[6][2] = new Array("<strong> 2008 Past Events </strong>", "../events_past(2008).php", "_self");
subInfo[6][3] = new Array("<strong> 2007 Past Events </strong>", "../events_past(2007).php", "_self");

//Menu07
//Blank





//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//

var xSubOffset = 0;
var ySubOffset = 22;

var overSub = false;
var delay = 1000;
totalButtons = 7;




//*** NO MORE SETTINGS BEYOND THIS POINT ***//



// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);"');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="menu/' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}

//*** MAIN BUTTONS FUNCTIONS ***//

//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}