

var products = {
"p1": "NAME: 'Confetti Underwire Balconnet Bra and Short'; DESC: ''; SIZE: 'D-K'; BRAND: 'Panache'; BRAND_LOGO: 'images/brand100/panache.jpg'; ", 
"p2": "NAME: 'Confetti Underwire Basque and Thong'; DESC: ''; SIZE: 'D-G'; BRAND: 'Panache'; BRAND_LOGO: 'images/brand100/panache.jpg'; ", 
"p3": "NAME: 'Confetti Underwire Body Thong'; DESC: ''; SIZE: 'D-H'; BRAND: 'Panache'; BRAND_LOGO: 'images/brand100/panache.jpg'; ", 
"p4": "NAME: 'Inferno Underwire Plunge Multiway Bra and Thong'; DESC: ''; SIZE: 'D-G'; BRAND: 'Panache'; BRAND_LOGO: 'images/brand100/panache.jpg'; ", 
"p5": "NAME: 'Strapless Underwire Bra and Brief'; DESC: ''; SIZE: 'D-G'; BRAND: 'Panache'; BRAND_LOGO: 'images/brand100/panache.jpg'; ",
"p6": "NAME: 'Enell Sports Bra'; DESC: ''; SIZE: 'D-G'; BRAND: 'Enell'; BRAND_LOGO: 'images/brand100/enell.jpg'; ",
"p7": "NAME: 'Enell Sports Bra'; DESC: ''; SIZE: 'D-G'; BRAND: 'Enell'; BRAND_LOGO: 'images/brand100/enell.jpg'; "

};

function formatted_list_get_item (str, name) {
    var outstr = str.match (name.toUpperCase() + ":[^;]{1,};") + "";
    outstr = outstr.replace (name.toUpperCase() + ":", "");
    outstr = outstr.replace (/\s*;.*$/, "");
    outstr = outstr.replace (/^\s*/, "");
    outstr = outstr.replace (/'$/, "");
    outstr = outstr.replace (/^'/, "");
    return outstr;
}


function removeChildren (ob) {
    while (ob.hasChildNodes()) {
        ob.removeChild(ob.firstChild);
    }
}


function showproduct (prodid) {
   
     removeChildren(document.getElementById ('big_view'));
    
    var outfit_div = document.createElement ('div');
   // outfit_div.className = "mix_garment";
    outfit_div.style.position = "relative";
    outfit_div.style.float = "left";
    outfit_div.style.padding = "8px";
    outfit_div.style.height = "400px";
   // outfit_div.style.width = "160px";
    
    var imStr = "<table border='0' width='100%' cellspacing='8px' cellpadding='0'><tr><td valign='top'>";
    imStr += "<img align='left' valign='top' src='products/big/" + prodid + ".jpg' id='" + prodid +  "' >";
        
    var prodstr = products[prodid];
    
    var prodname = formatted_list_get_item (prodstr , "NAME");
    var prodsize = formatted_list_get_item (prodstr , "SIZE");
    var prodbrandlogo = formatted_list_get_item (prodstr , "BRAND_LOGO");
    
    imStr += "</td><td  valign='top'><img src='" + prodbrandlogo + "'>";
    
    imStr += "<P><span class='prodhead'>" + prodname + "</span><P>";
    imStr += "<span class='prodfield'>Cup Size:</span><span class='prodvalue'>" + prodsize + "</span><P>";
    
    imStr += "</td></tr></table>";
    
    outfit_div.innerHTML = imStr;
        
    document.getElementById ('big_view').appendChild(outfit_div);
}

