var key = "";
function makeEntry ()
{
    this.Name="";
    this.URL = "";
    this.Desc = "";
    this.Category = "";
    return this;
}

function makeArray(n) 
{
    this.length = n;
    for (var k = 1; k <= n; k++) 
    {
        this[k] = "";
    }
    return this;
}               

function makeLinks(size) 
{
    this.length = size;
    for (var r=1; r<= size; r++) 
    {
        this[r] = new makeEntry();
        this[r].Name = namesArray[r];
        this[r].URL = urlsArray[r];
        this[r].Desc = descArray[r];
    }
    return this;
}



var linksize=0 

datesArray = new makeArray(linksize);
namesArray = new makeArray(linksize);
urlsArray = new makeArray(linksize);
descArray = new makeArray(linksize);


var arraycount=0

arraycount += 1 
urlsArray[arraycount] = "home.html"
namesArray[arraycount] = "Established in 2003 as a division of Corporate Publishing International, ..."
descArray[arraycount] = " home, about"

arraycount += 1 
urlsArray[arraycount] = "p-advertising.html"
namesArray[arraycount] = "Advertising"
descArray[arraycount] = "advertising, Climate Control Middle East, h20, magazines, chill, megawhat"

arraycount += 1 
urlsArray[arraycount] = "p-advertising-bp.html"
namesArray[arraycount] = "The Big Project, a monthly magazine, aims to understand the main aspects of a project vis-?vis architecture, design, the building industry and property development."
descArray[arraycount] = "advertising, the big project"

arraycount += 1 
urlsArray[arraycount] = "p-advertising-cc.html"
namesArray[arraycount] = "Climate Control Middle East, THE REGION’S FIRST DEDICATED MAGAZINE FOR THE HVACR INDUSTRY"
descArray[arraycount] = "advertising"

arraycount += 1 
urlsArray[arraycount] = "p-advertising-h2o.html"
namesArray[arraycount] = "H2O magazine"
descArray[arraycount] = "advertising, h2o"

arraycount += 1 
urlsArray[arraycount] = "p-advertising-mw.html"
namesArray[arraycount] = "MEGAWHAT offers comprehensive coverage of news and views on the Middle East power industry, with an emphasis on relevance and depth."
descArray[arraycount] = "advertising, megawhat"


arraycount += 1 
urlsArray[arraycount] = "p-h2o.html"
namesArray[arraycount] = "The Big Project. Every month, The Big Project reviews two or three projects in detail by speaking to the architects and masterplanners."
descArray[arraycount] = "H2O, water, Middle East, water magazine, trade publications, trade magazines, trade publication, trade magazine, CPI, CPI-Industry, CPI Industry, desalination, IDA, pipelines, piping networks, STPs, sewage treatment plants, sludge, dewatering, compacting, MBR, MBBR, valves, MSF, hybrid, RO, UF, reverse osmosis, ultra-filtration, ionisation, UV, Ashghal, Sulaibiya, Metito, Al Hijaz Electromechanical, GE, Zenon, Siemens, Veolia, grey water, recycling, activated carbon, adsorption, absorption, aquifer, backwash, bacteria, brine, filters, calcium, TDS, COD, chemical oxygen demand, BOD, biological oxygen demand, chlorine, chloride, coagulant, distillation, flocculation, fouling, hydraulic, hydraulics, ion exchange, ion exchanger, osmosis, ppm, parts per million, pH, pressure differential, pressure drop, EPA, USEPA"

arraycount += 1 
urlsArray[arraycount] = "p-climate-control.html"
namesArray[arraycount] = "Climate Control Middle East"
descArray[arraycount] = "Climate Control Middle East, air conditioning, air-conditioning, heating, refrigeration, refrigerant, refrigerants, HVAC, HVACR, HVAC magazine, HVACR magazine, trade publications, trade magazines, Middle East, GCC, CPI, CPI-Industry, CPI Industry, Industry, Chill, district cooling, chilled water, low delta T, MEP, EPC, chiller, condenser, compressor, VSDs, facilities management, cooling towers, climate, IAQ, IEQ, Green Buildings, ASHRAE, ARI, IFMA, Emirates Green Building Council, EmiratesGBC, USGBC, US Green Building Council, IDEA, Emirates Falcon Chapter, heat recovery, heat transfer, comfort cooling, mould, humidity, legionella, Legionnaire’s Disease, controls, thermostat, humidistat, ventilation, Tabreed, Emicool, Empower, Palm District Cooling, Stellar, TAS, Trane, JCI, Carrier, JCI, McQuay, LG, Samsung, Aftron, Hitachi, Danfoss, ebm-papst, piping networks, TES, TIAC, CTIAC, valves, pipes, construction, CO2, carbon credits, carbon dioxide emissions, Montreal Protocol, Kyoto Protocol, Building Related Illness, BRI, Sick Building Syndrome, SBS, LEED, LEED Platinum, LEED Silver, LEED Gold, LEED-NC, LEED-EB, daylighting, spectrally selective glass, kilowatt hour, kwh/t, Low-E windows, particulate matter, passive cooling, passive ventilation, photovoltaic panels, PV panels, PVs, TR, tons, tonnes, hydraulic, hydraulics, pressure differential, pressure drop, EPA, USEPA, BSRIA, CIBSE"

arraycount += 1 
urlsArray[arraycount] = "p-climate-control-directory.html"
namesArray[arraycount] = "Climate Control Middle East Directory"
descArray[arraycount] = "Climate Control Middle East, directory, air conditioning, air-conditioning, heating, refrigeration, refrigerant, refrigerants, HVAC, HVACR, HVAC magazine, HVACR magazine, trade publications, trade magazines, Middle East, GCC, CPI, CPI-Industry, CPI Industry, Industry, Chill, district cooling, chilled water, low delta T, MEP, EPC, chiller, condenser, compressor, VSDs, facilities management, cooling towers, climate, IAQ, IEQ, Green Buildings, ASHRAE, ARI, IFMA, Emirates Green Building Council, EmiratesGBC, USGBC, US Green Building Council, IDEA, Emirates Falcon Chapter, heat recovery, heat transfer, comfort cooling, mould, humidity, legionella, Legionnaire’s Disease, controls, thermostat, humidistat, ventilation, Tabreed, Emicool, Empower, Palm District Cooling, Stellar, TAS, Trane, JCI, Carrier, JCI, McQuay, LG, Samsung, Aftron, Hitachi, Danfoss, ebm-papst, piping networks, TES, TIAC, CTIAC, valves, pipes, construction, CO2, carbon credits, carbon dioxide emissions, Montreal Protocol, Kyoto Protocol, Building Related Illness, BRI, Sick Building Syndrome, SBS, LEED, LEED Platinum, LEED Silver, LEED Gold, LEED-NC, LEED-EB, daylighting, spectrally selective glass, kilowatt hour, kwh/t, Low-E windows, particulate matter, passive cooling, passive ventilation, photovoltaic panels, PV panels, PVs, TR, tons, tonnes, hydraulic, hydraulics, pressure differential, pressure drop, EPA, USEPA, BSRIA, CIBSE"

arraycount += 1 
urlsArray[arraycount] = "p-contact-us.html"
namesArray[arraycount] = "Contact Us"
descArray[arraycount] = "Contact Us, send, mail"

arraycount += 1 
urlsArray[arraycount] = "p-corporate.html"
namesArray[arraycount] = "CORPORATE INFORMATION"
descArray[arraycount] = "CORPORATE INFORMATION, publications, publication"

arraycount += 1 
urlsArray[arraycount] = "p-cpi-industry.html"
namesArray[arraycount] = "CPI Industry produces focused, vertical publications to serve a market need for special-interest publications with on-the-spot information, as opposed to general trade magazines that make the acquisition of news and information a time-consuming affair."
descArray[arraycount] = "CPI industry, publications, publication"

arraycount += 1 
urlsArray[arraycount] = "p-digital.html"
namesArray[arraycount] = "DIGITAL, Enter the digital world. Get CPI Industry’s publications delivered to your desktop every month. "
descArray[arraycount] = "digitl, climate control, download, h2o, megawhat, subscribtion, subscribe"

arraycount += 1 
urlsArray[arraycount] = "p-editorial.html"
namesArray[arraycount] = "Editorial"
descArray[arraycount] = "climate control, download, h2o, megawhat, media kit"

arraycount += 1 
urlsArray[arraycount] = "p-guides.html"
namesArray[arraycount] = "Guides"
descArray[arraycount] = "guides, guide, CLIMATE CONTROL MIDDLE EAST DIRECTORY, POWER SOLUTIONS MIDDLE EAST, offers"

arraycount += 1 
urlsArray[arraycount] = "p-subsciption.html"
namesArray[arraycount] = "Subsription"
descArray[arraycount] = "free subscription, climate control middle east, h2o, megawhat"


linksize = arraycount;

// ----end data -------


function searchLinks(links, keyword)
{
        document.write("<body bgcolor='#677679' text='#ffffff' link='#000066'  vlink='#000066' alink='#00ced1'>")
        document.write("Search results for keyword: <strong>" +keyword +"</strong><br><br>");
        for (var q=1; q<=links.length; q++) 
        {

        if (links[q].URL.toLowerCase().indexOf(keyword) != -1){
          document.write("<a href=" + links[q].URL +">" + links[q].URL + "</a> - ");
          document.write( links[q].Name + "<br>");
          continue;
         }
        if (links[q].Desc.toLowerCase().indexOf(keyword) != -1) {
          document.write("<a href=" + links[q].URL +">" + links[q].URL + "</a> - ");
          document.write( links[q].Name + "<br>");
          continue;
         }
        if (links[q].Name.toLowerCase().indexOf(keyword) != -1) {
          document.write("<a href=" + links[q].URL +">" + links[q].URL + "</a> - ");
          document.write( links[q].Name + "<br>");
          continue;
         }

     }                                       


}

//--></script>
function validate_form() {
 
  txt = document.form.search.value;
  if (txt.indexOf(".") != -1){
        alert("Search is invalid! Contains a '.'"); return;}
  if (txt.indexOf(",") != -1){
        alert("Search is invalid! Contains a ','"); return;}
  if (txt.indexOf("@") != -1){
        alert("Search is invalid! Contains a '@''"); return;}
  if (txt.indexOf("!") != -1){
        alert("Search is invalid! Contains a '!''"); return;}
  if (txt.indexOf("#") != -1){
        alert("Search is invalid! Contains a '#''"); return;}
  if (txt.indexOf("$") != -1){
        alert("Search is invalid! Contains a '$''"); return;}
  if (txt.indexOf("%") != -1){
        alert("Search is invalid! Contains a '%''"); return;}
  if (txt.indexOf("^") != -1){
        alert("Search is invalid! Contains a '^''"); return;}
  if (txt.indexOf("&") != -1){
        alert("Search is invalid! Contains a '&''"); return;}
  if (txt.indexOf("*") != -1){
        alert("Search is invalid! Contains a '*''"); return;}
  if (txt.indexOf("(") != -1){
        alert("Search is invalid! Contains a '(''"); return;}
  if (txt.indexOf(")") != -1){
        alert("Search is invalid! Contains a ')''"); return;}
  if (txt.indexOf("[") != -1){
        alert("Search is invalid! Contains a '[''"); return;}
  if (txt.indexOf("]") != -1){
        alert("Search is invalid! Contains a ']''"); return;}
  if (txt.indexOf(";") != -1){
        alert("Search is invalid! Contains a ';''"); return;}
  if (txt.indexOf(":") != -1){
        alert("Search is invalid! Contains a ':''"); return;}
  if (txt.indexOf("<") != -1){
        alert("Search is invalid! Contains a '<''"); return;}
  if (txt.indexOf(">") != -1){
        alert("Search is invalid! Contains a '>''"); return;}
  if (txt.indexOf("?") != -1){
        alert("Search is invalid! Contains a '?''"); return;}
  if (txt.indexOf("=") != -1){
        alert("Search is invalid! Contains a '=''"); return;}
  if (txt.indexOf("+") != -1){
        alert("Search is invalid! Contains a '+''"); return;}
  else {
        jsi = new makeLinks(linksize);
        searchLinks(jsi, txt);
}

}
