#! /usr/bin/perl

sub languagesarray {
$lang[0]="English";
$lang[1]="French";
$lang[2]="Spanish";
$lang[3]="Italian";
$lang[4]="German";
$lang[5]="Dutch";
$lang[6]="Swedish";
$lang[7]="Danish";
$lang[8]="Japanese";
$lang[9]="Chinese";
$lang[10]="Polish";
$lang[11]="Ukrainian";
$lang[12]="Romanian";
$lang[13]="Hungarian";
$lang[14]="Hebrew";
$lang[15]="Portuguese";
$lang[16]="Czech";
$lang[17]="Lithuanian";
$lang[18]="Russian";
$lang[19]="Korean";
$lang[20]="Sign Language";
$lang[21]="Turkish";
$lang[22]="Kiswahili";
$lang[23]="Hindi / Urdu";
$numlanguages=@lang;
}


sub paymentoptions {
### none of these payment names are allowed to contain a comma
$payoption[0]="Mastercard";
$payoption[1]="Visa";
$payoption[2]="Diners Club";
$payoption[3]="American Express";
$payoption[4]="Travelers Check";
$payoption[5]="Interac";
$payoption[6]="Cash";
$payoption[7]="E-Transfer";
$payoption[8]="Personal Check";
$payoption[9]="Discover Card";
$payoption[10]="Visa Debit";
}



sub guestroomamenitiesarray {
## these are amenities found in the room (BB or MO or IN or HO) or in the unit (CN or CO)
$Ram{bddaasm4}="ENT-GRP-Television In Room";
$Ram{w234ksm4}="ENT-GRP-Televisions (Two) In Room";
$Ram{mmqmmpf7}="ENT-GRP-Television Is LCD Flat Screen";
$Ram{a6quh3zz}="ENT-GRP-Television With Cable Service";
$Ram{kj33sadd}="ENT-GRP-Television With Satellite Service";
$Ram{fhffmw34}="INTERNET-GRP-High Speed Wireless Internet Extra";
$Ram{faafmw34}="INTERNET-GRP-High Speed Wireless Internet Included";
$Ram{b4fmz4u7}="INTERNET-GRP-High Speed Wired Internet Extra";
$Ram{b4faa4u7}="INTERNET-GRP-High Speed Wired Internet Included";
$Ram{hf37u4f6}="INTERNET-GRP-Modem Dialup Internet";
$Ram{huff736m}="ENT-GRP-Movies By Pay-Per-View";
$Ram{pqsssd6m}="ENT-GRP-Movie Channel (Free)";
$Ram{e4fbpwp3}="ENT-GRP-VCR For TV";
$Ram{q7mh47h7}="ENT-GRP-DVD Player For TV";
$Ram{dbw4uw7m}="Desk and Desk Chair in Room";
$Ram{qzu47q6p}="Balcony";
$Ram{hwhzfqq7}="Refrigerator In Room";
$Ram{hdyyeaq7}="Kitchenette";
$Ram{fmmzhquu}="Iron and Ironing Board";
$Ram{h4up6zub}="Microwave";
$Ram{ahhfhh74}="PHONE-GRP-Single Line Phone";
$Ram{dhp4hfmp}="PHONE-GRP-Two Line Phone";
$Ram{bzw6hq3q}="PHONE-GRP-Phone Has Speaker-Phone Feature";
$Ram{w7uqw763}="Coffee Maker";
$Ram{w3423kks}="Coffee Maker w/Complimentary Coffee";
$Ram{gqu6fwu4}="Fully-Stocked Wet Bar";
$Ram{gpqfmz6b}="In-Room Safe For Storage of Valuables";
$Ram{wbbfhzq7}="Clock Radio";
$Ram{uhwfhpwp}="Crib Available On Request";
$Ram{ks233aad}="Marble Flooring";
$Ram{zbhzbwqz}="Air Conditioning";
$Ram{a3umhpb6}="Climate Control In Room";
$Ram{m44pbp43}="Sofa With Pull-Out Sofabed";
$Ram{uzf3m7hh}="Wheelchair Accessible";
$Ram{ewbpqh74}="Room Service Available";
$Ram{uyyd66ad}="Adults Only";
$Ram{t355aadd}="Family Friendly";
$Ram{a77pw6z4}="Pets Welcomed";
$Ram{ahzfqwhh}="Window Opens";
$Ram{mbppq46h}="ENT-GRP-Video Games Console w/Controllers";
$Ram{dupzzuwq}="Desk Chair is Ergonomic";
$Ram{q3m46uf6}="Electronic Card Access Door Lock";
$Ram{qbzzhf7f}="Wide Angle Door Viewer";
$Ram{hh7zhzzz}="Fire Alarm";
$Ram{z3qm6z6w}="Automatic Door Closer";
$Ram{b6zp6h6u}="ENT-GRP-Television Is High Definition";
$Ram{wfq3fwwq}="ENT-GRP-Sound System With CD Player";
$Ram{ufwuhhz3}="Snacks Available For Purchase In Room";
$Ram{rh3uu3bu}="Shoe Shiner Machine";
$Ram{rzu7mh76}="PHONE-GRP-Cordless Phone";
$Ram{ffqwzpm6}="Room Has Scenic View";
$Ram{pp38snc6}="Room Has City View";
$Ram{peqwzpm6}="Room Has Falls View";
$Ram{aiqwzpm6}="Room Located on Lobby Level";
$Ram{zzb6mm47}="High Thread Count Linen";
$Ram{b7fzqbfb}="Hypo-Allergenic Pillows Available";
$Ram{wqwq4puw}="Feather Pillows Available";
$Ram{fwwf3z66}="Dining Table With Chairs";
$Ram{hp7zq4pu}="Sitting Area In Room";
$Ram{zuzmu3wb}="PHONE-GRP-Phone Has Voicemail";
$Ram{m73z6h46}="Wake-Up Call Available On Request";
$Ram{ffzwzmhw}="ENT-GRP-Sound System Has IPOD Dock";
$Ram{wfwwh67w}="Electronic Window Treatments";
$Ram{umqmzqwp}="Couch";
$Ram{k23sdf88}="Floor To Ceiling Windows";
$Ram{ksdf33sa}="Two-Storey Room w/Stairs";
$Ram{k2348sdf}="Continental Breakfast";
$Ram{kasd8823}="Daily Housekeeping Service";
$Ram{s234sdfs}="Complimentary Buffet Breakfast";
$Ram{akjsdf77}="Hot Breakfast Included-PROPTIPE-BB";
$Ram{w28ssdfk}="Suite (Multi-Room) Layout";
$Ram{ppkeu27k}="Separate Master Bedroom";
$Ram{kksdf33a}="ENT-GRP-Surround-Sound System";
$Ram{h8dsjkjs}="Room Located On A High Floor";
$Ram{nchd23sa}="Bedside Electronic Drapery Controls";
$Ram{nasd2dkk}="Bedside Lighting Controls";
$Ram{qa338asd}="PHONE-GRP-VOIP Phone System";
$Ram{sdf8sdfs}="Private Entry To Room From Outside";
$Ram{s8sdfjsm}="Nightly Turn-Down Service";
$Ram{uudjsdfj}="Designer Decor";
$Ram{bcvbbj3a}="Wall Artwork";
$Ram{p823ssaa}="Privacy Door to Adjoining Suite";
$Ram{k23sdkh4}="Fireplace (Wood Burning) in Room";
$Ram{njjdj123}="Fireplace (Gas-Powered) in Room";
$Ram{we92048a}="Fireplace (Electric) in Room";
$Ram{phnjsdfq}="Fireplace (Gas or Electric) in Room";
$Ram{e23234sd}="Linens Included";
$Ram{y6324ads}="Ceiling Fan";
$Ram{ws34sdf8}="PHONE-GRP-Local Calls Free From Room";
$Ram{p623sdfj}="KITCH-GRP-Kitchen-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{t723snnv}="KITCH-GRP-Kitchenette-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{q1237dja}="KITCH-GRP-Freezer-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{k73723sa}="KITCH-GRP-Cookware/Utensils Provided-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{u72347sa}="KITCH-GRP-Dishwasher-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{h23466as}="Washer/Dryer In Room-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{q1122wwq}="KITCH-GRP-Blender-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{qkid883q}="KITCH-GRP-Toaster-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{j23asdaa}="KITCH-GRP-Oven-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{i883duua}="KITCH-GRP-Cooking Range-PROPTIPE-AB-AP-CB-CN-CO";
$Ram{ihdye66s}="Hot Tub / Whirlpool With Room -PROPTIPE-HO";
$Ram{hqqrrr74}="Park Free Onsite-PROPTIPE-HO-BB";
$Ram{u37add74}="Hair Dryer-PROPTIPE-HO-BB";
$Ram{bdfr3354}="Mini Refrigerator-PROPTIPE-HO-BB";
}

sub bathroomamenitiesarray {
$Bam{wqq6q67b}="Walk-In Shower";
$Bam{yz74mzpm}="Powder Room";
$Bam{qm6qqwfz}="Hair Dryer";
$Bam{wb7uw376}="1-Person Tub With Spray Jets";
$Bam{hbh36h66}="2-Person Tub With Spray Jets";
$Bam{dfhmw7z4}="Bathrobe";
$Bam{heyd67z4}="Slippers";
$Bam{wwuf437q}="Complimentary Toiletries Including Shampoo";
$Bam{wyy823aq}="Complimentary Deluxe Spa Toiletries";
$Bam{ewbqw36u}="Towel Warmer Rack";
$Bam{nhyd63ra}="Towels Provided";
$Bam{fhhzpq6u}="Heat Timer";
$Bam{fuzfbz6u}="Make-up Mirror";
$Bam{zm7z4b7p}="His and Hers Bathrooms";
$Bam{sdfe333p}="His and Hers Sinks";
$Bam{bhfu6fmw}="Jetted Shower Fixtures";
$Bam{p6uw7b37}="Shower Cap";
$Bam{nnsd33qa}="Toilet in Private Room From Sink Vanity";
$Bam{fpmh6q7w}="Double Vanities";
$Bam{qzz4h4fp}="Telephone In Bathroom";
$Bam{qaasadf4}="Television In Bathroom";
$Bam{hq47hwmz}="Bidet";
$Bam{bbbd3asd}="Oversized Towels";
$Bam{sk38jdj2}="Regular Soaking Tub w/Overhead Shower";
}


sub propertyamenitiesarray {
$Pam{f7u4w3wm}="BIZ-GRP-Business Service Centre Onsite-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{fwbph4q3}="BIZ-GRP-Fax Service Available";
$Pam{sdfddd3f}="AAPROP-GRP-Beachfront";
$Pam{usdfjk2a}="Canoe Available-PROPTIPE-CO-BB";
$Pam{q83838af}="Cable Television Onsite-PROPTIPE-CO";
$Pam{uyee83af}="Television With VCR Available-PROPTIPE-HO";
$Pam{uy73773f}="Television With Videos Available-PROPTIPE-HO";
$Pam{p938sdf8}="Satellite Television Onsite-PROPTIPE-CO";
$Pam{ksdf8aad}="Cottage is Air Conditioned-PROPTIPE-CO";
$Pam{k823sdfa}="Fishing Boat Available-PROPTIPE-CO-BB";
$Pam{t7234sdf}="Speed Boat Available-PROPTIPE-CO-BB";
$Pam{hsdf62aa}="Firewood Available-PROPTIPE-CO-BB";
$Pam{ydsft52a}="Snowmobile / ATV Trails-PROPTIPE-CO-BB";
$Pam{nxcv62sd}="Bicycles Available-PROPTIPE-CO-BB";
$Pam{ue738asd}="AAPROP-GRP-Intracoastal View";
$Pam{w2339kna}="AAPROP-GRP-City View";
$Pam{sduhsd7a}="AAPROP-GRP-Beachview";
$Pam{ndfh73as}="AAPROP-GRP-Lakefront";
$Pam{s73773aa}="AAPROP-GRP-Lakeview";
$Pam{usdf73sa}="AAPROP-GRP-Beach Access Direct From Property";
$Pam{r44rraqs}="AAPROP-GRP-Oceanfront";
$Pam{jdf773af}="AAPROP-GRP-Oceanview";
$Pam{p7pbqqq4}="AAPROP-GRP-Water View";
$Pam{w36bwphh}="AAPROP-GRP-Mountain View";
$Pam{udy633ah}="AAPROP-GRP-Rainforest View";
$Pam{uie8377a}="AAPROP-GRP-Volcano View";
$Pam{u3fw6umz}="BIZ-GRP-Computer Available";
$Pam{u7bw4m3f}="BIZ-GRP-Meeting Rooms Available";
$Pam{muhbmpwb}="Major Attractions Within Walking Distance";
$Pam{zq7wmf6h}="Casino Within Walking Distance";
$Pam{hqquzp74}="Casino Onsite";
$Pam{hqh3hz6p}="Waterpark-PROPTIPE-HO";
$Pam{uqpp67ff}="Reception Services";
$Pam{ywq3ufhz}="Wedding Facilities";
$Pam{b3hbw4bq}="Banquet Hall-PROPTIPE-HO";
$Pam{k4737whu}="BIZ-GRP-Convention Space-PROPTIPE-HO";
$Pam{uuzmf3wp}="Drycleaning Service";
$Pam{z3h4m67z}="Event Planner Onsite";
$Pam{puf3hmq4}="Wedding Consultant";
$Pam{um664bw6}="Tour Desk-PROPTIPE-HO";
$Pam{h2sdfkka}="Fallsview-PROPTIPE-HO";
$Pam{ffgsdfwm}="Bellhop Service-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{fmbsdsq3}="DEPT-GRP-Sundries Shop-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{f45wefhf}="DEPT-GRP-Hair Salon-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{kjdf83sd}="Wired Internet Onsite-PROPTIPE-AB-AP-CB-CN-HO-CO";
$Pam{w45dsfbq}="Common Area Whirlpool-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{ueyd63ad}="Indoor Heated Pool and Whirlpools-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{k8sdf8aa}="Common Area Fireplace-PROPTIPE-BB-IN-HO-CO";
$Pam{m6as3ab6}="PARK-GRP-Park Onsite By Valet Service-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{nnh33ab6}="PARK-GRP-Valet and Self Parking-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{pjfaddq4}="DEPT-GRP-Gift Shop-PROPTIPE-HO";
$Pam{wjhdddhh}="ENT-GRP-Arcade";
$Pam{uddawsmz}="EXER-GRP-Weight Room";
$Pam{u723sdjj}="EXER-GRP-Exercise Room";
$Pam{u7svds3f}="Manicure Service";
$Pam{m248aswb}="DEPT-GRP-Spa Services Onsite";
$Pam{zasdfa6h}="TRANS-GRP-Street Car Nearby";
$Pam{h723as74}="TRANS-GRP-Train Service Nearby";
$Pam{hljkas6p}="TRANS-GRP-Subway Service Nearby";
$Pam{ubcasaff}="TRANS-GRP-Bus Service Nearby";
$Pam{ykjdadhz}="Concierge Desk-PROPTIPE-HO";
$Pam{b8asdsbq}="TRANS-GRP-Taxi Stand-PROPTIPE-HO";
$Pam{z3q21ddz}="DIN-GRP-Family Dining Within Walking Distance";
$Pam{pukhi484}="DIN-GRP-Fine Dining Within Walking Distance";
$Pam{um83adf6}="DIN-GRP-Casual Dining Within Walking Distance";
$Pam{f7rtyuwm}="Theatre Onsite-PROPTIPE-HO";
$Pam{sd3tyuwm}="Concert Hall-PROPTIPE-HO";
$Pam{fwertyq3}="Lobby With Seating-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{fqasdfhf}="Catering Service Available";
$Pam{m4khjgb6}="DIN-GRP-Branded Restaurant Onsite-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{w3qasshh}="POOL-GRP-Outdoor Pool Heated";
$Pam{u3wsssmz}="Historic Building";
$Pam{u7bedd3f}="PARK-GRP-Park For Free Nearby";
$Pam{muhnnnwb}="PARK-GRP-Park For A Fee Nearby";
$Pam{zq7jjj6h}="PARK-GRP-Park Onsite For A Fee";
$Pam{jkdf3332}="Local Calls Free From Onsite Phone-AB-AP-CB-CN-CO";
$Pam{hqhjas6p}="Deck Seating Area-PROPTIPE-BB-CO";
$Pam{uqksdfff}="Outdoor Screened Area For Guests-PROPTIPE-BB-CO";
$Pam{y43sgfhz}="Patio Seating Area-PROPTIPE-BB-CO";
$Pam{b3lja4bq}="PHONE-GRP-Payphone Onsite-PROPTIPE-AB-AP-CB-CN-CO-HO";
$Pam{k4fghwhu}="Campfire Permitted-PROPTIPE-BB-CO";
$Pam{uksjdfka}="Barbecue (Gas Powered)-PROPTIPE-BB-CO";
$Pam{u45df3wp}="Barbecue Charcoal Fueled-PROPTIPE-BB-CO";
$Pam{pksdf82s}="Treed Lot-PROPTIPE-BB-CO";
$Pam{pasdf83q}="Suitable For Guests With Children-PROPTIPE-BB-CO";
$Pam{puegwmq4}="Owner Has Children-PROPTIPE-BB";
$Pam{sss64bw6}="Owner Has Child-PROPTIPE-BB";
$Pam{wu4764bq}="Owner Has Cat-PROPTIPE-BB";
$Pam{m47qwfb6}="Owner Has Dog-PROPTIPE-BB";
$Pam{t823sdfa}="Marina Nearby";
$Pam{y723sdfj}="Shopping Mall Within Walking Distance";
$Pam{q238sdfj}="Shopping Mall Within A Short Drive";
$Pam{u823jaaa}="Starbucks Within Walking Distance-PROPTIPE-AB-AP-CB-CN-CO-HO";
$Pam{b7744d44}="Starbucks Onsite-PROPTIPE-AB-AP-CB-CN-CO-HO";
$Pam{k234sss7}="Gated Community-PROPTIPE-AB-AP-CB-CN";
$Pam{u6622asd}="Security Onsite-PROPTIPE-AB-AP-CB-CN-CO-HO";
$Pam{jsdf88sa}="Laundry Facility Onsite-AB-AP-CB-CN-CO-HO";
$Pam{hysdf6as}="Game Room-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{j7234ads}="Ice Machine";
$Pam{ksdfy36a}="Winter Destination";
$Pam{qwejsdfj}="EXER-GRP-Aerobics Classes-PROPTIPE-AB-AP-CB-CN-CO-HO";
$Pam{qkid883q}="EXER-GRP-Tennis Court-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{rw424asd}="EXER-GRP-Pool Table-PROPTIPE-BB-AB-AP-CB-CN-CO-HO";
$Pam{y7asdfjj}="Lanai (Roofed Veranda)-PROPTIPE-BB-AB-AP-CB-CN-CO";
$Pam{gg66d3ad}="Dock For Boat-PROPTIPE-BB-AB-AP-CB-CN-CO-HO";
$Pam{u7666aad}="Dog Friendly-PROPTIPE-CO";
$Pam{ks8234sd}="Boat Launch Nearby-PROPTIPE-BB-AB-AP-CB-CN-CO-HO";
$Pam{ggd663as}="Sauna-PROPTIPE-BB-AB-AP-CB-CN-CO-HO";
$Pam{bdfg66ad}="ATM Bank Machine Onsite-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{u8324jsd}="Playground-PROPTIPE-BB-CO-AB-AP-CB-CN-HO";

$Pam{hy37amad}="Adults Only-PROPTIPE-HO";
$Pam{ii33uuad}="Two Restaurants Onsite-PROPTIPE-HO";
$Pam{iiid83ad}="Air Conditioned";
$Pam{rse24asd}="All-Inclusive-PROPTIPE-HO";
$Pam{hqqrrr74}="PARK-GRP-Free Parking Onsite";
$Pam{h7234sdf}="Wi-Fi Wireless Internet Onsite-PROPTIPE-AB-AP-CB-CN-HO-CO";
$Pam{kkl93sju}="TRANS-GRP-Airport Shuttle Available For A Fee";
$Pam{uu923jsp}="TRANS-GRP-Free Airport Shuttle";
$Pam{y366ssdf}="Free Cancellation-PROPTIPE-HO";
$Pam{fdfdfddf}="Free Cancellation on 24 Hrs Notice-PROPTIPE-HO";
$Pam{ydte66sd}="Complimentary Hot Breakfast-PROPTIPE-HO";
$Pam{mnhdye62}="Complimentary Continental Breakfast-PROPTIPE-HO";
$Pam{m23sdfaa}="DIN-GRP-Restaurant Onsite-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{wubvcxbq}="Bar Onsite-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{fq337whf}="AAPROP-GRP-Waterfront";
$Pam{p7edccq4}="POOL-GRP-Indoor Pool";
$Pam{bd6fsdha}="POOL-GRP-Outdoor Pool";
$Pam{z3dgh67z}="POOL-GRP-Hot Tub Available To Guests";
$Pam{fffvcxbq}="Fitness Centre-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{kuuvcxbq}="Electric Vehicle Charging-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{ppnvcxbq}="Impact Indoor Golf Simulator-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{qwsvcxbq}="24/7 Front Desk-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{zxcvcxbq}="Smoke-Free facility-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{bvcvcxbq}="Housekeeping Service-PROPTIPE-AB-AP-CB-CN-HO";
$Pam{mmmvcxbq}="Ice and Vending Machines-PROPTIPE-AB-AP-CB-CN-HO";



}





sub printpropertyamenities {
	### i needed printtothelist this for my 1292 makeproperties.cgi file for niagaraonthelakelodgings.com
	### gets called by the various sites but those sites need to set the variable:
	### using available info at the source and field 120 in the masters record as follows:  $allpamenities="$is[120]";
        @pamenitieslist=split(/\,/,$allpamenities);
        $numpamenities=@pamenitieslist;
        for ($pm=0;$pm<=$numpamenities;$pm++) {
                $value=$pamenitieslist[$pm];
                if ($value ne '') {
                        ## let's strip out all the suffixes
                        $Pam{$value}=~ s/\-PROPTIPE//g;
                        $Pam{$value}=~ s/\-BB//g;
                        $Pam{$value}=~ s/\-CO//g;
                        $Pam{$value}=~ s/\-CN//g;
                        $Pam{$value}=~ s/\-HO//g;
                        $Pam{$value}=~ s/\-MO//g;
                        $Pam{$value}=~ s/\-IN//g;
                        $Pam{$value}=~ s/\-AB//g;
                        $Pam{$value}=~ s/\-AP//g;
                        $Pam{$value}=~ s/\-CB//g;

                        ## now let's strip out all the prefixes used to group and sort
                        $Pam{$value}=~ s/POOL\-GRP\-//g;
                        $Pam{$value}=~ s/PARK\-GRP\-//g;
                        $Pam{$value}=~ s/PHONE\-GRP\-//g;
                        $Pam{$value}=~ s/POOL\-GRP\-//g;
                        $Pam{$value}=~ s/KITCH\-GRP\-//g;
                        $Pam{$value}=~ s/EXER\-GRP\-//g;
                        $Pam{$value}=~ s/ENT\-GRP\-//g;
                        $Pam{$value}=~ s/DEPT\-GRP\-//g;
                        $Pam{$value}=~ s/TRANS\-GRP\-//g;
                        $Pam{$value}=~ s/DIN\-GRP\-//g;
                        $Pam{$value}=~ s/BIZ\-GRP\-//g;
                        $Pam{$value}=~ s/AAPROP\-GRP\-//g;
			if ($lundyslanebia eq 'Y') {
			        if ($printtothelist eq 'Y') {
					print THELIST "<tr><Td class=amens>$Pam{$value}</td></tr>\n";
				}
				else {
					print "<tr><Td class=amens>$Pam{$value}</td></tr>\n";
				}
			}
                        elsif ($atleastonepamenity ne 'yes') {
			        if ($printtothelist eq 'Y') {
                        	        print THELIST "<li class=\"amenities\">$Pam{$value}";
				}
				else {
                        	        print "$Pam{$value}";
				}
                                $atleastonepamenity="yes";
                        }
                        else {
			        if ($printtothelist eq 'Y') {
                        	        print THELIST "<li class=\"amenities\">$Pam{$value}";
				}
				else {
                        	        print ", $Pam{$value}";
				}
                        }
                }
        }
}



sub printroomamenities {
		$printedroomamenities=0;
		$mramen="";
		$amenc=0;
		## requires that $allramenities be set using likely field 20 guestrooms record
		undef @ramenitieslist;
		undef @collectedamenities;
                @ramenitieslist=split(/\,/,$allramenities);
                $numramenities=@ramenitieslist;
                for ($am=0;$am<=$numramenities;$am++) {
                        $value=$ramenitieslist[$am];
                        if ($value ne '') {
                        ## let's strip out all the suffixes
                        $Ram{$value}=~ s/\-PROPTIPE//g;
                        $Ram{$value}=~ s/\-BB//g;
                        $Ram{$value}=~ s/\-CO//g;
                        $Ram{$value}=~ s/\-CN//g;
                        $Ram{$value}=~ s/\-HO//g; 
                        $Ram{$value}=~ s/\-MO//g; 
                        $Ram{$value}=~ s/\-IN//g;
                
                        ## now let's strip out all the prefixes used to group and sort
                        $Ram{$value}=~ s/PHONE\-GRP\-//g;
                        $Ram{$value}=~ s/KITCH\-GRP\-//g;
                        $Ram{$value}=~ s/ENT\-GRP\-//g;
                        $Ram{$value}=~ s/INTERNET\-GRP\-//g;
			$collectedamenities[$amenc]="$Ram{$value}";
			if ($amenstarted eq 'Y') {
				$mramen="$mramen".", ";
			}
			else {
				$amenstarted="Y";
			}
			$mramen="$mramen"."$Ram{$value}";
			$amenc++;
			}
		}
		#print "$mramen";
		#print "$allramenities<Br>";
		$atleastoneramenity="N";
		#print "<h3>$amenc</h3>";
		for ($am=0;$am<=$amenc;$am++) {   
                        if ($atleastoneramenity ne 'yes') {
                                if ($printtothelist eq 'Y') {
	                                print THELIST "<b>Room Amenities:</b> $collectedamenities[$am]";
				}
				else {
	                                print "<b>Room Amenities:</b> $collectedamenities[$am]";
				}
                                $atleastoneramenity="yes";
                        }
			elsif (($printedroomamenities == 20) && ($printversion eq '')) {
				if ($codewritten ne 'Y') {
					&popupstylecode;
	                                if ($printtothelist eq 'Y') {
						print THELIST "<DIV ID=\"boxx\"></DIV>";
					}
					else {
						print "<DIV ID=\"boxx\"></DIV>";
					}
					&popupjscode;
				}
				$codewritten="Y";
                                if ($printtothelist eq 'Y') {
					#print THELIST "...<Br><A href=\"#\" ONMOUSEOVER=\"popup('$mramen','f0f0f0',300)\"; ONMOUSEOUT=\"kill()\"> View All</a>";
				}
				else {
					#print "...<Br><A href=\"#\" ONMOUSEOVER=\"popup('$mramen','f0f0f0',300)\"; ONMOUSEOUT=\"kill()\"> View All</a>";
				}
				$am=$amenc+3;
			}
                        else {
				if ($printtothelist eq 'Y') {
                                	print THELIST ", $collectedamenities[$am]";
				}
				else {
					if ($collectedamenities[$am]) {
	                                	print ", $collectedamenities[$am]";
					}
				}
				$printedroomamenities++;
                        }
                }
}




sub printbathroomamenities {
		## requires that $allbamenities gets preset usually field 19 in the guestrooms record
                @bamenitieslist=split(/\,/,$allbamenities);
                $numbamenities=@bamenitieslist;
                for ($bm=0;$bm<=$numbamenities;$bm++) {
                        $value=$bamenitieslist[$bm];
                        if ($value ne '') {
                        if ($atleastonebamenity ne 'yes') {
                                if ($printtothelist eq 'Y') {
	                                print THELIST "<b>Bathroom Amenities: </b>$Bam{$value}";
				}
				else {
	                                print "<b>Bathroom Amenities: </b>$Bam{$value}";
				}
                                $atleastonebamenity="yes";
                        }
                        else {
                                if ($printtothelist eq 'Y') {
	                                print THELIST ", $Bam{$value}";
				}
				else {
	                                print ", $Bam{$value}";
				}
                        }
                        }
                }
}







sub dayarraythreechars {
$day[1]="Sun";
$day[2]="Mon";
$day[3]="Tue";
$day[4]="Wed";
$day[5]="Thu";
$day[6]="Fri";
$day[7]="Sat";
$dayfrench[1]="dim";
$dayfrench[2]="lun";
$dayfrench[3]="mar";
$dayfrench[4]="mer";
$dayfrench[5]="jeu";
$dayfrench[6]="ven";
$dayfrench[7]="sam";

$dayespanol[1]="dom";
$dayespanol[2]="lun";
$dayespanol[3]="mar";
$dayespanol[4]="mie";
$dayespanol[5]="jue";
$dayespanol[6]="vie";
$dayespanol[7]="sab";


$daymonstart[1]="Mon";
$daymonstart[2]="Tue";
$daymonstart[3]="Wed";
$daymonstart[4]="Thu";
$daymonstart[5]="Fri";
$daymonstart[6]="Sat";
$daymonstart[7]="Sun";

$daymonstartfrench[1]="dim";
$daymonstartfrench[2]="lun";
$daymonstartfrench[3]="mar";
$daymonstartfrench[4]="mer";
$daymonstartfrench[5]="jeu";
$daymonstartfrench[6]="ven";
$daymonstartfrench[7]="sam";

$daymonstartespanol[1]="dom";
$daymonstartespanol[2]="lun";
$daymonstartespanol[3]="mar";
$daymonstartespanol[4]="mie";
$daymonstartespanol[5]="jue";
$daymonstartespanol[6]="vie";
$daymonstartespanol[7]="sab";
}


sub dayarrayonechar {
$da[1]="S";
$da[2]="M";
$da[3]="T";
$da[4]="W";
$da[5]="T";
$da[6]="F";
$da[7]="S";
}




sub montharraythreechars {
$month[1]="Jan";  
$month[2]="Feb";  
$month[3]="Mar";
$month[4]="Apr";
$month[5]="May";
$month[6]="Jun";
$month[7]="Jul";
$month[8]="Aug";
$month[9]="Sep";
$month[10]="Oct";
$month[11]="Nov";
$month[12]="Dec";

$monthfrench[1]="Janv";
$monthfrench[2]="Fevr";
$monthfrench[3]="Mars";
$monthfrench[4]="Avril";
$monthfrench[5]="Mai";
$monthfrench[6]="Juin";
$monthfrench[7]="Juil";
$monthfrench[8]="Aout";
$monthfrench[9]="Sept";   
$monthfrench[10]="Oct";
$monthfrench[11]="Nov";
$monthfrench[12]="Dec";

$monthespanol[1]="enero";
$monthespanol[2]="feb";
$monthespanol[3]="marzo";
$monthespanol[4]="abr";
$monthespanol[5]="mayo";
$monthespanol[6]="jun";
$monthespanol[7]="jul";
$monthespanol[8]="agosto";
$monthespanol[9]="set";
$monthespanol[10]="oct";
$monthespanol[11]="nov";
$monthespanol[12]="dic";
}

sub montharrayfullname {
$fmonth[1]="January";
$fmonth[2]="February";
$fmonth[3]="March";
$fmonth[4]="April";
$fmonth[5]="May";
$fmonth[6]="June";
$fmonth[7]="July";
$fmonth[8]="August";
$fmonth[9]="September";
$fmonth[10]="October";
$fmonth[11]="November";
$fmonth[12]="December";

$fmonthfrench[1]="Janvier";
$fmonthfrench[2]="Fevrier"; 
$fmonthfrench[3]="Mars"; 
$fmonthfrench[4]="Avril";
$fmonthfrench[5]="Mai";
$fmonthfrench[6]="Juin";
$fmonthfrench[7]="Juillet";
$fmonthfrench[8]="Aout";  
$fmonthfrench[9]="Septembre";
$fmonthfrench[10]="Octobre";
$fmonthfrench[11]="Novembre";
$fmonthfrench[12]="Decembre";

$fmonthespanol[1]="enero";
$fmonthespanol[2]="febrero";
$fmonthespanol[3]="marzo";
$fmonthespanol[4]="abril";
$fmonthespanol[5]="mayo";
$fmonthespanol[6]="junio";
$fmonthespanol[7]="julio";
$fmonthespanol[8]="agosto";
$fmonthespanol[9]="septiembre";
$fmonthespanol[10]="octubre";
$fmonthespanol[11]="noviembre";
$fmonthespanol[12]="diciembre";

}



sub monthnumberfromthreechars {
$month{Jan}="01";
$month{Feb}="02";
$month{Mar}="03";
$month{Apr}="04";
$month{May}="05";
$month{Jun}="06";
$month{Jul}="07";
$month{Aug}="08";
$month{Sep}="09";
$month{Oct}="10";
$month{Nov}="11";
$month{Dec}="12";
}


sub futuredayofweekarray {
## a table to set the week day on which the month starts... for instance 200407 starts on a thursday so, number:  5

$dayofweek{202201}="7";
$dayofweek{202202}="3";
$dayofweek{202203}="3";
$dayofweek{202204}="6";
$dayofweek{202205}="1";
$dayofweek{202206}="4";
$dayofweek{202207}="6";
$dayofweek{202208}="2";
$dayofweek{202209}="5";
$dayofweek{202210}="7";
$dayofweek{202211}="3";
$dayofweek{202212}="5";

$dayofweek{202301}="1";
$dayofweek{202302}="4";
$dayofweek{202303}="4";
$dayofweek{202304}="7";
$dayofweek{202305}="2";
$dayofweek{202306}="5";
$dayofweek{202307}="7";
$dayofweek{202308}="3";
$dayofweek{202309}="6";
$dayofweek{202310}="1";
$dayofweek{202311}="4";
$dayofweek{202312}="6";

$dayofweek{202401}="2";
$dayofweek{202402}="5";
$dayofweek{202403}="6";
$dayofweek{202404}="2";
$dayofweek{202405}="4";
$dayofweek{202406}="7";
$dayofweek{202407}="2";
$dayofweek{202408}="5";
$dayofweek{202409}="1";
$dayofweek{202410}="3";
$dayofweek{202411}="6";
$dayofweek{202412}="1";

$dayofweek{202501}="4";
$dayofweek{202502}="7";
$dayofweek{202503}="7";
$dayofweek{202504}="3";
$dayofweek{202505}="5";
$dayofweek{202506}="1";
$dayofweek{202507}="3";
$dayofweek{202508}="6";
$dayofweek{202509}="2";
$dayofweek{202510}="4";
$dayofweek{202511}="7";
$dayofweek{202512}="2";

$dayofweek{202601}="5";
$dayofweek{202602}="1";
$dayofweek{202603}="1";
$dayofweek{202604}="4";
$dayofweek{202605}="6";
$dayofweek{202606}="2";
$dayofweek{202607}="4";
$dayofweek{202608}="7";
$dayofweek{202609}="3";
$dayofweek{202610}="5";
$dayofweek{202611}="1";
$dayofweek{202612}="3";


}



sub futuredaysinmontharray {

$daysinmonth{202201}="31";
$daysinmonth{202202}="28";
$daysinmonth{202203}="31";
$daysinmonth{202204}="30";
$daysinmonth{202205}="31";
$daysinmonth{202206}="30";
$daysinmonth{202207}="31";
$daysinmonth{202208}="31";
$daysinmonth{202209}="30";
$daysinmonth{202210}="31";
$daysinmonth{202211}="30";
$daysinmonth{202212}="31";

$daysinmonth{202301}="31";
$daysinmonth{202302}="28";
$daysinmonth{202303}="31";
$daysinmonth{202304}="30";
$daysinmonth{202305}="31";
$daysinmonth{202306}="30";
$daysinmonth{202307}="31";
$daysinmonth{202308}="31";
$daysinmonth{202309}="30";
$daysinmonth{202310}="31";
$daysinmonth{202311}="30";
$daysinmonth{202312}="31";

$daysinmonth{202401}="31";
$daysinmonth{202402}="29";
$daysinmonth{202403}="31";
$daysinmonth{202404}="30";
$daysinmonth{202405}="31";
$daysinmonth{202406}="30";
$daysinmonth{202407}="31";
$daysinmonth{202408}="31";
$daysinmonth{202409}="30";
$daysinmonth{202410}="31";
$daysinmonth{202411}="30";
$daysinmonth{202412}="31";

$daysinmonth{202501}="31";
$daysinmonth{202502}="28";
$daysinmonth{202503}="31";
$daysinmonth{202504}="30";
$daysinmonth{202505}="31";
$daysinmonth{202506}="30";
$daysinmonth{202507}="31";
$daysinmonth{202508}="31";
$daysinmonth{202509}="30";
$daysinmonth{202510}="31";
$daysinmonth{202511}="30";
$daysinmonth{202512}="31";

$daysinmonth{202601}="31";
$daysinmonth{202602}="28";
$daysinmonth{202603}="31";
$daysinmonth{202604}="30";
$daysinmonth{202605}="31";
$daysinmonth{202606}="30";
$daysinmonth{202607}="31";
$daysinmonth{202608}="31";
$daysinmonth{202609}="30";
$daysinmonth{202610}="31";
$daysinmonth{202611}="30";
$daysinmonth{202612}="31";


}







sub roomlocationarray {
$totalroomlocations=3;
$roomlocation[1]="Room is on the Ground Floor";
$roomlocation[2]="Room is Upstairs";
$roomlocation[3]="Room is reached by Elevator";
}











sub popupstylecode {
if ($printtothelist eq 'Y') {
print THELIST "
<style type=\"text/css\">
#boxx {
        POSITION:absolute;VISIBILITY:hidden;Z-INDEX:20;
}
</style>
";
}
else {
print "
<style type=\"text/css\">
#boxx {
        POSITION:absolute;VISIBILITY:hidden;Z-INDEX:20;
}
</style>
";
}

}




sub popupjscode {
## michael peets advised me that system_requirements.html kept popping up on the NOTL BBA site on his ipad...
## i confirmed it on my iphone and thus commented out the 3 lines below
if ($printtothelist eq 'Y') {
print THELIST "
<SCRIPT TYPE=\"text/javascript\">
<!--
        //if (!document.getElementById || screen.width < 800 || screen.height < 600){
        //        document.location.href=\"system_requirements.html\";
        //}
	
                        
        Xoffset=20;     // modify these values to ...
        Xoffsetleft=-330;     // modify these values to ...
        Xoffset2=20;            // modify these values to ...
        Yoffset=-160;    // change the popup position.  this is used by niagaraonthelakebb.com for the pinterest type gallery
                        
        var old,skn,iex=(document.all),yyy=-1000;
         
        var ns4=document.layers
        var ns6=document.getElementById&&!document.all
        var ie4=document.all
                
        if (ns4)
                skn=document.boxx
        else if (ns6)
                skn=document.getElementById(\"boxx\").style
        else if (ie4)
                skn=document.all.boxx.style
                
        if(ns4)
                document.captureEvents(Event.MOUSEMOVE);
        else{
                skn.visibility=\"visible\"  
                skn.display=\"none\"
        }
         document.onmousemove=get_mouse;
        
        function popup(msg,bak,width){
                var content=\"<TABLE  WIDTH=\"+Math.abs(width)+\" BORDER=1 BORDERCOLOR=#000000 CELLPADDING=5 CELLSPACING=0 \" +
                        \"BGCOLOR=\"+bak+\"><TD ALIGN=left style='font:Arial; font-size:11px;'>\"+unescape(msg)+\"</TD></TABLE>\";

                yyy=Yoffset;
                if (width < 0 )
                        Xoffset2 = (Xoffset*-1) + width;
                else
                        Xoffset2 = Xoffset;
                if(ns4){
                        skn.document.write(content);
                        skn.document.close();
                        skn.visibility=\"visible\";
                }
                if(ns6){
                        document.getElementById(\"boxx\").innerHTML=content;
                        skn.display='';
                }
                if(ie4){
                        document.all(\"boxx\").innerHTML=content;
                        skn.display='';
                }
        }


        function popupleft(msg,bak,width){
                var content=\"<TABLE  WIDTH=\"+Math.abs(width)+\" BORDER=1 BORDERCOLOR=#000000 CELLPADDING=5 CELLSPACING=0 \" +
                        \"BGCOLOR=\"+bak+\"><TD ALIGN=left style='font:Arial; font-size:11px;'>\"+unescape(msg)+\"</TD></TABLE>\";

                yyy=Yoffset;
                if (width < 0 )
                        Xoffset2 = (Xoffsetleft*-1) + width;
                else
                        Xoffset2 = Xoffsetleft;
                if(ns4){
                        skn.document.write(content);
                        skn.document.close();
                        skn.visibility=\"visible\";
                }
                if(ns6){
                        document.getElementById(\"boxx\").innerHTML=content;
                        skn.display='';
                }
                if(ie4){
                        document.all(\"boxx\").innerHTML=content;
                        skn.display='';
                }
        }
        
        function get_mouse(e){
                var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
                var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
        
                skn.left=(x+Xoffset2)+'px';
                skn.top=y+yyy+'px';
        }
        
        function kill(){
                yyy=-1000;
                if(ns4){
                        skn.visibility=\"hidden\";
                }else if (ns6||ie4)
                        skn.display=\"none\"
        }
         
//-->
</SCRIPT>
";
}
else {
print "
<SCRIPT TYPE=\"text/javascript\">
<!--
        //if (!document.getElementById || screen.width < 800 || screen.height < 600){
        //        document.location.href=\"system_requirements.html\";
        //}
	
                        
        Xoffset=20;     // modify these values to ...
        Xoffsetleft=-330;     // modify these values to ...
        Xoffset2=20;            // modify these values to ...
        Yoffset=-160;    // change the popup position.  used by pinterest type gallery at niagaraonthelakebb.com
                        
        var old,skn,iex=(document.all),yyy=-1000;
         
        var ns4=document.layers
        var ns6=document.getElementById&&!document.all
        var ie4=document.all
                
        if (ns4)
                skn=document.boxx
        else if (ns6)
                skn=document.getElementById(\"boxx\").style
        else if (ie4)
                skn=document.all.boxx.style
                
        if(ns4)
                document.captureEvents(Event.MOUSEMOVE);
        else{
                skn.visibility=\"visible\"  
                skn.display=\"none\"
        }
         document.onmousemove=get_mouse;
        
        function popup(msg,bak,width){
                var content=\"<TABLE  WIDTH=\"+Math.abs(width)+\" BORDER=1 BORDERCOLOR=#000000 CELLPADDING=5 CELLSPACING=0 \" +
                        \"BGCOLOR=\"+bak+\"><TD ALIGN=left style='font:Arial; font-size:11px;'>\"+unescape(msg)+\"</TD></TABLE>\";

                yyy=Yoffset;
                if (width < 0 )
                        Xoffset2 = (Xoffset*-1) + width;
                else
                        Xoffset2 = Xoffset;
                if(ns4){
                        skn.document.write(content);
                        skn.document.close();
                        skn.visibility=\"visible\";
                }
                if(ns6){
                        document.getElementById(\"boxx\").innerHTML=content;
                        skn.display='';
                }
                if(ie4){
                        document.all(\"boxx\").innerHTML=content;
                        skn.display='';
                }
        }


        function popupleft(msg,bak,width){
                var content=\"<TABLE  WIDTH=\"+Math.abs(width)+\" BORDER=1 BORDERCOLOR=#000000 CELLPADDING=5 CELLSPACING=0 \" +
                        \"BGCOLOR=\"+bak+\"><TD ALIGN=left style='font:Arial; font-size:11px;'>\"+unescape(msg)+\"</TD></TABLE>\";

                yyy=Yoffset;
                if (width < 0 )
                        Xoffset2 = (Xoffsetleft*-1) + width;
                else
                        Xoffset2 = Xoffsetleft;
                if(ns4){
                        skn.document.write(content);
                        skn.document.close();
                        skn.visibility=\"visible\";
                }
                if(ns6){
                        document.getElementById(\"boxx\").innerHTML=content;
                        skn.display='';
                }
                if(ie4){
                        document.all(\"boxx\").innerHTML=content;
                        skn.display='';
                }
        }
        
        function get_mouse(e){
                var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
                var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
        
                skn.left=(x+Xoffset2)+'px';
                skn.top=y+yyy+'px';
        }
        
        function kill(){
                yyy=-1000;
                if(ns4){
                        skn.visibility=\"hidden\";
                }else if (ns6||ie4)
                        skn.display=\"none\"
        }
         
//-->
</SCRIPT>
";
}
}




sub gettaxtableshared {
$taxsettings[0]="Harmonized Sales Tax (HST)-13-100000";
$taxsettings[1]="Destination Promotion Fee-3-100001";
$taxsettings[2]="Destination Promotion Fee-3.3-100002";
$taxsettings[3]="Vermont Room Tax-9-100003";
$taxsettings[4]="Service Charge-10-100004";
$taxsettings[5]="California Room Tax-15-100005";
$taxsettings[6]="Taxes and Resort Fees-15-100006";
$taxsettings[7]="Gratuity-10-100007";
$taxsettings[8]="Gratuity-15-100008";
$taxsettings[9]="Surcharge-3-100009";
$taxsettings[10]="Manitoba Tax-12-100010"; 
$taxsettings[11]="Texas Tax-8.125-100011";
$taxsettings[12]="State Sales Tax-4.5-100012";
$taxsettings[13]="Local Sales and Use Tax-4.5-100013";
$taxsettings[14]="Erie County Hotel Tax-5-100014";
$taxsettings[15]="State Hotel Tax-6-100015";
$taxsettings[16]="Taxes and Fees-13-100016";
$taxsettings[17]="Taxes and Fees-16-100017";
$taxsettings[18]="Taxes and Resort Fees-14-100018";
$taxsettings[19]="Goods and Services Tax (GST)-5-100019";        
$taxsettings[20]="B.C. Harmonized Sales Tax (HST)-12-100020";
$taxsettings[21]="Ontario HST Tax (13% on cost inclusive of 3% TIF is 16.39\%)-16.39-100021"; 
$taxsettings[22]="Sales Tax-9.75-100022";
$taxsettings[23]="Quebec Sales Tax (9.5% on cost inclusive of GST)-9.975-100023";
$taxsettings[24]="We do not charge tax.-0-100024";  
$taxsettings[25]="State Rooms and Meals Tax-9-100025";
$taxsettings[26]="State and Local Room Tax-9.7-100026";
$taxsettings[27]="New Zealand Goods and Services Tax-15-100027"; 
$taxsettings[28]="Goods and Services Tax (GST) / Taxes sur les produits et les services (TPS)-5-100028";
$taxsettings[29]="Quebec Sales Tax (9.5% on cost inclusive of 5\% GST is 14.975\%) / Taxes de vente du Quebec 9.5%  (sur cout incluant la 5\% TVQ)-14.975-100029";
$taxsettings[30]="State Sales Tax-8.0-100030";
$taxsettings[31]="7% State Sales Tax-7.0-100031";
$taxsettings[32]="4% Lodgings Tax-4.0-100032";
$taxsettings[33]="4% Sales Tax-4.0-100033"; 
$taxsettings[34]="New Brunswick Tax-13-100034";
$taxsettings[35]="Newfoundland Tax-13-100035"; 
$taxsettings[36]="Nova Scotia Tax-15-100036";  
$taxsettings[37]="Northwest Territories Tax-5-100037";
$taxsettings[38]="Nunavut Tax-5-100038";
$taxsettings[39]="Prince Edward Island Tax-15-100039";
$taxsettings[40]="Saskatchewan Tax-10-100040";
$taxsettings[41]="Resort Fee-5-100041";
$taxsettings[42]="Florida Sales Tax-7-100042";
$taxsettings[43]="Florida Hotel Tax-5-100043";
$taxsettings[44]="5% Resort Fee and 13% HST-18.65-100044";
$taxsettings[45]="3% TIF Tourism Infrastructure Funding Fee-3-100045"; 
$taxsettings[46]="20% VAT (Value Added Tax)-20-100046";
$taxsettings[47]="Taxes and Fees (HST 13.39%, PF 3%)-16.39-100047";
$taxsettings[48]="Taxes and Fees (HST 13.49% and PF 3.8%)-17.29-100048";
$taxsettings[49]="Provincial Sales Tax-7-100049";
$taxsettings[50]="Taxes and Fees-16.8-100050";
$taxsettings[51]="Tourism Improvement Fee-3.8-100051";
$taxsettings[52]="Taxes and Fees (HST 13% and Promo Fee 3.8%)-17.29-100052";
$taxsettings[53]="Gratuity-18-100053";
$taxsettings[54]="Room Tax-9-100054"; 
$taxsettings[55]="New York Sales Tax-14.75-100055";
$taxsettings[56]="Tourism Improvement Fee-5.8-100056";
$taxsettings[57]="Ontario HST Tax (13% on cost inclusive of 5.8% TIF)-19.55-100057";
$taxsettings[58]="Hotel Service Fee-11.00-100058";              
$taxsettings[59]="Hotel Service Fee/Tax-15.54-100059";
$taxsettings[60]="PR Occupancy Tax-9.00-100060";         
$taxsettings[61]="PR Occupancy Tax-11.00-100061";
$taxsettings[62]="Provincial/Federal Tax and Niagara Falls TIF-16.95-100062";
$taxsettings[63]="Service Charge-6.00-100063";
$taxsettings[64]="Tourism Improvement Fee-10.00-100064";
$taxsettings[65]="Taxes and Fees (HST 13% and Promo Fee 4.5%)-18.09-100065";
$taxsettings[66]="15% Surcharge-15.00-100066"; 
$taxsettings[67]="13% HST Tax on Subtotal Plus Tourism Improvement Fee of 3.95%-17.46-100067";
$taxsettings[68]="7% Montana Bed Tax-7.00-100068"; 
$taxsettings[69]="13% HST Tax on Subtotal Plus Tourism Improvement Fee of 7.00%-20.91-100069";
$taxsettings[70]="13% HST Tax on Subtotal Plus Tourism Improvement Fee of 5.00%-18.65-100070";
$taxsettings[71]="18% for Taxes and Fees (HST 13% and Tourism Improvement Fee 5%)-18.65-100071";
$taxsettings[72]="Taxes and Fees-18.00-100072";
$taxsettings[73]="18.90% for Taxes and Fees (HST 13% and PF 5.9%)-18.90-100073";
$taxsettings[74]="13% HST and 4.2% Tif Totaling: -17.2-100074";
$taxsettings[75]="HST-13-100075";
$taxsettings[76]="Jamaica Tax-4.17-100076";
$taxsettings[77]="Jamaica Tax-4.16-100077";
$taxsettings[78]="Jamaica Tax-9.25-100078";
$taxsettings[79]="19% (13% HST + 6% DPF)-19.0-100079";
$taxsettings[80]="Taxes and Fees-17.2-100080";
$taxsettings[81]="HST Taxes and Fees-19.667-100081";
$taxsettings[82]="HST 13% and 6% TIF-19.00-100082";
$taxsettings[83]="13% HST & 4.5% TIF-17.5-100083";
$taxsettings[84]="20% Service Charge and G.C.T-20.0-100084";
$taxsettings[85]="Tourism Improvement Fee-6.00-100085";
$taxsettings[86]="HST 13% and TIF 10%-23.00-100086"; 
$taxsettings[87]="4% Tourism Improvement Fee-4.00-100087";
$taxsettings[88]="19.67% for HST Taxes and Fees (13.77% & 5.9%)-19.67-100088";
$taxsettings[89]="5.9% TIF-5.9-100089";
$taxsettings[90]="21.93% for Taxes and Fees (HST 13% and PF 7.9%)-21.93-100090";
$taxsettings[91]="7.9% PF-7.9-100091";
$taxsettings[92]="New Brunswick Tax-15-100092";
$taxsettings[93]="4% Resort Fee-4-100093";
$taxsettings[94]="8% Tourism Improvement Fee-8-100094";
$taxsettings[95]="10.25% Tax-10.25-100095";
$taxsettings[96]="10.75% Sales Tax-10.75-100096";
$taxsettings[97]="Taxes and Fees-17.8-100097";
$taxsettings[98]="Jamaica GCT-10.0-100098";
$taxsettings[99]="Jamaica tax and service charge-25.0-100099";
$taxsettings[100]="Jamaica GCT-16.6-100100";
$taxsettings[101]="Taxes and Fees-17.75-100101"; ## used by hojo
$taxsettings[102]="Accommodation Provincial Sales Tax-8.00-100102";
$taxsettings[103]="Promotional Fee-3.80-100103";
$taxsettings[104]="13% HST Tax and Tourism Improvement Fee of 5.65%-18.65-100104";
$taxsettings[105]="10.75% Tax-10.75-100105";
$taxsettings[106]="11% Sales Tax-11.00-100106";
$taxsettings[107]="4.8% Tourism Improvement Fee-4.8-100107";
$taxsettings[108]="DMF-3.95-100108";
$taxsettings[109]="15% Newfoundland HST-15.00-100109"; 
$taxsettings[110]="10.20% Sales Tax-10.20-100110";    
$taxsettings[111]="7% Service Charge-7-100111";   
$taxsettings[112]="8% Service Charge-8-100112";
$taxsettings[113]="2% PST-2-100113";
$taxsettings[114]="10% TIFF and 13% HST-24.3-100114";
$taxsettings[115]="10% Liquor Tax-10.0-100115";
$taxsettings[116]="4.8% Hotel Fee-4.8-100116";
$taxsettings[117]="Daily Mandatory Charge-10.00-100117";
$taxsettings[118]="Daily Mandatory Charge-4.5-100118";
$taxsettings[119]="Daily Mandatory Charge-6.0-100119";
$taxsettings[120]="Daily Mandatory Charge-4.0-100120";
$taxsettings[121]="Daily Mandatory Charge-12.0-100121";
$taxsettings[122]="14.027% HST on Tour and LF-14.027-100122";
$taxsettings[123]="7.9% LF-7.9-100123";
$taxsettings[124]="21.927% LF and HST Tax-21.927-100124";
$taxsettings[125]="15% BC Tax-15.00-100125";
$taxsettings[126]="9.45% Sales Tax-9.45-100126";
$taxsettings[127]="7.66% Service Charge-7.66-100127";	
$taxsettings[128]="Daily Mandatory Charge-5.00-100128";
$taxsettings[129]="Municipal Accommodation Tax-4.52-100129";
$taxsettings[130]="Municipal Accommodation Tax (3%) Plus HST (13%) Added To Base Cost-16.39-100130";
$taxsettings[131]="Municipal Accommodation Tax (4%) Plus HST (13%) Added To Base Cost-17.52-100131";
$taxsettings[132]="Daily Mandatory Charge (DMC)-11.5-100132";
$taxsettings[133]="Destination Levy Tax (3%) Plus HST (15%) Added to Base Cost PLUS DLT-18.45-100133";

$numtaxsettings=@taxsettings;

        
@sortedtaxsettings=sort(@taxsettings);
for ($tx=0;$tx<=$numtaxsettings;$tx++) {
        undef @datax;
        @datax=split(/\-/,$sortedtaxsettings[$tx]);
        $thistaxid=$datax[2];
        $taxtabledesc{$thistaxid}="$datax[0]";
        $taxtableperc{$thistaxid}="$datax[1]";
}               
}


sub mixcase {
$mixcase=~s/([\w']+)/\u\L$1/g;
}

### print the go back javascript link 
sub printgoback {
print "<Br><a href=\"javascript:history.back()\" onMouseOver=\"self.status=document.referrer\;return true\">Click here to go BACK to the previous screen.</a>";
}


sub rounding {
if ($ss > 0) {
        $ss=$ss+0.005;
}
else {
        $ss=$ss-0.005;
}
$ss=$ss*100;
$ss=int($ss);
$ss=$ss / 100;
}


sub printenv {
foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n<Br>";
}
}

### close the popup
sub closepopup {
print "<a href=\"JavaScript:top.close()\">Close This Window</a>";
}


1;
