// JavaScript Document
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
var flowerno = 1;
var maxno = 2;

function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}
function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}

function writetolayer(lay,txt) {
if (ie4) {
if (txt=='d'){
flowerno = flowerno+1;
if (flowerno>maxno){
flowerno = maxno;
}
}else{
flowerno = flowerno-1;
if (flowerno<1){
flowerno = 1;
}
}
document.all[lay].innerHTML = '<img name="flower1" src="flowers/flower'+flowerno+'.jpg" width="247" height="222" alt="">';
}


if (ns4) {
document[lay].document.write(txt);
document[lay].document.close();
}
if (ns6) {
over = document.getElementById([lay]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(txt);
while (over.hasChildNodes()) {
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
   }
}



if (document.images) {            // Active Images
            img1on = new Image();      
            img1on.src = "images/upbtn1.gif";

            img1off = new Image(); 
            img1off.src = "images/upbtn0.gif";   
			
			img2on = new Image();      
            img2on.src = "images/downbtn1.gif";

            img2off = new Image(); 
            img2off.src = "images/downbtn0.gif";
			
			imgOrderon = new Image();
			imgOrderon.src = "images/orderon.gif";   
			
			imgOrderoff = new Image();
			imgOrderoff.src = "images/orderoff.gif"; 
			
			}

// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}
