﻿// start banner slideshow
var pic = 1;
var crossFadeDuration = 2;
setInterval('runSlideShow()', 60000);
function runSlideShow(){
	document.getElementById("slideShowImg").src = "http://www.nestorplc.co.uk/img/banner" + String(pic) + ".jpg"
	changeOpac(100, "slideShowImg")
	pic = pic + 1
	if (pic > 4) {pic=1}
	document.getElementById("slideShowDiv").style.backgroundImage = "url(http://www.nestorplc.co.uk/img/banner" + String(pic) + ".jpg)"
	opacity("slideShowImg",100,0,crossFadeDuration)
}

// set preferred stylesheet
window.onload = function(e) {
  var cookie = readCookie('style');
  if (cookie != '') {
    var title = cookie ? cookie : getPreferredStyleSheet();
    setActiveStyleSheet(title);
  };
  fixColHeight();
  startList();
}
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie('style', title, 365);
}

// enable sub-menu for IE6
function startList(){
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {this.className+=" over";}
        node.onmouseout=function() {this.className=this.className.replace(" over", "");}
      }
    }
  }
}
