var count = 0;

var photoarray = new Array();
photoarray[0] ="gallery/cart.jpg";
photoarray[1] ="gallery/plant.png";
photoarray[2] ="gallery/row.jpg";
photoarray[3] ="gallery/boxed.png";
photoarray[4] ="gallery/packingline.png";
photoarray[5] ="gallery/cartinside.JPG";
photoarray[6] ="gallery/yellowvine.JPG";
photoarray[7] ="gallery/cartpeppers.png";
photoarray[8] ="gallery/colourbox.JPG";
photoarray[9] ="gallery/downview.JPG";
photoarray[10] ="gallery/dump.JPG";
photoarray[11] ="gallery/greenhouse.JPG";
photoarray[12] ="gallery/holdingtank.JPG";
photoarray[13] ="gallery/lane.JPG";
photoarray[14] ="gallery/orangevine.JPG";
photoarray[15] ="gallery/overview.JPG";
photoarray[16] ="gallery/scissorcart.JPG";
photoarray[17] ="gallery/packing.png";
photoarray[18] ="gallery/cartback.png";
photoarray[19] ="gallery/pepper.png";
photoarray[20] ="gallery/cartoutside.JPG";
photoarray[21] ="gallery/picking.png";
photoarray[22] ="gallery/peppervine.png";
photoarray[23] ="gallery/phase2.JPG";
photoarray[24] ="gallery/boxline.JPG";
photoarray[25] ="gallery/bradcart.JPG";
photoarray[26] ="gallery/slicedpeppers.JPG";
photoarray[27] ="gallery/straightview.JPG";
photoarray[28] ="gallery/tank.png";


function changePhoto(pic) {
count = pic;
var thisimg = "<img src='images/"+photoarray[pic]+"' />";
document.getElementById('main_pic').innerHTML = thisimg;
}

function slideNext() {
	count++;
	if (count >28) {//This number has to be the total size of the array
		count=0;
	}
	var thisimg1 = "<img src='images/"+photoarray[count]+"' />";
	document.getElementById('main_pic').innerHTML = thisimg1;
}

function slidePrev() {
	count--;
	if (count <0) {
		count=28;//This number has to be the total size of the array
	}
	var thisimg2 = "<img src='images/"+photoarray[count]+"' />";
	document.getElementById('main_pic').innerHTML = thisimg2;
}


var anylinkmenu1={divclass:'developmentmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.items=[
	["Produce", "produce.php"],
	["Innovations", "innovations.php"],
	["Energy", "energy.php"] //no comma following last entry!
]

var anylinkmenu2={divclass:'gallerymenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu2.items=[
	["Photos", "photo.php"],
	["Videos", "video.php"] //no comma following last entry!
]

thumb1on = new Image();
thumb2on = new Image();
thumb3on = new Image();
thumb4on = new Image();
thumb5on = new Image();
thumb6on = new Image();
thumb1off = new Image();
thumb2off = new Image();
thumb3off = new Image();
thumb4off = new Image();
thumb5off = new Image();
thumb6off = new Image();
thumb1on.src="images/homeover.png";
thumb2on.src="images/aboutover.png";
thumb3on.src="images/foodsafetyover.png";
thumb4on.src="images/developmentover.png";
thumb5on.src="images/galleryover.png";
thumb6on.src="images/contactover.png";
thumb1off.src="images/home.png";
thumb2off.src="images/about.png";
thumb3off.src="images/foodsafety.png";
thumb4off.src="images/development.png";
thumb5off.src="images/gallery.png";
thumb6off.src="images/contact.png";
function rollOver(img) {
butOn = eval(img+"on.src");
document.getElementById(img).src = butOn;
}
function rollOut(img) {
butOff = eval(img+"off.src");
document.getElementById(img).src = butOff;
}

function resizeIframe() {
    var height = document.documentElement.clientHeight;
    height -= document.getElementById('hometxt').offsetTop;
    
    // not sure how to get this dynamically
    height -= 10; /* whatever you set your body bottom margin/padding to be */
    
    document.getElementById('hometxt').style.height = height +"px";
    
};

window.onresize = resizeIframe;

