﻿//#e5c29e;
// Menu item definitions - to be passed from HTML as DrawMenu() parameters
var Home         = 0;
var Method       = 1;
var Events       = 2;
var Gallery      = 3;
var About        = 4;
var Testimonials = 5;
var Contact      = 6;
var Schedule     = 7;

function DrawMenu(id, background_image)
{
  // Table text definitions
  var MenuText = new Array(7);
  MenuText[Home]         = "Home";
  MenuText[Method]       = "Method";
  MenuText[Events]       = "Events";
  MenuText[Gallery]      = "Gallery";
  MenuText[About]        = "About";
  MenuText[Testimonials] = "Testimonials";
  MenuText[Contact]      = "Contact";
  MenuText[Schedule]     = "Schedule";

  // URL definitions for menu items
  var MenuURL = new Array(7);
  MenuURL[Home]          = "index.html";
  MenuURL[Method]        = "method.html";
  MenuURL[Events]        = "events.php";
  MenuURL[Gallery]       = "zen/index.php";
  MenuURL[About]         = "about.html";
  MenuText[Testimonials] = "testimonials.html";
  MenuURL[Contact]       = "contact.php";
  MenuURL[Schedule]      = "schedule.php";

  // Which one is selected?
  var MenuClass = new Array(7);
	for (var i = 0; i <= 7; i ++) {
		MenuClass[i]="menu";
	}
	MenuClass[id]="menuselected";

	// Set the background image
	if (background_image == null) {
    document.write('<div id="background_image">');
  } else {
    document.write('<div id="background_image" style="background-image: url(\'images/' +  background_image + '\');">');
	}
	// Set the page boundaries
	document.write('<div id="page">');
	// Draw the logo on the top of the page
	document.write('	<div id="header">');
	document.write('		<div style="position: relative; left: 550px; top: 0px; width: 245px;">');
	document.write('			<img src="images/ZEN-Vinyasa_logo.gif" alt="ZEN-Vinyasa method of yoga study, teaching, and practicing - a technological algorithm of the new generation" title="ZEN-Vinyasa  method of yoga study, teaching, and practicing - a technological algorithm of the new generation" />');
	document.write('		</div>');
	document.write('	</div>');
	document.write('	<div id="menu">');
	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Home] + '" class="' + MenuClass[Home] + '">' + MenuText[Home] + '</a> &nbsp; &nbsp;');
	document.write('		<dl class="dropdown" style="display: inline;">');
	if (id == Method) {
		document.write('			<dt id="one-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'one\',1)" onmouseout="this.style.color=\'#ecd3b9\'; ddMenu(\'one\',-1)" style="display: inline;">Method</dt>');
	} else {
		document.write('			<dt id="one-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'one\',1)" onmouseout="this.style.color=\'#ffffff\'; ddMenu(\'one\',-1)" style="display: inline; color: #ffffff;">Method</dt>');
	}
	document.write('			<dd id="one-ddcontent" onmouseover="cancelHide(\'one\')" onmouseout="ddMenu(\'one\',-1)" >');
	document.write('				<ul>');
	document.write('					<li><a href="method.html" class="overline">Method</a></li>');
	document.write('					<li><a href="group_practice.html" class="underline">Group Practice</a></li>');
	document.write('					<li><a href="personal_programs.html" class="underline">Personal Practice Programs</a></li>');
	document.write('					<li><a href="dynamic_forms.html" class="underline">Dynamic Forms</a></li>');
	document.write('					<li><a href="video.html">Video</a></li>');
	document.write('				</ul>');
	document.write('			</dd>');
	document.write('		</dl>');
//	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Events] + '" class="' + MenuClass[Events] + '">' + MenuText[Events] + '</a>');
	document.write('		&nbsp; &nbsp; ');
	document.write('		<dl class="dropdown" style="display: inline;">');
	if (id == Events) {
		document.write('			<dt id="three-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'three\',1)" onmouseout="this.style.color=\'#ecd3b9\'; ddMenu(\'three\',-1)" style="display: inline;">Events</dt>');
	} else {
		document.write('			<dt id="three-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'three\',1)" onmouseout="this.style.color=\'#ffffff\'; ddMenu(\'three\',-1)" style="display: inline; color: #ffffff">Events</dt>');
	}
	document.write('			<dd id="three-ddcontent" onmouseover="cancelHide(\'three\')" onmouseout="ddMenu(\'three\',-1)" style="left: 150px;">');
	document.write('				<ul>');
	document.write('					<li><a href="events.php?type=1" class="overline">Oncoming Events</a></li>');
	document.write('					<li><a href="events.php?type=0">Past Events</a></li>');
	document.write('				</ul>');
	document.write('			</dd>');
	document.write('		</dl>');

	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Gallery] + '" class="' + MenuClass[Gallery] + '">' + MenuText[Gallery] + '</a> &nbsp; &nbsp;');
	document.write('		<dl class="dropdown" style="display: inline;">');
	if (id == About) {
		document.write('			<dt id="two-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'two\',1)" onmouseout="this.style.color=\'#ecd3b9\'; ddMenu(\'two\',-1)" style="display: inline;">About</dt>');
	} else {
		document.write('			<dt id="two-ddheader" onmouseover="this.style.color=\'#ecd3b9\'; ddMenu(\'two\',1)" onmouseout="this.style.color=\'#ffffff\'; ddMenu(\'two\',-1)" style="display: inline; color: #ffffff">About</dt>');
	}
	document.write('			<dd id="two-ddcontent" onmouseover="cancelHide(\'two\')" onmouseout="ddMenu(\'two\',-1)" style="left: 290px;">');
	document.write('				<ul>');
	document.write('					<li><a href="about.html" class="overline">About Konstantin</a></li>');
	document.write('					<li><a href="about_sid.html">About Andrei Sidersky</a></li>');
	document.write('				</ul>');
	document.write('			</dd>');
	document.write('		</dl>');
//	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Testimonials] + '" class="' + MenuClass[Testimonials] + '">' + MenuText[Testimonials] + '</a>');
	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Contact] + '" class="' + MenuClass[Contact] + '">' + MenuText[Contact] + '</a>');
	document.write('		&nbsp; &nbsp; <a href="' + MenuURL[Schedule] + '" class="' + MenuClass[Schedule] + '">' + MenuText[Schedule] + '</a>');
	document.write('	</div>');

/*	
    var j = 0;
    for (var i = 0; i < Schedule+1; i++) {
		//if (i != Method) {
			if (i != id) {
				document.write('					<a href="' + MenuURL[i] + '" class="menu">' + MenuText[i] + '</a>');
			} else {
				document.write('					<a href="' + MenuURL[i] + '" class="menuselected">' + MenuText[i] + '</a>');
			}
			if (i != Schedule) {
				document.write(' &nbsp; &nbsp; &nbsp; &nbsp');
			}
    }
	*/
}

