function getRefToDiv(divID,oDoc) {
  if( document.getElementById ) {
    return document.getElementById(divID); }
  if( document.all ) {
    return document.all[divID]; }
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
      //repeatedly run through all child layers
      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        //on success, return that layer, else return nothing
        y = getRefToDiv(divID,oDoc.layers[x].document); }
    return y; } }
  return false;
}

	function captionContents(num) {
		switch (num) {
			case 1: return "THE BACKYARD";
			case 2: return "THE KITCHEN";
			case 3: return "HAPPY FARMING WWOOFERS";
			case 4: return "PICKED FRUIT";
			case 5: return "FRUIT PICKING WWOOFERS";
			case 6: return "THE HOUSE";
			case 7: return "THE HOUSE";
			case 8: return "MOTORBIKE";
			case 9: return "TREES ON THE ORCHARD";
			case 10: return "DUCKS ON THE DAM";
			case 11: return "CELEBRATING WWOOFERS";
		}
	}

	function selectImg(num, width) {
		theDiv = getRefToDiv("selectedPhoto");
		theDiv.style.width = width + 'px';
		theDiv.innerHTML = '<div id="caption">' + captionContents(num) + '</div><img src="/img/photos/img' + num + '_big.jpg">';
	}

  function changeState(a, b) {
	if (b == "on") {
		a.style.cursor='pointer'
	}
	else if (b == "off") {
		a.style.cursor='default'
	}
  }