Alright...I'm an AS3 programmer and am switching to php and have some issues.

I've got a Joomla site and I need to display graphics (either a gray or color version) based on the title of the "tag" that is being used for that particular Joomla article. I've sort of got it working, but it's not the most efficient code and it's not working completely correctly (displays multiple versions of the images).

Instead of just continuing to try options and bang my head, I thought I'd throw it out there to see if any of you php gurus can see something obviously easier and more efficient.

Here's the code (finds the tags and displays the right image, but it's ugly and, displays multiple versions of the graphic...I'm sure it's because the break is placed wrong, so I'm fixing that now (the second group is coded slightly different than the second one, just trying other options...there are 6 of these sections/images total):

Code:
						<td>
							<?php $tmp="0" ?>
							<?php foreach ($this->item->tags as $tag): ?>
								<?php if ($tag->name == "Thinking"): ?>
									<?php $tmp="1"; ?>
									<?php break; ?>
								<?php endif; ?>
								<?php if ($tmp=="1"): ?>
									<img src="templates/images/1-Thinking-color.gif" width="111" height="40" />
								<?php else: ?>
									<img src="templates/images/1-Thinking-gray.gif" width="111" height="40" />
								<?php endif; ?>
							<?php endforeach; ?>
							 </td>
						<td>
							<?php foreach ($this->item->tags as $tag): ?>
								<?php if ($tag->name == "Focus"): ?>
									<img src="templates/images/2-Focus-color.gif" width="111" height="40" />
									<?php break; ?>
								<?php else: ?>
									<img src="templates/images/2-Focus-gray.gif" width="111" height="40" />
								<?php endif; ?>
							<?php endforeach; ?>
						</td>
Thanks!