// Navbar.js  - A javascript file to generate a vertical Navigation Bar in a film-roll
// Version 1.9 10 Nov 08

// Some site-wide variables and functions

var workshopname = "Idea%20To%20Story%20To%20Script";

var add1 = "register"; // first part of address to which registrees will address their emails
var add2 = "dianelake";
var add3 = "diane";

// email link function

function doEmailLink(a){
document.write("<a href=mailto:"+a+"&#64;"+add2+".com title='Click to contact "+a+"'>");
}

// register link function

function doRegEmailLink(){
document.write("<a href=mailto:"+add1+"&#64;"+add2+".com?subject=Please%20register%20me%20for%20the%20workshop:%20"+workshopname+">");
}

//
// Navigation Bar:
// 
// If you ever want to change the order in which the nav buttons appear,
// Simply re-order in the 'topicz' list, and the rest will follow. If you want to ADD a button, simply add the following lines: (without the preceding // !)
// 
// In the 'topicz' list:
//
// i++;
// topicz[i]="New Button"; 
// NewButton=i;
// 
// Then in the 'addr' list:
// 
// addr[NewButton]="Corresponding page Name";
//
// Clearly, 'NewButton' and "Corresponding Page Name" will be replaced by something more meaningful!
// For example, if you wanted to add a new button called 'Resources', you'd add
//
// i++;
// topicz[i]="Resources"; 
// Resources=i;
//
// to the 'topicz' list,
// 
// then in the 'addr' list:
// 
// addr[Resources]="resources.htm";
//
//


// Button Names (the 'topicz' list)

i=0;
topicz = new Array();
topicz[i]="Home";
Home=i;

i++;
topicz[i]="Representation";
Representation=i;

i++;
topicz[i]="Writing Assignments";
Assignments=i;

i++;
topicz[i]="Works in Development";
Development=i;

// i++;
// topicz[i]="Workshops/ Consultations";
// Consulting=i;

i++;
topicz[i]="The Press Room";
Press=i;

i++;
topicz[i]="The Tasting Room"
Tasting=i;

i++;
topicz[i]="Biography"
Bio=i;

i++;
topicz[i]="Speaking Engagements"
Speaking=i;

i++;
topicz[i]="Links"
Links=i;

i++;
topicz[i]="Contact";
Contact=i;

var max
max=topicz.length // This automatically computes the number of tabs in the nav-bar


// Corresponding Page-names (the 'addr' list)


addr = new Array();
addr[Home]="index.html";
addr[Representation]="representation.htm";
addr[Assignments]="assignments.htm";
addr[Development]="development.htm";
// addr[Consulting]="consulting.htm";
addr[Press]="press.htm";
addr[Tasting]="tasting.htm";
addr[Bio]="bio.htm";
addr[Speaking]="speaking.htm";
addr[Links]="links.htm";
addr[Contact]="mailto:"+add3+"@"+add2+".com"; // mail address coded out of site of spam-list crawlers!

		 
var NS=0;
var NSvsn4=0;


function WriteNavBar(x) {document.writeln("<table align='center' width='152' border='0' cellspacing='0' cellpadding='0'><col width='24'><col width='100'><col width='28'><tr><td colspan='3'><img width='152' height='14' border='0' src='./Images/NavBarTop.gif'></td></tr>"); DoLinks(x); document.writeln("<tr><td colspan='3'><img width='152' height='14' border='0' src='./Images/NavBarBottom.gif'></td></tr></table>");}

function Highlight(y) {document.write("<tr><td><img width='24' border='0' src='./Images/NavLeft.gif'></td>"); document.writeln("<td id='navbarOn'>"+topicz[y]+"</td><td><img width='28' border='0' src='./Images/NavRight.gif'></td></tr><tr><td colspan='3'><img width='152' height='6' border='0' src='./Images/Bar.gif'></td></tr>")}

function WriteCell(z) {document.writeln("<tr><td><img width='24' height='41' border='0' src='./Images/NavLeft.gif'></td><td align='center' id='navbar' onMouseOver=\"this.style.backgroundColor='#8080FF'\"; onMouseOut=\"this.style.backgroundColor='#666666';\" >");  
document.writeln("<a class='nav' href='"+addr[z] +"'>"); document.writeln("<font color='white'><span class='sidelinks'>"+topicz[z]+"</span></font></a></td><td><img width='28' height='41' border='0' src='./Images/NavRight.gif'></td></tr><tr><td colspan='3'><img width='152' height='6' border='0' src='./Images/Bar.gif'></td></tr>")}
 

function DoLinks(x) {

    for (i=0;i<max;i++) if ((i == x) || (x == topicz[i])) Highlight(i); else WriteCell(i);
}	

function openVarWin(add,name,w,h){window.open(add,name,'width='+w+',height='+h+',directories=no,location=no,menubar=no,titlebar=no,scrollbars=no,toolbar=no,status=no,resizable=no,left=10,top=10,screenX=10,screenY=10');}


