// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    $objColorImage = new ColorImage($id);
    $objColor = new Color($objColorImage->ColorId);
    header("Location:colorimage_list.php?cat=" . $_REQUEST['cat'] . "&color=" . $objColor->Id);
    exit;
}
if ($_POST['commit'] == "Delete Color Image") {
    $objColorImage = new ColorImage($id);
    $objColor = new Color($objColorImage->ColorId);
    $objColorImage->Delete($id);
    header("Location:colorimage_list.php?cat=" . $_REQUEST['cat'] . "&color=" . $objColor->Id);
    exit;
}
$objColorImage = new ColorImage($id);
$objColor = new Color($objColorImage->ColorId);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objColorImage;
    global $objColor;
    global $id;
    ?>

            <div class="layout laymidwidth">