﻿
function cityCheck() {
   
    if (document.locations.menu.value = "--") {
        alert("Please select a city or state");
        return false
    } else {
        return true
    }
}

var viewRegion = function (setTo) {
    // Regional Info
    var currentSeason = "Winter";
    var currentYear = new Date().getFullYear();
    var today = new Date(),
     march20NextYear = new Date(currentYear + 1, 02, 20),
     march20CurrentYear = new Date(currentYear, 02, 20),
     june21 = new Date(currentYear, 05, 21),
     september23 = new Date(currentYear, 08, 23),
     december22 = new Date(currentYear, 12, 22),
     december22PreviousYear = new Date(currentYear - 1, 11, 22),
     december22CurrentYear = new Date(currentYear, 11, 22);
    var currentFloridaPestThreat, currentMidwestPestThreat, currentNortheastPestThreat, currentSoutheastPestThreat, currentSouthwestpestThreat, currentWestPestThreat;
    var southeastHtml, floridaHtml, midwestHtml, northeastHtml, southeastHtml, southwestHtml, westHtml;

    if ((today >= march20CurrentYear) && (today < june21))
        currentSeason = "Spring";
    else if ((today >= june21) && (today < september23))
        currentSeason = "Summer";
    else if ((today >= september23) && (today < december22))
        currentSeason = "Fall";
    else if (((today >= december22PreviousYear) && (today < march20CurrentYear)) || ((today >= december22CurrentYear) && (today < march20NextYear)))
        currentSeason = "Winter";
    else
        currentSeason = "Fall";

    var html_americanCockroach = '<a class="tags" rel="tag" href="/cockroaches/american-cockroach/">American Cockroaches</a>';
    var html_ants = '<a class="tags" rel="tag" href="/ants/">Ants</a>, ';
    var html_antActivity = '<a class="tags" rel="tag" href="/ants/">Ant Activity</a>';
    var html_argentineAntBase = '<a class="tags" rel="tag" href="/ants/argentine-ant/">Argentine Ants</a>';
    var html_argentineAnt = html_argentineAntBase + ', ';
    var html_argentineAnd = '<a class="tags" rel="tag" href="/ants/argentine-ant/">Argentine</a> and ';
    var html_bedBugs = '<a class="tags" rel="tag" href="/other/bed-bugs/">Bed Bugs</a>, ';
    var html_bees = '<a class="tags" rel="tag" href="/stinging-pests/bees/">Bees</a>, ';
    var html_bigHeadedAnts = '<a class="tags" rel="tag" href="/ants/">Big Headed Ants</a>, ';
    var html_carpenterAntsBase = '<a class="tags" rel="tag" href="/ants/carpenter-ant/">Carpenter Ants</a>';
    var html_carpenterAnts = html_carpenterAntsBase + ', ';
    var html_cricketsBase = '<a class="tags" rel="tag" href="/other/crickets/">Crickets</a>';
    var html_crickets = html_cricketsBase + ', ';
    var html_cockroachesBase = '<a class="tags" rel="tag" href="/cockroaches/">Cockroaches</a>';
    var html_cockroaches = html_cockroachesBase + ', ';
    var html_crazyAnts = '<a class="tags" rel="tag" href="/ants/crazy-ants">Crazy Ants</a>, ';
    var html_drywoodTermites = '<a class="tags" rel="tag" href="/termites/drywood-termites/">Drywood Termites</a>, ';
    var html_fireAnts = '<a class="tags" rel="tag" href="/ants/fire-ant/">Fire Ants</a>, ';
    var html_fleasBase = '<a class="tags" rel="tag" href="/other/fleas/">Fleas</a>';
    var html_Fleas = html_fleasBase + ', ';
    var html_flies = '<a class="tags" rel="tag" href="/flies/">Flies</a>, ';
    var html_houseFlies = '<a class="tags" rel="tag" href="/flies/house-fly/">House Flies</a>, ';
    var html_houseMice = '<a class="tags" rel="tag" href="/rodents/house-mouse/">House Mice</a>.';
    var html_indoorFlyActivity = '<a class="tags" rel="tag" href="/flies/">Indoor Fly Activity</a>';
    var html_miceBase = '<a class="tags" rel="tag" href="/rodents/">Mice</a>';
    var html_mice = html_miceBase + ', ';
    var html_mosquitoes = '<a class="tags" rel="tag" href="/other/mosquitoes/">Mosquitoes</a>, ';
    var html_nonBitingFlies = '<a class="tags" rel="tag" href="/flies/">Non biting Flies</a>, ';
    var html_norwayRat = '<a class="tags" rel="tag" href="/rodents/norway-rat/">Norway Rat</a>, ';
    var html_otherAnts = '<a class="tags" rel="tag" href="/ants/">Other Ants</a>, ';
    var html_pavementAnts = '<a class="tags" rel="tag" href="/ants/pavement-ants/">Pavement Ants</a>, ';
    var html_Rats = '<a class="tags" rel="tag" href="/rodents/">Rats</a>, ';
    var html_roachesBase = '<a class="tags" rel="tag" href="/cockroaches/">Roaches</a>';
    var html_Roaches = html_roachesBase + ', ';
    var html_rodentsBase = '<a class="tags" rel="tag" href="/rodents/">Rodents</a>';
    var html_rodents = html_rodentsBase + ', ';
    var html_roofRatAnd = '<a class="tags" rel="tag" href="/rodents/roof-rat/">Roof Rat</a> and ';
    var html_scorpions = '<a class="tags" rel="tag" href="/stinging-pests/scorpions/">Scorpions</a>, ';
    var html_SpidersBase = '<a class="tags" rel="tag" href="/other/spiders/">Spiders</a>';
    var html_spidersEnd = html_SpidersBase + '.';
    var html_spiders = html_SpidersBase + ', ';
    var html_subterraneanTermites = '<a class="tags" rel="tag" href="/termites/subterranean-termites/">Subterranean Termites</a>, ';
    var html_termites = '<a class="tags" rel="tag" href="/termites/">Termites</a>';
    var html_termiteSwarms = '<a class="tags" rel="tag" href="/termites/termite-swarm-why-termites-swarm">Termite Swarms</a>';
    var html_ticks = '<a class="tags" rel="tag" href="/other/ticks/">Ticks</a>, ';
    var html_variousAntSpecies = '<a class="tags" rel="tag" href="/ants/">Various ant species</a>, ';
    var html_waspsBase = '<a class="tags" rel="tag" href="/stinging-pests/wasps/">Wasps</a>';

    switch (currentSeason) {
        case "Winter":
            currentFloridaPestThreat = "Termites begin swarming in mid to late February through late March and have been feeding all winter, summer, spring and fall.  This is the first visible evidence of termites and their swarm is commonly mistaken as 'flying ants'. Turning on your heat on a cold day can cause these termites to immediately start flying out of your walls.  Fire ants, Argentine ants and other ant species, as well as American cockroaches, try to move indoors during this time as well, seeking warmth from the colder temperatures.";
            currentMidwestPestThreat = "Be aware for cockroaches, fleas, bedbugs, nonbiting flies, spiders, and rodents attempting to enter the home.  There will also be some ant activity during warmer days.;"
            currentNortheastPestThreat = "Be vigilant for inside dwellers such as bed bugs, cockroaches and interior rodent activity (house mice).";
            currentSoutheastPestThreat = "Termites begin swarming in mid to late February through late March and have been feeding all winter, summer, spring and fall.  This is the first visible evidence of termites and their swarm is commonly mistaken as 'flying ants'. Turning on your heat on a cold day can cause these termites to immediately start flying out of your walls.  Argentine ants are especially prevalent in areas like GA, AL and SC during this time of year. Other ant species try to move in doors during this time as well, seeking warmth from the colder temperatures. American Cockroaches also are generally seen indoors now, seeking warmth as well.";
            currentSouthwestpestThreat = "Multiple types of rodents (rats & mice) are attempting to come indoors to find warmth.";
            currentWestPestThreat = "Multiple types of rodents (rats & mice) are attempting to come indoors to find warmth.";
            floridaHtml = html_subterraneanTermites + html_argentineAnt + html_crazyAnts + html_americanCockroach;
            midwestHtml = html_Roaches + html_Fleas + html_bedBugs + html_nonBitingFlies + html_spidersEnd;
            northeastHtml = html_bedBugs + html_cockroaches + html_houseMice;
            southeastHtml = html_subterraneanTermites + html_argentineAnt + html_americanCockroach;
            southwestHtml = html_Rats + html_miceBase;
            westHtml = html_Rats + html_miceBase;
            break;
        case "Spring":
            currentFloridaPestThreat = "Drywood Termites, which can cause damage begin to swarm and flutter around homes in Florida and other coastal areas around May.  Homeowners usually mistake them for flying ants. First evidence of increased 'bug' activity will appear during Spring.  Ants begin to show themselves quite frequently.";
            currentMidwestPestThreat = "Mosquito activity is on the rise.  Be on the look out for ticks, which can cause lyme disease, as well as fleas.  Household ants now include carpenter ants.;"
            currentNortheastPestThreat = "Fly activity around dumpster areas. Ant and spider activity. Termite swarmers.";
            currentSoutheastPestThreat = "Subterranean termites are still swarming in parts of TN, AR, AL and SC, so be on the lookout for what most homeowners call 'flying ants' fluttering all around the home. Most ant species begin their movement during this time of year. In the SE the fire ant, crazy ant and argentine ant are the most notable.  Carpenter Bees begin doing their damage to wooden structures during this time, creating large holes in the sides of some homes.";
            currentSouthwestpestThreat = "Multiple types of flies (House flies & 'gnats'), spiders, rodents, termites are the current pest threat.";
            currentWestPestThreat = "The current threats are earwigs, sowbugs, spiders, ants, mosquitoes, flies and termites.";
            floridaHtml = html_drywoodTermites + html_variousAntSpecies + html_fireAnts + html_bigHeadedAnts + html_crazyAnts + html_argentineAnt + html_carpenterAntsBase;
            midwestHtml = html_mosquitoes + html_ticks + html_Fleas + html_carpenterAntsBase;
            northeastHtml = html_ants + html_spiders + html_termites;
            southeastHtml = html_spiders + html_variousAntSpecies + html_fireAnts + html_crazyAnts + html_argentineAnt + html_carpenterAnts + html_houseFlies + html_rodents + html_Roaches + html_ticks + html_fleasBase;
            southwestHtml = html_ants + html_scorpions + html_cricketsBase;
            westHtml = html_argentineAnd + html_otherAnts + html_cockroachesBase;
            break;
        case "Summer":
            currentFloridaPestThreat = "Fire ants are very common in Florida and the SE now. Be on the lookout for roaches and ants invading after a heavy rain.  Ants are the more common pests seen on the inside during the summer.  With the summer travel season upon us, more people are bringing BED BUGS home with them from hotels, motels and resorts.  Always inspect your luggage before you remove items after a summer vacation.  Look for spots on the head of the mattress area if you think you have brought bed bugs in. The heavy rains create a perfect breeding ground for mosquitos. Also be on the lookout for large ants, called Carpenter ants, trailing around at dusk. They come out at night searching for food and water and are very active during the summer.";
            currentMidwestPestThreat = "Early mosquito activity can be expected in later spring.  Carpenter ants and other household ants, as well as rodents may attempt to invade the home.  Termite swarming and carpenter ant swarming can be visible.";
            currentNortheastPestThreat = "The current pest threat is ants, flies and spiders.  German cockroaches, bed bugs, stored product pests in commercial accounts are year around issues. Cricket activity may increase in the fall in some areas. ";
            currentSoutheastPestThreat = "Bed bugs are exploding on the scene with a vengeance.  Be aware of your luggage when you travel to motels and resorts on summer vacation.  Children are also beginning to bring bed bugs home with them from summer camps.  Watch out for Fire ants in your yard as your children play. They can cause a serious painful sting and some individuals can have an allergic reaction. Fire ants are very common in the SE now and really show their ugly heads during the summer. The rainy season in the south causes a number of different ants and roaches to move indoors.";
            currentSouthwestpestThreat = "Flies, ants, American & Oriental cockroaches, scorpions are the current pest threats.";
            currentWestPestThreat = "Ants (Carpenter, Argentine, other), spiders, flies, cockroaches, mosquitoes are the current pest threat.";
            floridaHtml = html_fireAnts + html_bedBugs + html_mosquitoes + html_carpenterAntsBase;
            midwestHtml = html_mosquitoes + html_carpenterAnts + html_rodents + html_termiteSwarms;
            northeastHtml = html_antActivity;
            southeastHtml = html_crazyAnts + html_flies + html_argentineAnt + html_bigHeadedAnts + html_argentineAnt + html_roachesBase;
            southwestHtml = html_crickets + html_rodentsBase;
            westHtml = html_rodentsBase;
            break;
        case "Fall":
            currentFloridaPestThreat = "As the heavy bug season winds down, be on the lookout for ants trying to make their way inside.  Fall almost mimics summer as far as temperature goes in most areas, so a lot of the things you fight during the summer are still present in the fall.";
            currentMidwestPestThreat = "Be aware of rodents; mainly mice are moving inside.  Some mosquito populations survive into October.  Fleas and bedbugs will be moving inside.  Non threatening pest- boxelders and cluster flies are also abundant.  Bees and wasps are on the move.";
            currentNortheastPestThreat = "Mosquito activity will heighten.  Spiders constructing egg sacs as well as ants and mice are moving inside.  Potential wildlife harborage. Commercial accounts will want to be aware for possible small fly activity. House fly activity can be expected.";
            currentSoutheastPestThreat = "With the temperature still hovering around 80-90 degrees in some areas, most insects are still fairly active during this time.  Although the rain has stopped \"drowning them out\" of their natural environment and into yours, they still make it inside quite regularly during this time. Why? Most individuals begin to leave their windows and doors open during this time of year to enjoy the cooler weather. Unfortunately, American Roaches, Argentine Ants, Big Headed Ants and various other bugs just travel right in and get established.";
            currentSouthwestpestThreat = "The current pest threat is American & Oriental Cockroaches, ants, crickets, rodents.";
            currentWestPestThreat = "Argentine ants (CA);Carpenter ants (Pac NW); spiders, rodents will be abundant.";

            floridaHtml = html_fireAnts + html_pavementAnts + html_argentineAntBase;
            midwestHtml = html_mice + html_mosquitoes + html_Fleas + html_bedBugs + html_flies + html_bees + html_waspsBase;
            northeastHtml = html_mosquitoes + html_spiders + html_ants + 'Wildlife, ' + html_indoorFlyActivity;
            southeastHtml = html_fireAnts + html_pavementAnts + html_spiders + html_roofRatAnd + html_norwayRat + html_bedBugs + html_argentineAntBase;
            southwestHtml = html_rodentsBase;
            westHtml = html_rodentsBase;
            break;
        default:
            floridaHtml = html_subterraneanTermites + html_argentineAnt + html_crazyAnts + html_americanCockroach;
            midwestHtml = html_Roaches + html_Fleas + html_bedBugs + html_nonBitingFlies + html_spidersEnd;
            northeastHtml = html_bedBugs + html_cockroaches + html_houseMice;
            southeastHtml = html_subterraneanTermites + html_argentineAnt + html_americanCockroach;
            southwestHtml = html_Rats + html_miceBase;
            westHtml = html_Rats + html_miceBase;
            break;
    }

    var canadaHtml = html_mosquitoes + html_spiders + html_ants + html_mice + 'Wildlife and Indoor Fly activity';

    var irelandHtml =
        '<a class="tags" rel="tag" href="/flies/">Large Flies</a>, ' +
        '<a class="tags" rel="tag" href="/ants/">Ants</a>, ' +
        '<a class="tags" rel="tag" href="/cockroaches/">Outdoor Roaches</a>, ' +
        html_mosquitoes +
        'Occassional Invaders such as <a class="tags" rel="tag" href="/other/crickets/">Crickets</a>';

    var southkoreaHtml =
        html_mosquitoes +
        html_Fleas +
        html_flies +
        '<a class="tags" rel="tag" href="/cockroaches/">Outdoor Roaches</a>';

    var latinamericaHtml =
        '<a class="tags" rel="tag" href="/termites/">Termites</a>, ' +
        html_ants +
        '<a class="tags" rel="tag" href="/cockroaches/">Outdoor Cockroaches</a>, ' +
         html_mosquitoes +
        '<a class="tags" rel="tag" href="/flies/">Flies</a>';

    var middleeastregionHtml =
        '<a class="tags" rel="tag" href="/cockroaches/">Cockroaches</a>, ' +
        html_mosquitoes +
        html_Fleas +
        '<a class="tags" rel="tag" href="/flies/">Flies</a>,  ' +
        '<a class="tags" rel="tag" href="/ants/">Ants</a>,  ' +
        '<a class="tags" rel="tag" href="/termites/">Termites</a>';

    var turkeyHtml =
        '<a class="tags" rel="tag" href="/termites/">Termites</a>, ' +
        html_mosquitoes +
        '<a class="tags" rel="tag" href="/other/mites/">Mites</a>, ' +
        html_Rats;
    var cyprusHtml =
        html_Rats +
        '<a class="tags" rel="tag" href="/termites/">Termites</a>';
    var jamaicaHtml =
        '<a class="tags" rel="tag" href="/termites/">Termites</a>, ' +
        html_ants +
        '<a class="tags" rel="tag" href="/cockroaches/">Outdoor Cockroaches</a>, ' +
        html_mosquitoes;
    var chinaHtml =
        html_Rats +
        '<a class="tags" rel="tag" href="/termites/">Termites</a>';

    var puertoRicoHtml =
        html_termites + html_termiteSwarms + html_subterraneanTermites + html_drywoodTermites;

    // Create the region information psuedo objects
    var canada = [
        'Canada&mdash;' + currentSeason + ' season',
        'Mosquito activity will heighten.  Spiders constructing egg sacs as well as ants and mice are moving inside.  Potential wildlife harborage. Commercial accounts will want to be aware for possible small fly activity. House fly activity can be expected.',
        canadaHtml,
        'YT, BC, NT, AB, SK, MB, NU, ON, QC, NB, NS, PE, NL',
        'Orkin Pest Control in Canada'
        ];
    var southeast = [
        'Southeast&mdash;' + currentSeason + ' season',
        currentSoutheastPestThreat,
        southeastHtml,
        'AL, AR, GA, KY, LA, MS, NC, SC, TN, VA, WV',
        'Orkin Pest Control in the Southeast'];
    var northeast = [
        'Northeast&mdash;' + currentSeason + ' season',
        currentNortheastPestThreat,
        northeastHtml,
        'CT, DE, MA, MD, ME, NH, NJ, NY, PA, RI, VT',
        'Orkin Pest Control in the Northeast'];
    var midwest = [
        'Midwest&mdash;' + currentSeason + ' season',
        currentMidwestPestThreat,
        midwestHtml,
        'IA, IL, IN, KS, MI, MN, MO, ND, NE, OH, SD, WI',
        'Orkin Pest Control in the Midwest'];
    var southwest = [
        'Southwest&mdash;' + currentSeason + ' season',
        currentSouthwestpestThreat,
        southwestHtml,
        'AZ, NM, OK, TX',
        'Orkin Pest Control in the Southwest'];
    var west = [
        'West&mdash;' + currentSeason + ' season',
        currentWestPestThreat,
        westHtml,
        'AK, CA, CO, HI, ID, MT, NV, OR, UT, WA, WY',
        'Orkin Pest Control in the West'];
    var florida = [
        'Florida&mdash;' + currentSeason + ' season',
        currentFloridaPestThreat,
        floridaHtml,
        'FL',
        'Orkin Pest Control in the Florida'];
    var ireland = [
        'Ireland&mdash;' + currentSeason + ' season',
        'Overwintering pest will start to emerge both indoors and outdoors.  As the temperatures become milder, the pests that were dormant over the colder months will also start to become active.  Residual rains and standing water sources will start producing mosquito populations.',
        irelandHtml,
        'IE',
        'Orkin Pest Control in Ireland'];
    var latinamerica = [
        'Latin America&mdash;' + currentSeason + ' Season',
        'As the rain season starts, many pests will migrate indoors to escape from to much moisture.  The presence of rain along with the increase in temperatures will cause many pests to start breeding and appearing in large numbers.  Termite swarms will appear.  Be careful not to confuse swarming termites with swarming ants.',
        latinamericaHtml,
        'MX, CR, PA, HN, DO',
        'Orkin Pest Control in Latin America'];
    var middleeastregion = [
        'Middle East Region&mdash;' + currentSeason + ' Season',
        'Outside temperatures and climbing and the amount of rainfall is starting to drop.  This means pest will start trying to come indoors to find moisture.  Outdoor pests are more active as they prepare for the coming heat and dry seasons.',
        middleeastregionHtml,
        'LB, SA, KW, BH, QA, AE',
        'Orkin Pest Control in Middle East Region'];
    var southkorea = [
        'South Korea&mdash;' + currentSeason + ' Season',
        'As the weather becomes warmer outside and a few spring rain showers occur, many pests which were dormant over the winter cold period will start becoming active and appear in homes and buildings.   Early occurrences of mosquitoes will appear in areas where standing water accumulates from rains.',
        southkoreaHtml,
        'KR',
        'Orkin Pest Control in South Korea'];
    var turkey = [
        'Turkey&mdash;' + currentSeason + ' Season',
        'Due to Turkey&#39;s diverse landscape, climate conditions vary and thus the pest types found in the country. Among the most prevalent are termites, mites, rodents, and mosquitoes.  To maintain pest from entering your home, remove trash daily, eliminate any standing water, remove food debris from kitchen counters, and use screens on windows and doors.',
        turkeyHtml,
        'TR',
        'Orkin Pest Control in Turkey'];
    var cyprus = [
        'Cyprus&mdash;' + currentSeason + ' Season',
        'Cyprus delightful weather is inviting to various pest. This includes stinging insects, rodents, termites, and mosquitoes.  Besides contacting a pest control specialist, as a homeowner you can make sure you use screens on windows and doors, seal cracks and small opens with metal or cement, and store food in containers with tight lids. ',
        cyprusHtml,
        'CY',
        'Orkin Pest Control in Cyprus'];
    var china = [
        'China&mdash;' + currentSeason + ' Season',
        'China&#39;s large region gives way to varying climates that attract different types of pest. During the winter, rodents are more prevalent. In the rainy season many pest go indoors in search of shelter.  The best way to avoid pests is through a comprehensive pest control plan that emphasizes preventive methods.',
        chinaHtml,
        'CN',
        'Orkin Pest Control in China'];
    var jamaica = [
        'Jamaica&mdash;' + currentSeason + 'Season',
        'Jamaica enjoys great weather so many pests stay active year round. The warm sun combined with nice breezes makes the island hospitable for both inside and outside pests. Some pests such as termites swarm or breed certain times of the year but infestation and damage can occur year round. As days shorten in winter and lengthen in summer, even though it is not as pronounced as other parts of the world, pests adjust. Anytime there is an abundance of food, water, and protection pests will thrive. Pay particular attention to mosquito populations as they spread many diseases.',
        jamaicaHtml,
        'JM',
        'Orkin Pest Control in Jamaica'];
    var puertoRico = [
        'Puerto Rico&mdash;' + currentSeason + 'Season',
        'Puerto Rico is known for warm breezes and temperatures in the 80s nearly year round.  Besides humans enjoying the weather, pests enjoy that weather as well. There is no freezing and no snow to force the pests into winter dormancy. Pests are active year round in Puerto Rico. These pests include both indoor and outdoor roaches, many species of ants, flies, stinging insects, lizards, and termites. Termites found in Puerto Rico include subterranean termites, dampwood, as well as drywood termites. Termite nests can also be found in trees. With all of these pests in Puerto Rico, you need the best service to keep pests in their place. ',
        puertoRicoHtml,
        'PR',
        'Orkin Pest Control in Puerto Rico'] ;

    //Vars
    var regionSelect = document.getElementById('region'),
     regionTitle = document.getElementById('regionTitle'),
     regionMap = document.getElementById('map'),
     regionThreat = document.getElementById('regionThreat'),
     regionAlert = document.getElementById('regionAlert');

    selectedRegion = (setTo) ? setTo : regionSelect.options[regionSelect.selectedIndex].value;

    if (selectedRegion == '--')
        selectedRegion = 'southeast';

    regionTitle.innerHTML = eval(selectedRegion)[0];
    regionMap.src = '/images/misc/regions/' + selectedRegion + '_154x102.gif';
    regionMap.alt = eval(selectedRegion)[4];
    regionThreat.innerHTML = eval(selectedRegion)[1];
    regionAlert.innerHTML = eval(selectedRegion)[2];
    if (regionSelect.value == "latinamerica") {
        regionMap.src = '/images/misc/regions/latinamerica_154x102.png';
    }

    Set_Cookie('region', selectedRegion, 365);
    if (regionSelect.value == 'canada' || regionSelect.value == 'ireland' || regionSelect.value == 'latinamerica' ||
        regionSelect.value == 'middleeastregion' || regionSelect.value == 'southkorea' || regionSelect.value == 'turkey' ||
        regionSelect.value == 'china' || regionSelect.value == 'cyprus' || regionSelect.value == 'jamaica' ||
        Get_Cookie('region') == 'canada' || Get_Cookie('region') == 'ireland' || Get_Cookie('region') == 'latinamerica' ||
        Get_Cookie('region') == 'middleeastregion' || Get_Cookie('region') == 'cyprus' || Get_Cookie('region') == 'jamaica' ||
        Get_Cookie('region') == 'china' || Get_Cookie('region') == 'turkey' || Get_Cookie('region') == 'southkorea') {
        document.getElementById('us-cities').style.display = "none";
        document.getElementById('us-button').style.display = "none";
        document.getElementById('international-cities').style.display = "inline";
        document.getElementById('international-button').style.display = "inline";
    } else {
        document.getElementById('us-cities').style.display = "inline";
        document.getElementById('us-button').style.display = "inline";
        document.getElementById('international-cities').style.display = "none";
        document.getElementById('international-button').style.display = "none";
    }
}

function setRegionDropdown(region) {
    document.getElementById('region').value = region;
}

//Set Initial Region
if (Get_Cookie('region') == null) {
    viewRegion('southeast');
    setRegionDropdown('southeast');
}
else {
    viewRegion(Get_Cookie('region'));
    setRegionDropdown(Get_Cookie('region'));
}

function Set_Cookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function Get_Cookie(check_name) {
    //console.log('Get_Cookie');
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split(';');
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f

    for (i = 0; i < a_all_cookies.length; i++) {
        // now we'll split apart each name=value pair
        a_temp_cookie = a_all_cookies[i].split('=');

        // and trim left/right whitespace while we're at it
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

        // if the extracted name matches passed check_name
        if (cookie_name == check_name) {
            b_cookie_found = true;
            // we need to handle case where cookie has no value but exists (no = sign, that is):
            if (a_temp_cookie.length > 1) {
                cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
            }
            // note that in cases where cookie is initialized but no value, null is returned
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }
    if (!b_cookie_found)
        return null;
}

