Добрый день. Помогите разобраться, есть код
<img id="SBookMapImage_<?php echo $_GET['cid']; ?>" src="<?php echo INSTALL_URL . $tpl['arr']['path']; ?>" alt="<?php echo htmlspecialchars(stripslashes($tpl['arr']['map_title'])); ?>" style="margin: 0; border: none; position: absolute; top: 0; left: 0; z-index: 500" />
<?
if(!empty($tpl['price_arr']['price_color']) || !empty($tpl['price_arr']['price_color_hover']) || !empty($tpl['price_arr']['price_color_active'])): ?>
<style>
<? if(!empty($tpl['price_arr']['price_color'])): ?>
.custom_price_color {
background-color: #<?=$tpl['price_arr']['price_color']?>;
}
<? endif; ?>
<? if(!empty($tpl['price_arr']['price_color_hover'])): ?>
.custom_price_color:hover {
background-color: #<?=$tpl['price_arr']['price_color_hover']?> !important;
}
<? endif; ?>
<? if(!empty($tpl['price_arr']['price_color_active'])): ?>
.custom_price_color:active {
background-color: red !important;
}
<? endif; ?>
</style>
<? endif; ?>
<?if(count($tpl['price_color_arr']) != 0):?>
<style>
<?foreach ($tpl['price_color_arr'] as $i => $color):?>
.custom_price_color<?=$i;?> {
background-color: #<?=$color?>
}
<?endforeach;?>
</style>
<?endif;?>
<?if(count($tpl['price_color_hover_arr']) != 0):?>
<style>
<?foreach ($tpl['price_color_hover_arr'] as $j => $color_hover):?>
.custom_price_color<?=$j;?>:hover {
background-color: #<?=$color_hover?> !important;
}
<?endforeach;?>
</style>
<?endif;?>
<?if(count($tpl['price_color_active_arr']) != 0):?>
<style>
<?foreach ($tpl['price_color_active_arr'] as $j => $color_active):?>
.custom_price_color<?=$j;?>:active {
background-color: red !important;
}
<?endforeach;?>
</style>
<?endif;?>
<?
foreach ($tpl['seat_arr'] as $seat)
{
$avail = $seat['seats'] - $seat['booked'];
?><span onmouseout="UnTip()" onmouseover="Tip('Цена: <?php echo Util::formatCurrencySign(number_format(isset($tpl['custom_arr'][$seat['id']]) ? $tpl['custom_arr'][$seat['id']] : $tpl['price_arr']['price'], 2), $tpl['option_arr']['currency']); ?><br>Место: <?php echo stripslashes($seat['name']); ?><br /><?=@$seat['hint']?>', ABOVE, true, CENTERMOUSE, true, OFFSETX, 0);" rel="<?php echo $seat['id']; ?>" rev="<?php echo $avail; ?>" data-price_id="<?php echo $_GET['price_id']; ?>" data-price="<?php echo Util::formatCurrencySign(number_format(isset($tpl['custom_arr'][$seat['id']]) ? $tpl['custom_arr'][$seat['id']] : $tpl['price_arr']['price'], 2), $tpl['option_arr']['currency']); ?>" data-hint="<?php echo @$seat['hint'];?>" class="custom_price_color custom_price_color<?=$seat['id'];?> sbook-rect sbook-<?php echo (in_array($seat['id'], $tpl['bs_admin_arr_1']) ? "busy-admin" : (in_array($seat['id'], $tpl['bs_arr']) && (int) $avail <= 0 ? 'busy' : 'available')); ?>" style="width: <?php echo $seat['width']; ?>px; height: <?php echo $seat['height']; ?>px; left: <?php echo $seat['left']; ?>px; top: <?php echo $seat['top']; ?>px; line-height: <?php echo $seat['height']; ?>px;"><?php echo stripslashes($seat['name']); ?></span><?php
}
?>
Масив ($tpl['price_color_arr']) меняет цвет используя псевдокласы hover и active. А вот как повесить onclick функцию для изменения цвета при нажатии - не понимаю.
Прошу прощения сразу если что не так - начинающий я