var sBaseUrl = String(window.location);
sBaseUrl = sBaseUrl.substr(0, sBaseUrl.lastIndexOf("/") + 1);

var Slides = new Array();
Slides[1] = new Slide("slide1/slide1.html","Opening");
Slides[2] = new Slide("slide2/slide2.html","Agenda");
Slides[3] = new Slide("slide3/slide3.html","Why the climate is changing for company cars");
Slides[4] = new Slide("slide4/slide4.html","CSR/health and safety issues");
Slides[5] = new Slide("slide5/slide5.html","Procurement");
Slides[6] = new Slide("slide6/slide6.html","Funding");
Slides[7] = new Slide("slide7/slide7.html","HM Revenue & Customs");
Slides[8] = new Slide("slide8/slide8.html","Reward and HR implications");
Slides[9] = new Slide("slide9/slide9.html","Why you need to act now");
Slides[10] = new Slide("slide10/slide10.html","Questions");
Slides[11] = new Slide("slide11/slide11.html","Key Contacts");




function Slide(sUrl, sName) { this.sUrl = sUrl; this.sName = sName; }
function ShowSlide(iID) { ShowUrl(Slides[iID].sUrl); }
function ShowInstantslide(iID) { var sUrl = "instantslides/slide" + iID + ".html"; ShowUrl(sUrl);}
function ShowUrl(sUrl) { if(sUrl.indexOf("://") == -1) { sUrl = sBaseUrl + sUrl; } if(parent.mainFrame) {parent.mainFrame.location.href = sUrl;} }
function changeUserQuestionsMode(Dummy) { return true; }
function ShowQuestion(iID) { var sUrl = sBaseUrl + "choice.php?page=" + iID; ShowUrl(sUrl); }
function ShowQuestionResult(iID) { var sUrl = sBaseUrl + "result.php?show=1&page=" + iID; ShowUrl(sUrl); }


var sBuffer;

function PaintWhiteboard(sCommands) {
  if(!parent.mainFrame.document.Whiteboard) {
    LoadWhiteboard();
  }
  if(!parent.mainFrame.whbStatus) {
    if(sBuffer == "") {
      window.setTimeout("PaintBuffer()",1000);
    }
    sBuffer = sBuffer + sCommands + "|";
  } else {
    if (sBuffer !="") PaintBuffer();
    parent.mainFrame.document.Whiteboard.PaintWhiteboard(sCommands);
  }
}

function PaintBuffer() {
  if(parent.mainFrame.document.Whiteboard && !parent.mainFrame.whbStatus && sBuffer != "") {
    window.setTimeout("PaintBuffer()", 1000);
  } else if(sBuffer != "") {
    parent.mainFrame.document.Whiteboard.PaintWhiteboard(sBuffer);
    sBuffer = "";
  }
}

function LoadWhiteboard() {
  if(parent.mainFrame) parent.mainFrame.location.href = sBaseUrl + "whiteboard.html";
}

function updateToc(sParam) {

var field = parent.f_bottom.document.all['Gliederung'];

	if (field) {
		field.selectedIndex = sParam;
		//alert(sParam);
	}
}
