// global variables //
var TIMER = 5;
var SPEED = 10;
var WRAPPER = 'content';

// calculate the current window width //
function pageWidth() {
  return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

// calculate the current window height //
function pageHeight() {
  return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

// calculate the current window vertical offset //
function topPosition() {
  return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

// calculate the position starting at the left of the window //
function leftPosition() {
  return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}

// build/show the dialog box, populate the data and call the fadeDialog function //
function showDialog(title,message,type,autohide) {
  if(message == 'ants1')
	message = '<img src=images/img-popup-ant1.jpg align=left style=margin-right:15px;><h1>Argentine Ants</h1><p><h3>Key Features</h3><p>Argentine Ants <i>(Linepithema humile, formerly Iridomyrmex humilis)</i>are small dark coloured ants, approx 3mm in length.<p>Argentine ants cause problems in agricultural areas by protecting plant pests, such as aphids and scale insects, from predators and parasitoids. In return for this protection, the ants receive a sweet excretion, known as &#34;honeydew&#34;. Thus, when Argentine ants invade an agricultural area, the population densities of these plant parasites increase, and so too does the damage they cause to crops.<p><h3>Biology</h3><p>Argentine ant workers are unable to lay reproductive eggs, but can direct the development of eggs into reproductive females; the production of males appears to be controlled by the amount of food available to the larvae. The queens seldom or never disperse in winged form. Instead, colonies spread by budding off into new units, with Argentine ants routinely moving their nests. As few as ten workers and a single queen can establish a new colony.<p><h3>Distribution</h3><p>The native range of Argentine ants is limited to around major waterways in the lowland areas of the Paran&#229; River drainage; They have recently spread into parts of Argentina, Brazil, Chile, Colombia, Ecuador, and Peru. The species has become established in at least 15 countries throughout the world, on six continents as well as many oceanic islands.<p><h3>Significance</h3><p>These ants are ranked among the worlds 100 worst animal invaders. In its introduced range, the Argentine ant often displaces most or all native ants. This can, in turn, imperil other species in the ecosystem, such as native plants that depend on native ants for seed dispersal, or lizards that depend on native ants for food.<p><h3>Control</h3><p>The most effective control is through use of slow-acting poison bait, which will be carried back to the nest by the workers, eventually killing all the individuals, including the queens. It may take four to five days to eradicate a colony in this manner.'
  if(message == 'ants2')
	message = '<img src=images/img-popup-ant2.jpg align=left style=margin-right:15px;><h1>Black Garden Ants</h1><p><h3>Key Features</h3><p>The most significant species that invades UK houses is the Black Garden Ant (actually very dark brown). Black Garden Ants typically nest outside, preferring sandy soils, and can trail in some numbers into buildings in search of sweet, sugary foodstuffs.<p><h3>Biology</h3><p>Ants are highly organised social insects, normally with each nest being centred around one reproductive female, the queen, and her sterile daughters, the workers. It is the foraging workers that invade buildings in search of foodstuffs, which they take back to the nest to feed the larvae and queen.<p>&ldquo; Flying ants&rdquo; are the reproductive males and females - the potential queens. Black Garden Ants have a nuptial swarming flight during a few days in July and August, typically just after stormy weather. The males die shortly after mating and the females seek out nesting sites to build new colonies in the following spring.<p><h3>Distribution</h3><p>Black Ants are common throughout Europe, Asia, northern Africa and North America.<p><h3>Significance</h3><p>Black Ants usually nest in soil but can also be found living under paving stones and concrete. They can become real nuisance pests because during foraging, the workers may enter domestic, commercial and industrial premises - particularly food preparation areas - in search of sweet foodstuffs. The mating swarms can also cause a short-term nuisance, although this lasts only a few days.<p><h3>Control</h3><p>Following the trail of workers and scouts back to the nest is the best way to establish the source of the infestation. From here there is a variety of ways to control and remove the infestation:<ul><li>Insecticidal treatment (destruction) of the nest.</li><li>Gel baits, which the workers carry back to the nest to feed the queen.</li></ul>These sweet gels are actually poisonous to the ants.<ul><li>Hormonal Baits - disrupt the development of ants.</li><li>Strategically placed insecticide barriers to prevent the ants from entering the property</li></ul>Good hygiene is also vital to avoid attracting the ants back to food sources.'
  if(message == 'mice2')
	message = '<img src=images/img-popup-mice1.jpg align=left style=margin-right:15px;><h1>House Mouse</h1><p><h3>Key Features</h3><p>The adult house mouse <i>(Mus domesticus)</i> is small and slender - between 2 & 4 inches long, including the tail. The house mouse has large ears, a noticeably pointed nose and small eyes. Its fur is variable in colour, but is usually a light grey or brown.<p>The house mouse seeks the warmth and shelter of buildings for nesting sites and food. Infestations are normally detected from their dark-coloured droppings or damage to stored foods in the larder, packaging or woodwork.<p><h3>Biology:</h3><p>Mice become sexually mature in eight to ten weeks, and a pair may produce eight litters each of 16 young, in a year. In theory, a single breeding pair of mice can give rise to a population of more than 7000 mice in one year. Mice can climb well and can squeeze through very small gaps. The average mouse defaecates 70 times in 24 hours and urinates frequently to mark its territory.<p>Mice are erratic feeders, eating a little from here, a lttle from there, rather than taking repeated meals from a single large food source. They do not need free water to drink as they can extract sufficient moisture from their food.<p><h3>Distribution:</h3><p>Common throughout Europe, Asia and America, the house mouse is very secretive and is usually nocturnal, so is not often seen.<p><h3>Significance:</h3><p>Mice may seriously damage all water and gas pipes, electric cables, packaging and woodwork - many instances of electrical fires and floods have been attributed to them. They also contaminate far more food than they consume and they are capable of carrying many diseases, particularly food poisoning.<p><h3>Control:</h3><p>Mice can be controlled using a variety of traps and poison baits. Where children or pets are likely to be able to access mice control measures, it is recommended that poison bait is housed in tamperproof bait boxes. A traditional advantage of using traps was the easy disposal of dead rodents - there was a possibility of poisoned rodents dying under floorboards and potentially causing unpleasant odours. However, modern baits nowadays have an additive that prevents this smell, so the problem of disposal is less of an issue nowadays.'
  if(message == 'spimoth1')
	message = '<img src=images/img-popup-spimoth1.jpg align=left style=margin-right:15px;><h1>Indian Meal Moth</h1><p><h3>Key Features</h3><p>The Indian Meal Moth <i>(Plodia interpunctella)</i> is considered the most troublesome of the grain-infesting moths. The outer two thirds of the forewings are bronze or copper in color while the upper third are yellowish-gray, with a dark band at the interface between the two. The wingspan is 16-20 mm. The larvae, spinning silken threads as they feed and crawl, web food particles together, thus causing damage. Besides infesting all cereal food products and whole grains, larvae also feed on a wide variety of foods and feeds such as dried fruits, powdered milk, cornmeal, flour, raisins, prunes, nuts, chocolate, candies, health food and seeds, bird seed, dog and cat food, fish food, sweets crackers, dried red peppers, pastas, etc. These moths fly mostly at night and are attracted to lights.<p><h3>Biology</h3><p>Up to 300 eggs are laid directly onto the food surface. These are smaller than 0.5 mm and not sticky. The larvae (Waxworms) are off-white, with a brown head and approximately 12 mm long when mature.<p><h3>Distribution</h3><p>A cosmopolitan species, which is beleved to have originated in South America it is now established in milder areas of the U.K. It will survive all year round in warmer conditions.<p><h3>Significance</h3><p>Storage of many products at any stage is susceptible to Indian Meal Moth, whether it is in manufacturing and processing plants, distribution warehouses, shipping containers, restaurants, retail outlets etc.<p>These insect pests can cause damage in a variety of ways:<ul><li>Destruction or damage to the materials or foods through larval activity and contamination with larval by products, e.g. webbing and frass. Webbing can entirely coat commodities and may be responsible for blocking machinery and ducts. The problem is exacerbated when webbing becomes mixed with frass, food and general debris.<p><li>Reducing nutritional value of foods and spoiling food by defecating on the product. This can lead to the production of fungi and disease causing toxins. These in turn can cause human illness and potentially the production of deadly mycotoxins that can lead to illness in most livestock and have been linked to some forms of human cancer.<p><li>Spoiling by contaminating with whole bodies or insect fragments. If found by consumers in produce this is both off putting and potentially very damaging to the reputation of the producer.</ul><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation).<p>The location of infestations can be aided by the deployment of pheromone traps. Indian Meal Moth can feed and survive on even the smallest bits of food debris, so cleaning is a crucial part of controlling these pests. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate. In mills, cleaning and heat treatment of infested machinery can be very effective.'
  if(message == 'spimoth2')
	message = '<img src=images/img-popup-spimoth2.jpg align=left style=margin-right:15px;><h1>Mill Moth</h1><p><h3>Key Features</h3><p>Ephestia kuehniella is also known as the Mediterranean Flour Moth, the Mill Moth, and Flour Moth. They are pale grey, and have a 20-25mmm wingspan with the larvae being whitish with black speckles.<p>It is a particular problem in provender mills, bakeries and occasionally even in catering premises. Larval silk is often responsible for blockages in flour chutes and machinery.<p>One generation is usually produced, but in warmer conditions adults will be present throughout the year when there may be 4 - 6 generations. It is the main moth pest of cereal storage in the U.K.<p><h3>Biology</h3><p>Depending on temperature and humidity, a single female may lay up to 562 eggs. Optimum temperature is 26&deg; C. At 27&deg; C temperature, timing for development of a generation varies from 43 to 72 days, and from 140 to 243 days at 10&deg; C. It can only develop up to 35&deg; C.<p>Life cycle takes three to four months, under adequate conditions of temperature and air humidity (70%).<p><h3>Distribution</h3><p>This moth originally came from India. It was first found in Europe in about 1877 in some American wheat.<p><h3>Significance</h3><p>Storage of many products at any stage is susceptible to Mill Moth, whether it is in manufacturing and processing plants, distribution warehouses, shipping containers, restaurants, retail outlets etc.<p>These insect pests can cause damage in a variety of ways:<ul><li>Destruction or damage to the materials or foods through larval activity</li><p><li>Contamination with larval by products, e.g. webbing and frass. Webbing can entirely coat commodities and may be responsible for blocking machinery and ducts. The problem is exacerbated when webbing becomes mixed with frass, food and general debris.</li><p><li>Reducing nutritional value of foods</li><p><li>Spoiling food by defecating on the product. This can lead to the production of fungi and disease causing toxins. These in turn can cause human illness and potentially the production of deadly mycotoxins that can lead to illness in most livestock and have been linked to some forms of human cancer.</li><p><li>Spoiling by contaminating with whole bodies or insect fragments. If found by consumers in produce this is both off putting and potentially very damaging to the reputation of the producer.</li></ul><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation). The location of infestations can be aided by the deployment of pheromone traps. Mill Moth can feed and survive on even the smallest bits of food debris, so cleaning is a crucial part of controlling these pests. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate. In mills, cleaning and heat treatment of infested machinery can be very effective.'
  if(message == 'spimoth3')
	message = '<img src=images/img-popup-spimoth3.jpg align=left style=margin-right:15px;><h1>Warehouse Moth</h1><p><h3>Key Features</h3><p>Also called Cocoa Moth and Tobacco Moth, the adult warehouse moths <i>(Ephestia elutella)</i> are small (7-9mm in length) with a wingspan of 10-16mm and are greyish brown with a banded appearance.<p><h3>Biology</h3><p>Eggs are laid on or near the products. Larvae are highly mobile, moving over products and packaging, where they feed and produce silk which may form large webs. When fully grown, they leave the products and migrate toward the structures or package openings. Pupae may be immediately formed.<p>Adults are short lived and do not feed. They are active at night and usually fly towards the structures roofing. They live for 13 to 14 days and a female may lay 280 eggs. Life cycle takes 50-90 days under optimum temperature conditions.<p><h3>Distribution</h3><p>Widely distributed throughout temperate regions, the most common stored product pest moth in the U.K., although uncommon in the northern parts. It is rarely imported except on products from other temperate areas<p><h3>Significance</h3><p>Storage of many products at any stage is susceptible to Warehouse Moth, whether it is in manufacturing and processing plants, distribution warehouses, shipping containers, restaurants, retail outlets etc.<p>These insect pests can cause damage in a variety of ways:<ul><li>Destruction or damage to the materials or foods through larval activity</li><p><li>Contamination with larval by products, e.g. webbing and frass. Webbing can entirely coat commodities and may be responsible for blocking machinery and ducts. The problem is exacerbated when webbing becomes mixed with frass, food and general debris.</li><p><li>Reducing nutritional value of foods</li><p><li>Spoiling food by defecating on the product. This can lead to the production of fungi and disease causing toxins. These in turn can cause human illness and potentially the production of deadly mycotoxins that can lead to illness in most livestock and have been linked to some forms of human cancer.</li><p><li>Spoiling by contaminating with whole bodies or insect fragments. If found by consumers in produce this is both off putting and potentially very damaging to the reputation of the producer.</li></ul><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation). The location of infestations can be aided by the deployment of pheromone traps. Warehouse Moth can feed and survive on even the smallest bits of food debris, so cleaning is a crucial part of controlling these pests. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate. In mills, cleaning and heat treatment of infested machinery can be very effective.'
  if(message == 'spimoth4')
	message = '<img src=images/img-popup-spimoth4.jpg align=left style=margin-right:15px;><h1>White Shouldered House Moth</h1><p><h3>Key Features</h3><p>The adult white shouldered <i>(Endrosis sarcitrella)</i> house moths average 6.3 (male) and 10.5 (female) mm IN length. Recently emerged adults can be readily recognized by their white shoulders and prothorax, contrasting with the grayish-whiteforewings that are marked by dark patches.<p>This widely distributed insect feeds on a great variety of plant material, such as dry seeds, seed potatoes, rubbish in bird nests, thatch on roofs, fungi on trees, and miscellaneous dry vegetable refuse.<p>It is known to do serious damage in wine cellars by boring into corks, and is also said to infest homes, feeding on dry seeds, meal, and carpets. In Great Britain, where the oecophorids appear to be more important pests of stored products than they are in the United States, Endrosis sarcitrella is almost certain to be found wherever broken grain, flour, or other vegetable debris is allowed to accumulate undisturbed.<p><h3>Biology</h3><p>Complete metamorphosis life cycle is followed.<p>Females are capable of laying over 200 eggs directly in or close by food substrates. Larvae are nocturnal feeders, and pupation occurs in the structure of the habitat. Relative Humidity of 90% is optimum with preferred access to free water.<p><h3>Distribution</h3><p>It is reported to be a greater pest in Europe than in the United States.<p><h3>Significance</h3><p>Although seen often in domestic premises, this species is rarely a cause for concern - fabric and food are not directly attacked. Commercial and large scale food storage and processing are at greater risk from contamination by silk and frass created by the larvae.<p><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation. Moth larvae can feed and survive on even the smallest bits of debris, so cleaning is a crucial part of controlling these pests. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate. In mills, cleaning and heat treatment of infested machinery can be very effective.'
  if(message == 'gull1')
	message = '<img src=images/img-popup-gulls1.jpg align=left style=margin-right:15px;><h1>Great Black Backed Gull</h1><p><h3>Key Features</h3><p>The Great Black Backed Gull <i>(Larus marinus)</i> is the largest gull, much bigger than a Herring Gull and is often described as the King of Gulls. It is 61-74 cm (24-28 in) long with a 1.4-1.7 m wingspan, the large adult males often weighing in at more than 2 kilogrammes. It is bulky, and has a powerful bill. The adults have black wings and back, with conspicuous white &quot;mirrors&quot; at the wing tips. The legs are pinkish,and the bill yellow with a red spot.<p>The call is a deep &quot;laughing&quot; cry.<p>Unlike most Larus gulls, Great Black-backed Gulls are mostly carnivorous and frequently hunt and kill any prey smaller than themselves, behaving more like a raptor than a typical larid gull, though they will also scavenge.<p><h3>Biology</h3><p>This species breeds singly or in small colonies, making a lined nest on the ground often on top of a rocky stack. 1-3 eggs are laid. Young Great Black-backed Gulls leave the nest area at 50 days of age and may remain with their parents for months afterwards - though most fledglings choose to congregate with other immature gulls in the search for food.<p>Young birds have scaly black-brown upperparts, and a neat wing pattern. They take at least four years to reach maturity, development in this species being somewhat slower than that of other large gulls.<p><h3>Distribution</h3><p>These gulls are found throughout Northern latitudes in Europe, Greenland and North America.<p><h3>Significance</h3><p>Can carry serious diseases, and often cause significant hygiene problems through their droppings. Droppings can cause floods by blocking drainage, and can corrode masonry. Gulls are very territorial, and will attack if their territory is threatened. The raucous calls of massed nesting gulls causes significant nuisance.<p><h3>Control</h3><p>A careful survey will reveal areas of infestation, nest sites, perches and roosts. These should then be treated with a variety of proofing mechanisms, to restrict access by gulls. Flock sizes may be reduced by culling, by a variety of methods.'
  if(message == 'wasp1')
	message = '<img src=images/img-popup-wasps1.jpg align=left style=margin-right:15px;><h1>Common Wasp</h1><p><h3>Key Features</h3><p>Common Wasps <i>(Vespula vulgaris)</i> are insects who tend to build their elaborate nests in buildings and holes rather than in bushes. They feed on other insects in the early summer, and then feed on sweet substances later in the year.<p>Common wasps construct large nests from chewed wood which may eventually house approximately 10,000 workers. There is, however, only ever a single queen wasp per nest. The worker wasps forage over a distance of five hundred metres.<p>Common wasps can be aggressive when disturbed, and their sting can be quite painful.<p><h3>Biology</h3><p>Queens emerge from hibernation during the spring, and they search for a suitable location in which to start a new nest. She begins to build the nest with chewed wood pulp, and a few eggs are laid in individual paper cells; these eggs develop into non-reproductive workers. When 5-10 workers have emerged, they take over the care of the nest, and the rest of queens life is devoted solely to egg laying. Worker wasps capture insects, bringing them back to the nest to feed the brood. Most people do not realise that wasps control many species of insect pests, and their presence in a garden should be welcomed.<p>The nest grows throughout the summer, reaching its peak size towards mid September. At around this time the queen lays eggs that develop into males (drones) and new queens, she then dies shortly after. The new queens and males mate during a &quot;nuptial flight&quot;, after which the males die, and the newly mated queens seek out suitable places in which to hibernate; the old nest is never re-used.<p><h3>Distribution</h3><p>Widespread and common throughout Britain, this wasp has been introduced to many areas outside of its natural range, and is a serious pest in Australia and New Zealand.<p><h3>Significance</h3><p>This species has earned a bad public image, it is aggressive and many people every year suffer wasps stings.<p><h3>Control</h3><p>Wasps nests can be controlled through insecticidal sprays, insecticidal smoke generators and other treatments. Careful consideration should be given, before deciding to control these largely beneficial insects.'
  if(message == 'wasp2')
	message = '<img src=images/img-popup-wasps2.jpg align=left style=margin-right:15px;><h1>European Wasp</h1><p><h3>Key Features</h3><p>European Wasps <i>(Vespula germanica)</i> are large wasps who tend to build their elaborate nests in trees and bushes rather than in buildings. They feed on other insects in the early summer, then feed on sweet substances later in the year.<p>European wasps construct large nests which may eventually house approximately 10,000 workers. There is, however, only ever a single queen wasp per nest. The worker wasps forage over a distance of five hundred metres.<p>European wasps can be aggressive when disturbed, and their sting can be quite painful.<p><h3>Biology</h3><p>Queens emerge from hibernation during the spring, and they search for a suitable location in which to start a new nest. She begins to build the nest with chewed wood pulp, and a few eggs are laid in individual paper cells; these eggs develop into non-reproductive workers. When 5-10 workers have emerged, they take over the care of the nest, and the rest of queens life is devoted solely to egg laying. Worker wasps capture insects, bringing them back to the nest to feed the brood. Most people do not realise that wasps control many species of insect pests, and their presence in a garden should be welcomed.<p>The nest grows throughout the summer, reaching its peak size towards mid September. At around this time the queen lays eggs that develop into males (drones) and new queens, she then dies shortly after. The new queens and males mate during a &quot;nuptial flight&quot;, after which the males die, and the newly mated queens seek out suitable places in which to hibernate; the old nest is never re-used.<p><h3>Distribution</h3><p>The German wasp is found throughout Europe except on the Scandinavian peninsula.<p><h3>Significance</h3><p>This species has earned a bad public image, it is aggressive and many people every year suffer wasps stings.<p><h3>Control</h3><p>Wasps nests can be controlled through insecticidal sprays, insecticidal smoke generators and other treatments. Careful consideration should be given, before deciding to control these largely beneficial insects.'
  if(message == 'wasp3')
	message = '<img src=images/img-popup-wasps3.jpg align=left style=margin-right:15px;><h1>Hornets</h1><p><h3>Key Features</h3><p>Hornets <i>(Vespa crabro)</i> are the largest wasp to be found in the British Isles. They feed on other flying insects, often on smaller wasps. They are often attracted to bright lights at dusk. They have large crescent shaped compound eyes, a brown abdomen with yellow stripes, and have red wings.<p>Although they are large, impressive insects, hornets are really rather placid insects, often preferring to retreat rather than attack when threatened. Their sting is no worse that the sting of a wasp, and less toxic than that of a honey bee. However, a hornets sting can be painful, and possibly fatal to those allergic to hornet venom.<p><h3>Biology:</h3><p>Queens emerge from hibernation during the spring, and they search for a suitable location in which to start a new nest. She begins to build the nest with chewed wood pulp, and a few eggs are laid in individual paper cells; these eggs develop into non-reproductive workers. When 5-10 workers have emerged, they take over the care of the nest, and the rest of queens life is devoted solely to egg laying. Hornet workers capture insects, bringing them back to the nest to feed the brood. Workers need more high-energy sugary foods such as sap and nectar, and hornet larvae are able to exude a sugary liquid which the workers can feed on. The nest reaches its peak size towards mid September. At this time the queen lays eggs that develop into males (drones) and new queens, she then dies shortly after. The new queens and males mate during a &quot;nuptial flight&quot;, after which the males die, and the newly mated queens seek out suitable places in which to hibernate; the old nest is never re-used.<p><h3>Distribution</h3><p>This species was considered rare in Britain in the 1960s, but it has since made a recovery and has become fairly common in some parts of the south of England. It seems to be spreading northwards and reached south Yorkshire in 1985. It is found throughout Europe, but it is rare in many parts of Germany and is even threatened with extinction in some areas of central Europe. This species also occurs in Asia and Madagascar, and has been introduced to the United States and Canada.<p><h3>Significance</h3><p>This species has a bad public image, yet it is generally a peaceful, non-aggressive species. More needs to be done to educate the public about this fascinating insect.<p><h3>Control</h3><p>Hornets nests can be controlled through insecticidal sprays, insecticidal smoke generators and other treatments. Careful consideration should be given, before deciding to control these largely beneficial insects.'
  if(message == 'weevil1')
	message = '<img src=images/img-popup-weevil1.jpg align=left style=margin-right:15px;><h1>Grain Weevils</h1><p><h3>Key Features</h3><p>A wheat weevil <i>(Sitophilus granarius)</i> is a weevil that damages stored grain. Wheat or grain weevils are approximately 3-4mm long and dark brown in colour. A serious pest in grain and other hard cereal products, larvae and adults will feed on the grain. These insects are easily recognisable by their elongated snouts (this is known as their rostrum).<p>Wheat weevils penetrate and feed on the internal portions of whole grains during the larval (immature) stage, making early detection of infestations difficult. They are usually found in grain storage facilities or processing plants, infesting wheat, oats, rye, barley, and corn. Weevils are the commonest pest in stored grain.<p>The Grain Weevil cannot fly but is a tireless walker.<p><h3>Biology</h3><p>Female grain weevils lay from 36 to 254 eggs at a rate of 2-3 a day. At 80 to 86&deg;F, 75 to 90% relative humidity, eggs hatch in wheat with a moisture content of 13.5 to 19.6% in 3 days. Larvae mature in 18 days, and the pupa in 6 days. The life cycle is about 30 to 40 days during the summer, and 123 to 148 days during the winter, depending on temperature. Adults live 7 to 8 months.<p><h3>Distribution</h3><p>Grain weevils are encountered in all temperate and warm-termperate climates and are widely distributed in grain stores throughout the UK. Infestations arise as a result of their regular importation in grain and cereal products and from the fabric of vehicles or buildings used for the transportation and storage of these and other vulnerable commodities. Sacks, too, are an important source of infestation, the insects finding harbourage in the seams and weave. Being well suited to temperate conditions the species will breed readily in the UK and there may be three or more generations per year in unheated conditions. Both adults and larvae are cold-hardy.<p><h3>Significance</h3><p>Causes major damage to stores of wheat, barley, maize, oats and rye. Can cause taint, and significance infestations can result in localised areas of heat and humidity, leading to germination and mould.<p><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation (Koehler 2003). In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate.'
  if(message == 'weevil2')
	message = '<img src=images/img-popup-weevil2.jpg align=left style=margin-right:15px;><h1>Maize Weevils</h1><p><h3>Key Features</h3><p>Maize weevils are approximately 3-4mm long and dark brown in colour, with. A serious pest in grain and other hard cereal products, larvae and adults will feed on the grain.<p>Both maize and rice weevils, often known as &quot;snout weevils,&quot; penetrate and feed on the internal portions of whole grains during the larval (immature) stage, making early detection of infestations difficult. They are usually found in grain storage facilities or processing plants, infesting wheat, oats, rye, barley, rice, and corn. Weevils can contaminate the grain to such an extent that the pay of workers harvesting the grain can drop.<p><h3>Biology</h3><p>Female maize weevils lay between 300 to 400 eggs, with the life cycle requiring about 32 days for completion. maize weevil adults live 3 to 6 months, infesting grain in the field, especially in the tropics and sub-tropics, in fact it is one of the most serious pests. Two larvae can develop in one wheat kernel, but only one larva of the granary weevil can develop per wheat kernel. Both maize and rice weevils feign death by drawing up their legs close to the body, falling, and remaining silent when disturbed.<p><h3>Distribution</h3><p>Rice and Maize weevils are widely distributed in tropical and sub-tropical areas and regularly imported into the UK. The Maize weevil will breed on maize in the field, but the Rice weevil only breeds in stored grain. Both insects are less cold-hardy than the grain weevil and will not normally over winter in unheated premises or grain stored at normal temperature.<p><h3>Significance</h3><p>The following damage may be caused:<ul><li>Reduction in the weight and quality of grain as a result of the larvae feeding on the endosperm. The germ is not always attacked so germination may take place, producing a weak seedling which is vulnerable to attack by moulds, bacteria and other insects. Both larvae and adults will feed upon grains.</li><p><li>Tainting with white, dusty excreta which contaminate the product as well as rendering it unpalatable.</li><p><li>Heating of the grain, accelerating development of the insects and making the commodity liable to caking, moulding and even germination. Temperatures may be attained which actually kill the insects.</li></ul><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate.'
  if(message == 'weevil3')
	message = '<img src=images/img-popup-weevil3.jpg align=left style=margin-right:15px;><h1>Rice Weevils</h1><p><h3>Key Features</h3><p>A Rice weevil <i>(Sitophilus oryzae)</i> is a weevil that damages stored grain. Rice weevils are approximately 3-4mm long and dark brown in colour, with. A serious pest in grain and other hard cereal products, larvae and adults will feed on the grain. Both granary and rice weevils, often known as &quot;snout weevils,&quot; penetrate and feed on the internal portions of whole grains during the larval (immature) stage, making early detection of infestations difficult. They are usually found in grain storage facilities or processing plants, infesting wheat, oats, rye, barley, rice, and corn. Weevils can contaminate the grain to such an extent that the pay of workers harvesting the grain can drop.<p><h3>Biology</h3><p>Female rice weevils lay between 300 to 400 eggs, with the life cycle requiring about 32 days for completion. Rice weevil adults live 3 to 6 months, infesting grain in the field, especially in the tropics and sub-tropics, in fact it is one of the most serious pests. Two larvae can develop in one wheat kernel, but only one larva of the granary weevil can develop per wheat kernel. Both granary and rice weevils feign death by drawing up their legs close to the body, falling, and remaining silent when disturbed.<p><h3>Distribution</h3><p>Rice and Maize weevils are widely distributed in tropical and sub-tropical areas and regularly imported into the UK. The Maize weevil will breed on maize in the field, but the Rice weevil only breeds in stored grain. Both insects are less cold-hardy than the grain weevil and will not normally over winter in unheated premises or grain stored at normal temperature.<p><h3>Significance</h3><p>The following damage may be caused:<ul><li>Reduction in the weight and quality of grain as a result of the larvae feeding on the endosperm. The germ is not always attacked so germination may take place, producing a weak seedling which is vulnerable to attack by moulds, bacteria and other insects. Both larvae and adults will feed upon grains.</li><p><li>Tainting with white, dusty excreta which contaminate the product as well as rendering it unpalatable.</li><p><li>Heating of the grain, accelerating development of the insects and making the commodity liable to caking, moulding and even germination. Temperatures may be attained which actually kill the insects.</li></ul><h3>Control</h3><p>The first step in managing an infestation is to find and remove the source of the infestation. In large-scale infestations, fumigation (the treatment of the infested material via the application of toxic gas) may be appropriate.'
  if(!type) {
    type = 'error';
  }
  var dialog;
  var dialogheader;
  var dialogfooter;
  var dialogclose;
  var dialogclose1;
  var dialogtitle;
  var dialogcontent;
  var dialogmask;
  if(!document.getElementById('dialog')) {
    dialog = document.createElement('div');
    dialog.id = 'dialog';
    dialogheader = document.createElement('div');
    dialogheader.id = 'dialog-header';
    dialogfooter = document.createElement('div');
    dialogfooter.id = 'dialog-footer';
    dialogtitle = document.createElement('div');
    dialogtitle.id = 'dialog-title';
    dialogclose = document.createElement('div');
    dialogclose.id = 'dialog-close'
    dialogcontent = document.createElement('div');
    dialogcontent.id = 'dialog-content';
    dialogclose1 = document.createElement('div');
    dialogclose1.id = 'dialog-close1'
    dialogmask = document.createElement('div');
    dialogmask.id = 'dialog-mask';
    document.body.appendChild(dialogmask);
    document.body.appendChild(dialog);
    dialog.appendChild(dialogheader);
    dialogheader.appendChild(dialogtitle);
    dialogheader.appendChild(dialogclose);
    dialog.appendChild(dialogcontent);;
    dialog.appendChild(dialogfooter);
    dialogfooter.appendChild(dialogtitle);
    dialogfooter.appendChild(dialogclose1);
    dialogclose.setAttribute('onclick','hideDialog()');
    dialogclose.onclick = hideDialog;
    dialogclose1.setAttribute('onclick','hideDialog()');
    dialogclose1.onclick = hideDialog;
  } else {
    dialog = document.getElementById('dialog');
    dialogheader = document.getElementById('dialog-header');
    dialogfooter = document.getElementById('dialog-footer');
    dialogtitle = document.getElementById('dialog-title');
    dialogclose = document.getElementById('dialog-close');
    dialogclose1 = document.getElementById('dialog-close1');
    dialogcontent = document.getElementById('dialog-content');
    dialogmask = document.getElementById('dialog-mask');
    dialogmask.style.visibility = "visible";
    dialog.style.visibility = "visible";
  }
  dialog.style.opacity = .00;
  dialog.style.filter = 'alpha(opacity=0)';
  dialog.alpha = 0;
  var width = pageWidth();
  var height = pageHeight();
  var left = leftPosition();
  var top = topPosition();
  var dialogwidth = dialog.offsetWidth;
  var dialogheight = dialog.offsetHeight;
  var topposition = top + (height / 3) - (dialogheight / 2);
  var leftposition = left + (width / 2) - (dialogwidth / 2);
  //dialog.style.top = topposition + "px";
  //dialog.style.left = leftposition + "px";
  dialog.style.top = "220px";
  dialog.style.left = "335px";
  dialogheader.className = type + "header";
  dialogfooter.className = type + "header";
  dialogtitle.innerHTML = title;
  dialogcontent.className = type;
  dialogcontent.innerHTML = message;
  var content = document.getElementById(WRAPPER);
  dialogmask.style.height = content.offsetHeight + 'px';
  dialog.timer = setInterval("fadeDialog(1)", TIMER);
  if(autohide) {
    dialogclose.style.visibility = "hidden";
    dialogclose1.style.visibility = "hidden";
    window.setTimeout("hideDialog()", (autohide * 1000));
  } else {
    dialogclose.style.visibility = "visible";
    dialogclose1.style.visibility = "visible";
  }
}

// hide the dialog box //
function hideDialog() {
  var dialog = document.getElementById('dialog');
  clearInterval(dialog.timer);
  dialog.timer = setInterval("fadeDialog(0)", TIMER);
}

// fade-in the dialog box //
function fadeDialog(flag) {
  if(flag == null) {
    flag = 1;
  }
  var dialog = document.getElementById('dialog');
  var value;
  if(flag == 1) {
    value = dialog.alpha + SPEED;
  } else {
    value = dialog.alpha - SPEED;
  }
  dialog.alpha = value;
  dialog.style.opacity = (value / 100);
  dialog.style.filter = 'alpha(opacity=' + value + ')';
  if(value >= 99) {
    clearInterval(dialog.timer);
    dialog.timer = null;
  } else if(value <= 1) {
    dialog.style.visibility = "hidden";
    document.getElementById('dialog-mask').style.visibility = "hidden";
    clearInterval(dialog.timer);
  }
}
