there are different ways how to do it..you could save whole panel definitions in a string* array and call pan_create with them..or you just use an bmap* array.

example for the 2nd method:

Code:
define gemTypes 3

BMAP* gemMap[gemTypes];

void createGemBMAPs_startup(){
    //you can do this in a for loop, too
    //if you have uniform filenames like gem1, 2, 3
    gemMap[0] = bmap_create("gem_red.tga");
    gemMap[1] = bmap_create("gem_green.tga");
    gemMap[2] = bmap_create("gem_blue.tga");
}

PANEL* createNewGem(VECTOR* pos, int gemType){
    PANEL* tempPan = pan_create("",5);
    set(tempPan,VISIBLE);
    tempPan.pos_x = pos.x;
    tempPan.pos_y = pos.y;
    tempPan.bmap = gemMap[gemType];
    tempPan.size_x = bmap_width(tempPan.bmap);
    tempPan.size_y = bmap_height(tempPan.bmap);
    return tempPan;
}


Have fun =)