:: shop_events[events shop_events]
	<<if !$location.isOpen('shop')>>
		<<event 100000>>
			<h2>Supermarket</h2>
			The supermarket is currently closed.
			<<include 'shop_navigation'>>
			<<eventFired>>
		<</event>>
	<</if>>

:: shop_navigation[include]
	<<switch $shop_returnPassage>>
		<<case 'city_residential'>>
			<<ConnectedLocationCode 'Leave' "locations/city/residential/street.jpg" 3>>
				<<travel  'city_residential'>>
			<</ConnectedLocationCode>>
		<<case 'torgcentr'>>
			<<ConnectedLocation 'Leave' 'torgcentr' '' 'locations/city/citycenter/mall/torgcentr.jpg' 3>>
		<<case 'pav_commercial'>>
			<<ConnectedLocationCode 'Leave' "locations/pavlovsk/gorodok.jpg" 2>>
				<<travel  'pav_commercial'>>
			<</ConnectedLocationCode>>
		<<default>>
			<<warn '$shop_returnPassage is invalid. Defaulting to pav_commercial'>>
			<<ConnectedLocationCode 'Leave' "locations/pavlovsk/gorodok.jpg" 2>>
				<<travel  'pav_commercial'>>
			<</ConnectedLocationCode>>
	<</switch>>

	<<if $location.isOpen('shop')>>
		<<if _thisMainPassage == 'shop'>>
			/*<<ConnectedLocation 'ATM' 'shop_atm' '' "locations/shared/store/atm.jpg" 1>>*/
		<<else>>
			<<if _thisMainPassage != 'shop'>><<ConnectedLocation 'Checkout' 'shop' '' "locations/shared/store/shop.jpg" 1>><</if>>
		<</if>>

		<<if _thisMainPassage != 'shop_grocery'>><<ConnectedLocation 'Groceries' 'shop_grocery' '' "locations/shared/store/shop1.jpg" 1>><</if>>
		<<if _thisMainPassage != 'shop_cosmetics'>><<ConnectedLocation 'Cosmetics' 'shop_cosmetics' '' "locations/shared/store/shop2.jpg" 1>><</if>>
		<<if _thisMainPassage != 'shop_hardware'>><<ConnectedLocation 'Hardware' 'shop_hardware' '' "locations/shared/store/shop3.jpg" 1>><</if>>
		<<if _thisMainPassage != 'shop_clothes'>><<ConnectedLocation 'Clothing' 'shop_clothes' '' "locations/shared/store/shop4.jpg" 1>><</if>>
		<<if _thisMainPassage != 'shop_tech'>><<ConnectedLocation 'Household Appliances' 'shop_tech' '' "locations/shared/store/shop5.jpg" 1>><</if>>
		<<if _thisMainPassage != 'shop_icecream'>><<ConnectedLocation 'Ice Cream' 'shop_icecream' '' "shared/store/icecreamcounter.jpg" 1>><</if>>
	<</if>>



:: shop[public indoors]
	<<set $shop_returnPassage = $location_var[$here]?.[0] ?? $shop_returnPassage>>

	<<include 'shop_navigation'>>

	/*<<act "MegaFon">><<set $time.minutes += 1>><<gt 'shop_megafon'>><</act>>
	<<act "Notice board">><<gt 'noticeboard'>><</act>>*/

	<h2>Supermarket</h2>
	<<image "locations/shared/store/shop.jpg">>


	<p>An ATM, from which you can withdraw money from your bank account, stands against a wall.</p>
	<p>There is a branch of the communications giant MegaFon.</p>
	<p>A public notice board, where you can check various private and official advertisements, is sitting on a nearby wall.</p>
	<p>Most of the space in the supermarket is taken up by the grocery department, but the store has many smaller departments as well.</p>

	<p>
		These include cosmetics,
		hardware,
		clothing
		and household appliances.
		Not far from the entrance is a counter selling ice cream.
	</p>

	<!-- !! The store in the town and in the altstart only-->
	<<if $location.region == 'pav'>>
		<<if getvar("$locat['Anya']") == 7>>
			Your sister <<npc $npc_sister>><<gt 'shop_Anya'>><</npc>> is sitting at the cash register.
		<</if>>
	/*<<elseif $loc == 'city_residential'>>
		<<gs 'shop_city_risdential_events' $location_var[$here][0] $location_var[$here][1] $location_var[$here][2] $location_var[$here][3] $location_var[$here][4]>>*/
	<</if>>
	<p>The store is crowded with shoppers.</p>
	<!-- !! This is connected to the trade mission-->
	/*<<if getvar("$TorgPredZ") > 0>>
		<!-- !! the location of the shop hasn''t been done today-->
		<<if ($loc == 'city_residential' and $StreetShopTPday != $time.daystart) or ($loc == 'city_industrial' and $nordShopTPday != $time.daystart) or ($loc == 'torgcentr' and $downShopTPday != $time.daystart)>>
			<<actCLA 'Promote products'>>
				<<if $loc == 'city_residential'>>
					<<set $StreetShopTPday = $time.daystart>>

				<</if>>
				<<if $loc == 'city_industrial'>>
					<<set $nordShopTPday = $time.daystart>>

				<</if>>
				<<if $loc == 'torgcentr'>>
					<<set $downShopTPday = $time.daystart>>

				<</if>>
				<<set $mtprand = rand(40, 130)>>
				<<set $time.minutes += $mtprand>>
				<<set $TorgPredZ -= 1>>
				<<set $TorgPredZV += 1>>
				<<image "locations/shared/store/shop.jpg">>
				You promote the products for quite a while, and when you finally finish, you go to the cashier and tell them that they sold.
				<<act 'Leave'>>
					<<gt 'shop'>>
				<</act>>
			<</actCLA>>
		<</if>>
	<</if>>*/

/*:: shop_atm
	<h2>ATM</h2>
	<<image "locations/shared/store/atm.jpg">>
	<<if $finances.hasBankAccount == 1>>
		<<if $finances.bank >= 0>>
			<p>You have karta <b>₽</b> in your account.</p>
			<!-- FAILED TO CONVERT
				'You have an overdraft limit of <font color="blue"><<bankDebtLimit>></font>!'
			-----
				<<set ERROR: FAILED TO CONVERT LITERAL: """'You have an overdraft limit of <font color""" = ERROR: FAILED TO CONVERT LITERAL: """"blue"><<bankDebtLimit>><""" / ERROR: FAILED TO CONVERT LITERAL: """font>!'""">>

			-->
			<<warn "CONVERSION ERROR 9a220b64286b0988d8f273a837f6d12c">>
		<<else>>
			<!-- FAILED TO CONVERT
				'You are overdrawn by <font color="red"><<-1 * karta>> <b>₽</b></font>.'
			-----
				<<set ERROR: FAILED TO CONVERT LITERAL: """'You are overdrawn by <font color""" = ERROR: FAILED TO CONVERT LITERAL: """"red"><<""" - 1 * ERROR: FAILED TO CONVERT LITERAL: """karta>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b><""" / ERROR: FAILED TO CONVERT LITERAL: """font>.'""">>

			-->
			<<warn "CONVERSION ERROR ac2462f7bdc2bd796377d882cae5b387">>
			<!-- FAILED TO CONVERT
				'You have a remaining credit limit of <font color="blue"><<bankDebtLimit + karta>></font>!'
			-----
				<<set ERROR: FAILED TO CONVERT LITERAL: """'You have a remaining credit limit of <font color""" = ERROR: FAILED TO CONVERT LITERAL: """"blue"><<bankDebtLimit""" + ERROR: FAILED TO CONVERT LITERAL: """karta>><""" / ERROR: FAILED TO CONVERT LITERAL: """font>!'""">>

			-->
			<<warn "CONVERSION ERROR e37b59c0d34f20940f02a507fc3e6fb9">>
		<</if>>
		<br>ATM Deposit Fee: 100 <b>₽</b>
		<<if getvar("$atmDeposit") == 0>>
			<<actCLA 'Deposit money'>>
				<<set $time.minutes += 5>>
				<<set $finances.bankINATM = input ("How much money do you want to deposit into the account? Note: A service charge of 100 <b>₽</b> will be deducted from the amount deposited.")>>
				<<if getvar("$finances.bankINATM") < 100 or $finances.bankINATM > $finances.cash>>
					This is not a valid input.
				<<else>>
					<<set $finances.bank += $finances.bankINATM - 100>>
					<<set $atmDepositDate = $time.daystart + 2>>
					<<set $finances.cash -= $finances.bankINATM>>
					<p><br>You deposit kartaINATM <b>₽</b> into your account.</p>
					<p>It will take 2 days for funds to be available. Your new balance will be karta+atmDeposit <b>₽</b>.</p>
				<</if>>
				<<act 'Move away'>>
					<<gt 'shop'>>
				<</act>>
			<</actCLA>>
		<<else>>
			<p><br>★ Processing deposit of atmDeposit <b>₽</b> in atmDepositDate - daystart days.</p>
		<</if>>
		<<if $finances.bankAvailable > 0>>
			<<actCLA 'Withdraw money from the ATM'>>
				<<set $time.minutes += 5>>
				<<set $finances.bankOUT = input ("How much money do you want to withdraw?")>>
				<<if getvar("$finances.bankOUT") <= 0 or $finances.bankOUT > $finances.bankAvailable>>
					<br>Invalid operation.
				<<else>>
					<<set $finances.bank -= $finances.bankOUT>>
					<<set $finances.cash += $finances.bankOUT>>
					<<if $finances.bank > 0>>
						<p><br>You withdraw kartaOUT <b>₽</b>. You have karta <b>₽</b> left in your bank account.</p>
					<<elseif $finances.bank == 0>>
						<p><br>You withdraw kartaOUT <b>₽</b>. You have no money left in your bank account.</p>
					<<else>>
						<br>You withdraw <<kartaOUT>> <b>₽</b>. <font color="red">Your bank account is overdrawn by <b><<karta>> ₽</b>.</font>
					<</if>>
				<</if>>
				<<act 'Move away'>>
					<<gt 'shop'>>
				<</act>>
			<</actCLA>>
		<<else>>
			You have maxed out your overdraft.
		<</if>>
	<<else>>
		<p>You don't have a bank account yet!</p>
	<</if>>
	<<act 'Move away'>>
		<<gt 'shop'>>
	<</act>>*/

:: shop_grocery[public indoors]
	<<include 'shop_navigation'>>
	<h2>Grocery</h2>
	<<image "locations/shared/store/shop1.jpg">>
	<<if !$location.isOpen('shop')>>
		The grocery department is currently closed.
	<<else>>
		<<shopItemList>>
			<<stockItem `{id:'food',amount:1,price:80,label:'Regular food'}`>>
			<<stockItem `{id:'food',amount:10,price:800,label:'Regular food'}`>>
			<<stockItem `{id:'foodDiet',amount:1,price:300,label:'Diet food'}`>>
			<<stockItem `{id:'foodDiet',amount:10,price:3000,label:'Diet food'}`>>
			/*<<stockItem `{id:'biscuit',amount:10,price:400,label:'Tea biscuits'}`>>

			<<if $wardrobe.purseEquipped > 0>>
				<<stockItem `{id:'water',amount:1,price:100,label:'Bottle of water'}`>>
				<<stockItem `{id:'sandwich',amount:1,price:100,label:'Sandwich'}`>>
				<<stockItem `{id:'wine',amount:1,price:200,label:'Cheap Bottle of wine'}`>>
			<<else>>
				<span class="information">
					If you had a handbag, you could buy bottles of water and wine and a sandwich.
				</span>
			<</if>>*/
		<</shopItemList>>

		/*<<act 'Go to the pet aisle'>>
			<<gt 'shop_dog'>>
		<</act>>*/
	<</if>>
:: shop_dog[public indoors]
	<<image "characters/shared/rex/pet_isle.jpg">>
	You're currently in the pet aisle, where you can buy food, treats and other things for your dog.
	<<act 'Leave'>>
		<<gt 'shop'>>
	<</act>>
	<<if $housing.home != 'homeParents'>>
		<<actCLA 'Buy dog food'>>
			<<set $time.minutes += 1>>
			<<image "characters/shared/rex/dog_food.jpg">>
			<p>The store sells dog food for 600 <b>₽</b>. Inside each pack is enough food for 20 meals. You have objects['dog_food'].</p>
			<<if $finances.cash >= 600>>
				<<actCLA 'Buy enough for 20 meals (600 <b>₽</b>, pay cash)'>>
					<<set $finances.cash -= 600>>
					<<setinit $objects['dog_food'] += 20>>
					<<gt 'shop' 'dog_items'>>
				<</actCLA>>
			<<else>>
				<br>You don't have enough money to buy food.
			<</if>>
			<<if $finances.cash >= 1200>>
				<<actCLA 'Buy enough for 40 meals (1200 <b>₽</b>, pay cash)'>>
					<<set $finances.cash -= 1200>>
					<<setinit $objects['dog_food'] += 40>>
					<<gt 'shop' 'dog_items'>>
				<</actCLA>>
			<</if>>
			<<if $finances.cash >= 2400>>
				<<actCLA 'Buy enough for 80 meals (2400 <b>₽</b>, pay cash)'>>
					<<set $finances.cash -= 2400>>
					<<setinit $objects['dog_food'] += 80>>
					<<gt 'shop' 'dog_items'>>
				<</actCLA>>
			<</if>>
		<</actCLA>>
	<<else>>
		<br>You don't need to buy dog food. Your parents pay for it.
	<</if>>
	<<actCLA 'Buy some dog treats'>>
		<<set $time.minutes += 1>>
		<<image "characters/shared/rex/treat_#.jpg" 0 2>>
		<p>The store sells dog treats for 300 <b>₽</b>. Inside each pack are 20 treats. You have objects['treats'].</p>
		<<act 'Go back'>>
			<<gt 'shop' 'dog_items'>>
		<</act>>
		<<if $finances.cash >= 300>>
			<<actCLA 'Buy a pack (300 <b>₽</b>, pay cash)'>>
				<<set $finances.cash -= 300>>
				<<setinit $objects['treats'] += 20>>
				<<gt 'shop' 'dog_items'>>
			<</actCLA>>
		<<else>>
			You don't have enough money to buy a pack.
		<</if>>
	<</actCLA>>
	<<actCLA 'Buy a chew toy for your dog'>>
		<<set $time.minutes += 1>>
		<<image "characters/shared/rex/chew.jpg">>
		<p>The store sells a chew toy for 800 <b>₽</b>.</p>
		<<act 'Go back'>>
			<<gt 'shop' 'dog_items'>>
		<</act>>
		<<if $finances.cash >= 800>>
			<<actCLA 'Buy one (800 <b>₽</b>, pay cash)'>>
				<<set $finances.cash -= 800>>
				<<setinit $objects['chew'] += 10>>
				<<gt 'shop' 'dog_items'>>
			<</actCLA>>
		<<else>>
			You don't have enough money to buy it.
		<</if>>
	<</actCLA>>
	<<if getvar("$objects['toys']") == 0>>
		<<actCLA 'Buy fetch balls'>>
			<<set $time.minutes += 1>>
			<<image "characters/shared/rex/balls.jpg">>
			<p>The store sells rubber balls for 900 <b>₽</b> that you can use to play fetch with your dog.</p>
			<<act 'Go back'>>
				<<gt 'shop' 'dog_items'>>
			<</act>>
			<<if $finances.cash >= 900>>
				<<actCLA 'Buy them (900 <b>₽</b>, pay cash)'>>
					<<set $finances.cash -= 900>>
					<<setinit $objects['toys'] = 1>>
					<<gt 'shop' 'dog_items'>>
				<</actCLA>>
			<<else>>
				You don't have enough money to buy them.
			<</if>>
		<</actCLA>>
	<</if>>

:: shop_cosmetics[indoors public]
	<<include 'shop_navigation'>>
	<h2>Cosmetics Department</h2>
	<<image "locations/shared/store/shop2.jpg">>
	<<if !$location.isOpen('shop')>>
		The cosmetics department is currently closed.
	<<else>>
		<<set _shopLocation to 'shop_cosmetics'>>
		<<shopItemList>>
			<<stockItem `{id:'cosmetics',amount:50,price:1300,label:'Cosmetics'}`>>
			/*<<stockItem `{id:'moisturizer',amount:30,price:2100,label:'Moisturizer'}`>>*/
			<<stockItem `{id:'lipbalm',amount:30,price:127,label:'Lip balm'}`>>
			<<stockItem `{id:'razor',amount:25,price:350,label:'Razors'}`>>
			/*<<stockItem `{id:'deo',amount:40,price:200,label:'Deodorant'}`>>*/
			<<stockItem `{id:'tampon',amount:20,price:200,label:'Tampons'}`>>
			/*<<stockItem `{id:'sanpad',amount:30,price:100,label:'Sanitary napkins'}`>>*/
			<<stockItem `{id:'shampoo',amount:30,price:250,label:'Shampoo'}`>>
			<<stockItem `{id:'hairScrunchie',amount:80,price:1300,label:'Hair scrunchies'}`>>
			<<stockItem `{id:'hairPin',amount:12,price:100,label:'Hair pins'}`>>
			/*<<stockItem `{id:'falselashesplain',amount:10,price:100,label:'Plain false lashes'}`>>
			<<stockItem `{id:'falselashesmink',amount:3,price:100,label:'Mink false lashes'}`>>*/
			<<stockItem `{id:'sunblock',amount:20,price:100,label:'Sunblock'}`>>

			/*<<if $wardrobe.purseEquipped > 0>>
				<<stockItem `{id:'wipe',amount:10,price:50,label:'Wipes'}`>>
				<<stockItem `{id:'mouthwash',amount:20,price:150,label:'Mouthwash'}`>>
				<<stockItem `{id:'comb',amount:1,price:150,label:'Comb'}`>>
				<<stockItem `{id:'compactMirror',amount:1,price:1150,label:'Compact Mirror'}`>>
			<<else>>
				<span class="information">
					If you had a handbag, you could buy wipes, portable makeup, mouthwash, combs and compact mirrors.
				</span>
			<</if>>*/


		<</shopItemList>>
		/*<<if $loc == 'torgcentr'>>
			<<gs 'shoplifting' 'city'>>
		<</if>>*/
	<</if>>

:: shop_hardware[indoors public]
	<<include 'shop_navigation'>>
	<h2>Division of household goods</h2>
	<<image "locations/shared/store/shop3.jpg">>
	<<if !$location.isOpen('shop')>>
		The hardware department is currently closed.
	<<else>>
		<<shopItemList>>
			<<if $wardrobe.purseEquipped > 0>>
				<<stockItem  `{label:'Umbrella',price:1150,id:'umbrella'}`>>
			<<else>>
				<span class="information">
					If you had a handbag, you could buy an umbrella.
				</span>
			<</if>>
		<</shopItemList>>

		<p>You see fabric suitable for sewing on the counter. It's sold in large squares costing <<money 50>> each. You have <<=getvar('$tkan')>> squares of fabric.</p>

		/*<<stockItem `{id:'$fairy',amount:20,price:500,label:'Dishwashing detergent'}  _shopLocation>>
			<<stockItem 30 'Clothing detergent' 500 '$poroshok'  _shopLocation>>
			<<stockItem 5  'Plates' 450 '$cltarelka'  _shopLocation>>
			<<stockItem 5  'Fabric' 250 '$tkan'  _shopLocation>>
			<<stockItem 1  'Sewing kit' 500 '$sewing_kit'  _shopLocation '' `{limit:1}`>>*/

		/*<<if getvar("$pod_whore_countQW") > 15 and getvar("$paint_blue") == 0 and $finances.cash >= 200>>
			<<actCLA 'Buy paint to cover graffiti (200 <b>₽</b>)'>>
				<<set $finances.cash -= 200>>
				<<set $paint_blue = 1>>
				<<gt _shopLocation>>
				<<msg "You bought a tin of paint.">>
			<</actCLA>>
		<</if>>*/
	<</if>>
:: shop_clothes[indoors public]
	<<include 'shop_navigation'>>
	<h2>Department of Women's Clothing</h2>
	<<image "locations/shared/store/shop4.jpg">>
	This department only sells cheap underwear and ice skates.
	<<if !$location.isOpen('shop')>>
		The women''s clothing department is currently closed.
	<<else>>
		<p>Women's panties and bras 300<b>₽</b> each</p>
		
		<<set _shopDevisions to [
			{label:'Bras',type:'bra'},
			{label:'Panties',type:'panties'}
		]>>
		<<shop `{vendor:'gm',baseprice:300}` _shopDevisions>>

		<<if getvar("$konki") != 1>>
			<p>A pair of ice-skates are available for 3000 <b>₽</b>.</p>
			<<if $finances.cash >= 3000>>
				<<actCLA 'Buy ice skates (3000 <b>₽</b>)'>>
					<<set $finances.cash -= 3000>>
					<<set $konki = 1>>
					<<image "locations/pavlovsk/lake/konki_shop.jpg">>
					You buy a pair of ice skates.
					<<act 'Move away from the counter'>>
						<<gt 'shop'>>
					<</act>>
				<</actCLA>>
			<</if>>
		<</if>>
		<<if getvar("$pcs_ski_owned") != 1>>
			<p>A pair of skis and poles are available for 4000 <b>₽</b>.</p>
			<<if $finances.cash >= 4000>>
				<<actCLA 'Buy skis (4000 <b>₽</b>)'>>
					<<set $finances.cash -= 4000>>
					<<set $konki = 1>>
					<<image "pc/activities/ski_buy.jpg">>
					You buy a pair of skis and poles.
					<<act 'Move away from the counter'>>
						<<gt 'shop'>>
					<</act>>
				<</actCLA>>
			<</if>>
		<</if>>
	<</if>>


:: shop_tech[indoors public]
	<<include 'shop_navigation'>>
	<h2>Department of household appliances</h2>
	<<image "locations/shared/store/shop5.jpg">>
	<<if !$location.isOpen('shop')>>
		The household appliance department is currently closed.
	<<else>>
		<<shopItemList>>
			<<stockItem `{id:'computer'}`>>
			<<stockItem `{id:'webcam'}`>>
		<</shopItemList>>
	<</if>>
	/**p func ('$single_stock_item', 1, 'Small TV', 15000, 'TV', $curloc, '', iif(func('homes_properties', 'get_furnishable_property_count') > 0, 0, 1), 'You need your own home')
	*p func ('$single_stock_item', 2, 'Large Plasma TV', 30000, 'TV', $curloc, '', iif(func('homes_properties', 'get_furnishable_property_count'), 0, 1), 'You need your own home')
	*p func ('$single_stock_item', 1, 'Computer', 40000, 'computer', $curloc)
	<!-- FAILED TO CONVERT
		*p func ('$single_stock_item', 1, 'Computer game Dead Sunset', 800, 'GameCD2', $curloc, '', iif(komp > 0 and GameCD2 = 0, 0, 1), 'You need a computer')
	-----
		<<set  * p func ('$single_stock_item' , 1 , 'Computer game Dead Sunset' , 800 , 'GameCD2' , $curloc , '' , ERROR: FAILED TO CONVERT LITERAL: """iif(komp > 0 and GameCD2""" = 0, 0, 1), 'You need a computer')>>

	-->
	<<warn "CONVERSION ERROR 25f8ccaa2161196658804226ed7cb133">>
	*p func ('$single_stock_item', 1, 'Dishwasher', 28000, 'posudomashina', $curloc, '', iif(func('homes_properties', 'get_furnishable_property_count'), 0, 1), 'You need your own home')
	*p func ('$single_stock_item', 1, 'Washing machine', 30000, 'stiralka', $curloc, '', iif(func('homes_properties', 'get_furnishable_property_count'), 0, 1), 'You need your own home')
	*p func ('$single_stock_item', 1, 'Camera', 20000, 'zenit', $curloc)
	*p func ('$single_stock_item', 1, 'Mini camera disguised as a cigarette pack', 100000, 'minifoto', $curloc)
	<!-- FAILED TO CONVERT
		*p func ('$single_stock_item', 1, 'Webcam', 2000, 'webcamera', $curloc, '', iif(komp > 0 and webcamera = 0, 0, 1), 'You need a computer to use this')
	-----
		<<set  * p func ('$single_stock_item' , 1 , 'Webcam' , 2000 , 'webcamera' , $curloc , '' , ERROR: FAILED TO CONVERT LITERAL: """iif(komp > 0 and webcamera""" = 0, 0, 1), 'You need a computer to use this')>>

	-->
	<<warn "CONVERSION ERROR 6bad14a9bcfd24fc9c4262a452d824fe">>
	<!-- !! Webcam can be used for more things now, so there is no point for checking the conditions it used to check-->
	<!-- !!*p func ('$single_stock_item', 1, 'Webcam', 2000, 'webcamera', $curloc, '', iif((npc_rel['A11']>=30 and webcamera = 0) or (camwhore = 1 and webcamera = 0), 0, 1), 'You have no use for this')-->
*/
/*:: shop_megafon
	<<set $time.minutes += 3>>
	<h2>MegaFon shop</h2>
	<center><img src="images/system/phone/megafon2.jpg" ></center>
	<<set $tables = '<center><table>'>>
	<<set $tablec = '</table></center>'>>
	<<if $finances.hasBankAccount == 0>>
		<center><h4>You need a valid bank account to buy monthly contracts.</h4></center>

	<</if>>
	<<set $title = '<center><h4>Home Internet Subscription</h4></cemter>'>>
	<<set $price = 900>>
	<<if $housing.home == 'homeParents'>>
		<<set $line = '<tr><td align="center">Your parents are paying for the internet at home, and you can't take out a second internet subscriptions for the same address</td></tr>'>>
	<<elseif getvar("$home['internet_enabled']") == 0>>
		<<set $line = '<tr><td align="center">You can't buy an internet subscription for $home['display']</td></tr>'>>
	<<elseif $subscription[$housing.home] == 1>>
		<<set $temp_home = '$housing.home-date'>>
		<<set $line = '<tr><td align="center">You have an active internet subscription at $home['display'] that will renew next month on day subscription[$temp_home] for price <b>₽</b></td></tr>'>>
		<<set $temp_home to null>>
	<<else>>
		<<set $line = '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; ">Monthly internet subscription for price<b>₽</b> at your $home['display']. Automatically renews every month</td>'>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.bankAvailable >= $price>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$home[''current'']>>'', <<price>>, 0 & minut += 30 & karta -= <<price>> & gs ''stat'' & gt ''shop'' ">Pay with Card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'buy_subscription' , '$housing.home' , ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" , 0>> <<set $time.minutes += 30>> <<set $finances.bank -= ERROR: FAILED TO CONVERT LITERAL: """<<price>>""">> <<gt 'shop' ">Pay with Card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR b6892fb48a78a70b2294c54208c1cf85">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
	<</if>>
	<<$title>><<$tables>><<$line>><<$tablec>>
	<<set $line to null>>
	<<set $title to null>>
	<!-- !! "Returns":-->
	<!-- !! $property_code[], $property_name[], $property_status[], property__is_current_home[]-->
	<!-- !! $property_stat values: 'rented', 'owned', 'tenants', 'no access'-->
	<<gs 'homes_properties' 'get_internet_enabled_properties' 'home' 'hasaccess'>>
	<<set $count = ARRSIZE('$property_name')>>
	<<if getvar("$count") > 0>>
		<<warn 'JUMP MARKER ENCOUNTERED: :propertyloop'>>
		<<if getvar("$property__is_current_home["+$i+"]") == 0>>
			<<set $title = '<center><h4>Internet Subscription for your other properties</h4></center>'>>
			<<if $property_status[$i] == 'tenants'>>
				<<set $line += '<tr><td align="center">You have rented out the LCASE($property_name[$i]) and you don't have to buy internet for our tenants.</td></tr>'>>
			<<elseif $subscription[$property_code[$i]] == 0>>
				<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; ">Monthly internet subscription for price <b>₽</b> at LCASE($property_name[$i]). Automatically renews every month</td>'>>
				<<if $finances.hasBankAccount == 0>>
					<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
				<<elseif $finances.bankAvailable >= $price>>
					<!-- FAILED TO CONVERT
						$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''<<$property_code[i]>>'', <<price>>, 0 & minut += 30 & karta -= <<price>> & gs ''stat'' & gt ''shop'' ">Pay with card</a></td></tr>'
					-----
						<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'buy_subscription' , '$property_code[$i]' , ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" , 0>> <<set $time.minutes += 30>> <<set $finances.bank -= ERROR: FAILED TO CONVERT LITERAL: """<<price>>""">> <<gs 'stat'>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

					-->
					<<warn "CONVERSION ERROR 9292d727b1022e225f2b485655a6cc2a">>
				<<else>>
					<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
				<</if>>
			<<elseif $subscription[$property_code[$i]] > 0>>
				<<set $line += '<tr><td align="center">You have an active internet subscription for the LCASE($property_name[$i]) that will renew next month on day subscription[''+$$property_code[$i]+'-date'] for price <b>₽</b></td></tr>'>>
			<</if>>
		<</if>>
		<<set $property to null>>
		<<set $i += 1>>
		<<if $i < $count>>
			<<warn 'JUMP COMMAND ENCOUNTERED: jump propertyloop'>>

		<</if>>
		<<gs 'homes_properties' 'clean_up_property_data'>>
		<<if $title != ''>>
			<<$title>><<$tables>><<$line>><<$tablec>>

		<</if>>
	<</if>>
	<<set $title = '<center><h4>Mobile Internet Subscription</h4></center>'>>
	<<set $price = 1200>>
	<<if getvar("$subscription['mobile']") == 1>>
		<<set $line = '<tr><td align="center">You have an active mobile internet subscription that will renew next month on day subscription['mobile-date'] for price<b>₽</b></td></tr>'>>
	<<else>>
		<<if getvar("$subscription['metered_mobile']") > 0>>
			<!-- !! Every 12 minutes gives back 1 ₽-->
			<<set $discount = $subscription['metered_mobile'] / 12>>
			<<set $discount_left = Math.max(price - discount, 0)>>
			<<set $line = '<tr><td align="center">You still a have <b>subscription['metered_mobile'] ₽</b> balance for your metered mobile internet which gives you a discount <b>₽</b> discount</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; ">Monthly mobile internet subscription for'+iif(discount > 0, ' <s>price</s>price-discount', ' price')+'<b>₽</b>. Automatically renews every month</td>'>>
		<!-- FAILED TO CONVERT
			if bankAccount = 1 and karta+bankDebtLimit >= (price-discount): $line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''mobile'', <<price>>, <<discount_left>> & gs ''internet_mobile'', ''cancel_subscription'', ''metered_mobile'' & minut += 30 & karta -= <<price-discount>> & gs ''stat'' & gt ''shop'' ">Pay with card</a></td></tr>'
		-----
			<<if $finances.hasBankAccount == 1 and $finances.bankAvailable >= (price-discount)>>
			<!-- FAILED TO CONVERT
	$line += '<td style="padding-left: 10px; padding-right: 10px;"><<link "Pay with card">><<gs 'internet_mobile' 'buy_subscription' 'mobile' ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" ERROR: FAILED TO CONVERT LITERAL: """<<discount_left>>""">> <<gs 'internet_mobile' 'cancel_subscription' 'metered_mobile'>> <<set $time.minutes +  = 30>> <<set $finances.bank -  = ERROR: FAILED TO CONVERT LITERAL: """<<price""" - ERROR: FAILED TO CONVERT LITERAL: """discount>>""">> <<gs 'stat'>> <<gt 'shop'>><</link>></td></tr>'
-----
	<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'buy_subscription' , 'mobile' , ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" , ERROR: FAILED TO CONVERT LITERAL: """<<discount_left>>""">> <<gs 'internet_mobile' 'cancel_subscription' 'metered_mobile'>> <<setn $time.minutes += 30>> <<set $finances.bank -= ERROR: FAILED TO CONVERT LITERAL: """<<price""" - ERROR: FAILED TO CONVERT LITERAL: """discount>>""">> <<gs 'stat'>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

-->
<<warn "CONVERSION ERROR 8494755a651ce4342c316e3bfb93dd94">>

		<</if>>

		-->
		<<warn "CONVERSION ERROR cb63c2e58ca5200ca07551b294870ec4">>
		<<if $finances.hasBankAccount == 1 and $finances.bankAvailable < (price-discount)>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient funds</td></tr>'>>

		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>

		<</if>>
	<</if>>
	<<$title>><<$tables>><<$line>><<$tablec>>
	<<set $line to null>>
	<<set $title to null>>
	<<set $title = '<center><h4>Metered Internet</h4></center>'>>
	<<if getvar("$subscription['mobile']") == 1>>
		<<set $line = '<tr><td align="center">You have an active mobile internet subscription for unlimited use, you can't buy extra minutes </td></tr>'>>
		<<set $line += '<tr><td align="left"><b>300 minutes</b> (5 hours) of mobile internet for 80 <b>₽</b></td></tr>'>>
		<<set $line += '<tr><td align="left"><b>600 minutes</b> (10 hours) of mobile internet for 155 <b>₽</b></td></tr>'>>
		<<set $line += '<tr><td align="left"><b>1200 minutes</b> (20 hours) of mobile internet for 295 <b>₽</b></td></tr>'>>
		<<set $line += '<tr><td align="left"><b>3000 minutes</b> (50 hours) of mobile internet for 695 <b>₽</b></td></tr>'>>
	<<else>>
		<<set $line = '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; "><b>300 minutes</b> (5 hours) of mobile internet for 80<b>₽</b></td>'>>
		<<if $finances.cash > 80>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 300 & money -= 80 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 300>> <<set $finances.cash -= 80>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 9ce4fa451b4a8b926c75162757b1597f">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.bankAvailable >= 80>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 300 & karta -= 80 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 300>> <<set $finances.bank -= 80>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 2777802f0d90d1ca804e012e95ba746f">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; "><b>600 minutes</b> (10 hours) of mobile internet for 115<b>₽</b></td>'>>
		<<if $finances.cash > 155>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 600 & money -= 115 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 600>> <<set $finances.cash -= 115>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 125e8ae16ac821f1ccc22ccc716552b2">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.bankAvailable >= 155>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 600 & karta -= 115 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 600>> <<set $finances.bank -= 115>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 15929d9fee657542330ec9eccfef19ab">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; "><b>1200 minutes</b> (20 hours) of mobile internet for 295<b>₽</b></td>'>>
		<<if $finances.cash > 295>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 1200 & money -= 295 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 1200>> <<set $finances.cash -= 295>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 9df35e4c7b2b38b176b072bf32ece6e4">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.bankAvailable >= 295>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 1200 & karta -= 295 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 1200>> <<set $finances.bank -= 295>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 9e671e14979381393313b03a02a98fda">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; "><b>3000 minutes</b> (50 hours) of mobile internet for 695<b>₽</b></td>'>>
		<<if $finances.cash > 695>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 3000 & money -= 695 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 3000>> <<set $finances.cash -= 695>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR e17738a839d121e92f639aa7b8e14fad">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.bankAvailable >= 695>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_mobile'', 3000 & karta -= 695 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_mobile' , 3000>> <<set $finances.bank -= 695>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 38988acb9bea0de198be1f986240b696">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
	<</if>>
	<<$title>><<$tables>><<$line>><<$tablec>>
	<center>You have <b><<subscription[''metered_mobile'']>></b> minutes for mobile internet use</center>
	<<set $line to null>>
	<<set $title to null>>
	<<set $title = '<center><h4>Mobile Calls and Texts</h4></center>'>>
	<<set $price = 800>>
	<<if getvar("$subscription['monthly_calls']") == 1>>
		<<set $line += '<tr><td align="center">You have an active mobile subscription that will renew next month on day subscription['monthly_calls-date'] for price <b>₽</b></td></tr>'>>
	<<else>>
		<<if getvar("$subscription['metered_calls']") > 0>>
			<<set $discount = $subscription['metered_calls'] / 2>>
			<<set $discount_left = Math.max(price - discount, 0)>>
			<<set $line += '<tr><td align="center">You have <b>subscription['metered_calls']₽</b> for mobile calls and text messages which gives you a discount <b>₽</b> discount</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left;">Monthly mobile subscription that allows you to make calls and send text messages for'+iif(discount > 0, '<b><s>price</s></b> <span color="red"><b>price-discount</b></span>', ' <b>price</b>')+'<b>₽</b> Automatically renews every month</td>'>>
		<!-- FAILED TO CONVERT
			if bankAccount = 1 and karta+bankDebtLimit >= (price-discount): $line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''buy_subscription'', ''monthly_calls'', <<price>>, <<discount_left>> & gs ''internet_mobile'', ''cancel_subscription'', ''metered_calls'' & minut += 30 & karta -= <<price>> & gs ''stat'' & gt ''shop'' ">Pay with card</a></td></tr>'
		-----
			<<if $finances.hasBankAccount == 1 and $finances.bankAvailable >= (price-discount)>>
			<!-- FAILED TO CONVERT
	$line += '<td style="padding-left: 10px; padding-right: 10px;"><<link "Pay with card">><<gs 'internet_mobile' 'buy_subscription' 'monthly_calls' ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" ERROR: FAILED TO CONVERT LITERAL: """<<discount_left>>""">> <<gs 'internet_mobile' 'cancel_subscription' 'metered_calls'>> <<set $time.minutes +  = 30>> <<set $finances.bank -  = ERROR: FAILED TO CONVERT LITERAL: """<<price>>""">> <<gs 'stat'>> <<gt 'shop'>><</link>></td></tr>'
-----
	<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'buy_subscription' , 'monthly_calls' , ERROR: FAILED TO CONVERT LITERAL: """<<price>>""" , ERROR: FAILED TO CONVERT LITERAL: """<<discount_left>>""">> <<gs 'internet_mobile' 'cancel_subscription' 'metered_calls'>> <<setn $time.minutes += 30>> <<set $finances.bank -= ERROR: FAILED TO CONVERT LITERAL: """<<price>>""">> <<gs 'stat'>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

-->
<<warn "CONVERSION ERROR 32e943d80f6e31751f565dacb00ceb7e">>

		<</if>>

		-->
		<<warn "CONVERSION ERROR fbdf7d6bd1496474fa03e6ff7845f08f">>
		<<if $finances.hasBankAccount == 1 and $finances.bankAvailable < (price-discount)>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient funds</td></tr>'>>

		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>

		<</if>>
	<</if>>
	<<$title>><<$tables>><<$line>><<$tablec>>
	<<set $title to null>>
	<<set $line to null>>
	<<set $title = '<center><h4>Metered Calls and Texts</h4></center>'>>
	<<if getvar("$subscription['monthly_calls']") == 1>>
		<<set $line += '<tr><td>You have an active mobile subscription with unlimited minutes and texts, you can't buy extra minutes</td></tr>'>>
	<<else>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left;">60<b>₽</b> call pack for your mobile phone that gives you 60 minutes of calltime and 120 text messages</td>'>>
		<<if $finances.cash >= 60>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 60, 120 & money -= 60 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 60 , 120>> <<set $finances.cash -= 60>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 5e2d3ad7f27ed68ef66ff6744620715f">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.hasBankAccount == 1 and $finances.bankAvailable >= 60>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 60, 120 & karta -= 60 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 60 , 120>> <<set $finances.bank -= 60>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR bc0b1db302642c34f0a55f547aca7e75">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left;">115<b>₽</b> call pack for your mobile phone that gives you 120 minutes of calltime and 240 text messages</td>'>>
		<<if $finances.cash >= 115>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 120, 240 & money -= 115 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 120 , 240>> <<set $finances.cash -= 115>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 6f40e5d1fd106c46dd68667edebaa1b7">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.hasBankAccount == 1 and $finances.bankAvailable >= 115>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 120, 240 & karta -= 115 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 120 , 240>> <<set $finances.bank -= 115>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 0016c27255d7ed76f6974fc12b235e49">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left;">170<b>₽</b> call pack for your mobile phone that gives you 180 minutes of calltime and 360 text messages</td>'>>
		<<if $finances.cash >= 170>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 180, 360 & money -= 170 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 180 , 360>> <<set $finances.cash -= 170>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR 78c7e3ade88e98321725e2c4536ab13b">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.hasBankAccount == 1 and $finances.bankAvailable >= 170>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 180, 360 & karta -= 170 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 180 , 360>> <<set $finances.bank -= 170>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR 518f463428accd33f449dc2db2f2f0f7">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
		<<set $line += '<tr><td style="padding-left: 10px; padding-right: 10px; align: left;">225<b>₽</b> call pack for your mobile phone that gives you 240 minutes of calltime and 480 text messages</td>'>>
		<<if $finances.cash >= 225>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 240, 480 & money -= 225 & minut += 10 & gt ''shop'' ">Pay with cash</a></td>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 240 , 480>> <<set $finances.cash -= 225>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with cash</a></td>'>>

			-->
			<<warn "CONVERSION ERROR f8674511781cd53152a5fbddea856f1b">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Not enough cash</td>'>>
		<</if>>
		<<if $finances.hasBankAccount == 0>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">No bank account</td></tr>'>>
		<<elseif $finances.hasBankAccount == 1 and $finances.bankAvailable >= 225>>
			<!-- FAILED TO CONVERT
				$line += '<td style="padding-left: 10px; padding-right: 10px;"><a href="exec: gs ''internet_mobile'', ''top_up_metered'', ''metered_calls'', 240, 480 & karta -=225 & minut += 10 & gt ''shop'' ">Pay with card</a></td></tr>'
			-----
				<<set $line += ERROR: FAILED TO CONVERT LITERAL: """'<td style="padding""" - ERROR: FAILED TO CONVERT LITERAL: """left: 10px; padding""" - ERROR: FAILED TO CONVERT LITERAL: """right: 10px;"><a href="exec: gs ''internet_mobile''""" , 'top_up_metered' , 'metered_calls' , 240 , 480>> <<set $finances.bank -= 225>> <<set $time.minutes += 10>> <<gt 'shop' ">Pay with card</a></td></tr>'>>

			-->
			<<warn "CONVERSION ERROR f1e5fc61a516511bb01c399baa8a58e7">>
		<<else>>
			<<set $line += '<td style="padding-left: 10px; padding-right: 10px;">Insufficient balance</td></tr>'>>
		<</if>>
	<</if>>
	<<$title>><<$tables>><<$line>><<$tablec>>
	<center>You have <b><<subscription[''metered_calls'']>> minutes</b> for mobile calls and <<subscription[''sms_limit'']>> text messages</center>
	<<set $title to null>>
	<<set $line to null>>
	<<set $discount to null>>
	<<set $discount_left to null>>
	<<set $price to null>>
	<<act 'Return to the supermarket'>>
		<<gt 'shop'>>
	<</act>>
<</if>> */
:: shop_Anya
	<<image "characters/pavlovsk/resident/anya/anyabusywork.webp">>
	<<gs 'sister_chat' 'checks'>>
	<p>"Don't disturb me at work, $pc.name_nick! Can't you see that I have customers?"</p>
	<<act 'Move away'>>
		<<gt 'shop'>>
	<</act>>

:: shop_city_risdential_events
<<if rand(1, 20) == 20>>
	<<if getvar("$dimaQW") == 0>>
		A man is standing by the entrance, looking at you appreciatively.
		<<act 'Return the look'>>
			<<gt 'event' 'dima'>>
		<</act>>
	<<elseif getvar("$dimaQW") == 1>>
		You notice Dima nearby and are frozen with fear. You want to run, but your legs won't respond.
		Your heart thumps in your chest, your vision narrows and you feel faint.
		<<act 'Pass out'>>
			<<gt 'event' 'scoreslut1'>>
		<</act>>
	<<else>>
		You meet the same Dima whose friend fucked and abused you. Dima grins confidently. "Hello there..."
		<<actCLA 'Hello'>>
			"Come with me. My wife's away..." he says with a grin.
			<<actCLA 'No' undefined `{willpower:['sex','resist']}`>>
				<<gt 'shop'>>
			<</actCLA>>

			<<actCLA 'I deserve this'>>
				<<if rand(1, 2) == 1>>
					Dima takes you to his house and orders you to lie across the sofa. You get into position and he calls you a bitch before he starts fucking you in the mouth.
					<<image "locations/city/residential/street/sex/gostdt2.jpg">>
					Dima finally finishes in your mouth. You obediently swallow and lick the remnants of sperm off his cock.
					<<arouse 'bj' 10 `['sub','deepthroat','humiliation']`>>
					
					<<cum 'mouth_swallow' 'A169' 1>>
					<<actCLA 'Leave'>>
						<<set $time.minutes += 3>> <<gt 'city_residential'>>
					<</actCLA>>
				<<else>>
					<<gs 'pain' 6 'asscheeks' 'slap'>>
					<<set $spank += 1>>
					Dima brings you to his house and begins to kiss and undress you in the hall. Once you're naked, he takes you to the bathroom.
					He unscrews the shower head and shoves the hose in your ass. You feel the rush of water quickly filling you before Dima sits you on the toilet. After the rough enema, he bends you over and inserts his dick into your ass.
					<<image "locations/city/residential/street/sex/gostanal2.jpg">>
					He fucks and slaps your ass for a few minutes before he moans and you feel a warmth filling your ass.
					<<arouse 'anal' 30 `['sub','rough','humiliation']`>>
					
					<<cum 'anus' 'A169' 1>>
					<<actCLA 'Leave'>>
						<<set $time.minutes += 3>> <<gt 'city_residential'>>
					<</actCLA>>
				<</if>>
			<</actCLA>>
		<</actCLA>>
	<</if>>
<</if>>
<!-- END: shop_city_risdential_events -->
