<!--
/* 	Bournville Community Website
	created by David Smith 
	Copyright 2003
	www.bournville-web.net
	email: david@bournville-web.net
	
	If you make use of this script please 
	leave in this header note, provide a 
	link to and acknowledge 
	www.Bournville-Web.net
	
	file created 03-October-03

        Contents functions

*/

var that;
var index=0, intervalTime=600;
var old_weight, old_colour, old_bg, nid;
var button;
var e=document.getElementsByTagName("A");
var e2=document.getElementsByTagName("input");
var upArrImg = new Image();
var downArrImg = new Image();
upArrImg = './images/uparrw.jpg';
downArrImg = './images/downarrw.jpg';

function contentsChange(){
  if(index){
    e[index-1].style.fontWeight=old_weight;
    e[index-1].style.color=old_colour;
    e[index-1].style.backgroundColor=old_bg;
  }
  
  old_weight=e[index].style.fontWeight;
  old_colour=e[index].style.color;
  old_bg=e[index].style.backgroundColor;

  e[index].style.fontWeight='bold';
  e[index].style.color='#ffffda';
  e[index].style.backgroundColor='red';
  index ++;

  if(index>=e.length) {
    clearInterval(t);
    e[index-1].style.fontWeight=old_weight;
    e[index-1].style.color=old_colour;
    e[index-1].style.backgroundColor=old_bg;
  }
}

function add_to_favourites(){
if (document.all)
  window.external.AddFavorite('http://www.bournville-web.net','The Bournville Community Website')
}

// function to flip over button
function flip_over(button){
  e2[button].style.backgroundColor='red';
  return true;
}

// function to flip back button
function flip_back(button){
  e2[button].style.backgroundColor='navy';
  return true;
}

// function to highlight selected contents
function highlight(e){
  if(that){
    that.style.color=old_color; 
    that.style.fontWeight=old_weight;
    that.style.textDecoration=old_dec;
  }
  old_weight=e.style.fontWeight;
  old_color=e.style.color;
  old_dec=e.style.textDecoration;
  e.style.fontWeight='bold'; 
  e.style.color='blue';
  e.style.textDecoration='underline';
  that=e;
  return true;
}

// function to 'service' site search form box
function cursor_focus(){
  if(document.search.keywords.value=="search this site"){
    document.search.keywords.value="";
  }
  else return true;
}

// function to display / remove sub-menu 
function subMenu(nid,em){
  if (em.style.backgroundColor!="#bbff98") {   // sub-menu closed
    em.style.backgroundColor='#bbff98';
	//em.style.listStyleImage="url(./images/uparrw.jpg)"; // change image
	subMenuOpen(nid);                          // open sub-menu
  }
  else {      
    em.style.backgroundColor='#ffffda';	      // sub-menu open
    //em.style.listStyleImage="url(./images/downarrw.jpg)"; // change image
	subMenuClose(nid);			              // close sub-menu
  }	
}   

// function to close sub-menu 
function subMenuClose(sid){
  sid.style.position='absolute';
  sid.style.visibility='hidden';
}

// function to open sub-menu 
function subMenuOpen(sid){
  sid.style.position='relative';
  sid.style.visibility='visible';
}

// function to display menu heading 'bullet' image 
function menuImage(eb,img) {
  eb.style.listStyleImage=img;
  alert(img);
  return true;
}
-->
