function rollIn(overid)
{
//overid.innerHTML = "<font size = 3 color=#FF0066>" + overid.innerText + "</font>";

overid.style.color = '#FF0000';

}

function rollOut(overid)
{
//overid.innerHTML = "<font size = 3 color=#00FF00>" + overid.innerText + "</font>";
overid.style.color = '';
}

function subpage(Name, Link) {
		this.Name = Name;
		this.Link = Link;
	}

function createCookie(name,value,days) {
	
	//will overwrite if name is the same as an existing cookie
	//otherwise will add a new cookie

	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}



function Navigation() {

	var opts=10
	
	navs = new Array;	
	
	navs[1] = new subpage("Home","index");
	navs[2] = new subpage("The Choir","thechoir");
	navs[3] = new subpage("Our Principals","principals");
	navs[4] = new subpage("Concert Diary","diary");
	navs[5] = new subpage("Repertoire","repertoire");
	navs[6] = new subpage("Recent Concerts","concerts");
	navs[7] = new subpage("CD & Booklet","CDandBook");
	navs[8] = new subpage("Contact Us","contacts");
	navs[9] = new subpage("Choose Header Style","header");
	navs[10] = new subpage("Links","links");
	
	
	pagequery = location.search.substring(1,5);
	
	SessionHeader = readCookie('HeaderCookie');
	SessionFlash = readCookie('FlashCookie');
	
	//alert("SessionHeader = " + SessionHeader);
	//alert("SessionFlash = " + SessionFlash);

	if (pagequery == "htex") {
		texquery = location.search.substring(6,7);
	
		createCookie('HeaderCookie',texquery,30);
		SessionHeader = texquery;
		}

	if (pagequery == "flas") {
		createCookie('FlashCookie',1,30);
		SessionFlash = 1;
		}

	
	
	if (SessionHeader == null) {
		//defaults
		createCookie('HeaderCookie',1,30);
		SessionHeader = 1;
		createCookie('FlashCookie',0,30);
		SessionFlash = 0;
	}
	
	titletex = "titleback" + SessionHeader + ".jpg"


	document.write("<body link=#C2103D vlink=#800030 alink=#FF0000>");

	document.write("<center><table border=0 width='100%' cellpadding=1>");
   
   	document.write("<tr><td height='10%' width='20%' align=center valign=top><img border=0 src='birdfinal.png' width=107 height=116></td>");    
    
  	document.write("<td height='10%' width='80%' colspan=2 bgcolor=#FFFFCC background=" + titletex + ">");
  	document.write("<p align=center style='margin-bottom: 0'><img border=0 src='masktitle.gif' width=501 height=43></p>");
  	document.write("<p align='center' style='margin-top: 10'><font face='Times New Roman'>Registered Charity Number 1119093</font></p>");
    
  	document.write("</td></tr><tr><td height='90%' width='20%' align=center valign=top>");
      
	document.write("<p>&nbsp;</p><p>&nbsp;</p>");
   
 	document.write("<table border=0 cellspacing=0>");

      for (j=1;j<opts+1;j++) {      
      		if (j==1) { document.write("<tr><td><p style='margin-top: 15'>");}
      		if (j>1) { document.write("<tr><td><p style='margin-top: 5'>");}
      		document.write("<font face = calisto size=3>");
      		if (j==1) { document.write("<a onmouseover=rollIn(this) onmouseout=rollOut(this) href=" + navs[j].Link + ".asp><b>" + navs[j].Name + "</b></font></p></td></tr>");}
      		if (j>1) { document.write("<a onmouseover=rollIn(this) onmouseout=rollOut(this) href=" + navs[j].Link + ".html><b>" + navs[j].Name + "</b></font></p></td></tr>");}
			}
      
      
      document.write("</table></td><td height='90%' width='2%'>&nbsp;</td>");
      
      document.write("<td height='90%' width='78%' align=left valign=top background='birdwmark.jpg'><p>&nbsp;</p>");
	  }
