﻿function ChangeToolTip(elm)
{
   elm.title = elm.options[elm.selectedIndex].text;
}



// Drop down list tool tip 

//function showDropDownToolTip(elementRef) 
//{
// if ( elementRef.options[elementRef.selectedIndex].value == '' )
//    return;

// var informationSpanRef = document.getElementById('informationText');
// informationSpanRef.innerHTML = elementRef.options[elementRef.selectedIndex].text;

// var toolTipRef = document.getElementById('divDropDownToolTip');
// toolTipRef.style.top = window.event.clientY + 20;
// toolTipRef.style.left = window.event.clientX;
// toolTipRef.style.display = 'block';
//}

//function hideDropDownToolTip()
//{
// document.getElementById('divDropDownToolTip').style.display = 'none';
//}




//Populare Design Classes 

function PopulateClasses()
{
    elm = document.getElementById("ctl00_Content_DDLClass");
    elm.options[elm.length] = new Option("----- Select Class -----", "00");
    elm.options[elm.length] = new Option("01 Foodstuffs", "01");
    elm.options[elm.length] = new Option("02 Articles of clothing","02")
    elm.options[elm.length] = new Option("03 Travel goods, cases, parasols and personal belongings, not elsewhere specified","03")
    elm.options[elm.length] = new Option("04 Brushware","04")
    elm.options[elm.length] = new Option("05 Textile piece goods, artificial and natural sheet material","05")
    elm.options[elm.length] = new Option("06 Furnishing","06")
    elm.options[elm.length] = new Option("07 Household goods, not elsewhere specified","07")
    elm.options[elm.length] = new Option("08 Tools and hardware","08")
    elm.options[elm.length] = new Option("09 Packages and containers for the transport or handling of goods","09")
    elm.options[elm.length] = new Option("10 Clocks and watches and other measuring instruments, checking and signalling instruments","10")
    elm.options[elm.length] = new Option("11 Articles of adornment","11")
    elm.options[elm.length] = new Option("12 Means of transport or hoisting","12")
    elm.options[elm.length] = new Option("13 Equipment for production, distribution or transformation of electricity","13")
    elm.options[elm.length] = new Option("14 Recording, communication or information retrieval equipment","14")
    elm.options[elm.length] = new Option("15 Machines, not elsewhere specified","15")
    elm.options[elm.length] = new Option("16 Photographic, cinematographic and optical apparatus","16")
    elm.options[elm.length] = new Option("17 Musical instruments","17")
    elm.options[elm.length] = new Option("18 Printing and office machinery","18")
    elm.options[elm.length] = new Option("19 Stationery and office equipment,artists' and teaching materials","19")
    elm.options[elm.length] = new Option("20 Sales and advertising equipment,signs","20")
    elm.options[elm.length] = new Option("21 Games, toys, tents and sports goods","21")
    elm.options[elm.length] = new Option("22 Arms, pyrotechnic articles, articles for hunting, fishing and pest killing","22")
    elm.options[elm.length] = new Option("23 Fluid distribution equipment, sanitary, heating, ventilation and air-conditioning equipment,solid fuel","23")
    elm.options[elm.length] = new Option("24 Medical and laboratory equipment","24")
    elm.options[elm.length] = new Option("25 Building units and construction elements","25")
    elm.options[elm.length] = new Option("26 Lighting apparatus","26")
    elm.options[elm.length] = new Option("27 Tobacco and smokers' supplies","27")
    elm.options[elm.length] = new Option("28 Pharmaceutical and cosmetic products, toilet articles and apparatus","28")
    elm.options[elm.length] = new Option("29 Devices and equipment against fire hazards, for accident prevention for rescue","29")
    elm.options[elm.length] = new Option("30 Articles for the care and handling of animals","30")
    elm.options[elm.length] = new Option("31 Machines and appliances for preparing food or drink, not elsewhere specified","31")
    elm.options[elm.length] = new Option("99 Miscellaneous ","99")
    
    elm.title = elm.options[elm.selectedIndex].text;
    
    elm1 = document.getElementById("ctl00_Content_DDLSubClass");
    elm1.options[elm1.length] = new Option("----- Select Sub Class -----", "00");
 
}

function PopSubCls(elm,text,value)
{
    elm.options[elm.length] = new Option(text, value);
    elm.title = elm.options[elm.selectedIndex].text;
}

// Tool Tip 
function ChangeToolTip(elm)
{
   elm.title = elm.options[elm.selectedIndex].text;
   
}

function ChangeSubClass()
{
    elm1 = document.getElementById("ctl00_Content_DDLSubClass");
    document.getElementById("txt2").value = elm1.options[elm1.selectedIndex].value;
}



//Bind Sub Class LIst according to class 

function ChangeClass()
{
    // Delete List from Sub Class DDL
   elm1 = document.getElementById("ctl00_Content_DDLSubClass");
   for (var i = elm1.options.length; i >= 0; i--)
   {
       elm1.options[i] = null;
   }
   
   elm = document.getElementById("ctl00_Content_DDLClass");  
   
   document.getElementById("txt1").value = elm.options[elm.selectedIndex].value;
   document.getElementById("txt2").value ="00";
   
   
   elm.title = elm.options[elm.selectedIndex].text; // DDLClass  Tool Tip 
   
   elm1.options[elm1.length] = new Option("----- Select Sub Class -----", "00");  //Bind Default Value 
   
   var index = elm.options[elm.selectedIndex].value
   if (index == "01")
   {
        PopSubCls(elm1,"01 Bakers' products, biscuits, pastry, macaroni and other cereal products, chocolates, confectionery, ices","01")
        PopSubCls(elm1,"02 Fruit and vegetables","02")
        PopSubCls(elm1,"03 Cheeses, butter and butter substitutes, other dairy produce","03")
        PopSubCls(elm1,"04 Butchers' meat (including pork products), fish","04")
        PopSubCls(elm1,"05 Vacant","05")
        PopSubCls(elm1,"06 Animal foodstuffs","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "02")
   {
        PopSubCls(elm1,"01 Undergarments, lingerie, corsets, brassieres, nightwear","01")
        PopSubCls(elm1,"02 Garments","02")
        PopSubCls(elm1,"03 Headwear","03")
        PopSubCls(elm1,"04 Footwear, socks and stockings","04")
        PopSubCls(elm1,"05 Neckties, scarves, neckerchiefs and handkerchiefs","05")
        PopSubCls(elm1,"06 Gloves","06")
        PopSubCls(elm1,"07 Haberdashery and clothing accessories","07")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "03")
   {
        PopSubCls(elm1,"01 Trunks, suitcases, briefcases, handbags, keyholders, cases specially designed for their contents, wallets and similar articles","01")
        PopSubCls(elm1,"02 Vacant","02")
        PopSubCls(elm1,"03 Umbrellas, parasols, sunshades and walking sticks","03")
        PopSubCls(elm1,"04 Fans","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
 
   if (index == "04")
   {
        PopSubCls(elm1,"01 Brushes and brooms for cleaning","01")
        PopSubCls(elm1,"02 Toilet brushes, clothes brushes and shoe brushes","02")
        PopSubCls(elm1,"03 Brushes for machines","03")
        PopSubCls(elm1,"04 Paintbrushes, brushes for use in cooking","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
 
   if (index == "05")
   {
        PopSubCls(elm1,"01 Spun articles","01")
        PopSubCls(elm1,"02 Lace","02")
        PopSubCls(elm1,"03 Embroidery","03")
        PopSubCls(elm1,"04 Ribbons, braids and other decorative trimmings ","04")
        PopSubCls(elm1,"05 Textile fabrics ","05")
        PopSubCls(elm1,"06 Artificial or natural sheet material","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "06")
   {
        PopSubCls(elm1,"01 Beds and seats","01")
        PopSubCls(elm1,"02 Vacant","02")
        PopSubCls(elm1,"03 Tables and similar furniture","03")
        PopSubCls(elm1,"04 Storage furniture","04")
        PopSubCls(elm1,"05 Composite furniture","05")
        PopSubCls(elm1,"06 Other furniture and furniture parts","06")
        PopSubCls(elm1,"07 Mirrors and frames","07")
        PopSubCls(elm1,"08 Clothes hangers","08")
        PopSubCls(elm1,"09 Mattresses and cushions","09")
        PopSubCls(elm1,"10 Curtains and indoor blinds","10")
        PopSubCls(elm1,"11 Carpet, rugs and mats","11")
        PopSubCls(elm1,"12 Tapestries","12")
        PopSubCls(elm1,"13 Blankets and other covering materials, household linen and napery","13")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "07")
   {
        PopSubCls(elm1,"01 China, glassware, dishes and other articles of a similar nature","01")
        PopSubCls(elm1,"02 Cooking appliances, utensils and containers","02")
        PopSubCls(elm1,"03 Table knives, forks and spoons","03")
        PopSubCls(elm1,"04 Appliances and utensils, hand-manipulated, for preparing food or drink","04")
        PopSubCls(elm1,"05 Flatirons and washing, cleaning and drying equipment","05")
        PopSubCls(elm1,"06 Other table utensils","06")
        PopSubCls(elm1,"07 Other household receptacles","07")
        PopSubCls(elm1,"08 Fireplace implements","08")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "08")
   {
        PopSubCls(elm1,"01 Tools and implements for drilling, milling or digging","01")
        PopSubCls(elm1,"02 Hammers and other similar tools and implements","02")
        PopSubCls(elm1,"03 Cutting tools and implements","03")
        PopSubCls(elm1,"04 Screwdrivers and other similar tools and implements","04")
        PopSubCls(elm1,"05 Other tools and implements","05")
        PopSubCls(elm1,"06 Handles, knobs and hinges","06")
        PopSubCls(elm1,"07 Locking or closing devices","07")
        PopSubCls(elm1,"08 Fastening, supporting or mounting devices not included in other classes","08")
        PopSubCls(elm1,"09 Metal fittings and mountings for doors, windows and furniture and similar articles.","09")
        PopSubCls(elm1,"10 Bicycle racks","10")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "09")
   {
        PopSubCls(elm1,"01 Bottles, flasks, pots, carboys, demijohns and containers with dynamic dispensing means","01")
        PopSubCls(elm1,"02 Storage cans, drums and casks","02")
        PopSubCls(elm1,"03 Boxes, cases, containers, (preserve) tins or cans","03")
        PopSubCls(elm1,"04 Hampers, crates and baskets","04")
        PopSubCls(elm1,"05 Bags, sachets, tubes and capsules","05")
        PopSubCls(elm1,"06 Ropes and hooping materials","06")
        PopSubCls(elm1,"07 Closing means and attachments","07")
        PopSubCls(elm1,"08 Pallets and platforms for forklifts","08")
        PopSubCls(elm1,"09 Refuse and trash containers and stands therefor","09")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "10")
   {
        PopSubCls(elm1,"01 Clocks and alarm clocks","01")
        PopSubCls(elm1,"02 Watches and wrist watches","02")
        PopSubCls(elm1,"03 Other time-measuring instruments","03")
        PopSubCls(elm1,"04 Measuring instruments, apparatus and devices","04")
        PopSubCls(elm1,"05 Instruments, apparatus and devices for checking, security or testing","05")
        PopSubCls(elm1,"06 Signalling apparatus and devices","06")
        PopSubCls(elm1,"07 Casings, cases, dials, hands and all other parts and accessories of instruments for measuring, checking and signalling","07")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "11")
   {
        PopSubCls(elm1,"01 Jewellery","01")
        PopSubCls(elm1,"02 Trinkets, table, mantel and wall ornaments, flower vases and pots","02")
        PopSubCls(elm1,"03 Medals and badges","03")
        PopSubCls(elm1,"04 Artificial flowers, fruit and plants","04")
        PopSubCls(elm1,"05 Flags, festive decorations","05")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "12")
   {
        PopSubCls(elm1,"01 Vehicles drawn by animals","01")
        PopSubCls(elm1,"02 Handcarts, wheel barrows","02")
        PopSubCls(elm1,"03 Locomotives and rolling stock for railways and all other rail vehicles","03")
        PopSubCls(elm1,"04 Telpher carriers, chair lifts and ski lifts","04")
        PopSubCls(elm1,"05 Elevators and hoists for loading or conveying","05")
        PopSubCls(elm1,"06 Ships and boats","06")
        PopSubCls(elm1,"07 Aircraft and space vehicles","07")
        PopSubCls(elm1,"08 Motor cars, buses and lorries","08")
        PopSubCls(elm1,"09 Tractors","09")
        PopSubCls(elm1,"10 Road vehicle trailers","10")
        PopSubCls(elm1,"11 Cycles and motor cycles","11")
        PopSubCls(elm1,"12 Perambulators, invalid chairs, stretchers","12")
        PopSubCls(elm1,"13 Special purpose vehicles","13")
        PopSubCls(elm1,"14 Other vehicles","14")
        PopSubCls(elm1,"15 Tyres and anti-skid chains for vehicles","15")
        PopSubCls(elm1,"16 Parts, equipment and accessories for vehicles, not included in other classes or sub-classes","16")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "13")
   {
        PopSubCls(elm1,"01 Generators and motors","01")
        PopSubCls(elm1,"02 Power transformers, rectifiers, batteries and accumulators","02")
        PopSubCls(elm1,"03 Equipment for distribution or control of electric power","03")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "14")
   {
        PopSubCls(elm1,"01 Equipment for the recording or reproduction of sound or pictures","01")
        PopSubCls(elm1,"02 Data processing equipment as well as peripheral apparatus and devices","02")
        PopSubCls(elm1,"03 Communications equipment, wireless remote controls and radio amplifiers","03")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "15")
   {
        PopSubCls(elm1,"01 Engines","01")
        PopSubCls(elm1,"02 Pumps and compressors","02")
        PopSubCls(elm1,"03 Agricultural machinery","03")
        PopSubCls(elm1,"04 Construction machinery","04")
        PopSubCls(elm1,"05 Washing, cleaning and drying machines","05")
        PopSubCls(elm1,"06 Textile, sewing, knitting and embroidering machines including their integral parts","06")
        PopSubCls(elm1,"07 Refrigeration machinery and apparatus","07")
        PopSubCls(elm1,"09 Machine tools, abrading and founding machinery","09")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "16")
   {
        PopSubCls(elm1,"01 Photographic cameras and film cameras","01")
        PopSubCls(elm1,"02 Projectors and viewers","02")
        PopSubCls(elm1,"03 Photocopying apparatus and enlargers","03")
        PopSubCls(elm1,"04 Developing apparatus and equipment","04")
        PopSubCls(elm1,"05 Accessories","05")
        PopSubCls(elm1,"06 Optical articles","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "17")
   {
        PopSubCls(elm1,"01 Keyboard instruments","01")
        PopSubCls(elm1,"02 Wind instruments","02")
        PopSubCls(elm1,"03 Stringed instruments","03")
        PopSubCls(elm1,"04 Percussion instruments","04")
        PopSubCls(elm1,"05 Mechanical instruments","05")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "18")
   {
        PopSubCls(elm1,"01 Typewriters and calculating machines","01")
        PopSubCls(elm1,"02 Printing machines","02")
        PopSubCls(elm1,"03 Type and type faces","03")
        PopSubCls(elm1,"04 Bookbinding machines, printers' stapling machines, guillotines and trimmers (for bookbinding)","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "19")
   {
        PopSubCls(elm1,"01 Writing paper, cards for correspondence and announcements","01")
        PopSubCls(elm1,"02 Office equipment","02")
        PopSubCls(elm1,"03 Calendars","03")
        PopSubCls(elm1,"04 Books and other objects of similar outward appearance","04")
        PopSubCls(elm1,"05 Vacant","05")
        PopSubCls(elm1,"06 Materials and instruments for writing by hand, for drawing, for painting, for sculpture, for engraving and for other artistic techniques","06")
        PopSubCls(elm1,"07 Teaching materials","07")
        PopSubCls(elm1,"08 Other printed matter","08")
        PopSubCls(elm1,"99 Miscellaneous (Inc bookmarks)","99")
   }
 
   if (index == "20")
   {
        PopSubCls(elm1,"01 Automatic vending machines","01")
        PopSubCls(elm1,"02 Display and sales equipment","02")
        PopSubCls(elm1,"03 Signs, signboards and advertising devices","03")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "21")
   {
        PopSubCls(elm1,"01 Games and toys","01")
        PopSubCls(elm1,"02 Gymnastics and sports apparatus and equipment","02")
        PopSubCls(elm1,"03 Other amusement and entertainment articles","03")
        PopSubCls(elm1,"04 Tents and accessories thereof","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "22")
   {
        PopSubCls(elm1,"01 Projectile weapons","01")
        PopSubCls(elm1,"02 Other weapons","02")
        PopSubCls(elm1,"03 Ammunition, rockets and pyrotechnic articles","03")
        PopSubCls(elm1,"04 Targets and accessories","04")
        PopSubCls(elm1,"05 Hunting and fishing equipment","05")
        PopSubCls(elm1,"06 Traps, articles for pest killing","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "23")
   {
        PopSubCls(elm1,"01 Fluid distribution equipment","01")
        PopSubCls(elm1,"02 Sanitary appliances","02")
        PopSubCls(elm1,"03 Heating equipment (excluding hand tools)","03")
        PopSubCls(elm1,"04 Ventilation and air-conditioning equipment","04")
        PopSubCls(elm1,"05 Solid fuel","05")
        PopSubCls(elm1,"99 Miscellaneous ","99")
   }
 
   if (index == "24")
   {
        PopSubCls(elm1,"01 Apparatus and equipment for doctors, hospitals and laboratories","01")
        PopSubCls(elm1,"02 Medical instruments, instruments and tools for laboratory use","02")
        PopSubCls(elm1,"03 Prosthetic articles","03")
        PopSubCls(elm1,"04 Materials for dressing wounds, nursing and medical care","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "25")
   {
        PopSubCls(elm1,"01 Building materials","01")
        PopSubCls(elm1,"02 Prefabricated or pre-assembled building parts","02")
        PopSubCls(elm1,"03 Houses, garages and other buildings","03")
        PopSubCls(elm1,"04 Steps, ladders and scaffolds","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "26")
   {
        PopSubCls(elm1,"01 Candlesticks and candelabra","01")
        PopSubCls(elm1,"02 Torches and hand lamps and lanterns","02")
        PopSubCls(elm1,"03 Public lighting fixtures","03")
        PopSubCls(elm1,"04 Luminous sources, electrical or not","04")
        PopSubCls(elm1,"05 Lamps, standard lamps, chandeliers, wall and ceiling fixtures, lampshades, reflectors, photographic and cinematographic projector lamps","05")
        PopSubCls(elm1,"06 Luminous devices for vehicles","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "27")
   {
        PopSubCls(elm1,"01 Tobacco, cigars and cigarettes","01")
        PopSubCls(elm1,"02 Pipes, cigar and cigarette holders","02")
        PopSubCls(elm1,"03 Ashtrays","03")
        PopSubCls(elm1,"04 Matches","04")
        PopSubCls(elm1,"05 Lighters","05")
        PopSubCls(elm1,"06 Cigar cases, cigarette cases, tobacco jars and pouches","06")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "28")
   {
        PopSubCls(elm1,"01 Pharmaceutical products","01")
        PopSubCls(elm1,"02 Cosmetic products","02")
        PopSubCls(elm1,"03 Toilet articles and beauty parlour equipment","03")
        PopSubCls(elm1,"04 Wigs, false hairpieces","04")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "29")
   {
        PopSubCls(elm1,"01 Devices and equipment against fire hazards","01")
        PopSubCls(elm1,"02 Devices and equipment for accident prevention and for rescue not elsewhere specified","02")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
  
   if (index == "30")
   {
        PopSubCls(elm1,"01 Animal clothing","01")
        PopSubCls(elm1,"02 Pens, cages, kennels and similar shelters","02")
        PopSubCls(elm1,"03 Feeders and waterers","03")
        PopSubCls(elm1,"04 Saddlery","04")
        PopSubCls(elm1,"05 Whips and prods","05")
        PopSubCls(elm1,"06 Beds and nests","06")
        PopSubCls(elm1,"07 Perches and other cage attachments","07")
        PopSubCls(elm1,"08 Markers, marks and shackles","08")
        PopSubCls(elm1,"09 Hitching posts","09")
        PopSubCls(elm1,"99 Miscellaneous","99")
   }
 
   if (index == "31")
   {
        PopSubCls(elm1,"00 Machines and appliances for preparing food or drink, not elsewhere specified","00")
   }
  
   if (index == "99")
   {
        PopSubCls(elm1,"00 Miscellaneous","00")
   }
}

 
 
 function PopulateClassAfterPostback(classID,SubClassID)
{
   //Bind Class
    PopulateClasses();
    if((classID.Length>0)&&(classID.Length <2))
    {
        classID ='0'+classID
    }
    elm = document.getElementById("ctl00_Content_DDLClass");
    for (var i =0;i< elm.options.length;i++)
    {
        if(elm.options[i].value==classID)
            elm.selectedIndex=i;
    }
    //Bind Sub Class 
    ChangeClass();   
    
    if((SubClassID.Length>0)&&(SubClassID.Length <2))
    {
        SubClassID ='0'+SubClassID
    }
       
    elm1 = document.getElementById("ctl00_Content_DDLSubClass");
    for (var i =0;i< elm1.options.length;i++)
    {
        if(elm1.options[i].value==SubClassID)
        elm1.selectedIndex=i;
    }
    
}
