
var PastButton, PlateMakerExampleFileOpened=false;
var Image1 = new Image;
Image1.src="img/ExampleWorkbook1.jpg";
var Image2 = new Image;
Image2.src="img/ExampleWorkbook2.jpg";
var Image3 = new Image;
Image3.src="img/ExampleWorkbook3.jpg";
var Image4 = new Image;
Image4.src="img/ExampleWorkbook4.jpg";
var Image5 = new Image;
Image5.src="img/ExampleWorkbook5.jpg";
var Image6 = new Image;
Image6.src="img/ExampleWorkbook6.jpg";
var Image7 = new Image;
Image7.src="img/ExampleWorkbook7.jpg";
var Image8 = new Image;
Image8.src="img/ExampleWorkbook8.jpg";
var Instructions="<p><i>Push on the buttons below to get a screen shot of each page in the example workbook. If you push on the screenshot itself, then you can open and view the example workbook in Excel.</i></p>"; 
var RightFig = new Array(8);
RightFig[0]="<p><b>pEGFR Total EGFR Study Page 1:</b> The first page of the workbook document contains the meta data for the project including general experimental details, who conducted the work, and the dates on which the experiments were performed plus any other notes relevant to the experiment in question. This page also includes a useful hyperlink index to help you navigate through the workbook.</p>";
RightFig[1]="<p><b>pEGFR Total EGFR Study Page 2:</b> The second page of the workbook shows all the graphs summarising the experimental data. Other information may also be displayed on these pages including heatmaps if appropriate.</p>";
RightFig[2]="<p><b>pEGFR Total EGFR Study Page 3:</b> The third page of the workbook shows an Excel pivot table summarising all the information for all the independent variables of the experiment. You can use this pivot table yourself to slice and dice the data further or create new pivot tables from it. The graph below the tables is dynamic and will change as you change the pivot table filters at the top of the page.</p>";
RightFig[3]="<p><b>pEGFR Total EGFR Study Page 4:</b> In this particular example, we have created two pivot tables. This pivot table differs from the previous one in that it is the transposed version. The reason we did this was to obtain the graph for total EGFR (<i>see Graphs page</i>) where the compounds are along the X axis and the treatment doses are represented by the different bars in the graph.</p>";
RightFig[4]="<p><b>pEGFR Total EGFR Study Page 5:</b> The fifth page of the workbook shows example images from the experiment. With larger studies we will deliver the images separately as a PowerPoint file but imbed the file as a link on the experimental details page.</p>";
RightFig[5]="<p><b>pEGFR Total EGFR Study Page 6:</b> The sixth page of the workbook records the plate maps used in the experiment. Each independent variable in the experiment has its own map so one can clearly see how the different variables were laid out.</p>";
RightFig[6]="<p><b>pEGFR Total EGFR Study Page 7:</b> The seventh page of the workbook is the most important of all because it is the flat data file which associates all the independent and dependent variables of the experiment. This table can be open in most statistical programs including high content analysis programs such as Spotfire. Thus, our data format allows you to continue to perform further analysis independently.</p>";
RightFig[7]="<p><b>pEGFR Total EGFR Study Page 8:</b> The eighth and ninth page of this example workbook contain the raw data matrices obtained directly from the plate reading instrument for total and pEGFR respectively. This gives the customer a complete audit trail from the capturing of the raw data to the final data associated with its independent variables.</p>";
RightFig[8]="<p>The image below shows a screen shot of the final page of the Plate Maker Wizard. The controls on this page allow us to lay out the plate many different ways giving the customer complete control over experiment and plate design.";
var ButtonIdCount=1;

// window.onerror=IgnoreError;

//function IgnoreError(message,url,line){
//return true;
//}

function ButtonRollover(pEvent){
	if (!pEvent) var pEvent=window.event;
	thislink = (pEvent.target) ? pEvent.target: pEvent.srcElement;
	if (!PastButton || PastButton!=thislink.id)	thislink.parentNode.style.backgroundColor="#00349E";
}

function ButtonRollout(pEvent){
	if (!pEvent) var pEvent=window.event;
	thislink = (pEvent.target) ? pEvent.target: pEvent.srcElement;
	if (!PastButton || PastButton!=thislink.id) thislink.parentNode.style.backgroundColor="#bdbdbd";
}

function PlateMakerLinkClick(){
	if (!PlateMakerExampleFileOpened){
		document.getElementById("PlateMakerLink").target="_blank";
		PlateMakerExampleFileOpened=true;
		return true;
	}
	else{
		if (confirm("You already have opened this file. If you do not want to save or reopen the file then please push the Cancel button")) return true;
		return false;
	}
}

function ChangeImage(pEvent){
	if (!pEvent) var pEvent=window.event;
	thislink=(pEvent.target) ? pEvent.target : pEvent.srcElement;
	if (PastButton && PastButton!=thislink.id){
		document.getElementById(PastButton).parentNode.style.borderStyle="outset";
		document.getElementById(PastButton).parentNode.style.backgroundColor="#bdbdbd";
		ChangeSelection(document.getElementById(PastButton).parentNode,false);
		}
	if (!PastButton || PastButton!=thislink.id){
		thislink.parentNode.style.borderStyle="inset";
		thislink.parentNode.style.backgroundColor="gray";
		ChangeSelection(false,thislink.parentNode);
		PastButton=thislink.id;
		switch(thislink.id){
			case "button1":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[0] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook1.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Experimental Details Page";
				break;
			case "button2":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[1] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook2.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Plate Map Page";
				break;
			case "button3":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[2] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook3.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Graphs Page";
				break;
			case "button4":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[3] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook4.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Images Page";
				break;
			case "button5":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[4] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook5.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Statistical Summary Page";
				break;
			case "button6":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[5] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook6.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Statistical Summary Page";
				break;
			case "button7":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[6] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook7.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Raw Data Page";
				break;
			case "button8":
				document.getElementById("PlateMakerWizardFigFooter").innerHTML=RightFig[7] + Instructions;
				document.getElementById("PlateMakerWizardFig").src="img/ExampleWorkbook8.jpg";
				document.getElementById("PlateMakerWizardFig").alt="Flat Data File Page";
				break;
		} //close switch
	} // close if
} // close function

function ChangeSelection(pOld, pNew){
	if (pOld){
		a=findchild(pOld,"#text");
		a.nodeValue="";
		a=findchild(pOld,"A");
		a.style.display="inline";
	}
	if (pNew){
		a=findchild(pNew,"A");
		a.style.display="none";
		textMem=findchild(a,"#text");
		a=findchild(pNew,"#text");
		if (a)
			a.nodeValue=textMem.nodeValue
		else{
 			var TextNode=document.createTextNode(textMem.nodeValue);
			pNew.appendChild(TextNode);
		}
	}
}

function findchild(obj,tag){
	if (obj.hasChildNodes()){
		cn=obj.childNodes;
		for (k=0; k<cn.length; k++){
			if (cn[k].nodeName==tag) return cn[k];
		}
	}
	return false;
}

MenuObjs=document.getElementsByTagName("table");
for (i=0; i<MenuObjs.length; i++){
	if (MenuObjs[i].className=="ButtonMenu"){
		MenuObjChild=findchild(MenuObjs[i],"TBODY")
		MenuObjChild=findchild(MenuObjChild,"TR")
		for (j=0; j<MenuObjChild.childNodes.length; j++){
			Target=findchild(MenuObjChild.childNodes[j],"A")	
			if (Target){
				Target.onmouseover=ButtonRollover;
				Target.onmouseout=ButtonRollout;
				Target.href="#return";
				Target.onclick=ChangeImage;
				Target.id="button" + ButtonIdCount++;
			}
		}
	}
}



