var graphics = new Array (); var countGraph = 0, prevID = 0, prev1 = -1, prev2 = -1; function CreateGraph (nameGraph, width, height) { if ( SupportDHTML ()) { this.image = new Image (); this.image.src = "images/" + nameGraph; this.image.width = width; this.image.height = height; } // if } function AddGraph (nameGraph, width, height) { graphics [countGraph] = new CreateGraph (nameGraph, width, height); countGraph++; } function CountGraph () { return countGraph; } function OnSelectImg(ID) { if (ID < 0 || ID > countGraph) { do { ID = Math.floor (Math.random () * countGraph); } while (ID == prevID); } // if prev2 = prev1; prev1 = prevID; prevID = ID; if (SupportDHTML ()) { var e; e = window.event.srcElement; if (e.tagName == "IMG") { e.src = graphics [ID].image.src; e.width = graphics [ID].image.width; e.height = graphics [ID].image.height; } // if if (prev1 >= 0) { if (table1.style.visibility != "visible") table1.style.visibility="visible"; fig1.src = graphics [prev1].image.src; fig1.width = graphics [prev1].image.width; fig1.height = graphics [prev1].image.height; } // if if (prev2 >= 0 && countGraph > 2) { if (table2.style.visibility != "visible") table2.style.visibility="visible"; fig2.src = graphics [prev2].image.src; fig2.width = graphics [prev2].image.width; fig2.height = graphics [prev2].image.height; } // if } // if }