function show(divid)
{

	if(document.getElementById(divid).style.display == "block")
	{
		document.getElementById(divid).style.display = "none";
	}
	else
	{
		document.getElementById(divid).style.display = "block";
	}
}

function help(topic)
{
	var topicid = topic;
	switch (topic)
	{
	
case "animals":
show('help');
document.getElementById('help').innerHTML = "These are the animals you have bought from the store. Underneath the image of the animal you can see it's name and how happy it is based on the number of hearts it has. You can also see how many turns this animal has been alive for as well as how many events/races this animal has won. <br /><br />If you would like to edit your animal's name or description click on <b>Edit Animal Details</b>. <br /><br />To take care of your animal, click on one of the icons below your animal's description. The feed trough feeds your animal, the poo clean up the animal's poo and the sponge will wash your animal. You can take care of your animal once per day and doing so will increase your animal's happiness.<br />Some animals can also produce produce such as milk. To harvest this produce, click on the icon. The value of the produce depends on the happiness of the animal.<br /><br />Your animal will stop producing produce at 30 turns. After that you can sell it to the store. Animals that don't produce produce such as pigs and horses will be worth more money at the store if they are happier.";
break;
	 		
case "home":
show('help');
document.getElementById('help').innerHTML = "This is your farm home. This is where you can edit your profile and see what other users see. If you click on 		your field or barn you will see what other users see, if you want to take care of your field or barn, click on the main buttons above.<br><br>You can edit your nickname, farm name and description. You can use HTML in your	description.";
break;
	 	
case "inventory":
show('help');
document.getElementById('help').innerHTML = "This is your inventory. Any items you buy or harvest go here. Click on the item to show or hide the item details.";
break;

case "field":
show('help');
document.getElementById('help').innerHTML = "This is your field. To plant crops you must first buy seeds from the <a href=store.php>Store</a>. Once you have purchased the seeds you can plant them by clicking on the plant button on the right.<br><br>Once your seed is planted you can see it on the field. To take care of the seed click on one of the icons below and then click on your seed in the field. To de-select an icon click on the red icon. Take care of your seeds every day to harvest them at top quality.<br><br>Click on a plot to show or hide the plot details.";
break;

case "events":
show('help');
document.getElementById('help').innerHTML = "You can enter any animal except pets into events. These events are run automatically every 24 hours. Your animals are judged against other players and the more entries in the event, the more money the top 3 animals win.";
break;

case "store":
show('help');
document.getElementById('help').innerHTML = "At the store you can buy everyday farming items such as seeds an animals. Click on the buy button to buy an item for the price listed beside the item name.<br /><br />To sell items to the store click on the item from your inventory. The clerk will tell you how much the item is worth and you can either accept or reject the offer.";
break;

case "sellanimals":
show('help');
document.getElementById('help').innerHTML = "To sell an animal, click on the Sell (animal name) button underneath the animal's image and value. With the exception of sheep, cows and chickens, the happier your animal is, the more the animal is worth.";
break;

case "town":
show('help');
document.getElementById('help').innerHTML = "At the town you can search for other players in the game and view their home page, barn and field. You can also view the top players in the game ordered by points and rank. You can raise your player rank by selling items and making as much money as possible.";
break;
	 	
default:
show('help');
document.getElementById('help').innerHTML = "There is no help text for this 		page yet. Check back soon.";
break;

	 }
}

