var myevent=false;
var arr_f=new Array(1);
arr_f[0]="";

var search_duplicate=false;
var search_duplicate_id="";
/*********************** Variable for product library menu ***********************/
var material_filter_to_model='';
var pattern_filter_to_model='';
var texture_filter_to_model='';
var scale_filter_to_model='';
var color_filter_to_model='';
var color_grouping_filter_to_model='';
var collect_filter_to_model='';
var brands_filter_to_model='';
var designer_filter_to_model='';
var sustain_filter_to_model='';
/* for filter menu */

/* for material filter menu */                
var wallcovering_material_title='Select one or multiple items';
var wallcovering_material_heading=new Array(2);
    wallcovering_material_heading[0]="";
    wallcovering_material_heading[1]="";
var wallcovering_material_column_count=2;    
var wallcovering_material_column_width=472;
var wallcovering_material_column=new Array(2);
    wallcovering_material_column[0]=new Array(6);
    wallcovering_material_column[1]=new Array(5);
    
    for(i=0;i<wallcovering_material_column[0].length;i++)
        wallcovering_material_column[0][i]=new Array(3);
        
    for(i=0;i<wallcovering_material_column[1].length;i++)
        wallcovering_material_column[1][i]=new Array(3);
    
    wallcovering_material_column[0][0][0]="Acoustical"; 
    wallcovering_material_column[0][0][1]="1";
    wallcovering_material_column[0][0][2]="";
    
    wallcovering_material_column[0][1][0]="Cork"; 
    wallcovering_material_column[0][1][1]="1";
    wallcovering_material_column[0][1][2]="";
    
    wallcovering_material_column[0][2][0]="Dry Erase/Projection"; 
    wallcovering_material_column[0][2][1]="1";
    wallcovering_material_column[0][2][2]="";
    
    wallcovering_material_column[0][3][0]="Grass Cloth"; 
    wallcovering_material_column[0][3][1]="1";
    wallcovering_material_column[0][3][2]="";
    
    wallcovering_material_column[0][4][0]="Non Woven/Paper"; 
    wallcovering_material_column[0][4][1]="1";
    wallcovering_material_column[0][4][2]="";
    
    wallcovering_material_column[0][5][0]="Silk"; 
    wallcovering_material_column[0][5][1]="1";
    wallcovering_material_column[0][5][2]="";
    
    
    wallcovering_material_column[1][0][0]="Suede"; 
    wallcovering_material_column[1][0][1]="1";
    wallcovering_material_column[1][0][2]="";
    
    wallcovering_material_column[1][1][0]="Textile"; 
    wallcovering_material_column[1][1][1]="1";
    wallcovering_material_column[1][1][2]="";
    
    wallcovering_material_column[1][2][0]="Thermoplastic Olefin (TPO)"; 
    wallcovering_material_column[1][2][1]="1";
    wallcovering_material_column[1][2][2]="";
    
    wallcovering_material_column[1][3][0]="Vinyl"; 
    wallcovering_material_column[1][3][1]="1";
    wallcovering_material_column[1][3][2]="";
    
    wallcovering_material_column[1][4][0]="Wood"; 
    wallcovering_material_column[1][4][1]="1";
    wallcovering_material_column[1][4][2]="";

var wallcovering_value_material_title='Select one or multiple items';
var wallcovering_value_material_heading=new Array(1);
    wallcovering_value_material_heading[0]="";
var wallcovering_value_material_column_count=1;  
var wallcovering_value_material_column_width=247;  
var wallcovering_value_material_column=new Array(1);
    wallcovering_value_material_column[0]=new Array(3);
    
    for(i=0;i<wallcovering_value_material_column[0].length;i++)
        wallcovering_value_material_column[0][i]=new Array(3);
    
    wallcovering_value_material_column[0][0][0]="Vinyl"; 
    wallcovering_value_material_column[0][0][1]="1";
    wallcovering_value_material_column[0][0][2]="";
    
    wallcovering_value_material_column[0][1][0]="Textile"; 
    wallcovering_value_material_column[0][1][1]="1";
    wallcovering_value_material_column[0][1][2]="";
    
    wallcovering_value_material_column[0][2][0]="Non Woven/Paper"; 
    wallcovering_value_material_column[0][2][1]="1";
    wallcovering_value_material_column[0][2][2]="";
    

var upholstery_material_title='Select one or multiple items';
var upholstery_material_heading=new Array(1);
    upholstery_material_heading[0]="";
var upholstery_material_column_count=1;
var upholstery_material_column_width=247;  
var upholstery_material_column=new Array(1);
    upholstery_material_column[0]=new Array(4);
    
    for(i=0;i<upholstery_material_column[0].length;i++)
        upholstery_material_column[0][i]=new Array(3);
    
    upholstery_material_column[0][0][0]="Mohair"; 
    upholstery_material_column[0][0][1]="1";
    upholstery_material_column[0][0][2]="";
    
    upholstery_material_column[0][1][0]="Polyurethane"; 
    upholstery_material_column[0][1][1]="1";
    upholstery_material_column[0][1][2]="";
    
    upholstery_material_column[0][2][0]="Trevira CS"; 
    upholstery_material_column[0][2][1]="1";
    upholstery_material_column[0][2][2]="";
    
    upholstery_material_column[0][3][0]="Wool"; 
    upholstery_material_column[0][3][1]="1";
    upholstery_material_column[0][3][2]=""; 
    

/*var drapery_material_title='Select one or multiple items';
var drapery_material_heading=new Array(1);
    drapery_material_heading[0]="";
var drapery_material_column_count=1;
var drapery_material_column_width=247;     
var drapery_material_column=new Array(1);
    drapery_material_column[0]=new Array(4);
    
    for(i=0;i<drapery_material_column[0].length;i++)
        drapery_material_column[0][i]=new Array(3);
    
    drapery_material_column[0][0][0]="Mohair"; 
    drapery_material_column[0][0][1]="1";
    drapery_material_column[0][0][2]="";
    
    drapery_material_column[0][1][0]="Polyurethane"; 
    drapery_material_column[0][1][1]="1";
    drapery_material_column[0][1][2]="";
    
    drapery_material_column[0][2][0]="Trevira CS"; 
    drapery_material_column[0][2][1]="1";
    drapery_material_column[0][2][2]="";
    
    drapery_material_column[0][3][0]="Wool"; 
    drapery_material_column[0][3][1]="1";
    drapery_material_column[0][3][2]=""; 
    
var drapery_material_footer_logout='<p class="logDisplay"><sup style="vertical-align:text-top;">*</sup>Please <a href="#" onclick="close_all_filters();dhtmlModalWindow(\'/product_library/login\', \'Login\', \'350\', \'375\')" title="Login"><strong>log in</strong></a> to view all products available in your area</p>';
var drapery_material_footer_login='<p class="logDisplay"><sup style="vertical-align:text-top;">*</sup>Not available in your area.</p>'; */


var drapery_material_title='Select one or multiple items';
var drapery_material_heading=new Array(1);
    drapery_material_heading[0]="";
var drapery_material_column_count=1;
var drapery_material_column_width=247;     
var drapery_material_column=new Array(1);
    drapery_material_column[0]=new Array(2);
    
    for(i=0;i<drapery_material_column[0].length;i++)
        drapery_material_column[0][i]=new Array(3);
    
    //drapery_material_column[0][0][0]="Trevira CS only"; 
    drapery_material_column[0][0][0]="FR Polyester";
    drapery_material_column[0][0][1]="1";
    drapery_material_column[0][0][2]="";
    
    drapery_material_column[0][1][0]="Trevira CS"; 
    drapery_material_column[0][1][1]="1";
    drapery_material_column[0][1][2]="";
    

var paint_material_title='Select one or multiple items';
var paint_material_heading=new Array(1);
    paint_material_heading[0]="";
var paint_material_column_count=1;
var paint_material_column_width=247;    
var paint_material_column=new Array(1);
    paint_material_column[0]=new Array(1);
    
    for(i=0;i<paint_material_column[0].length;i++)
        paint_material_column[0][i]=new Array(3);
    
    paint_material_column[0][0][0]="Paint"; 
    paint_material_column[0][0][1]="1";
    paint_material_column[0][0][2]="";

var material_footer='';    
 
       
var material_title='Select one or multiple items';
var material_heading=new Array(2);
    //material_heading[0]="STANDARD";
    //material_heading[1]="SPECIALTY";
    material_heading[0]="";
    material_heading[1]="";
    
var material_column=new Array(2);
    material_column[0]=new Array(7);
    material_column[1]=new Array(7);
    
    for(i=0;i<material_column[0].length;i++)
        material_column[0][i]=new Array(3);
        
    for(i=0;i<material_column[1].length;i++)
        material_column[1][i]=new Array(3);
        
    material_column[0][0][0]="Vinyl"; 
    material_column[0][0][1]="1";
    material_column[0][0][2]="Vinyl&mdash;our most versatile, affordable, and durable material&mdash;is easy to clean, mold and mildew resistant, and printed with water-based or HAP-free (hazardous air pollutant-free) inks. It&rsquo;s available in a plethora of colors, textures, and patterns. And, with our continuing focus on sustainability, many are made with pre- and post-consumer recycled content, and surpass Cal 01350 low-emitting standards. For those in healthcare, we have vinyls treated with a Silvadur&reg, bacteria-destroying topcoat. Our vinyl wallcoverings are suitable for high traffic areas, Class A rated for fire safety, and recyclable through the WG Reclamation Program.";
                                       
     //material_column[0][1][0]="PVC-Free Type II"                                       
    material_column[0][1][0]="TPO" 
    material_column[0][1][1]="1";
    material_column[0][1][2]="Created with Thermoplastic Olefin technology, our TPO wallcoverings are free of chlorine and phthalate plasticizers, offering an alternative to vinyl with many of the same performance characteristics. TPO&rsquo;s are mold, mildew, and stain resistant, and have excellent tensile strength and scrubability. Printed with water-based inks, this material surpasses the low-emitting standards set by Cal 03150, and contains 20% post-consumer content. Our TPO wallcoverings are suitable for high traffic areas, halogen-free, Class A rated for fire safety, and recyclable through the WG Reclamation Program.";
    
    material_column[0][2][0]="Non Woven"; 
    material_column[0][2][1]="1";
    material_column[0][2][2]="Offering a breadth of unique patterns, our non woven wallcoverings contain natural materials such as cellulose, wood pulp, sisal, and kenaf, along with polyester and acrylic fibers. Many also boast environmental attributes including FSC certification, use of rapidly-renewable resources, post-consumer recycled content, and HAP-free (hazardous air pollutant-free) inks. Our non wovens are suitable for medium traffic areas, Class A rated for fire safety, low-emitting, and recyclable through the WG Reclamation Program.";
    
    material_column[0][3][0]="Textile"; 
    material_column[0][3][1]="1";
    material_column[0][3][2]="Crafted with high performance polyester and polyolefin fibers, as well as cotton, linen, and burlap, our textile wallcoverings provide a diverse range of weights, textures, and aesthetics. Many contain varying amounts of pre- and post-consumer recycled content&mdash;up to 100%&mdash;and are finished with GreenShield<span style='font-size:11px;top:-2px;position:relative'>&reg;</span> or Crypton<span style='font-size:11px;top:-2px;position:relative'>&reg;</span> Green, sustainable topcoats that are resistant to moisture, stains, and bacteria. All of our textile wallcoverings are Class A rated for fire safety and recyclable through the WG Reclamation Program&mdash;and many are made in the USA.";

    material_column[0][4][0]="Dry Erase/Projection"; 
    material_column[0][4][1]="1";
    material_column[0][4][2]="Our Multi Media collection is an innovative line of dry erase wallcoverings, dual-purpose writing/projection substrates, and a peel & stick material designed for resurfacing chalkboards or marker boards. The dry erase products are made from high quality, low-emitting polyester or vinyl, and are highly resistant to ink, stains, and solvents. Available in a variety of finishes, thicknesses, widths, and price points, we also offer six decorator colors and options printed with light grid lines or guide lines. All of our dry erase and projection materials are Class A rated for fire safety, low-emitting, and recyclable through the WG Reclamation Program, and most are made in the USA.";

    material_column[0][5][0]="Acoustical"; 
    material_column[0][5][1]="1";
    material_column[0][5][2]="Our high quality, easy to clean, acoustical wallcoverings are made with Eco-fi&trade;, a polyester fiber created from 100% post-consumer recycled plastic bottles. Produced with no VOC&rsquo;s (volatile organic compounds), plasticizers, or heavy metals, our three acousticals are PVC and chlorine-free, and 100% recyclable through the WG Reclamation Program. This non woven wall carpeting comes in three different textures and over 60 fade-resistant colorways, all of which are Class A rated for fire safety, lightweight, non-allergenic, and mold and mildew resistant.";

    // material_column[0][6][0]="Paint";
    // material_column[0][6][1]="0";
    
    

    material_column[0][6][0]="Paint"; 
    material_column[0][6][1]="0";
    material_column[0][6][2]="Easy to apply and easy to maintain, our Scuffmaster paints offer high performance and visual impact, while complying with all environmental standards. The seven finishes including eggshell, pearl, metallic, and textural patterns, can be brushed, rolled, or sprayed. Whether choosing from our color collections or creating a custom color, the water-based, polyurethane interior paints deliver beauty and industry-best durability. With low-VOC (volatile organic compound) formulas, and a Class A rating for fire safety, Scuffmaster paints are a sustainable product that can contribute to LEED credits. ";
    

    material_column[1][0][0]="Grass Cloth"; 
    material_column[1][0][1]="1";
    material_column[1][0][2]="We have a bountiful selection of grass cloth wallcoverings, woven from natural materials like sisal, jute, bamboo, and river grass, yet Class A rated for fire safety. In addition to colors inspired by the earth, sea, sky, and sun, you&rsquo;ll find weaves varying from fine neutral threads, to thick splinters of bamboo, to shimmering foil strands and grounds. Our grass cloths are suitable for medium traffic areas and recyclable through the WG Reclamation Program.";
    
    material_column[1][1][0]="Silk"; 
    material_column[1][1][1]="1";
    material_column[1][1][2]="Our luxurious silk wallcoverings are almost exclusively made from 100% rapidly-renewable silk fibers that produce the characteristic tonal variations. Patterns range from refined weaves to ribbed raw silks, in an array of colors including soft pastels, rich, earthy tones and deep, vibrant shades. The homespun, hand-dyed appearance will create a pleasing paneled effect when installed in medium traffic areas. Our silk wallcoverings are Class A rated for fire safety, low-emitting, and recyclable through the WG Reclamation Program.";
    
    material_column[1][2][0]="Suede"; 
    material_column[1][2][1]="1";
    material_column[1][2][2]="Available in close to 200 colorways, our faux suedes are composed of polyester and polyurethane polymers&mdash;many from pre- and post-consumer recycled content. Most have been engineered to comply with, and exceed, industry standards for fabric strength, abrasion, tear resistance, and color-fastness. Our suede wallcoverings are suitable for medium traffic areas, Class A rated for fire safety, low-emitting, and recyclable through the WG Reclamation Program.";
    
    material_column[1][3][0]="Wood"; 
    material_column[1][3][1]="1";
    material_column[1][3][2]="Our two lines of real wood products offer a range of over 50 grain styles, composed of veneers made from 100% rapidly-renewable trees. Our \"Wood\" wallcovering is sliced from 38 species of trees, while \"WonderWood\" is a reconstituted wood product manufactured using a unique cutting and dyeing process that results in look-alikes of exotic species. Our wood wallcoverings are suitable for medium traffic areas, Class A rated for fire safety, low-emitting, and recyclable through the WG Reclamation Program.";

    material_column[1][4][0]="Cork"; 
    material_column[1][4][1]="1";
    material_column[1][4][2]="Offered in 12 colors and backed with burlap for stability, our natural cork products are made from rapidly-renewable materials, recyclable through the WG Reclamation Program. Self-healing and washable Bulletin Board Corks are constructed from a heavy-density, insulating cork composite that includes pigments which extend through the thickness of the material. Our natural-colored cork is unbacked and stocked in 1/8\" and 1/4\" thicknesses. Also available are 100% natural cork wallcoverings in four different textural compositions.";
    
    material_column[1][5][0]="Patent & Mylar";
    material_column[1][5][1]="1";
    material_column[1][5][2]="These unique, high-gloss wallcoverings are made with 100% vinyl, providing durability and versatility. High Society mimics the look of patent leather and is offered in a wide selection of vivid colors, golds, and silvers, in smooth, pearl, and metallic finishes. Mirror Mylar&rsquo;s highly reflective surface is available in metal colors, in smooth and brushed finishes. Both wallcoverings are Class A rated for fire safety, recyclable through the WG Reclamation Program, and manufactured in the USA.";

    material_column[1][6][0]="Value Products";
    material_column[1][6][1]="1";
    material_column[1][6][2]="An extensive selection of wallcoverings including Type I and Type II Vinyls, Non Wovens, Textiles, and Suedes, specially priced under $10 per yard with QuickShip availability. The generous assortment of faux finishes, subtle patterns, and popular textures provides an excellent alternative for budget-conscious customers not willing to sacrifice good design. All products are low-emitting, Class A rated for fire safety, and covered by a 5-year manufacturer&rsquo;s warranty. <br/>Note: Some of the designs are offered with limited inventory.";

//Please login to view brands available in your area

var footer_logout='<p id="logDisp"><sup style="vertical-align:text-top;">*</sup>Please <a href="#" onclick="close_all_filters();dhtmlModalWindow(\'/product_library/login\', \'Login\', \'350\', \'375\')" title="log in"><strong>log in</strong></a> to view all products available in your area</p>';
var footer_login='<p id="logDisp"><sup style="vertical-align:text-top;">*</sup>Not available in your area.</p>';  


/* for pattern filter menu */
var pattern_title='Select one or multiple items';
var pattern_heading=new Array(1);
    pattern_heading[0]="";
    
var pattern_column=new Array(1);
    pattern_column[0]=new Array(7);

for(i=0;i<pattern_column[0].length;i++)
        pattern_column[0][i]=new Array(1);
        
    pattern_column[0][0][0]="Botanicals/Florals";
    pattern_column[0][0][1]="1";
    
    pattern_column[0][1][0]="Damasks";
    pattern_column[0][1][1]="1";

    pattern_column[0][2][0]="Faux Effects";
    pattern_column[0][2][1]="1";

    pattern_column[0][3][0]="Geometrics";
    pattern_column[0][3][1]="1";

    pattern_column[0][4][0]="Solids";
    pattern_column[0][4][1]="1";

    pattern_column[0][5][0]="Stripes and Verticals";
    pattern_column[0][5][1]="1";

    pattern_column[0][6][0]="Woven";
    pattern_column[0][6][1]="1";

var pattern_footer='';


/* for surface texture filter menu */ 
var texture_title='Select one or multiple items';
var texture_heading=new Array(1);
    texture_heading[0]="Surface Texture";
    
var texture_column=new Array(1);
    texture_column[0]=new Array(3);

for(i=0;i<texture_column[0].length;i++)
        texture_column[0][i]=new Array(1);
    texture_column[0][0][0]="Smooth";
    texture_column[0][0][1]="1";
    
    texture_column[0][1][0]="Light Texture";
    texture_column[0][1][1]="1";

    texture_column[0][2][0]="Heavy Texture";
    texture_column[0][2][1]="1";

var texture_footer='';


/* for scale filter menu */
var scale_title='Select one or multiple items';
var scale_heading=new Array(1);
    scale_heading[0]="Scale";
    
var scale_column=new Array(1);
    scale_column[0]=new Array(2);
for(i=0;i<scale_column[0].length;i++)
        scale_column[0][i]=new Array(1);
    scale_column[0][0][0]="Small-scale";
    scale_column[0][0][1]="1";
    
    scale_column[0][1][0]="Large-scale";
    scale_column[0][1][1]="1";
    
var scale_footer='';


/* for sustain filter menu */
var sustain_title='Select one or multiple items';
var sustain_heading=new Array(1);
    //sustain_heading[0]="SUSTAINABILITY";
    sustain_heading[0]="";
    
var sustain_column=new Array(1);
    sustain_column[0]=new Array(4);
for(i=0;i<sustain_column[0].length;i++)
        sustain_column[0][i]=new Array(1);
    sustain_column[0][0][0]="Low-emitting";
    sustain_column[0][0][1]="1";
    
    sustain_column[0][1][0]="Recycled Content";
    sustain_column[0][1][1]="1";
    
    sustain_column[0][2][0]="Rapidly-Renewable";
    sustain_column[0][2][1]="1";
    
    sustain_column[0][3][0]="Anti-Microbial/Anti-Bacterial";
    sustain_column[0][3][1]="1";
    
var sustain_footer='';



/* for color filter menu */
var color_title='Select one or multiple colors';
var color_heading=new Array(2);

    color_heading[0]="";
    color_heading[1]="";

var color_footer='';  
    
var color_column=new Array(2);
    color_column[0]=new Array(11);
    color_column[1]=new Array(7);
for(i=0;i<color_column[0].length;i++)
        color_column[0][i]=new Array(1);
    for(i=0;i<color_column[1].length;i++)
        color_column[1][i]=new Array(1);
            
    color_column[0][0][0]="Beige";    //    Color 
    color_column[0][0][1]="1";        //    ON State
    color_column[0][0][2]="0";        //     Color Category 0=> color, 1=> color_group
    
    color_column[0][1][0]="Black";
    color_column[0][1][1]="1";
    color_column[0][1][2]="0";

    color_column[0][2][0]="Blue";
    color_column[0][2][1]="1";
    color_column[0][2][2]="0";

    color_column[0][3][0]="Brown";
    color_column[0][3][1]="1";
    color_column[0][3][2]="0";

    color_column[0][4][0]="Green";
    color_column[0][4][1]="1";
    color_column[0][4][2]="0";

    color_column[0][5][0]="Orange";
    color_column[0][5][1]="1";
    color_column[0][5][2]="0";

    color_column[0][6][0]="Purple";
    color_column[0][6][1]="1";
    color_column[0][6][2]="0";
    
    color_column[0][7][0]="Red";
    color_column[0][7][1]="1";
    color_column[0][7][2]="0";

    color_column[0][8][0]="Silver/Gray";
    color_column[0][8][1]="1";
    color_column[0][8][2]="0";
    
    color_column[0][9][0]="White";
    color_column[0][9][1]="1";
    color_column[0][9][2]="0";

    //color_column[0][10][0]="Grey";
	color_column[0][10][0]="Yellow";
    color_column[0][10][1]="1";
    color_column[0][10][2]="0";
    


    color_column[1][0][0]="Cool";
    color_column[1][0][1]="1";
    color_column[1][0][2]="1";
    
    color_column[1][1][0]="Neutral";
    color_column[1][1][1]="1";
    color_column[1][1][2]="1";

    color_column[1][2][0]="Warm";
    color_column[1][2][1]="1";
    color_column[1][2][2]="1";

    color_column[1][3][0]="Soft-Light";
    color_column[1][3][1]="1";
    color_column[1][3][2]="1";

    color_column[1][4][0]="Vibrant";
    color_column[1][4][1]="1";
    color_column[1][4][2]="1";

    color_column[1][5][0]="Dark";
    color_column[1][5][1]="1";
    color_column[1][5][2]="1";

	color_column[1][6][0]="Metallic";
    color_column[1][6][1]="1";
    color_column[1][6][2]="1";
    

/* for environmental attributes filter menu */
var wallcovering_sustain_title='Select one or multiple items';
var wallcovering_sustain_heading=new Array(1);
    wallcovering_sustain_heading[0]="";
var wallcovering_sustain_column_count=1;
var wallcovering_sustain_column_width=247;    
var wallcovering_sustain_column=new Array(1);
    wallcovering_sustain_column[0]=new Array(4);
    
    for(i=0;i<wallcovering_sustain_column[0].length;i++)
        wallcovering_sustain_column[0][i]=new Array(3);
    
    wallcovering_sustain_column[0][0][0]="Anti-Microbial/Anti-Bacterial"; 
    wallcovering_sustain_column[0][0][1]="1";
    wallcovering_sustain_column[0][0][2]=""; 
    
    wallcovering_sustain_column[0][1][0]="Low-emitting"; 
    wallcovering_sustain_column[0][1][1]="1";
    wallcovering_sustain_column[0][1][2]="";
    
    wallcovering_sustain_column[0][2][0]="Rapidly-Renewable"; 
    wallcovering_sustain_column[0][2][1]="1";
    wallcovering_sustain_column[0][2][2]="";
    
    wallcovering_sustain_column[0][3][0]="Recycled Content"; 
    wallcovering_sustain_column[0][3][1]="1";
    wallcovering_sustain_column[0][3][2]=""; 

    
    
var wallcovering_value_sustain_title='Select one or multiple items';
var wallcovering_value_sustain_heading=new Array(1);
    wallcovering_value_sustain_heading[0]="";
var wallcovering_value_sustain_column_count=1;
var wallcovering_value_sustain_column_width=247;    
var wallcovering_value_sustain_column=new Array(1);
    wallcovering_value_sustain_column[0]=new Array(4);
    
    for(i=0;i<wallcovering_value_sustain_column[0].length;i++)
        wallcovering_value_sustain_column[0][i]=new Array(3);
    
    wallcovering_value_sustain_column[0][0][0]="Anti-Microbial/Anti-Bacterial"; 
    wallcovering_value_sustain_column[0][0][1]="1";
    wallcovering_value_sustain_column[0][0][2]=""; 
    
    wallcovering_value_sustain_column[0][1][0]="Low-emitting"; 
    wallcovering_value_sustain_column[0][1][1]="1";
    wallcovering_value_sustain_column[0][1][2]="";
    
    wallcovering_value_sustain_column[0][2][0]="Rapidly-renewable"; 
    wallcovering_value_sustain_column[0][2][1]="1";
    wallcovering_value_sustain_column[0][2][2]="";
    
    wallcovering_value_sustain_column[0][3][0]="Recycled content"; 
    wallcovering_value_sustain_column[0][3][1]="1";
    wallcovering_value_sustain_column[0][3][2]="";
 
    
 
var upholstery_sustain_title='Select one or multiple items';
var upholstery_sustain_heading=new Array(1);
    upholstery_sustain_heading[0]="";
var upholstery_sustain_column_count=1;
var upholstery_sustain_column_width=247;    
var upholstery_sustain_column=new Array(1);
    upholstery_sustain_column[0]=new Array(4);
    
    for(i=0;i<upholstery_sustain_column[0].length;i++)
        upholstery_sustain_column[0][i]=new Array(3);
    
    upholstery_sustain_column[0][0][0]="Anti-microbial/Anti-bacterial"; 
    upholstery_sustain_column[0][0][1]="1";
    upholstery_sustain_column[0][0][2]=""; 
    
    upholstery_sustain_column[0][1][0]="ISO 14001 certified"; 
    upholstery_sustain_column[0][1][1]="1";
    upholstery_sustain_column[0][1][2]="";
    
    upholstery_sustain_column[0][2][0]="Made in the USA"; 
    upholstery_sustain_column[0][2][1]="1";
    upholstery_sustain_column[0][2][2]="";
    
    upholstery_sustain_column[0][3][0]="Oeko-Tex Standard 100 certified"; 
    upholstery_sustain_column[0][3][1]="1";
    upholstery_sustain_column[0][3][2]="";
 
    
 
 var drapery_sustain_title='Select one or multiple items';
var drapery_sustain_heading=new Array(1);
    drapery_sustain_heading[0]="";
var drapery_sustain_column_count=1;
var drapery_sustain_column_width=247;    
var drapery_sustain_column=new Array(1);
    drapery_sustain_column[0]=new Array(3);
    
    for(i=0;i<drapery_sustain_column[0].length;i++)
        drapery_sustain_column[0][i]=new Array(3);
    
    drapery_sustain_column[0][0][0]="Anti-microbial/Anti-bacterial"; 
    drapery_sustain_column[0][0][1]="1";
    drapery_sustain_column[0][0][2]=""; 
    
    drapery_sustain_column[0][1][0]="ISO 14001 certified"; 
    drapery_sustain_column[0][1][1]="1";
    drapery_sustain_column[0][1][2]="";
    
    drapery_sustain_column[0][2][0]="Oeko-Tex Standard 100 certified"; 
    drapery_sustain_column[0][2][1]="1";
    drapery_sustain_column[0][2][2]="";

    
    
var paint_sustain_title='Select one or multiple items';
var paint_sustain_heading=new Array(1);
    paint_sustain_heading[0]="";
var paint_sustain_column_count=1;
var paint_sustain_column_width=247;    
var paint_sustain_column=new Array(1);
    paint_sustain_column[0]=new Array(2);
    
    for(i=0;i<paint_sustain_column[0].length;i++)
        paint_sustain_column[0][i]=new Array(3);
    
    paint_sustain_column[0][0][0]="Low-emitting"; 
    paint_sustain_column[0][0][1]="1";
    paint_sustain_column[0][0][2]=""; 
    
    paint_sustain_column[0][1][0]="Made in the USA"; 
    paint_sustain_column[0][1][1]="1";
    paint_sustain_column[0][1][2]="";              
 
var sustain_footer='';


/* for performance filter menu */ 
var upholstery_perform_title='Select one or multiple items';
var upholstery_perform_heading=new Array(1);
    upholstery_perform_heading[0]="";
var upholstery_perform_column_count=1;
var upholstery_perform_column_width=247;    
var upholstery_perform_column=new Array(1);
    upholstery_perform_column[0]=new Array(2);
    
    for(i=0;i<upholstery_perform_column[0].length;i++)
        upholstery_perform_column[0][i]=new Array(3);
    
    upholstery_perform_column[0][0][0]="General Contract (<30,000 double rubs)"; 
    upholstery_perform_column[0][0][1]="1";
    upholstery_perform_column[0][0][2]=""; 
    
    upholstery_perform_column[0][1][0]="Heavy-duty (>30,000 double rubs)"; 
    upholstery_perform_column[0][1][1]="1";
    upholstery_perform_column[0][1][2]="";
 
 var perform_footer='';
        
        
/* for collection filter menu */  
var wallcovering_collect_title='Select one or multiple item';
var wallcovering_collect_heading=new Array(5);
    wallcovering_collect_heading[0]="Collection";
    wallcovering_collect_heading[1]="&nbsp;";
    wallcovering_collect_heading[2]="Designers"; 
    wallcovering_collect_heading[3]="Brands";

var wallcovering_collect_column_count=2;
var wallcovering_collect_column_width=472;
var wallcovering_collect_column=new Array(5);
    wallcovering_collect_column[0]=new Array(13);
    wallcovering_collect_column[1]=new Array(13);
    
    wallcovering_collect_column[2]=new Array(6);
    wallcovering_collect_column[3]=new Array(6);

   
for(i=0;i<wallcovering_collect_column[0].length;i++)
        wallcovering_collect_column[0][i]=new Array(3);
        
for(i=0;i<wallcovering_collect_column[1].length;i++)
        wallcovering_collect_column[1][i]=new Array(3); 
   
for(i=0;i<wallcovering_collect_column[2].length;i++)
    wallcovering_collect_column[2][i]=new Array(3); 

for(i=0;i<wallcovering_collect_column[3].length;i++)
    wallcovering_collect_column[3][i]=new Array(3);   

          
    /* 1st column */
    wallcovering_collect_column[0][0][0]="Acoustical Wall";    //    Design Name
    wallcovering_collect_column[0][0][1]="1";                //    ON State (1=ON, 0=OFF)
    wallcovering_collect_column[0][0][2]=16;                    //    CMS Content ID

    wallcovering_collect_column[0][1][0]="Digital Nature";
    wallcovering_collect_column[0][1][1]="1";
    wallcovering_collect_column[0][1][2]=17;

    wallcovering_collect_column[0][2][0]="Etchings";
    wallcovering_collect_column[0][2][1]="1";
    wallcovering_collect_column[0][2][2]=25;

    wallcovering_collect_column[0][3][0]="Esquire";
    wallcovering_collect_column[0][3][1]="1";
    wallcovering_collect_column[0][3][2]=18;

    wallcovering_collect_column[0][4][0]="Essentials";
    wallcovering_collect_column[0][4][1]="1";
    wallcovering_collect_column[0][4][2]=18;

    wallcovering_collect_column[0][5][0]="Europa";
    wallcovering_collect_column[0][5][1]="1";
    wallcovering_collect_column[0][5][2]=19;

    wallcovering_collect_column[0][6][0]="Geo Graphic";
    wallcovering_collect_column[0][6][1]="1";
    wallcovering_collect_column[0][6][2]=20;
    
    wallcovering_collect_column[0][7][0]="Haven Binder";
    wallcovering_collect_column[0][7][1]="1";
    wallcovering_collect_column[0][7][2]=36;

    wallcovering_collect_column[0][8][0]="Infinity";
    wallcovering_collect_column[0][8][1]="1";
    wallcovering_collect_column[0][8][2]=22;
    
    wallcovering_collect_column[0][9][0]="Inscriptions";
    wallcovering_collect_column[0][9][1]="1";
    wallcovering_collect_column[0][9][2]=23;

    wallcovering_collect_column[0][10][0]="Linework";
    wallcovering_collect_column[0][10][1]="1";
    wallcovering_collect_column[0][10][2]=27;

    wallcovering_collect_column[0][11][0]="London Chic";
    wallcovering_collect_column[0][11][1]="1";
    wallcovering_collect_column[0][11][2]=28;
    
    wallcovering_collect_column[0][12][0]="Multi Media";
    wallcovering_collect_column[0][12][1]="1";
    wallcovering_collect_column[0][12][2]=35;
    
    // 2nd Column
    
    wallcovering_collect_column[1][0][0]="Permawall";
    wallcovering_collect_column[1][0][1]="1";
    wallcovering_collect_column[1][0][2]=29;
    
    wallcovering_collect_column[1][1][0]="Premier";
    wallcovering_collect_column[1][1][1]="1";
    wallcovering_collect_column[1][1][2]=30;
    
    wallcovering_collect_column[1][2][0]="Refractions";
    wallcovering_collect_column[1][2][1]="1";
    wallcovering_collect_column[1][2][2]=21;

    wallcovering_collect_column[1][3][0]="Suite";
    wallcovering_collect_column[1][3][1]="1";
    wallcovering_collect_column[1][3][2]=32;
    
    wallcovering_collect_column[1][4][0]="Summit";
    wallcovering_collect_column[1][4][1]="1";
    wallcovering_collect_column[1][4][2]=34;

    wallcovering_collect_column[1][5][0]="Textural Embosses 03";
    wallcovering_collect_column[1][5][1]="1";
    wallcovering_collect_column[1][5][2]=38;

    wallcovering_collect_column[1][6][0]="Touchstone";
    wallcovering_collect_column[1][6][1]="1";
    wallcovering_collect_column[1][6][2]=24;

    wallcovering_collect_column[1][7][0]="Vescom 01/02";
    wallcovering_collect_column[1][7][1]="1";
    wallcovering_collect_column[1][7][2]=40;

    wallcovering_collect_column[1][8][0]="Vescom Non Woven";
    wallcovering_collect_column[1][8][1]="1";
    wallcovering_collect_column[1][8][2]=41;
   
    wallcovering_collect_column[1][9][0]="Vescom Textile 04";
    wallcovering_collect_column[1][9][1]="1";
    wallcovering_collect_column[1][9][2]=41;
    
    wallcovering_collect_column[1][10][0]="Visions";
    wallcovering_collect_column[1][10][1]="1";
    wallcovering_collect_column[1][10][2]=42;
    
    wallcovering_collect_column[1][11][0]="Wood Paper Grass";
    wallcovering_collect_column[1][11][1]="1";
    wallcovering_collect_column[1][11][2]=39;
    
    wallcovering_collect_column[1][12][0]="Organics";
    wallcovering_collect_column[1][12][1]="1";
    wallcovering_collect_column[1][12][2]=28;
    
/********************************* Designer *******************/    
    
    wallcovering_collect_column[2][0][0]="Gensler";
    wallcovering_collect_column[2][0][1]="1";
    wallcovering_collect_column[2][0][2]=8;
    
    wallcovering_collect_column[2][1][0]="Karim Rashid";
    wallcovering_collect_column[2][1][1]="1";
    wallcovering_collect_column[2][1][2]=9;

    wallcovering_collect_column[2][2][0]="Laurinda Spear";
    wallcovering_collect_column[2][2][1]="1";
    wallcovering_collect_column[2][2][2]=10;
    
    wallcovering_collect_column[2][3][0]="Museum of New Mexico";
    wallcovering_collect_column[2][3][1]="1";
    wallcovering_collect_column[2][3][2]=11;
    
    wallcovering_collect_column[2][4][0]="Patty Madden";
    wallcovering_collect_column[2][4][1]="1";
    wallcovering_collect_column[2][4][2]=14;
    
    wallcovering_collect_column[2][5][0]="WG Design Studio";
    wallcovering_collect_column[2][5][1]="1";
    wallcovering_collect_column[2][5][2]=15;

 /********************************* Brands *******************/       
    wallcovering_collect_column[3][0][0]="Haven";
    wallcovering_collect_column[3][0][1]="1";
    wallcovering_collect_column[3][0][2]=3;
    
    wallcovering_collect_column[3][1][0]="Scuffmaster";
    wallcovering_collect_column[3][1][1]="0";
    wallcovering_collect_column[3][1][2]=26;
    
    wallcovering_collect_column[3][2][0]="Symphony";
    wallcovering_collect_column[3][2][1]="0";
    wallcovering_collect_column[3][2][2]=4;
    
    wallcovering_collect_column[3][3][0]="Vescom";
    wallcovering_collect_column[3][3][1]="1";
    wallcovering_collect_column[3][3][2]=5;
    
    wallcovering_collect_column[3][4][0]="Vycon";
    wallcovering_collect_column[3][4][1]="0";
    wallcovering_collect_column[3][4][2]=6;
    
    wallcovering_collect_column[3][5][0]="Wolf-Gordon";
    wallcovering_collect_column[3][5][1]="1";
    wallcovering_collect_column[3][5][2]=45;                   
          
var wallcovering_collect_footer='';


var upholstery_collect_column=new Array(5);
    upholstery_collect_column[0]=new Array(1);
    upholstery_collect_column[1]=new Array(1);
    
    upholstery_collect_column[2]=new Array(1);
    upholstery_collect_column[3]=new Array(1);

var upholstery_collect_column_count=1;
var upholstery_collect_column_width=247;   
for(i=0;i<upholstery_collect_column[0].length;i++)
        upholstery_collect_column[0][i]=new Array(1);
        
for(i=0;i<upholstery_collect_column[1].length;i++)
        upholstery_collect_column[1][i]=new Array(1); 
   
for(i=0;i<upholstery_collect_column[2].length;i++)
    upholstery_collect_column[2][i]=new Array(1); 

for(i=0;i<upholstery_collect_column[3].length;i++)
    upholstery_collect_column[3][i]=new Array(1);   
    
    upholstery_collect_column[0][0][0]="Fabrics by Vescom";    
    upholstery_collect_column[0][0][1]="1";                
    upholstery_collect_column[0][0][2]=4;                 
    
    upholstery_collect_column[3][0][0]="Vescom";    
    upholstery_collect_column[3][0][1]="1";                
    upholstery_collect_column[3][0][2]=4;                 
    
var upholstery_collect_footer='';     


var drapery_collect_column=new Array(5);
    drapery_collect_column[0]=new Array(1);
    drapery_collect_column[1]=new Array(1);
    
    drapery_collect_column[2]=new Array(1);
    drapery_collect_column[3]=new Array(1);

var drapery_collect_column_count=1;
var drapery_collect_column_width=247;   
for(i=0;i<drapery_collect_column[0].length;i++)
        drapery_collect_column[0][i]=new Array(1);
        
for(i=0;i<drapery_collect_column[1].length;i++)
        drapery_collect_column[1][i]=new Array(1); 
   
for(i=0;i<drapery_collect_column[2].length;i++)
    drapery_collect_column[2][i]=new Array(1); 

for(i=0;i<drapery_collect_column[3].length;i++)
    drapery_collect_column[3][i]=new Array(1);   
    
    drapery_collect_column[0][0][0]="Fabrics by Vescom";    
    drapery_collect_column[0][0][1]="1";                
    drapery_collect_column[0][0][2]=4;                 

    drapery_collect_column[3][0][0]="Vescom";    
    drapery_collect_column[3][0][1]="1";         
    drapery_collect_column[3][0][2]=4; 
    
var drapery_collect_footer='';        


 var paint_collect_column=new Array(5);
    paint_collect_column[0]=new Array(1);
    paint_collect_column[1]=new Array(1);
    
    paint_collect_column[2]=new Array(1);
    paint_collect_column[3]=new Array(1);
    
 var paint_collect_column_count=1;
var paint_collect_column_width=247;   
for(i=0;i<paint_collect_column[0].length;i++)
        paint_collect_column[0][i]=new Array(1);
        
for(i=0;i<paint_collect_column[1].length;i++)
        paint_collect_column[1][i]=new Array(1); 
   
for(i=0;i<paint_collect_column[2].length;i++)
    paint_collect_column[2][i]=new Array(1); 

for(i=0;i<paint_collect_column[3].length;i++)
    paint_collect_column[3][i]=new Array(1);   
    
    /*paint_collect_column[0][0][0]="Scuffmaster";    
    paint_collect_column[0][0][1]="0";                
    paint_collect_column[0][0][2]=45;                 
    
    paint_collect_column[3][0][0]="Scuffmaster";    
    paint_collect_column[3][0][1]="0";                
    paint_collect_column[3][0][2]=45;*/
    
    paint_collect_column[0][0][0]="Scuffmaster";    
    paint_collect_column[0][0][1]="0";                
    paint_collect_column[0][0][2]=45;                 
    
    paint_collect_column[3][0][0]="Scuffmaster";    
    paint_collect_column[3][0][1]="0";                
    paint_collect_column[3][0][2]=45;                 
    
var paint_collect_footer=''; 



var collect_title='Select one or multiple item';
var collect_heading=new Array(5);
    collect_heading[0]="Collection";
    collect_heading[1]="&nbsp;";
    collect_heading[2]="Designers"; 
    collect_heading[3]="Brands";
    
var collect_column=new Array(5);
    collect_column[0]=new Array(13);
    collect_column[1]=new Array(13);
    
    collect_column[2]=new Array(6);
    collect_column[3]=new Array(6);

   
for(i=0;i<collect_column[0].length;i++)
        collect_column[0][i]=new Array(3);
        
for(i=0;i<collect_column[1].length;i++)
        collect_column[1][i]=new Array(3); 
   
for(i=0;i<collect_column[2].length;i++)
    collect_column[2][i]=new Array(3); 

for(i=0;i<collect_column[3].length;i++)
    collect_column[3][i]=new Array(3);   

          
    /* 1st column */
    collect_column[0][0][0]="Acoustical Wall";    //    Design Name
    collect_column[0][0][1]="1";                //    ON State (1=ON, 0=OFF)
    collect_column[0][0][2]=16;                    //    CMS Content ID

    collect_column[0][1][0]="Digital Nature";
    collect_column[0][1][1]="1";
    collect_column[0][1][2]=17;

    collect_column[0][2][0]="Etchings";
    collect_column[0][2][1]="1";
    collect_column[0][2][2]=25;

    collect_column[0][3][0]="Esquire";
    collect_column[0][3][1]="1";
    collect_column[0][3][2]=18;

    collect_column[0][4][0]="Essentials";
    collect_column[0][4][1]="1";
    collect_column[0][4][2]=18;

    collect_column[0][5][0]="Europa";
    collect_column[0][5][1]="1";
    collect_column[0][5][2]=19;

    collect_column[0][6][0]="Geo Graphic";
    collect_column[0][6][1]="1";
    collect_column[0][6][2]=20;
    
    collect_column[0][7][0]="Haven Binder";
    collect_column[0][7][1]="1";
    collect_column[0][7][2]=36;

    collect_column[0][8][0]="Infinity";
    collect_column[0][8][1]="1";
    collect_column[0][8][2]=22;
    
    collect_column[0][9][0]="Inscriptions";
    collect_column[0][9][1]="1";
    collect_column[0][9][2]=23;

    collect_column[0][10][0]="Linework";
    collect_column[0][10][1]="1";
    collect_column[0][10][2]=27;

	collect_column[0][11][0]="London Chic";
    collect_column[0][11][1]="1";
    collect_column[0][11][2]=28;
	
    collect_column[0][12][0]="Multi Media";
    collect_column[0][12][1]="1";
    collect_column[0][12][2]=35;
	
    // 2nd Column

    collect_column[1][0][0]="Permawall";
    collect_column[1][0][1]="1";
    collect_column[1][0][2]=29;
    
    collect_column[1][1][0]="Premier";
    collect_column[1][1][1]="1";
    collect_column[1][1][2]=30;
    
    collect_column[1][2][0]="Refractions";
    collect_column[1][2][1]="1";
    collect_column[1][2][2]=21;

    collect_column[1][3][0]="Suite";
    collect_column[1][3][1]="1";
    collect_column[1][3][2]=32;
    
    collect_column[1][4][0]="Summit";
    collect_column[1][4][1]="1";
    collect_column[1][4][2]=34;

    collect_column[1][5][0]="Textural Embosses 03";
    collect_column[1][5][1]="1";
    collect_column[1][5][2]=38;

    collect_column[1][6][0]="Touchstone";
    collect_column[1][6][1]="1";
    collect_column[1][6][2]=24;

    collect_column[1][7][0]="Vescom 01/02";
    collect_column[1][7][1]="1";
    collect_column[1][7][2]=40;

    collect_column[1][8][0]="Vescom Non Woven";
    collect_column[1][8][1]="1";
    collect_column[1][8][2]=41;

   
    collect_column[1][9][0]="Vescom Textile 04";
    collect_column[1][9][1]="1";
    collect_column[1][9][2]=41;
    
    collect_column[1][10][0]="Visions";
    collect_column[1][10][1]="1";
    collect_column[1][10][2]=42;
    
    
    collect_column[1][11][0]="Wood Paper Grass";
    collect_column[1][11][1]="1";
    collect_column[1][11][2]=39;
    
	collect_column[1][12][0]="Organics";
    collect_column[1][12][1]="1";
    collect_column[1][12][2]=28;
	
/********************************* Designer *******************/    
    
    collect_column[2][0][0]="WG Design Studio";
    collect_column[2][0][1]="1";
    collect_column[2][0][2]=8;
    
    collect_column[2][1][0]="Patty Madden";
    collect_column[2][1][1]="1";
    collect_column[2][1][2]=9;

    collect_column[2][2][0]="Karim Rashid";
    collect_column[2][2][1]="1";
    collect_column[2][2][2]=10;
    
    collect_column[2][3][0]="Laurinda Spear";
    collect_column[2][3][1]="1";
    collect_column[2][3][2]=11;
    
    collect_column[2][4][0]="Gensler";
    collect_column[2][4][1]="1";
    collect_column[2][4][2]=14;
    
    collect_column[2][5][0]="Museum of New Mexico";
    collect_column[2][5][1]="1";
    collect_column[2][5][2]=15;

 /********************************* Brands *******************/       
    collect_column[3][0][0]="Wolf-Gordon";
    collect_column[3][0][1]="1";
    collect_column[3][0][2]=3;
    
    collect_column[3][1][0]="Haven";
    collect_column[3][1][1]="1";
    collect_column[3][1][2]=26;
    
    collect_column[3][2][0]="Vescom";
    collect_column[3][2][1]="1";
    collect_column[3][2][2]=4;
    
    collect_column[3][3][0]="Vycon";
    collect_column[3][3][1]="0";
    collect_column[3][3][2]=5;
    
    collect_column[3][4][0]="Symphony";
    collect_column[3][4][1]="0";
    collect_column[3][4][2]=6;
    
    collect_column[3][5][0]="Scuffmaster";
    collect_column[3][5][1]="0";
    collect_column[3][5][2]=45;                   
          
var collect_footer='';



  function get_collection_text(id)
{
        for(i=0;i<collect_column.length;i++)
        {
            for(j=0;j<collect_column[i].length;j++)
            {
                if( collect_column[i][j][2]==id)
                {
                    str=collect_column[i][j][0]+"|"+i;
                    return (str);
                }
            }
        }
}


/********************** Model Window variable ***********************/

/* Product Library Script file */

function resize_product_preview_ajax(window_height,colorname)
{
       /* parent.popupwin_pre.setSize(605,window_height); 
        var ver=navigator.appVersion;
        var keyText='; MSIE ';
        var version=parseFloat(ver.substr(ver.indexOf(keyText)+keyText.length,3));
        if(navigator.appName=='Microsoft Internet Explorer' && version<=6.0)
          parent.popupwin_pre.setSize(605,window_height+50); 
        if(navigator.appName=='Microsoft Internet Explorer' && version>6.0)
          parent.popupwin_pre.setSize(605,window_height+50); 
        if(colorname!="") 
            if(navigator.appName=='Microsoft Internet Explorer' && version>6.0)
                parent.popupwin_pre.setSize(605,window_height+67); 
        */
                                      
        parent.popupwin_pre.setSize(595,window_height); 
        var ver=navigator.appVersion;
        var keyText='; MSIE ';
        var version=parseFloat(ver.substr(ver.indexOf(keyText)+keyText.length,3));
        if(navigator.appName=='Microsoft Internet Explorer' && version<=6.0)
          parent.popupwin_pre.setSize(595,window_height+50); 
        if(navigator.appName=='Microsoft Internet Explorer' && version>6.0)
          parent.popupwin_pre.setSize(595,window_height); 
        if(colorname!="") 
            if(navigator.appName=='Microsoft Internet Explorer' && version>6.0)
                parent.popupwin_pre.setSize(595,window_height+67); 
}

function get_combination(search_Input)
{

            var keywords_Array = new Array();
            var total_Keywords_Array = new Array();
            var total_Keywords_Len;
            var loop = 0;
            var word_Len;
            var move_Len;
            var keywords_Str = '';
            total_Keywords_Array = search_Input.split(' ');
            total_Keywords_Len = total_Keywords_Array.length;
            while(loop < total_Keywords_Len){
                word_Len = loop;
                if(word_Len == 0){
                    for(inc=0;inc<total_Keywords_Len;inc++){
                        keywords_Array[keywords_Array.length] = total_Keywords_Array[inc];
                    }
                }
                else if(word_Len == total_Keywords_Len - 1){
                    keywords_Array[keywords_Array.length] = search_Input;
                }
                else{
                    for(inc=0;inc<total_Keywords_Len;inc++){
                        move_Len = inc + word_Len;
                        if(move_Len < total_Keywords_Len){
                            for(cnt=inc;cnt<=move_Len;cnt++){
                                if(cnt < move_Len){
                                    keywords_Str += total_Keywords_Array[cnt]+' ';
                                }
                                else{
                                    keywords_Str += total_Keywords_Array[cnt];
                                }
                            }
                            keywords_Array[keywords_Array.length] =    keywords_Str;
                            keywords_Str = '';
                        }
                    }
                }
                loop++;
            }
     return keywords_Array;
}


function turn_on_filter_for_search(arr,total)
{

      var table,cells,i,j;
      table = document.getElementById("material_product_library_filter"); 
                     cells = table.getElementsByTagName("a"); 
                    for(j=0; j< total;j++){
                        for (i = 0; i < cells.length; i++) { 
                               testvalue=arr[j].toLowerCase();
                               /* Special Case for Accoustical Wall */
                               if((j+1)<total)
                               {
                                    if(testvalue=="acoustical" && arr[j+1].toLowerCase()=="wall")
                                       continue;
                               }
                               
                                testvalue= testvalue.replace("&","&amp;");
                               //search_keyword=(search_keyword.replace(new RegExp( str_repl, "gi" ),""));  
                               //  alert(testvalue);
                                
                            if((cells[i].innerHTML).toLowerCase()==testvalue){
                                cells[i].className="alp";
                                cells[i].style.background="white";
                                cells[i].style.fontWeight = 'Normal';
                                do_filter(cells[i],"material_filter");
                                
                                
                             //    material_filter_to_model +="["+arr[j]+"]";
                            }
                        }
                    }
                    
       table = document.getElementById("pattern_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                        if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white"; 
                            cells[i].style.fontWeight = 'Normal';
                            do_filter(cells[i],"pattern_filter");
                         //   pattern_filter_to_model +="["+arr[j]+"]";
                        }
                    }
                }              
       
         table = document.getElementById("texture_product_library_filter"); 
                cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                        
                       if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                     //   alert("c val"+cells[i].innerHTML);     
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            cells[i].style.fontWeight = 'Normal';
                            do_filter(cells[i],"texture_filter");
                         //   texture_filter_to_model +="["+arr[j]+"]";
                         //   alert("T val "+texture_filter_to_model);     
                            
                        }
                    }
                }
                
         table = document.getElementById("color_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                        if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            cells[i].style.fontWeight = 'Normal';
                            if(i<color_column[0])
                                do_filter(cells[i],"color_filter","0");
                            else
                                do_filter(cells[i],"color_filter","1");
                            
                        }
                    }
                }
                
        /*   table = document.getElementById("color_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for(j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                        if(cells[i].innerHTML==arr[j]){
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            do_filter(cells[i],"color_filter");
                         //   color_grouping_filter_to_model +="["+arr[j]+"]";
                        }
                    }
                }
             */
            table = document.getElementById("scale_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                        if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            cells[i].style.fontWeight = 'Normal';
                            do_filter(cells[i],"scale_filter");
                           // scale_filter_to_model +="["+arr[j]+"]";
                        }
                    }
                }
                
           table = document.getElementById("sustain_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) {     
                        if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white"; 
                            cells[i].style.fontWeight = 'Normal';
                            do_filter(cells[i],"sustain_filter");
                         //  sustain_filter_to_model +="["+arr[j]+"]"; 
                        }
                    }
                }
         
           table = document.getElementById("collect_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                       if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){ 
                       
                           
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            cells[i].style.fontWeight = 'Normal';
                            if(i<collect_column[0].length)
                                do_filter(cells[i],"collect_filter","0");
                            else
                                do_filter(cells[i],"collect_filter","1");
                         
                           
                           
                        }
                    }
                }
                                       
            table = document.getElementById("designer_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                       if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            cells[i].style.fontWeight = 'Normal';
                            if(i<collect_column[2].length)
                                do_filter(cells[i],"designer_filter","2");
                            else
                                do_filter(cells[i],"designer_filter","3");
                         //   collect_filter_to_model +="["+arr[j]+"]";
                        }
                    }
                }    
                                        
         /*    table = document.getElementById("brand_product_library_filter"); 
                 cells = table.getElementsByTagName("a"); 
                for( j=0; j< total;j++){
                    for ( i = 0; i < cells.length; i++) { 
                       if((cells[i].innerHTML).toLowerCase()==arr[j].toLowerCase()){  
                            cells[i].className="alp";
                            cells[i].style.background="white";
                            do_filter(cells[i],"brand_filter",0);
                         //   collect_filter_to_model +="["+arr[j]+"]";
                        }
                    }
                }                
           */     
              
}



        function show_login_popup(url)
        {
            messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(340,340);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();
        
        }

        function show_product_view(url)
        {
            //height=560;
            //width=780;
            height=608;
            width=750;
                title="a";
               _height=parseInt(height)+5;
               
                if(navigator.appName=='Microsoft Internet Explorer'){
                    popupwin_preview = dhtmlmodal.open('product_preview_popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=0, width='+width+'px', '');
               
                }else{
                    popupwin_preview = dhtmlmodal.open('product_preview_popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=0, width='+width+'px', ''); 
               
                }
               
              // popupwin_preview.moveTo("middle",10);  
            openpopupwindow = popupwin_preview;    
        }
        function show_feed_email(url)
        {
                height=360;
                width=580;
                title="a";
               _height=parseInt(height)+15;
                if(navigator.appName=='Microsoft Internet Explorer'){
                    popupwin = dhtmlmodal.open('email_popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=1, scrolling=1, width='+width+'px', '');
                }else{ 
                    popupwin = dhtmlmodal.open('email_popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=1, scrolling=1, width='+width+'px', '');
                }
openpopupwindow = popupwin; 
            //alert(url);
        //    popupwin =dhtmlmodal.open("email_popup", "iframe", url, "  ", "width=580px,height=420px,resize=1,scrolling=1,center=1", "")

                //popupwin = dhtmlmodal.open('email_popup', 'iframe', url,'', 'center=1, height=200, resize=1, scrolling=1, width=200');

            /*messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(540,420);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();*/
        }    
         function show_email(url)
        {
                //height=400;
                //width=580;
                height=506;
                width=596;
                title="a";
                _width=596;
               _height=506;
                if(navigator.appName=='Microsoft Internet Explorer'){
                    popupwin = dhtmlmodal.open('email_popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=1, scrolling=1, width='+(_width)+'px', '');
                }else{ 
                    popupwin = dhtmlmodal.open('email_popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=1, scrolling=1, width='+width+'px', '');
                }
openpopupwindow = popupwin; 
            //alert(url);
        //    popupwin =dhtmlmodal.open("email_popup", "iframe", url, "  ", "width=580px,height=420px,resize=1,scrolling=1,center=1", "")

                //popupwin = dhtmlmodal.open('email_popup', 'iframe', url,'', 'center=1, height=200, resize=1, scrolling=1, width=200');

            /*messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(540,420);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();*/
        } 
        
        function show_feedback(url)                                   
        {                          
                //height=400;
                //width=580;
                height=366;
                width=596;
                title="a";
                _width=596;
               _height=370;
                if(navigator.appName=='Microsoft Internet Explorer'){
                    popupwin = dhtmlmodal.open('email_popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=1, scrolling=1, width='+(_width)+'px', '');
                }else{ 
                    popupwin = dhtmlmodal.open('email_popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=1, scrolling=1, width='+width+'px', '');
                }
openpopupwindow = popupwin; 
            //alert(url);
        //    popupwin =dhtmlmodal.open("email_popup", "iframe", url, "  ", "width=580px,height=420px,resize=1,scrolling=1,center=1", "")

                //popupwin = dhtmlmodal.open('email_popup', 'iframe', url,'', 'center=1, height=200, resize=1, scrolling=1, width=200');

            /*messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(540,420);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();*/ 
        }
        
        function show_remainder(url)
        {
                //height=180;
                //height=261;
                height=255;
                width=340;
                title="a";
               //_height=parseInt(height)+5;
               _height=parseInt(height-12);
                if(navigator.appName=='Microsoft Internet Explorer'){
                    popupwin = dhtmlmodal.open('remain_popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=0, width='+width+'px', '');
                }else{ 
                    popupwin = dhtmlmodal.open('remain_popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=0, width='+width+'px', '');
                }
openpopupwindow = popupwin; 
        /*    
            messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(240,200);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();*/
        }
    
    /*    function show_product_preview(url)
        {
            messageObj.setSource(url);
            messageObj.setCssClassMessageBox(false);
            messageObj.setSize(540,520);
            messageObj.setShadowDivVisible(false);    // Enable shadow for these boxes
            messageObj.display();
        
        }
        function closeMessage()
        {
            messageObj.close();    
        }*/

        function show_per_page(where)
        {
            
            if(where)
            {
            
                var obj_name=where+"_number_per_page";
                var display_obj=document.getElementById(obj_name);
        
                display_obj.style.position = "absolute";
				display_obj.style.zIndex="2";
                //display_obj.style.left="722px";
                display_obj.style.left="504px";
                display_obj.style.display='block';
            }
            else
                alert('object not found');
                
                
        }
        
        
        
        
        
        function change_per_page(myobj)
        {

            var top_obj=document.getElementById('top_page_number_span');
            var bottom_obj=document.getElementById('bottom_page_number_span');
            var display_obj=document.getElementById("top_number_per_page");
            var display_obj1=document.getElementById("bottom_number_per_page");            
            var myobj1=document.getElementById(myobj);                                

            //top_obj.innerHTML=myobj1.innerHTML+"&nbsp";
            //bottom_obj.innerHTML=myobj1.innerHTML+"&nbsp";
            top_obj.innerHTML=myobj1.innerHTML;
            bottom_obj.innerHTML=myobj1.innerHTML;
            display_obj.style.display='none';
            display_obj1.style.display='none';
            
            //xajax_test(2,"1","1");
            xajax_filter_change("3",myobj1.innerHTML,"");
        }
        
        function show_sort_order(where)
        {
            if(where)
            {
                var obj_name=where+"_sort_order_page";
                var display_obj=document.getElementById(obj_name);
                display_obj.style.position = "absolute";
                //display_obj.style.left="812px";
                display_obj.style.left="576px";
				display_obj.style.margin="-6px 0px 0px 0px";
                if(navigator.appName=="Microsoft Internet Explorer"){
                    display_obj.style.margin="-7px 0px 0px 0px";
                }
                display_obj.style.display='block';
            }
            else
                alert('object not found');
        
        }
        function change_sort_order(myobj)
        {
    
            var top_obj=document.getElementById('top_sort_order_span');
            var bottom_obj=document.getElementById('bottom_sort_order_span');
            var display_obj=document.getElementById("top_sort_order_page");
            var display_obj1=document.getElementById("bottom_sort_order_page");    
            
            display_obj.style.display='none';
            display_obj1.style.display='none';    
        
            var myobj1=document.getElementById(myobj);
            
            //top_obj.innerHTML=myobj1.innerHTML+"&nbsp";
            //bottom_obj.innerHTML=myobj1.innerHTML+"&nbsp";
            top_obj.innerHTML=myobj1.innerHTML;
            bottom_obj.innerHTML=myobj1.innerHTML;
            switch(myobj1.id)
            {
              case "sr_1":
             
                xajax_filter_change("4","1","");            
                break;
              case "sr_2":
            
                xajax_filter_change("4","2","");
                break;
              case "sr_3":
                xajax_filter_change("4","3","");
                break;
              case "sr_4":
                xajax_filter_change("4","4","");
                break;
              case "sr_5":
                xajax_filter_change("4","5","");
                break;
              case "sr_6":
                xajax_filter_change("4","6","");
                break;
 
 
            } 
            
          /*  if($('#top_sort_order_span').html()=='SORT BY RELEVANCE'){
              $('#top_inside_pagenumber').css('width','142px');
            }
            else if($('#top_sort_order_span').html()=='SORTSORT BY MOST RECENT'){
              $('#top_inside_pagenumber').css('width','151px');
            }
            else{
              $('#top_inside_pagenumber').css('width','152px');
            } 
                                  
            if($('#bottom_sort_order_span').html()=='SORT BY RELEVANCE'){
              $('#bottom_inside_pagenumber').css('width','142px');
            }
            else if($('#bottom_sort_order_span').html()=='SORTSORT BY MOST RECENT'){
              $('#bottom_inside_pagenumber').css('width','151px');
            }
            else{
              $('#bottom_inside_pagenumber').css('width','152px');
            }     */        
        }

function check_page_number(e,id)
{

    var keynum;
    var keychar;
    var numcheck;
    
    if(window.event) // IE
        keynum = e.keyCode;
    else if(e.which) // Netscape/Firefox/Opera
        keynum = e.which;
    keychar = String.fromCharCode(keynum);
    
   
    if(keynum==13)
    {    var cur_page=0;
        if(id=='top_pagenumber')
            cur_page=document.getElementById('bottom_pagenumber').value;
        else
            cur_page=document.getElementById('top_pagenumber').value;
            
        var mm=document.getElementById(id).value;
        if(mm=='')
            return false;
        if(parseInt(mm)==0)
            return false;
        curval=parseInt(mm);
        var tp=document.getElementById('top_total_number');
        total_p=parseInt(tp.innerHTML);
        if(curval>total_p)
            return false;
        else
        {

            if(curval<cur_page)
            {
                xajax_filter_change("2",cur_page,-(cur_page - curval));
            }
            else
            {
                xajax_filter_change("2",cur_page,(curval - cur_page));            
            }
        }
    }
    else if(keynum==8 || keynum==46)
        return  true;
   else if(keynum>=96 && keynum<=105)
      return true;
    else if(keynum<48 || keynum>57)
        return false;

}


function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
    }
    return [curleft,curtop];
}

function close_all_filters()
{
    document.getElementById('material_product_library_filter').style.display='none';
    document.getElementById('pattern_product_library_filter').style.display='none';
    document.getElementById('color_product_library_filter').style.display='none';
    document.getElementById('scale_product_library_filter').style.display='none';
    document.getElementById('collect_product_library_filter').style.display='none';
    document.getElementById('texture_product_library_filter').style.display='none';
     //document.getElementById('sustain_product_library_filter').style.display='none';
     
     document.getElementById('designer_product_library_filter').style.display='none';
  //   document.getElementById('brand_product_library_filter').style.display='none';
  
  document.getElementById('sustain_product_library_filter').style.display='none';
  if(document.getElementById('perform_product_library_filter')!=null){
    document.getElementById('perform_product_library_filter').style.display='none';
  }
}


//    function show_filter_window(menu,heading,num_cols,column_heading,column_value,footer,width,y)
    function show_filter_window(menu,width)
    {            
        var mymenu='';
        var menu_name=menu+'_product_library_filter';
        var menu_filter=document.getElementById(menu_name);
        var mm=document.getElementById("ah_"+menu);
        var oHeight=0;
        close_all_filters();
        if(menu_filter)
        {  
            menu_filter.style.position='absolute';
            menu_filter.style.width=width+'px';
            document.getElementById(menu+'_product_library_filter_shadow').style.width=width+'px';
            menu_filter.style.display='block';
            
            if(document.getElementById)
            {
                oHeight = document.getElementById(menu_name).offsetHeight;
            
            }
            else if (document.layers)
            {
                oHeight = document.layers[menu_name].clip.height;
            }

            win_top=(findPos(mm)[1]-(oHeight/2))+10;
            arrow_height=(-(oHeight/2))+10;
            if(navigator.appName=="Microsoft Internet Explorer"){
                arrow_height+=5;
            }
            document.getElementById(menu+"_menu_arrow_mark").style.top=arrow_height+"px";
            //menu_filter.style.top=win_top+"px";
            
            if(navigator.appName=="Microsoft Internet Explorer"){
                menu_filter.style.top=(win_top+2)+"px";  
                if(navigator.appVersion.indexOf("MSIE 7.0")!=-1){
                    menu_filter.style.top=(win_top)+"px";  
                }
            }
            else{
               menu_filter.style.top=(win_top+7)+"px";
            }
                     
              /*          
            win_top=-(oHeight/2)-5;
            arrow_height=(-(oHeight/2))+10;
            if(navigator.appName=="Microsoft Internet Explorer"){
                arrow_height+=5;
            }
            document.getElementById(menu+"_menu_arrow_mark").style.top=arrow_height+"px";
            menu_filter.style.left=180+"px";
            if(menu=="sustain" || menu=="collect" || menu=="designer" || menu=="brand")
                menu_filter.style.left=190+"px";    
            */
            //document.getElementById(menu+"_menu_arrow_mark").style.top=(win_top+arrow_height)+"px";
        }
    }
    
    last_obj="";
    last_main_target="";
    last_url_value="";
    last_action="add";
    
    function show_remove_filter_item()
    {
        if(last_main_target!="")
        {
            txt="";
            if(last_action=="add")
            {   if(last_main_target=="new_design")
                    txt="Adding New Design ";
                else
                {
                txtid=document.getElementById(last_obj.id); 
                txt="Adding "+txtid.innerHTML+" ";
                }
            }
            else
            {
                if(last_main_target=="new_design")
                    txt="Removing New Design ";
                else
                {
                    txtid=document.getElementById(last_obj); 
                    txt="Removing "+txtid.innerHTML+" ";
                }
            }
            s=last_main_target.split("_");
            menu=last_main_target;
            var menu_name=menu+'_filter_warning';
			var shadow = menu+'_filter_warning_shadow';
			
			var shadow_filter=document.getElementById(menu_name);
            var menu_filter=document.getElementById(menu_name);
			
            close_all_filters();
            var mm=document.getElementById("ah_"+s[0]);
            x=findPos(mm)[1];
            if(menu_filter)
            {
                 menu_filter.style.position='absolute';
                 menu_filter.style.display='block';
                 cont=document.getElementById(last_main_target+"_filter_warning_content");
                 cont.innerHTML=txt;
                 if(navigator.appName=='Microsoft Internet Explorer')
                    win_top=x - 25;
                 else
                    win_top=x - 30;
                 menu_filter.style.top=win_top+"px";
				 
				 $("#"+menu+'_filter_warning_shadow').height($("#"+menu+'_filter_warning_content_outer').innerHeight()+3);
				 
				 $("#"+menu+'_menu_arrow_mark').css("top",-($("#"+menu+'_filter_warning_content_outer').innerHeight()/2));
				 
				
                 
            }   
        }
        else
            object_click="Y" ;
    }
   
    var cancel_button_click="no";
    var ok_button_click="no";
	
    function change_warning(arg)
    {                               
        object_click="Y";
        if(last_action=="add")                           
        {                                  
          cancel_button_click="yes";
          if(last_main_target=="new_design"){
              remove_new_design();
          }
          else
          {
            //alert("here "+last_main_target+last_obj.id+last_url_value);
            remove_filter(last_main_target,last_obj.id,last_url_value);
          }
        }
        else
        {                      
          if(last_main_target=="new_design")
              show_new_design();
          else
            do_filter(last_obj,last_main_target,last_url_value);
        }
    } 
    
    function remove_new_design()
    {
        document.getElementById('new_design_block').style.display='none';   
        xajax_filter_change("1","newdesign_filter","remove");  
    }
 
 
     function show_new_design()
    {
        last_obj=null;
        last_main_target='new_design';
        
        document.getElementById('new_design_block').style.display='block';
        document.getElementById('new_designsdiv_close').style.display='block';
        xajax_filter_change("1","newdesign_filter",""); 
    }

   
   function Refresh_Mysamples(place,id)
   {
      
       url=parent.document.location.pathname;
       uri=url.split("/");
       if(uri[1]=="mysamples")
       {  
          if(uri.length==2)
                parent.xajax_get_saved_samples('mysamples',0,parent.document.getElementById('top_page_number').value,0,"1"); 
          else
            if(place==uri[2] && place=="sample_set" && uri[3]==id)
                parent.xajax_get_saved_samples("sample_set",uri[3],parent.document.getElementById('top_page_number').value,0,1); 
            else if(place==uri[2] && place=="sample_order") 
            {
                parent.xajax_get_saved_samples("sample_order",0,1,0,1); 
            }
       }
   }
   
    
    
     function show_add_sample_preview(sku)
    {
        ele=document.getElementById('add_setDiv_preview');
        var mm=document.getElementById("sample_button_div");
          x=findPos(mm);
        
        
        ele.style.position="absolute";
        if(navigator.appName=='Microsoft Internet Explorer')
        {
              win_top=x[1] + 30;
             win_left=x[0] + 2;
        }
        else
        {
             win_top=x[1] + 30;
             win_left=x[0] + 2;
        }
        ele.style.display='block';  
        ele.style.top=win_top+"px"; 
        ele.style.left=win_left+"px"; 
    }
    
    function show_add_sample_preview_detail(sku)
    {
       //alert(navigator.userAgent);
	   ele=document.getElementById('add_setDiv_preview');
        var mm=document.getElementById("sample_button_div");
        x=findPos(mm);

		var ver=navigator.userAgent;
		var keyText='Firefox/';
		var version=ver.substr(ver.indexOf(keyText));
		var ffv=version.split('/');
		var ffversion=parseFloat(ffv[1]);
		
		var ieVer=navigator.appVersion;
		var keyText='; MSIE ';
		var ieVersion=parseFloat(ieVer.substr(ieVer.indexOf(keyText)+keyText.length,3));
        
        ele.style.position="absolute";
       /* if(navigator.appName=='Microsoft Internet Explorer' && ieVersion <7){
              win_top=x[1] - 218;
			  ele.style.margin="0px 0px 0px -3px";
		}else if(navigator.appName=='Microsoft Internet Explorer' && ieVersion ==7){
              win_top=x[1] - 223;
		}else if(navigator.userAgent.indexOf('MSIE 8.0')){
			 win_top=x[1] - 220;
		}else if(navigator.userAgent.indexOf('Firefox/3.6')!=-1){
			 win_top=x[1] - 215;
		}else if(navigator.appName=='Netscape' && ffversion>3){
             //win_top=x[1] - 190;
			 win_top=x[1] - 215;
		}else  if(navigator.appName=='Netscape' && ffversion<3){
			
			win_top=x[1]+30;
		}*/
		//alert(navigator.userAgent);
		
        ele.style.display='block';  
        //ele.style.top=win_top+"px"; 
		// alert(ele.style.top);
    }
    
    
    
    function do_filter(obj,main_target,url_value)
    {                                                   
		document.getElementById(main_target).style.display='';
		  //alert(obj.id+" "+main_target+" "+url_value);
           v=document.getElementById(obj);
           if(v!=null)
                obj=v; 
          
          last_obj=obj;
          last_main_target=main_target;
          last_url_value=url_value;
        
        //alert(obj.id+" "+main_target+" "+url_value);
        
        var popup_target=main_target.replace("_","_product_library_");
        document.getElementById(popup_target).style.display="none";         
        
        var target_obj=document.getElementById(main_target);
        if (obj.className=="beta" )
        {
            obj.className="alp";
            obj.style.background="white";
            obj.style.fontWeight = 'normal';
            last_action="remove";
            remove_filter(main_target,obj.id,url_value);
        }
        else if(obj.className=="alp")
        {
           
            obj.className="beta";
            obj.style.background="#ebf2f8"; 
            obj.style.fontWeight = 'bold';
            last_action="add";
            add_filter(target_obj,obj,main_target,url_value);
        }
        else
        {
            
            obj.className="beta";
            obj.style.background="#ebf2f8";
            obj.style.fontWeight = 'bold';
            last_action="add";
            add_filter(target_obj,obj,main_target,url_value);
        }
        
    }
    function add_filter(t_obj,obj,main_target,url_value)
    {
     
      //  if(main_target !='collect_filter')
      //  { 
     
       // var new_val = "<li id='inn_"+obj.id+"'>"+obj.innerHTML+"<a href='#' onclick=\"remove_filter(\'"+main_target+"\','"+obj.id+"','"+url_value+"');\"><img src='/images/into_mark.jpg' style='float:right;position:relative;margin-top:8px;_margin-top:-15px;'/></a></li><div class='clear'></div>";
       if(main_target=='sustain_filter' || main_target=='collect_filter'){
        var new_val = "<li id='inn_"+obj.id+"' style='padding-bottom:4px;.padding-bottom:0px;_padding-bottom:4px;'><span style='float:left;display:inline-block;width1:150px;'>"+obj.innerHTML+"</span><a style='float:right;display:inline-block;' href='#' onclick=\"remove_filter(\'"+main_target+"\','"+obj.id+"','"+url_value+"');\"><img src='/images/into_mark.jpg' /></a></li><div class='clear'></div>";
        
        t_obj.innerHTML +=new_val;
       }else{
        var new_val = "<li id='inn_"+obj.id+"'><span style='float:left;display:inline-block;'>"+obj.innerHTML+"</span><a style='float:right;display:inline-block;' href='#' onclick=\"remove_filter(\'"+main_target+"\','"+obj.id+"','"+url_value+"');\"><img src='/images/into_mark.jpg' /></a></li><div class='clear'></div>";
        t_obj.innerHTML +=new_val;
       }
        
    // alert(main_target + '   '+ from_refresh);
        /**********   Try to call Xajax Function Here *************/ 
        if(main_target=='material_filter' && !from_refresh)
        {
            testvalue =obj.innerHTML;
			if(testvalue=="Value Products")
			{
				window.location = "/product_library/material/Value Products";
				return ;
			}
            testvalue= testvalue.replace("&amp;","&");
            material_filter_to_model +="["+testvalue+"]";
            xajax_filter_change("1",main_target,material_filter_to_model);
        }
        if(main_target=='pattern_filter' && !from_refresh)
        {
            pattern_filter_to_model +="["+obj.innerHTML+"]"; 
            xajax_filter_change("1",main_target,pattern_filter_to_model); 
        }
        if(main_target=='texture_filter' && !from_refresh)
        {
            texture_filter_to_model +="["+obj.innerHTML+"]";
            xajax_filter_change("1",main_target,texture_filter_to_model); 
        }

        if(main_target=='scale_filter' && !from_refresh)
        {
            
            scale_filter_to_model +="["+obj.innerHTML+"]";
            xajax_filter_change("1",main_target,scale_filter_to_model); 
        }

        if(main_target=='sustain_filter' && !from_refresh)
        {
            sustain_filter_to_model +="["+obj.innerHTML+"]";
            xajax_filter_change("1",main_target,sustain_filter_to_model); 
        } 
        
        if(main_target=='perform_filter' && !from_refresh)
        {
            perform_filter_to_model +="["+obj.innerHTML+"]";
            xajax_filter_change("1",main_target,perform_filter_to_model); 
        }
        
         if(main_target=='collect_filter' && !from_refresh)
        {
             switch(url_value)
             {
             case "0":
             case "1":  
                collect_filter_to_model +="["+obj.innerHTML+"]";
                xajax_filter_change("1",main_target,collect_filter_to_model);
                break;
        /*    case "2":
                brands_filter_to_model +="["+obj.innerHTML+"]";
                xajax_filter_change("1",main_target+"_brand",brands_filter_to_model); 
                break;
            case "3":
                designer_filter_to_model +="["+obj.innerHTML+"]";
                xajax_filter_change("1",main_target+"_design",designer_filter_to_model);    
                break;                                                                      */
            }
        }
        
        if(main_target=='designer_filter' && !from_refresh)
        {
           // main_target= 'collect_filter';
          //  designer_filter_to_model +="["+obj.innerHTML+"]";
            //xajax_filter_change("1",main_target+"_design",designer_filter_to_model);
          //  xajax_filter_change("1",main_target,designer_filter_to_model);
             switch(url_value)
             {
                case "2":
                     designer_filter_to_model +="["+obj.innerHTML+"]";
                     xajax_filter_change("1",main_target,designer_filter_to_model); 
                    break;
                case "3":
                    brands_filter_to_model +="["+obj.innerHTML+"]"; 
                     xajax_filter_change("1",'brand_filter',brands_filter_to_model);  
                    break;
             }
             
        }
   /*  
      if(main_target=='brand_filter' && !from_refresh)
        {
           // main_target= 'collect_filter';
            brands_filter_to_model +="["+obj.innerHTML+"]";
            //xajax_filter_change("1",main_target+"_brand",brands_filter_to_model);
            xajax_filter_change("1",main_target,brands_filter_to_model);
        }
        
     */   
     
        if(main_target=='color_filter' && !from_refresh)
        {
                switch(url_value)
             {
             case "0":
             
                color_filter_to_model +="["+obj.innerHTML+"]";
                xajax_filter_change("1",main_target,color_filter_to_model); 
                break;
             case "1":
                
                color_grouping_filter_to_model +="["+obj.innerHTML+"]";
                xajax_filter_change("1",main_target+"_group",color_grouping_filter_to_model); 
                break;
             }
            
        }    
     
    }
    
    function remove_filter(t_obj,obj,url_value)
    {
          
          last_main_target=t_obj;  
          last_obj=obj;
          last_url_value=url_value;
          last_action="remove";
         				
 
        var target_obj=document.getElementById(t_obj);

        var other_target_obj=document.getElementById(obj);
        other_target_obj.style.background="white";
        other_target_obj.className="alp";
        other_target_obj.style.fontWeight= 'normal';
        
        var obj_name='inn_'+obj;
        var myobj=document.getElementById(obj_name);
        target_obj.removeChild(myobj);
        
        var search_keyword_str=search_keyword;
        //alert('search keyword -'+search_keyword);
        
        if(search_keyword!='')
        {
            str_repl=other_target_obj.innerHTML;
            
            if(str_repl=="Patent &amp; Mylar")
                search_keyword=(search_keyword.replace(new RegExp( "Patent & Mylar", "gi" ),""));
            else
                search_keyword=(search_keyword.replace(new RegExp( str_repl, "gi" ),""));
            
            if(search_keyword_str!=search_keyword){
                //alert("Replace search key "+search_keyword); 
                t_obj='';
                cancel_button_click="no"; 
                xajax_filter_change("0","search_button",search_keyword,"remove"); 
            }
        }
        
        
        //alert('js '+t_obj);
        if(t_obj=='material_filter')
        {
		
             if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
                str_rpl="["+ other_target_obj.innerHTML+"]";
			
			if(str_rpl=="[Value Products]")
			{
				window.location = "/product_library/ClearValue";
				return ;
			}
			if(str_rpl=="[Patent &amp; Mylar]")
			{
                //material_filter_to_model=(material_filter_to_model.replace(new RegExp( "Patent & Mylar", "g" ),""));
				material_filter_to_model=(material_filter_to_model.replace("[Patent & Mylar]",""));
			}
            else
               // material_filter_to_model=(material_filter_to_model.replace(new RegExp( str_rpl, "g" ),""));
				material_filter_to_model=material_filter_to_model.replace(str_rpl,'');
		//		material_filter_to_model=material_filter_to_model.replace('[]','');
                /*xajax_filter_change("1",t_obj,material_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,material_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,material_filter_to_model);
                }
             }
        }
        if(t_obj=='pattern_filter')
        {
            if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
               str_rpl="["+ other_target_obj.innerHTML+"]";
                pattern_filter_to_model=pattern_filter_to_model.replace(str_rpl,'');
                /*xajax_filter_change("1",t_obj,pattern_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,pattern_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,pattern_filter_to_model);
                }   
             }
        }
        if(t_obj=='texture_filter')
        {
           // alert('befor here'+texture_filter_to_model+"  "+t_obj); 
            if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
               str_rpl="["+ other_target_obj.innerHTML+"]";
                texture_filter_to_model=texture_filter_to_model.replace(str_rpl,'');
             //   alert('here'+texture_filter_to_model+"  "+t_obj); 
                /*xajax_filter_change("1",t_obj,texture_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,texture_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,texture_filter_to_model);
                }
             }
        }
        if(t_obj=='scale_filter')
        {
            if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
               str_rpl="["+ other_target_obj.innerHTML+"]";
                scale_filter_to_model=scale_filter_to_model.replace(str_rpl,'');
                /*xajax_filter_change("1",t_obj,scale_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,scale_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,scale_filter_to_model);
                }
             }
        }        
        
        if(t_obj=='color_filter')
        {
             switch(url_value)
             {
             case "0":
              if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
                str_rpl="["+ other_target_obj.innerHTML+"]";
                color_filter_to_model=color_filter_to_model.replace(str_rpl,'');
              //  alert("0 called");                                     
                /*xajax_filter_change("1",t_obj,color_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,color_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,color_filter_to_model);
                }
             }
                break;
             case "1":
              if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
                str_rpl="["+ other_target_obj.innerHTML+"]";
                color_grouping_filter_to_model=color_grouping_filter_to_model.replace(str_rpl,'');
              //  alert("1 called");
                /*xajax_filter_change("1",t_obj+"_group",color_grouping_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj+"_group",color_grouping_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj+"_group",color_grouping_filter_to_model);
                }
             }
                break;
             } 
          
        }
        if(t_obj=='sustain_filter')
        {
            if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
               str_rpl="["+ other_target_obj.innerHTML+"]";
                sustain_filter_to_model=sustain_filter_to_model.replace(str_rpl,'');
                /*xajax_filter_change("1",t_obj,sustain_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,sustain_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,sustain_filter_to_model);
                }
             }
        }
        
        if(t_obj=='perform_filter')
        {
            if(arr_f[0]==other_target_obj.innerHTML)
                 xajax_filter_change("1","favour_filter","remove");
             else{
               str_rpl="["+ other_target_obj.innerHTML+"]";
                perform_filter_to_model=perform_filter_to_model.replace(str_rpl,'');
                /*xajax_filter_change("1",t_obj,perform_filter_to_model);*/
                if(cancel_button_click=="yes"){
                    cancel_button_click="no";
                    xajax_filter_change("1",t_obj,perform_filter_to_model,'cancel_button_click');
                }
                else{
                    xajax_filter_change("1",t_obj,perform_filter_to_model);
                }
             }
        }
        
        if(t_obj=='collect_filter')
        {
              
             switch(url_value)
             {
             case "0":
             case "1":  
                      if(arr_f[0]==other_target_obj.innerHTML)
                         xajax_filter_change("1","favour_filter","remove");
                     else{
                       str_rpl="["+ other_target_obj.innerHTML+"]";
                        collect_filter_to_model=collect_filter_to_model.replace(str_rpl,'');
                        /*xajax_filter_change("1",t_obj,collect_filter_to_model);*/
                        if(cancel_button_click=="yes"){
                            cancel_button_click="no";
                            xajax_filter_change("1",t_obj,collect_filter_to_model,'cancel_button_click');
                        }
                        else{
                            xajax_filter_change("1",t_obj,collect_filter_to_model);
                        }
                     }
                break;
        /*    case "2":
                     if(arr_f[0]==other_target_obj.innerHTML)
                         xajax_filter_change("1","favour_filter","remove");
                     else{
                         str_rpl="["+ other_target_obj.innerHTML+"]";
                        brands_filter_to_model=brands_filter_to_model.replace(str_rpl,'');
                        xajax_filter_change("1",t_obj+"_brand",brands_filter_to_model);
                     }
                break;
            case "3":
                     if(arr_f[0]==other_target_obj.innerHTML)
                         xajax_filter_change("1","favour_filter","remove");
                     else{
                        str_rpl="["+ other_target_obj.innerHTML+"]";
                        designer_filter_to_model=designer_filter_to_model.replace(str_rpl,'');
                        xajax_filter_change("1",t_obj+"_design",designer_filter_to_model);
                     }
                break;    */
            }
        }
        if(t_obj=='designer_filter')
        {     
              switch(url_value)
             {
              case "2": 
                      
                    if(arr_f[0]==other_target_obj.innerHTML)
                         xajax_filter_change("1","favour_filter","remove");
                     else{
                        str_rpl="["+ other_target_obj.innerHTML+"]";
                        designer_filter_to_model=designer_filter_to_model.replace(str_rpl,'');
                        /*xajax_filter_change("1",t_obj,designer_filter_to_model);*/
                        if(cancel_button_click=="yes"){
                            cancel_button_click="no";
                            xajax_filter_change("1",t_obj,designer_filter_to_model,'cancel_button_click');
                        }
                        else{
                            xajax_filter_change("1",t_obj,designer_filter_to_model);
                        }
                     }
                break;
              case "3":
                       if(arr_f[0]==other_target_obj.innerHTML)
                         xajax_filter_change("1","favour_filter","remove");
                     else{
                          str_rpl="["+ other_target_obj.innerHTML+"]";
                        brands_filter_to_model=brands_filter_to_model.replace(str_rpl,'');
                        /*xajax_filter_change("1",'brand_filter',brands_filter_to_model);*/
                        if(cancel_button_click=="yes"){
                            cancel_button_click="no";
                            xajax_filter_change("1",'brand_filter',brands_filter_to_model,'cancel_button_click');
                        }
                        else{
                            xajax_filter_change("1",'brand_filter',brands_filter_to_model);
                        }
                     }
                break;
             }
         }
   /*  
      if(t_obj=='brand_filter')
        {
             //   t_obj='collect_filter';
                str_rpl="["+ other_target_obj.innerHTML+"]";
                brands_filter_to_model=brands_filter_to_model.replace(str_rpl,'');
                xajax_filter_change("1",t_obj,brands_filter_to_model);
        }        
        
     */   
    }
    
    
    function call_page(pgnum)
    {
        var curid=document.getElementById('bottom_pagenumber');
        var total=document.getElementById('bottom_total_number');
        var totalpage=parseInt(total.innerHTML);
        if(curid.value==1 && pgnum==-1)
        {    
            //alert("Not Valid");
            return;
        }
        if((pgnum==1) && (curid.value==totalpage))
        {    
            //alert("Not Valid");
            return;
        }
        xajax_filter_change("2",curid.value,pgnum);            
    }
    
    function call_color_page(name,pgnum,cur,displaysku,colorname)
    {
        var curid=document.getElementById('current_color_page');
        var total=document.getElementById('total_color_page');
        
        
        
        var totalpage=parseInt(total.value);
        if(curid.value==1 && pgnum==-1)
        {    
            //alert("Not Valid");
            return;
        }
        if((pgnum==1) && (curid.value==totalpage) && cur!='S')
        {    
            //alert("Not Valid");
            return;
        }
    
      if(cur=='S')
          xajax_call_color_page(name,0,pgnum,displaysku,colorname);            
      else
          xajax_call_color_page(name,curid.value,pgnum,displaysku,colorname);            
    }
    
    
    function ischild(evt,myroot)
    {
        //var parent_id = evt.target.parentNode.id;
        var mypar=document.getElementById(myroot);
        mypar.style.display='block';
		//alert(myroot);
		
		var height1=$("#"+myroot+" .content").height();
		// $("#"+myroot+' .add_setDiv_preview_shadow').css('height',height1+'px');
		
    }
    function ischildall(evt,myroot)
    {
        //var parent_id = evt.target.parentNode.id;
        var mypar=document.getElementById(myroot);
        mypar.style.display='block';
		
		var height=$('.content_all').height();
		$('.add_setDiv_preview_shadow_all').css('height',height+'px');

    }
	function isQtchildall(evt,myroot)
    {
        //var parent_id = evt.target.parentNode.id;
        var mypar=document.getElementById("qtDiv"+myroot);
        mypar.style.display='block';
		var mypar1=document.getElementById("shadow_qtDiv"+myroot).style.display='block';
    }
	function isQtclose(myroot)
    {
        //var parent_id = evt.target.parentNode.id;
        var mypar=document.getElementById("qtDiv"+myroot);
        mypar.style.display='none';
		var mypar1=document.getElementById("shadow_qtDiv"+myroot).style.display='none';
    }

    
    function close_me(win_id)
    {
        document.getElementById(win_id).style.display='none';
		//document.getElementById("textare").innerHTML = "out "+win_id;
    }
    
    function number_per_popup(where,arg)
    {

        var pop_val="<div id='"+where+"_number_per_page'  onmouseover=\"ischild(event,'"+where+"_number_per_page');\" onmouseout=\"close_me('"+where+"_number_per_page');\" style='margin-left:-24px;'>";
        if(arg=='on'){
            var pop_val="<div id='"+where+"_number_per_page'  onmouseover=\"ischild(event,'"+where+"_number_per_page');\" onmouseout=\"close_me('"+where+"_number_per_page');\" style='margin-left:-44px;'>";
        }
    
            pop_val+='<div id="'+where+'_num_shadow" class="num_shadow">';
            pop_val+='<div id="'+where+'_content" class="content" >';

                pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_per_page(\'pg_24\');" id="pg_24">24 PER PAGE</a>&nbsp<img src="/images/downarrow.gif" /></p>';
                pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_per_page(\'pg_48\');" id="pg_48">48 PER PAGE</a></p>';
                pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_per_page(\'pg_96\');" id="pg_96">96 PER PAGE</a></p>';
                pop_val+= '<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_per_page(\'pg_192\');" id="pg_192">192 PER PAGE</a></p>';
            pop_val+='</div>';
            pop_val+='</div>';
            pop_val+='</div>';


        return pop_val;
    
    }
    function sort_order_popup(where,opt)
    {
            var pop_val="<div id='"+where+"_sort_order_page' onmouseover=\"ischild(event,'"+where+"_sort_order_page');\" onmouseout=\"close_me('"+where+"_sort_order_page');\">";
            pop_val+='<div class="sort_shadow">';
            pop_val+='<div class="content">';
            pop_val+='<p style="margin-bottom:7px;"><span style="display:block;"><a class="L1" href="javascript:change_sort_order(\'sr_3\');" id="sr_3">SORT BY RELEVANCE</a>&nbsp<img src="/images/downarrow.gif" /></span></p>';  
            pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_sort_order(\'sr_1\');" id="sr_1">SORT BY MOST RECENT</a></p>';
            pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_sort_order(\'sr_2\');" id="sr_2">SORT BY PRODUCT NAME</a></p>';
            
			if(opt=="on")
			{
             pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_sort_order(\'sr_4\');" id="sr_4">SORT BY QUANTITY</a></p>';   
             pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_sort_order(\'sr_5\');" id="sr_5">SORT BY PRICE:HIGH TO LOW</a></p>';   
             pop_val+='<p style="margin-bottom:7px;"><a class="L1" href="javascript:change_sort_order(\'sr_6\');" id="sr_6">SORT BY PRICE:LOW TO HIGH</a></p>';   
            }
            pop_val+='</div>';
            pop_val+='</div>';
            pop_val+='</div>';

            return pop_val;
    }

    
 function Remove_filter_warning(menu)
 {
      var    display_val='<div id="'+menu+'_filter_warning" class="product_filter_warning">';
             display_val+='<div id="'+menu+'_filter_warning_shadow" class="Shadow">';
             display_val+='<div id="'+menu+'_filter_warning_content_outer" class="content">';
             display_val+='<div><span id="'+menu+'_filter_warning_content"> </span>will result in no products being displayed</div>';
             display_val+='<div class="button_contain">';
             display_val+='<input type="button" value="OK" class="submit_but L4"  onclick="document.getElementById(\''+menu+'_filter_warning\').style.display=\'none\';object_click=\'Y\'; "/>';
             display_val+='<input type="button" value="CANCEL" class="cancel_but L5" onclick="change_warning();document.getElementById(\''+menu+'_filter_warning\').style.display=\'none\'" />';
             display_val+='<div class="clear"></div>';
             display_val+='</div>';
             display_val+='<div id="'+menu+'_menu_arrow_mark" style="position:relative;left:-18px;width:20px;top:-40px;"><img  src="/images/menu_arrow_mark.gif" /></div>';
             display_val+='</div></div>';
       return display_val; 
       //alert(display_val);
 }  
 
 function Remove_filter_warning_write(menu,id){
     var    display_val='<div id="'+menu+'_filter_warning" class="product_filter_warning">';
             display_val+='<div id="'+menu+'_filter_warning_shadow" class="Shadow">';
             display_val+='<div id="'+menu+'_filter_warning_content_outer" class="content">';
             display_val+='<div><span id="'+menu+'_filter_warning_content"> </span>will result in no products being displayed</div>';
             display_val+='<div class="button_contain">';
             display_val+='<input type="button" value="OK" class="submit_but"  onclick="xajax_noResultsOkayButton();document.getElementById(\''+menu+'_filter_warning\').style.display=\'none\'; "/>';
             display_val+='<input type="button" value="CANCEL" class="cancel_but" onclick="change_warning();document.getElementById(\''+menu+'_filter_warning\').style.display=\'none\'" />';
             //display_val+='<input type="button" value="CANCEL" class="cancel_but" onclick="document.getElementById(\''+menu+'_filter_warning\').style.display=\'none\'" />';
             display_val+='<div class="clear"></div>';
             display_val+='</div>';
             display_val+='<div id="'+menu+'_menu_arrow_mark" style="position:relative;left:-18px;width:20px;top:-40px;"><img  src="/images/menu_arrow_mark.gif" /></div>';
             display_val+='</div></div>';
       //return display_val; 
       document.getElementById(id).innerHTML = document.getElementById(id).innerHTML+display_val;
 }
     
function gen_menu(menu,heading,num_cols,column_heading,column_value,footer,start_pos)
{
 
  /*
        menu - menu id
        Heading - Title for the menu
        num_cols - number of colms
        Column_heading - column heading
        column_value  - column value (2 dimension array value,enabled/disabled)
        footer - footer text to display
        width - width of the window
        y   -  posistion y axis
    */
    var loop_i,loop_j;
    var col_w;
    var    display_val='<div id="'+menu+'_product_library_filter" class="product_library_filter" onmousedown="myevent=true;">';
        display_val+='<div id="'+menu+'_product_library_filter_shadow" class="Shadow">';
        display_val+='<div class="content">';
        display_val+='<div class="top_position" style="1margin-bottom:15px;1margin-top:5px;width:96%;height:10px;padding-bottom:15px;_padding-bottom:10px;">';
        display_val+='<div style="float:left;">';
        display_val+=heading+'</div>';
        display_val+='<img src="/images/into_mark.jpg" style="cursor:pointer;float:right;margin-top:4px;" onclick="document.getElementById(\''+menu+'_product_library_filter\').style.display=\'none\';"/>';
        display_val+='</div>';
        display_val+='<div class="clear">';
        display_val+='</div>';
        display_val+='<div class="filtermenuContent">';
        display_val+='<table cellpadding="0" cellspacing="0" class="column" width="100%" border="0">';
        display_val+='<tr>';

         col_w=90/num_cols;

        for(loop_i=start_pos;loop_i<(num_cols+start_pos);loop_i++)
        {
            display_val+='<td valign="top" width="'+col_w+'%" >';
            display_val+='<label>'+column_heading[loop_i]+'</label><ul>';
            
            for(loop_j=0;loop_j<column_value[loop_i].length;loop_j++)
            {
                    txt=column_value[loop_i][loop_j][0];
                   
                if(column_value[loop_i][loop_j][1]==1 && loop_j==0)
                  if(txt!="Value Products")
                    display_val+='<li style="border-top:1px solid #ccc;border-bottom:1px dotted #ccc;height:22px;"><a href="#" id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+ loop_i +'\');">'+column_value[loop_i][loop_j][0]+' 5</a></li>';
                  else
                     display_val+='<li style="border-top:1px solid #ccc;border-bottom:1px dotted #ccc;height:22px;"><a href="#" id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+ loop_i +'\');">'+column_value[loop_i][loop_j][0]+'</a></li>';
                       
                else if(column_value[loop_i][loop_j][1]==1 && loop_j>0)
                 if(txt!="Value Products")
                    display_val+='<li style="border-top:none;border-bottom:1px dotted #ccc;height:22px;"><a href="#"  id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+loop_i+'\');">'+column_value[loop_i][loop_j][0]+' 6 </a></li>';
                   else
                      display_val+='<li style="border-top:none;border-bottom:1px dotted #ccc;height:22px;"><a href="#"  id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+loop_i+'\');">'+column_value[loop_i][loop_j][0]+'</a></li>';               
                else
                    display_val+='<li style="border-top:none;border-bottom:1px dotted #ccc;padding-left:3px;height:22px;">'+column_value[loop_i][loop_j][0]+'<sup style="vertical-align:text-top;">*</sup></li>';
            }
                display_val+='</ul></td>';
            if(num_cols>1)
                display_val+='<td width="3%" align="center">&nbsp;</td>';
        }
        
        display_val+='</tr></table>';
        display_val+='<div class="clear"></div>';
        display_val+=footer;
        display_val+='<div class="clear"></div>';
        display_val+='</div>';
        display_val+='<div id="'+menu+'_menu_arrow_mark" style="position:relative;left:-18px;width:20px;"><img  src="/images/menu_arrow_mark.gif" /></div>';
        display_val+='</div></div></div>';
      
        return display_val;
        
        //
        
        //document.write(display_val);
}      

function gen_menu_write(menu,heading,num_cols,column_heading,column_value,footer,start_pos,id)
{                                                                                                    //alert(id);
//alert(document.getElementById(id));
  /*
        menu - menu id
        Heading - Title for the menu
        num_cols - number of colms
        Column_heading - column heading
        column_value  - column value (2 dimension array value,enabled/disabled)
        footer - footer text to display
        width - width of the window
        y   -  posistion y axis
    */
	//document.getElementById(menu+'_filter').style.display='';
    var start_flag=true;
    var num_cols_flag=true;
    var loop_i,loop_j;
    var col_w;
    var    display_val='<div id="'+menu+'_product_library_filter" class="product_library_filter" onmousedown="myevent=true;">';
        display_val+='<div id="'+menu+'_product_library_filter_shadow" class="Shadow">';
        display_val+='<div class="content">';
        display_val+='<div class="top_position" style="1margin-bottom:15px;1margin-top:5px;width:96%;height:10px;padding-bottom:15px;_padding-bottom:10px;">';
        display_val+='<div style="float:left;">';
        display_val+=heading+'</div>';
        if(num_cols>1){
            display_val+='<img src="/images/into_mark.jpg" style="cursor:pointer;float:right;margin-top:4px;.margin-top:1px;_margin-top:4px;position:relative;left:8px;.left:10px;" onclick="document.getElementById(\''+menu+'_product_library_filter\').style.display=\'none\';"/>';
        }
        else{
            display_val+='<img src="/images/into_mark.jpg" style="cursor:pointer;float:right;margin-top:4px;.margin-top:1px;_margin-top:4px;" onclick="document.getElementById(\''+menu+'_product_library_filter\').style.display=\'none\';"/>';
        }
        display_val+='</div>';
        display_val+='<div class="clear">';
        display_val+='</div>';
        display_val+='<div class="filtermenuContent">';
        display_val+='<table cellpadding="0" cellspacing="0" class="column" width="100%" border="0">';
        display_val+='<tr>';

         col_w=90/num_cols;

        for(loop_i=start_pos;loop_i<(num_cols+start_pos);loop_i++)
        {
            display_val+='<td valign="top" width="'+col_w+'%" >';
			if(column_heading[loop_i]!="")
				display_val+='<div style="padding-top:2px;"><label>'+column_heading[loop_i]+'</div></label>';
            display_val+='<ul>';
            for(loop_j=0;loop_j<column_value[loop_i].length;loop_j++)
            {
                      txt=column_value[loop_i][loop_j][0];
                       
                if(column_value[loop_i][loop_j][1]==1 && loop_j==0)
                   if(txt!="Value Products"){
                    display_val+='<li style="border-top:1px solid #999999;border-bottom1:1px dotted #999999;margin-top:5px;"><a class="L8" href="#" id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+ loop_i +'\');">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    start_flag=false;
                   }
                    else {}
					/*
                       display_val+='<li style="border-top:1px solid #ccc;border-bottom1:1px dotted #ccc;margin-top:5px;"><a href="#" id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+ loop_i +'\');" style="color:#E82863;">'+column_value[loop_i][loop_j][0]+'</a></li>'; */
                else if(column_value[loop_i][loop_j][1]==1 && loop_j>0)
                    if(txt!="Value Products"){
                        
                        display_val+='<li style="border-top:none;border-bottom1:1px dotted #999999;height1:22px;"><a class="L8" href="#"  id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+loop_i+'\');">'+column_value[loop_i][loop_j][0]+'</a></li>';
                        start_flag=false;
                    }    
                    else{}
					/*
                        display_val+='<li style="border-top:none;border-bottom1:1px dotted #ccc;height1:22px;"><a href="#"  id="s'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" onclick="do_filter(this,\''+menu+'_filter\',\''+loop_i+'\');" style="color:#E82863;">'+column_value[loop_i][loop_j][0]+'</a></li>';             */
                else{
                    if(start_flag){
                        display_val+='<li style="border-top:1px solid #999999;margin-top:5px;border-bottom1:1px dotted #999999;padding-left1:3px;height1:22px;">'+column_value[loop_i][loop_j][0]+'<sup style="vertical-align:text-top;">*</sup></li>';
                        start_flag=false;
                    }
                    else{
                        display_val+='<li style="border-top:none;border-bottom1:1px dotted #999999;padding-left1:3px;height1:22px;">'+column_value[loop_i][loop_j][0]+'<sup style="vertical-align:text-top;">*</sup></li>';
                    }
                }    
                   
                   
            }
                display_val+='</ul></td>';
            if(num_cols>1){
                //display_val+='<td width="3%" align="center">&nbsp;</td>';
                if(num_cols_flag){
                    display_val+='<td width="10%" align="center"><div style="width:10px;">&nbsp;</div></td>';
                    num_cols_flag=false;
                }
                else{
                    display_val+='<td width="0%" align="center">&nbsp;</td>';
                    num_cols_flag=true;
                }
            }
        }
        
        display_val+='</tr></table>';
        display_val+='<div class="clear"></div>';
        display_val+=footer;
        display_val+='<div class="clear"></div>';
        display_val+='</div>';
        display_val+='<div id="'+menu+'_menu_arrow_mark" style="position:relative;left:-18px;width:20px;"><img  src="/images/menu_arrow_mark.gif" /></div>';
        display_val+='</div></div></div>';        
      //  alert(display_val);
        //return display_val;
		//alert(document.getElementById(id).innerHTML+display_val);              
        document.getElementById(id).innerHTML = document.getElementById(id).innerHTML+display_val;
        
        //
                                                   
        //document.write(display_val);             
}

function gen_dropmenu(menuformat,menu,heading,num_cols,column_heading,column_value,start_col,column_space)
{
    /*
        menu - menu id
        Heading - Title for the menu
        num_cols - number of colms
        Column_heading - column heading
        column_value  - column value (2 dimension array value,enabled/disabled)
        footer - footer text to display
        width - width of the window
        y   -  posistion y axis
    */
    
    var loop_i,loop_j;
    var col_w;
    var space_per_col;
    var page;
    var menu_title;
    var close_menu;  
    if(menu=='material')
    {
        page='product_library/material';
        menu_title='Material Category';
        close_menu='drop1';
    }else if(menu=='pattern'){
        page='product_library/pattern';
        menu_title='Pattern';
        close_menu='drop2';
    }else if(menu=='color'){
        page='product_library/color';
        menu_title='';
        close_menu='drop3';
    }else if(menu=='collect'){
        page='collections_designers/selectpage';
        menu_title='Collections & Designers';
        close_menu='';
    }else if(menu=='sustain'){
        page='product_library/sustain';
        menu_title='Sustainability';
        close_menu='drop4';
    }else{
    }
    
    
    var display_val='<table cellpadding="0" cellspacing="0" class="column" width="100%" border="0">';
        if(menuformat=='pickmenu' && menu!="color"){
        display_val+='<tr>';
        display_val+='<td colspan="'+(num_cols+1)+'" valign="top">';
        display_val+='<div id="closeDiv" style="margin-bottom:15px;padding-bottom:10px;clear:both;"><span style="float:left;"><strong>'+menu_title+'</strong></span> <span style="float:right;"><img src="/images/close_button.jpg" alt="close" title="Close" onclick="document.getElementById(\''+close_menu+'\').style.display=\'none\'" style="cursor:pointer;"/></span></div>';
        display_val+='</td>';
        display_val+='</tr>';
        }else if(menu=="color"){
        display_val+='<tr>';
        display_val+='<td colspan="'+(num_cols)+'" valign="top"><strong>Color</strong></td><td colspan="'+(num_cols+1)+'" valign="top">';
        display_val+='<div id="closeDiv" style="margin-bottom:15px;padding-bottom:10px;clear:both;"><span style="float:left;"><strong>Grouping</strong></span> <span style="float:right;"><img src="/images/close_button.jpg" alt="close" title="Close" onclick="document.getElementById(\''+close_menu+'\').style.display=\'none\'" style="cursor:pointer;"/></span></div>';
        display_val+='</td>';
        display_val+='</tr>';
        }
        space_per_col=column_space;
        display_val+='<tr>';
        col_w=space_per_col/(num_cols - start_col);
        //alert("Test : "+col_w);
        var temp_cnt=0;        // Temporary count for border set up
        for(loop_i=start_col;loop_i<num_cols;loop_i++)
        {
            temp_cnt++;
            if(temp_cnt!=(num_cols-start_col))    // Setting Border for column
                display_val+='<td valign="top" width="'+col_w+'%" style="border-right:1px #cccccc solid;">';
            else
                display_val+='<td id="lnkTest" valign="top" width="'+col_w+'%">';
            
            display_val+='<label>'+column_heading[loop_i]+'</label><ul>';
            
            for(loop_j=0;loop_j<column_value[loop_i].length;loop_j++)
            {
                if(column_value[loop_i][loop_j][1]==1 && loop_j==0){
                    if(menu=="material"){
                       txt=column_value[loop_i][loop_j][0];
					   txt1=txt;
                       if(txt=="Patent & Mylar")
					   {
                                txt="Patent_Mylar";
								txt1="Patent & Mylar";
                        }    
                       
                       // display_val+='<li style=""><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                       if(txt!="Value Products")
					    display_val+='<li style=""><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'"  onmouseover="showMenuContent(\''+escape(txt1)+'\',\''+escape(column_value[loop_i][loop_j][2])+'\')" onmouseout="hideMenuContent()" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                        else{
						if(menuformat!='pickmenu')
			display_val+='<li style=""><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'"  onmouseover="showMenuContent(\''+escape(txt1)+'\',\''+escape(column_value[loop_i][loop_j][2])+'\')" onmouseout="hideMenuContent()" class="alp" style="color:#E82863;">'+column_value[loop_i][loop_j][0]+'</a></li>';			
						}
                        
                    }else if(menu=="collect"){
                        if(loop_i==3)
                       display_val+='<li style=""><a href="/product_library/collection/2'+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                       else
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][2]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                        
                    }else if(menu=="pattern"){
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else if(menu=="color"){
                        if(column_value[loop_i][loop_j][2]==1)
                            page='product_library/color_group';
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else if(menu=="sustain"){
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }
                    else{
                        
                    }
                }else if(column_value[loop_i][loop_j][1]==1 && loop_j>0){
                    if(menu=="material"){
                     txt=column_value[loop_i][loop_j][0];
					 txt1=txt;
                       if(txt=="Patent & Mylar")
					   {
                                txt="Patent_Mylar";
								txt1="Patent & Mylar";
                        }        
                       
                        if(txt!="Value Products")
                        display_val+='<li style=""><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'"  onmouseover="showMenuContent(\''+escape(txt1)+'\',\''+escape(column_value[loop_i][loop_j][2])+'\')" onmouseout="hideMenuContent()" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                        else{
						if(menuformat!='pickmenu')
						display_val+='<tr ><td colspan="3"><span id="pinkspan" style="padding-top:5px;margin-top:6px;display:block;border-top:1px #cccccc solid;"><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'"  onmouseover="showMenuContent(\''+escape(txt1)+'\',\''+escape(column_value[loop_i][loop_j][2])+'\')" onmouseout="hideMenuContent()" class="alp" style="color:#E82863;">'+column_value[loop_i][loop_j][0]+'</a></span></td>';
						
						}
						
						
						
                        
//					    display_val+='<li style=""><a href="/'+page+'/'+txt+'" id="'+menu+'_'+loop_i+'_'+loop_j+'"  onmouseover="showMenuContent(\''+escape(txt1)+'\',\''+escape(column_value[loop_i][loop_j][2])+'\')" onmouseout="hideMenuContent()" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
						
                    }else if(menu=="collect"){
                       if(loop_i==3)
                       display_val+='<li style="border1:1px red solid;"><a href="/product_library/collection/2'+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                       else
                        display_val+='<li style="border1:1px red solid;"><a href="/'+page+'/'+column_value[loop_i][loop_j][2]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else if(menu=="pattern"){
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else if(menu=="color"){
                        if(column_value[loop_i][loop_j][2]==1)
                            page='product_library/color_group';
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else if(menu=="sustain"){
                        display_val+='<li style=""><a href="/'+page+'/'+column_value[loop_i][loop_j][0]+'" id="'+menu+'_'+loop_i+'_'+loop_j+'" class="alp" style="color:#006699;">'+column_value[loop_i][loop_j][0]+'</a></li>';
                    }else{
                        
                    }
                }else{
                        display_val+='<li class="nolink" style="padding-left:0px;">'+column_value[loop_i][loop_j][0]+'<span>*</span></li>';
                }
            }
            display_val+='</ul></td>';
            if(num_cols>1)
                display_val+='<td width="3%" align="center">&nbsp;</td>';
        }
        
        display_val+='</tr></table>';
        display_val+='<div class="clear"></div>';
        return display_val;
}          

//showMenuContent
function showMenuContent(txt,content){
	
	document.getElementById('productContainer').style.display='block';
	document.getElementById('menuTitle').innerHTML='<strong>'+unescape(txt)+'</strong>';
	document.getElementById('menuDesc').innerHTML=unescape(content);
}
function showMenuContent2(test){
	alert(test);
}
//hideMenuContent
function hideMenuContent(){
	document.getElementById('productContainer').style.display='none';
	document.getElementById('menuTitle').innerHTML='';
	document.getElementById('menuDesc').innerHTML=''
}


/** Product Tooltip **/
function showProductToolTipDiv(id){
   document.getElementById(id).style.display='block';   
}

function hideProductToolTipDiv(id){
    document.getElementById(id).style.display='none';   
}


/** Search Results Popup **/
function search_results_popup(url)
{
    //height=239;
    height=242;
    width=466;
    title="Search Results Popup";
     _height=parseInt(height);
    if(navigator.appName=='Microsoft Internet Explorer'){
        popupwin = dhtmlmodal.open('Search_Results_Popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=1, width='+width+'px', '');
    }else{ 
        popupwin = dhtmlmodal.open('Search_Results_Popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=1, width='+width+'px', '');
    }
	openpopupwindow = popupwin;
}

/** Search Refinements Popup **/
function search_refinements_popup(url)
{
    height=121;  //mozilla
    //height=119;
    width=446;
    title="Search Refinements Popup";
     _height=parseInt(height);
    if(navigator.appName=='Microsoft Internet Explorer'){
        popupwin = dhtmlmodal.open('Search_Refinements_Popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=1, width='+width+'px', '');
    }else{ 
        popupwin = dhtmlmodal.open('Search_Refinements_Popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=1, width='+width+'px', '');
    }
	openpopupwindow = popupwin;
}

/** Paint Login Popup **/
function paint_login_popup(url)
{
    //height=121;  //mozilla
    height=89;
    width=446;
    title="Search Refinements Popup";
     _height=parseInt(height);         
    if(navigator.appName=='Microsoft Internet Explorer'){
        popupwin = dhtmlmodal.open('Search_Refinements_Popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=1, width='+width+'px', '');
    }else{ 
        popupwin = dhtmlmodal.open('Search_Refinements_Popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=1, width='+width+'px', '');
    }
	openpopupwindow = popupwin;
}

/** Paint Not Available Popup **/
function paint_not_available_popup(url)
{
    height=89;
    width=446;
    title="Paint Not Available Popup";
     _height=parseInt(height);
    if(navigator.appName=='Microsoft Internet Explorer'){
        popupwin = dhtmlmodal.open('Paint_Not_Available_Popup', 'iframe',url,title, 'center=1, height='+(_height)+'px, resize=0, scrolling=1, width='+width+'px', '');
    }else{ 
        popupwin = dhtmlmodal.open('Paint_Not_Available_Popup', 'iframe', url,title, 'center=1, height='+height+'px, resize=0, scrolling=1, width='+width+'px', '');
    }
	openpopupwindow = popupwin;
}

/** Collection and Designer Filter on/off **/
function login_paint_on(tab,collect_column){
    switch(tab){
        case "wallcovering":
            for(i=0;i<collect_column[3].length;i++)
            {
                collect_column[3][i][1]="0";
            }    
            
            for(i=0;i<collect_column[3].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[3][i][0].toLowerCase()==arr[j])
                {
                    collect_column[3][i][1]="1";
                }
              }  
            }
            break;
        case "upholstery":
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    collect_column[2][i][1]="1";
                }
              }  
            }
            break;
        case "drapery":
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    collect_column[2][i][1]="1";
                }
              }  
            }
            break;
        case "paint":
            for(i=0;i<collect_column[0].length;i++)
            {
                collect_column[0][i][1]="0";
            }    
            
            for(i=0;i<collect_column[0].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[0][i][0].toLowerCase()==arr[j])
                {
                    collect_column[0][i][1]="1";
                }
              }  
            }
            
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    collect_column[2][i][1]="1";
                }
              }  
            }
            break;
     }
}

function login_paint_off(tab,collect_column){
    switch(tab){
        case "wallcovering":
            for(i=0;i<collect_column[3].length;i++)
            {
                collect_column[3][i][1]="0";
            }    
            
            for(i=0;i<collect_column[3].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[3][i][0].toLowerCase()==arr[j])
                {
                    if(collect_column[3][i][0].toLowerCase()!="scuffmaster"){
                        collect_column[3][i][1]="1";
                    }
                }
              }  
            }            
            break;
        case "upholstery":
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    if(collect_column[2][i][0].toLowerCase()!="scuffmaster"){
                        collect_column[2][i][1]="1";
                    }
                }
              }  
            }                                
            break;
        case "drapery":
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    if(collect_column[2][i][0].toLowerCase()!="scuffmaster"){
                        collect_column[2][i][1]="1";
                    }
                }
              }  
            }                                
            break;
        case "paint":
            for(i=0;i<collect_column[0].length;i++)
            {
                collect_column[0][i][1]="0";
            }    
            
            for(i=0;i<collect_column[0].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[0][i][0].toLowerCase()==arr[j])
                {
                    if(collect_column[0][i][0].toLowerCase()!="scuffmaster"){
                        collect_column[0][i][1]="1";
                    }
                }
              }  
            }
            
            for(i=0;i<collect_column[2].length;i++)
            {
                collect_column[2][i][1]="0";
            }    
            
            for(i=0;i<collect_column[2].length;i++)
            {
              for(j=0;j<arr.length;j++){
                if(collect_column[2][i][0].toLowerCase()==arr[j])
                {
                    if(collect_column[2][i][0].toLowerCase()!="scuffmaster"){
                        collect_column[2][i][1]="1";
                    }
                }
              }  
            }                                
            break;
     }
}

function logout_paint_on(tab,collect_column){
    switch(tab){
        case "wallcovering":
            for(i=0;i<collect_column[3].length;i++)
            {
                if(collect_column[3][i][0].toLowerCase()=="scuffmaster")
                {
                    collect_column[3][i][1]="1";
                }
            }
            break;
        case "upholstery":
            for(i=0;i<collect_column[2].length;i++)
            {
                if(collect_column[2][i][0].toLowerCase()=="scuffmaster")
                {
                    collect_column[2][i][1]="1";
                }
            }
            break;
        case "drapery":
            for(i=0;i<collect_column[2].length;i++)
            {
                if(collect_column[2][i][0].toLowerCase()=="scuffmaster")
                {
                    collect_column[2][i][1]="1";
                }
            }
            break;
        case "paint":
            for(i=0;i<collect_column[0].length;i++)
            {
                if(collect_column[0][i][0].toLowerCase()=="scuffmaster")
                {
                    collect_column[0][i][1]="1";
                }
            }
            for(i=0;i<collect_column[2].length;i++)
            {
                if(collect_column[2][i][0].toLowerCase()=="scuffmaster")
                {
                    collect_column[2][i][1]="1";
                }
            }
            break;
    }
}

function macFFFix(arg){           
    var ua=navigator.userAgent;          
    if(ua.indexOf("Mac")!=-1){
        if(ua.indexOf("Firefox")!=-1){        
            if(arg=='0'){
               // $(".content_product_library #productcontainer .menu_left").css("width","163px");
                $("#clear_all_div").css("padding-top","4px");
                $("#clear_all_div").css("margin-bottom","-1px");
                $("#clear_all_div .clear_all_txt").css("display","block");
                $("#clear_all_div .clear_all_txt").css("top","3px");
                $("#clear_all_div .clear_all_img").css("float","right");
                $("#clear_all_div .clear_all_img").css("margin-top","-11px");
            }
            if(arg=='1'){                
                // $(".content_product_library #productcontainer .menu_left").css("width","163px");
                $("#clear_all_div").css("padding-top","6px");
                $("#clear_all_div").css("margin-bottom","2px");
                $("#clear_all_div .clear_all_txt").css("display","block");
                $("#clear_all_div .clear_all_txt").css("top","2px");
                $("#clear_all_div .clear_all_img").css("float","right");
                $("#clear_all_div .clear_all_img").css("margin-top","-4px");
            }
            
            
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_lt").css("margin-top","1px");
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_mid").css("margin-top","1px");
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_rt").css("margin-top","1px");
            
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_lt").css("margin-bottom","1px");
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_mid").css("margin-bottom","1px");
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_rt").css("margin-bottom","1px");
            
            $(".content_product_library #productcontainer .content_right .footer .pagenumber").css("margin-top","1px");
            
        }
        else{
            $("#Search_text_display a").css("height","14px");
            $("#Search_text_display a").css("overflow","hidden");
            
            if(arg=='0'){
                $("#clear_all_div").css("padding-top","1px");
                $("#clear_all_div").css("margin-bottom","2px");
                $("#clear_all_div .clear_all_img").css("margin-top","0px"); 
            }
            if(arg=='1'){
                $("#clear_all_div").css("padding-top","2px");
                $("#clear_all_div").css("margin-bottom","8px");
                $("#clear_all_div .clear_all_img").css("margin-top","-3px");               
            }
                                                                                                                              
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_lt").css("margin-top","1px");
            $(".content_product_library #productcontainer .top_content .pagenumber .inside_pagenumber_top_mid").css("margin-top","1px");
            
            $(".content_product_library #productcontainer .content_right .footer .pagenumber .inside_pagenumber_bot_lt").css("margin-top","1px");
            $(".content_product_library #productcontainer .content_right .footer .pagenumber .inside_pagenumber_bot_mid").css("margin-top","1px");
            
            $(".content_product_library #productcontainer .top_content .pagenumber").css("margin-bototm","-1px");
            
        }
    }
}

/********************************************************************************************************************/

function Call_Filter_View(tot,str,filterid,filter_sub,xajaxarg,cellnumber)
{
		    var total=tot;
			var arr=str.split(",");
			var from_refresh=true;
            var table = document.getElementById(filterid); 
                        var cells = table.getElementsByTagName("a"); 
                        for(var j=0; j< total;j++){
                            for (var i = 0; i < cells.length; i++) { 
                                if(cells[i].innerHTML==arr[j]){
                                    cells[i].className="alp";
                                    cells[i].style.background="white";
                                    do_filter(cells[i],filter_sub,cellnumber);
                                    color_filter_to_model +="["+arr[j]+"]";
                                }
                            }
                        }

				if(!aj_called)
                 {  
				 
                    xajax_filter_change("1",xajaxarg,color_filter_to_model);
                    aj_called=true;
                 }
				 
}

var aj_called=false;
var from_refresh=true; 
var  category_filter_to_model;
var  material_filter_to_model;
var  pattern_filter_to_model;
var  texture_filter_to_model;
var  scale_filter_to_model;
var  color_filter_to_model;
var  color_grouping_filter_to_model;
var  collect_filter_to_model;
var  brands_filter_to_model;
var  designer_filter_to_model;
var  sustain_filter_to_model; 
var  search_keyword;
var  envattr_filter_to_model; 
var  perform_filter_to_model; 
			  
function ajaxCalled()
{
         if(!aj_called)
         {
              category_filter_to_model='';
              material_filter_to_model='';
              pattern_filter_to_model='';
              texture_filter_to_model='';
              scale_filter_to_model='';
              color_filter_to_model='';
              color_grouping_filter_to_model='';
              collect_filter_to_model='';
              brands_filter_to_model='';
              designer_filter_to_model='';
              sustain_filter_to_model=''; 
              search_keyword='';
              envattr_filter_to_model=''; 
              perform_filter_to_model=''; 
              
         } 
}  

function category_view(tol,str)
{
     var total=tol;
     var arr=str.split(",");
     var from_refresh=true;
	 for(var j=0; j< total;j++)
			category_filter_to_model +="["+arr[j]+"]";
	 if(!aj_called)
	 {
		
		 xajax_filter_change("1","category_filter",category_filter_to_model);
		aj_called=true;
	 }
				 

}
var search_keyword='';
function normal_search_view(keyw,onoff)
{
    search_keyword=keyw;
	if(search_keyword!='')
	{
   /*********************************************************************************/
                   var arr=get_combination(search_keyword); 
                                              
                      var from_refresh=true;  
                      turn_on_filter_for_search(arr,arr.length);
   /**********************************************************************************/
   if(onoff=="on")
    xajax_filter_change("0","search_button",search_keyword);
  }
}



var arr_f=Array();
function favour_filter_view(arg1,arg2)
{
    
    arr_f.push(arg2);
  
	from_refresh=true;
	turn_on_filter_for_search(arr_f,arr_f.length); 
}

function calldefault(){
 from_refresh=false;
        document.onmousedown=function(event){
                if(!myevent)
                {
                    close_all_filters();
                }
                myevent=false;
        }
}


