
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
var Designdb = new Object()
Designdb["monogram"] = [
{id:"1", text:"black"},
{id:"131", text:"blue"},
{id:"62", text:"burgundy"},
{id:"2", text:"cream"},
{id:"61", text:"deep_red"},
{id:"5", text:"green"},
{id:"4", text:"light_blue"},
{id:"3", text:"sage"}
];
Designdb["icon_church"] = [
{id:"8", text:"blue"},
{id:"64", text:"burgundy"},
{id:"63", text:"deep_red"},
{id:"7", text:"green"},
{id:"10", text:"lavender"},
{id:"6", text:"pink"},
{id:"9", text:"sage"}
];
Designdb["icon_hearts"] = [
{id:"13", text:"blue"},
{id:"66", text:"burgundy"},
{id:"65", text:"deep_red"},
{id:"12", text:"green"},
{id:"15", text:"lavender"},
{id:"11", text:"pink"},
{id:"14", text:"sage"}
];
Designdb["icon_rings"] = [
{id:"18", text:"blue"},
{id:"68", text:"burgundy"},
{id:"67", text:"deep_red"},
{id:"17", text:"green"},
{id:"20", text:"lavender"},
{id:"16", text:"pink"},
{id:"19", text:"sage"}
];
Designdb["wedding_bells"] = [
{id:"23", text:"blue"},
{id:"22", text:"chocolate"},
{id:"24", text:"lime"},
{id:"25", text:"pale_pink"},
{id:"21", text:"pink"}
];
Designdb["butterfly"] = [
{id:"31", text:"black"},
{id:"70", text:"burgundy"},
{id:"69", text:"deep_red"},
{id:"28", text:"deep_sky"},
{id:"29", text:"pale_green"},
{id:"27", text:"peach"},
{id:"26", text:"red"},
{id:"30", text:"slate"}
];
Designdb["tropical_palm_tree"] = [
{id:"34", text:"blue"},
{id:"33", text:"green"},
{id:"36", text:"lavender"},
{id:"32", text:"pink"},
{id:"35", text:"sage"},                      
];
Designdb["rose"] = [
{id:"60", text:"chocolate"},
{id:"61", text:"coral"},
{id:"55", text:"green"},
{id:"56", text:"lavender"},
{id:"54", text:"pink"},
{id:"58", text:"pumpkin"},
{id:"59", text:"red"},
{id:"57", text:"sky_blue"},                      
];
Designdb["calla_lily"] = [
{id:"55", text:"default_color"}
];
Designdb["bee"] = [
{id:"58", text:"blue"},
{id:"60", text:"green"},
{id:"57", text:"orange"},
{id:"59", text:"red"},
{id:"56", text:"yellow"}
];
Designdb["champagne_flutes"] = [
{id:"63", text:"blue"},
{id:"62", text:"cream"},
{id:"66", text:"lavender"},
{id:"64", text:"lime"},
{id:"61", text:"pink"},
{id:"68", text:"wht_blue"},
{id:"67", text:"wht_blue_blue"},
{id:"70", text:"wht_lavender"},
{id:"69", text:"wht_lime"},
{id:"65", text:"wht_pink"}
];
Designdb["retro_beach"] = [
{id:"73", text:"blue"},
{id:"72", text:"cream"},
{id:"74", text:"sand"},
{id:"71", text:"surf"}
];
Designdb["fleur_de_lis"] = [
{id:"76", text:"blue"},
{id:"78", text:"brown"},
{id:"82", text:"cream"},
{id:"81", text:"lavender"},
{id:"77", text:"lime"},
{id:"79", text:"orange"},
{id:"75", text:"pink"},
{id:"80", text:"sage"},
{id:"84", text:"wht_pink"},
{id:"83", text:"wht_teal"}
];
Designdb["heart_and_roses"] = [
{id:"89", text:"blue"},
{id:"90", text:"dk_pink"},
{id:"91", text:"grean"},
{id:"87", text:"lavender"},
{id:"88", text:"lt_pink"},
{id:"92", text:"orange"},
{id:"86", text:"tane"},
{id:"85", text:"teal"},
{id:"94", text:"white"},
{id:"93", text:"yellow"}
];
Designdb["victorian_silhouette"] = [
{id:"104", text:"airmail_stripe"},
{id:"99", text:"blue"},
{id:"97", text:"cream"},
{id:"96", text:"lime"},
{id:"101", text:"olive_green_stripe"},
{id:"98", text:"pink"},
{id:"103", text:"pink_green_stripe"},
{id:"100", text:"pink_stripe"},
{id:"102", text:"tan_stripe"},
{id:"95", text:"teal"}
];

function setCities(chooser) {
    var newElem;
    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var AttributeValueChooser = document.getElementById('AttributeValue[2]');
    while (AttributeValueChooser.options.length) {
        AttributeValueChooser.remove(0);
    }
    var choice = chooser.options[chooser.selectedIndex].id;
    var db = Designdb[choice];
    newElem = document.createElement("option");
    newElem.text = "Choose a Color";
    newElem.id = "";
    AttributeValueChooser.add(newElem, where);
    if (choice != "") {
        for (var i = 0; i < db.length; i++) {
            newElem = document.createElement("option");
            newElem.text = db[i].text;
            newElem.id = db[i].id;
            AttributeValueChooser.add(newElem, where);
        }
    }
}

/**********
  DOM LEVEL 0 ALTERNATE
 **********
function setCities(chooser) {
    var AttributeValueChooser = chooser.form.elements["AttributeValue"];
    // empty previous settings
    AttributeValueChooser.options.length = 0;
    // get chosen id to act as index to Designdb hash table
    var choice = chooser.options[chooser.selectedIndex].id;
    var db = Designdb[choice];
    // insert default first item
    AttributeValueChooser.options[0] = new Option("Choose a AttributeValue:", "", true, false);
    if (choice != "") {
        // loop through array of the hash table entry, and populate options
        for (var i = 0; i < db.length; i++) {
            AttributeValueChooser.options[i + 1] = new Option(db[i].text, db[i].id);
        }
    }
}
**********/

